diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d9ca47..36e43044 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ - Added Patreon OAuth2 provider ([#3323](https://github.com/pocketbase/pocketbase/pull/3323); thanks @ghostdevv). +- Added mailcow OAuth2 provider ([#3364](https://github.com/pocketbase/pocketbase/pull/3364); thanks @thisni1s). + - Added support for `:excerpt(max, withEllipsis?)` `fields` modifier that will return a short plain text version of any string value (html tags are stripped). This could be used to minimize the downloaded json data when listing records with large `editor` html values. ```js diff --git a/apis/settings_test.go b/apis/settings_test.go index 98bb3811..219c5baf 100644 --- a/apis/settings_test.go +++ b/apis/settings_test.go @@ -81,6 +81,7 @@ func TestSettingsList(t *testing.T) { `"vkAuth":{`, `"yandexAuth":{`, `"patreonAuth":{`, + `"mailcowAuth":{`, `"secret":"******"`, `"clientSecret":"******"`, }, @@ -163,6 +164,7 @@ func TestSettingsSet(t *testing.T) { `"vkAuth":{`, `"yandexAuth":{`, `"patreonAuth":{`, + `"mailcowAuth":{`, `"secret":"******"`, `"clientSecret":"******"`, `"appName":"acme_test"`, @@ -234,6 +236,7 @@ func TestSettingsSet(t *testing.T) { `"vkAuth":{`, `"yandexAuth":{`, `"patreonAuth":{`, + `"mailcowAuth":{`, `"secret":"******"`, `"clientSecret":"******"`, `"appName":"update_test"`, diff --git a/models/settings/settings.go b/models/settings/settings.go index 3dd312d7..1a6fd06d 100644 --- a/models/settings/settings.go +++ b/models/settings/settings.go @@ -64,6 +64,7 @@ type Settings struct { VKAuth AuthProviderConfig `form:"vkAuth" json:"vkAuth"` YandexAuth AuthProviderConfig `form:"yandexAuth" json:"yandexAuth"` PatreonAuth AuthProviderConfig `form:"patreonAuth" json:"patreonAuth"` + MailcowAuth AuthProviderConfig `form:"mailcowAuth" json:"mailcowAuth"` } // New creates and returns a new default Settings instance. @@ -191,6 +192,9 @@ func New() *Settings { PatreonAuth: AuthProviderConfig{ Enabled: false, }, + MailcowAuth: AuthProviderConfig{ + Enabled: false, + }, } } @@ -235,6 +239,7 @@ func (s *Settings) Validate() error { validation.Field(&s.VKAuth), validation.Field(&s.YandexAuth), validation.Field(&s.PatreonAuth), + validation.Field(&s.MailcowAuth), ) } @@ -302,6 +307,7 @@ func (s *Settings) RedactClone() (*Settings, error) { &clone.VKAuth.ClientSecret, &clone.YandexAuth.ClientSecret, &clone.PatreonAuth.ClientSecret, + &clone.MailcowAuth.ClientSecret, } // mask all sensitive fields @@ -343,6 +349,7 @@ func (s *Settings) NamedAuthProviderConfigs() map[string]AuthProviderConfig { auth.NameVK: s.VKAuth, auth.NameYandex: s.YandexAuth, auth.NamePatreon: s.PatreonAuth, + auth.NameMailcow: s.MailcowAuth, } } diff --git a/models/settings/settings_test.go b/models/settings/settings_test.go index 48337282..9bbda12f 100644 --- a/models/settings/settings_test.go +++ b/models/settings/settings_test.go @@ -75,6 +75,8 @@ func TestSettingsValidate(t *testing.T) { s.YandexAuth.ClientId = "" s.PatreonAuth.Enabled = true s.PatreonAuth.ClientId = "" + s.MailcowAuth.Enabled = true + s.MailcowAuth.ClientId = "" // check if Validate() is triggering the members validate methods. err := s.Validate() @@ -117,6 +119,7 @@ func TestSettingsValidate(t *testing.T) { `"vkAuth":{`, `"yandexAuth":{`, `"patreonAuth":{`, + `"mailcowAuth":{`, } errBytes, _ := json.Marshal(err) @@ -192,6 +195,8 @@ func TestSettingsMerge(t *testing.T) { s2.YandexAuth.ClientId = "yandex_test" s2.PatreonAuth.Enabled = true s2.PatreonAuth.ClientId = "patreon_test" + s2.MailcowAuth.Enabled = true + s2.MailcowAuth.ClientId = "mailcow_test" if err := s1.Merge(s2); err != nil { t.Fatal(err) @@ -283,6 +288,7 @@ func TestSettingsRedactClone(t *testing.T) { s1.VKAuth.ClientSecret = testSecret s1.YandexAuth.ClientSecret = testSecret s1.PatreonAuth.ClientSecret = testSecret + s1.MailcowAuth.ClientSecret = testSecret s1Bytes, err := json.Marshal(s1) if err != nil { @@ -342,6 +348,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) { s.VKAuth.ClientId = "vk_test" s.YandexAuth.ClientId = "yandex_test" s.PatreonAuth.ClientId = "patreon_test" + s.MailcowAuth.ClientId = "mailcow_test" result := s.NamedAuthProviderConfigs() @@ -374,6 +381,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) { `"vk":{"enabled":false,"clientId":"vk_test"`, `"yandex":{"enabled":false,"clientId":"yandex_test"`, `"patreon":{"enabled":false,"clientId":"patreon_test"`, + `"mailcow":{"enabled":false,"clientId":"mailcow_test"`, } for _, p := range expectedParts { if !strings.Contains(encodedStr, p) { diff --git a/plugins/jsvm/internal/types/generated/types.d.ts b/plugins/jsvm/internal/types/generated/types.d.ts index 241b7c8b..c6fff850 100644 --- a/plugins/jsvm/internal/types/generated/types.d.ts +++ b/plugins/jsvm/internal/types/generated/types.d.ts @@ -1575,8 +1575,8 @@ namespace os { */ readFrom(r: io.Reader): number } - type _subCSLTr = io.Writer - interface onlyWriter extends _subCSLTr { + type _subJWStI = io.Writer + interface onlyWriter extends _subJWStI { } interface File { /** @@ -2200,8 +2200,8 @@ namespace os { /** * File represents an open file descriptor. */ - type _subAxHLn = file - interface File extends _subAxHLn { + type _subAnaPI = file + interface File extends _subAnaPI { } /** * A FileInfo describes a file and is returned by Stat and Lstat. @@ -2567,485 +2567,6 @@ namespace filepath { } } -/** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. - * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the path/filepath package's Glob function. - * To expand environment variables, use package os's ExpandEnv. - * - * Note that the examples in this package assume a Unix system. - * They may not run on Windows, and they do not run in the Go Playground - * used by golang.org and godoc.org. - */ -namespace exec { - interface command { - /** - * Command returns the Cmd struct to execute the named program with - * the given arguments. - * - * It sets only the Path and Args in the returned structure. - * - * If name contains no path separators, Command uses LookPath to - * resolve name to a complete path if possible. Otherwise it uses name - * directly as Path. - * - * The returned Cmd's Args field is constructed from the command name - * followed by the elements of arg, so arg should not include the - * command name itself. For example, Command("echo", "hello"). - * Args[0] is always name, not the possibly resolved Path. - * - * On Windows, processes receive the whole command line as a single string - * and do their own parsing. Command combines and quotes Args into a command - * line string with an algorithm compatible with applications using - * CommandLineToArgvW (which is the most common way). Notable exceptions are - * msiexec.exe and cmd.exe (and thus, all batch files), which have a different - * unquoting algorithm. In these or other similar cases, you can do the - * quoting yourself and provide the full command line in SysProcAttr.CmdLine, - * leaving Args empty. - */ - (name: string, ...arg: string[]): (Cmd | undefined) - } -} - -namespace security { - interface s256Challenge { - /** - * S256Challenge creates base64 encoded sha256 challenge string derived from code. - * The padding of the result base64 string is stripped per [RFC 7636]. - * - * [RFC 7636]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 - */ - (code: string): string - } - interface md5 { - /** - * MD5 creates md5 hash from the provided plain text. - */ - (text: string): string - } - interface sha256 { - /** - * SHA256 creates sha256 hash as defined in FIPS 180-4 from the provided text. - */ - (text: string): string - } - interface sha512 { - /** - * SHA512 creates sha512 hash as defined in FIPS 180-4 from the provided text. - */ - (text: string): string - } - interface hs256 { - /** - * HS256 creates a HMAC hash with sha256 digest algorithm. - */ - (text: string, secret: string): string - } - interface hs512 { - /** - * HS512 creates a HMAC hash with sha512 digest algorithm. - */ - (text: string, secret: string): string - } - interface equal { - /** - * Equal compares two hash strings for equality without leaking timing information. - */ - (hash1: string, hash2: string): boolean - } - // @ts-ignore - import crand = rand - interface encrypt { - /** - * Encrypt encrypts data with key (must be valid 32 char aes key). - */ - (data: string, key: string): string - } - interface decrypt { - /** - * Decrypt decrypts encrypted text with key (must be valid 32 chars aes key). - */ - (cipherText: string, key: string): string - } - interface parseUnverifiedJWT { - /** - * ParseUnverifiedJWT parses JWT token and returns its claims - * but DOES NOT verify the signature. - * - * It verifies only the exp, iat and nbf claims. - */ - (token: string): jwt.MapClaims - } - interface parseJWT { - /** - * ParseJWT verifies and parses JWT token and returns its claims. - */ - (token: string, verificationKey: string): jwt.MapClaims - } - interface newJWT { - /** - * NewJWT generates and returns new HS256 signed JWT token. - */ - (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string - } - interface newToken { - /** - * Deprecated: - * Consider replacing with NewJWT(). - * - * NewToken is a legacy alias for NewJWT that generates a HS256 signed JWT token. - */ - (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string - } - // @ts-ignore - import cryptoRand = rand - // @ts-ignore - import mathRand = rand - interface randomString { - /** - * RandomString generates a cryptographically random string with the specified length. - * - * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. - */ - (length: number): string - } - interface randomStringWithAlphabet { - /** - * RandomStringWithAlphabet generates a cryptographically random string - * with the specified length and characters set. - * - * It panics if for some reason rand.Int returns a non-nil error. - */ - (length: number, alphabet: string): string - } - interface pseudorandomString { - /** - * PseudorandomString generates a pseudorandom string with the specified length. - * - * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. - * - * For a cryptographically random string (but a little bit slower) use RandomString instead. - */ - (length: number): string - } - interface pseudorandomStringWithAlphabet { - /** - * PseudorandomStringWithAlphabet generates a pseudorandom string - * with the specified length and characters set. - * - * For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead. - */ - (length: number, alphabet: string): string - } -} - -namespace filesystem { - /** - * FileReader defines an interface for a file resource reader. - */ - interface FileReader { - [key:string]: any; - open(): io.ReadSeekCloser - } - /** - * File defines a single file [io.ReadSeekCloser] resource. - * - * The file could be from a local path, multipipart/formdata header, etc. - */ - interface File { - name: string - originalName: string - size: number - reader: FileReader - } - interface newFileFromPath { - /** - * NewFileFromPath creates a new File instance from the provided local file path. - */ - (path: string): (File | undefined) - } - interface newFileFromBytes { - /** - * NewFileFromBytes creates a new File instance from the provided byte slice. - */ - (b: string, name: string): (File | undefined) - } - interface newFileFromMultipart { - /** - * NewFileFromMultipart creates a new File instace from the provided multipart header. - */ - (mh: multipart.FileHeader): (File | undefined) - } - /** - * MultipartReader defines a FileReader from [multipart.FileHeader]. - */ - interface MultipartReader { - header?: multipart.FileHeader - } - interface MultipartReader { - /** - * Open implements the [filesystem.FileReader] interface. - */ - open(): io.ReadSeekCloser - } - /** - * PathReader defines a FileReader from a local file path. - */ - interface PathReader { - path: string - } - interface PathReader { - /** - * Open implements the [filesystem.FileReader] interface. - */ - open(): io.ReadSeekCloser - } - /** - * BytesReader defines a FileReader from bytes content. - */ - interface BytesReader { - bytes: string - } - interface BytesReader { - /** - * Open implements the [filesystem.FileReader] interface. - */ - open(): io.ReadSeekCloser - } - type _subvdbqb = bytes.Reader - interface bytesReadSeekCloser extends _subvdbqb { - } - interface bytesReadSeekCloser { - /** - * Close implements the [io.ReadSeekCloser] interface. - */ - close(): void - } - interface System { - } - interface newS3 { - /** - * NewS3 initializes an S3 filesystem instance. - * - * NB! Make sure to call `Close()` after you are done working with it. - */ - (bucketName: string, region: string, endpoint: string, accessKey: string, secretKey: string, s3ForcePathStyle: boolean): (System | undefined) - } - interface newLocal { - /** - * NewLocal initializes a new local filesystem instance. - * - * NB! Make sure to call `Close()` after you are done working with it. - */ - (dirPath: string): (System | undefined) - } - interface System { - /** - * SetContext assigns the specified context to the current filesystem. - */ - setContext(ctx: context.Context): void - } - interface System { - /** - * Close releases any resources used for the related filesystem. - */ - close(): void - } - interface System { - /** - * Exists checks if file with fileKey path exists or not. - */ - exists(fileKey: string): boolean - } - interface System { - /** - * Attributes returns the attributes for the file with fileKey path. - */ - attributes(fileKey: string): (blob.Attributes | undefined) - } - interface System { - /** - * GetFile returns a file content reader for the given fileKey. - * - * NB! Make sure to call `Close()` after you are done working with it. - */ - getFile(fileKey: string): (blob.Reader | undefined) - } - interface System { - /** - * List returns a flat list with info for all files under the specified prefix. - */ - list(prefix: string): Array<(blob.ListObject | undefined)> - } - interface System { - /** - * Upload writes content into the fileKey location. - */ - upload(content: string, fileKey: string): void - } - interface System { - /** - * UploadFile uploads the provided multipart file to the fileKey location. - */ - uploadFile(file: File, fileKey: string): void - } - interface System { - /** - * UploadMultipart uploads the provided multipart file to the fileKey location. - */ - uploadMultipart(fh: multipart.FileHeader, fileKey: string): void - } - interface System { - /** - * Delete deletes stored file at fileKey location. - */ - delete(fileKey: string): void - } - interface System { - /** - * DeletePrefix deletes everything starting with the specified prefix. - */ - deletePrefix(prefix: string): Array - } - interface System { - /** - * Serve serves the file at fileKey location to an HTTP response. - * - * If the `download` query parameter is used the file will be always served for - * download no matter of its type (aka. with "Content-Disposition: attachment"). - */ - serve(res: http.ResponseWriter, req: http.Request, fileKey: string, name: string): void - } - interface System { - /** - * CreateThumb creates a new thumb image for the file at originalKey location. - * The new thumb file is stored at thumbKey location. - * - * thumbSize is in the format: - * - 0xH (eg. 0x100) - resize to H height preserving the aspect ratio - * - Wx0 (eg. 300x0) - resize to W width preserving the aspect ratio - * - WxH (eg. 300x100) - resize and crop to WxH viewbox (from center) - * - WxHt (eg. 300x100t) - resize and crop to WxH viewbox (from top) - * - WxHb (eg. 300x100b) - resize and crop to WxH viewbox (from bottom) - * - WxHf (eg. 300x100f) - fit inside a WxH viewbox (without cropping) - */ - createThumb(originalKey: string, thumbKey: string): void - } -} - -/** - * Package template is a thin wrapper around the standard html/template - * and text/template packages that implements a convenient registry to - * load and cache templates on the fly concurrently. - * - * It was created to assist the JSVM plugin HTML rendering, but could be used in other Go code. - * - * Example: - * - * ``` - * registry := template.NewRegistry() - * - * html1, err := registry.LoadFiles( - * // the files set wil be parsed only once and then cached - * "layout.html", - * "content.html", - * ).Render(map[string]any{"name": "John"}) - * - * html2, err := registry.LoadFiles( - * // reuse the already parsed and cached files set - * "layout.html", - * "content.html", - * ).Render(map[string]any{"name": "Jane"}) - * ``` - */ -namespace template { - interface newRegistry { - /** - * NewRegistry creates and initializes a new templates registry with - * some defaults (eg. global "raw" template function for unescaped HTML). - * - * Use the Registry.Load* methods to load templates into the registry. - */ - (): (Registry | undefined) - } - /** - * Registry defines a templates registry that is safe to be used by multiple goroutines. - * - * Use the Registry.Load* methods to load templates into the registry. - */ - interface Registry { - } - interface Registry { - /** - * AddFuncs registers new global template functions. - * - * The key of each map entry is the function name that will be used in the templates. - * If a function with the map entry name already exists it will be replaced with the new one. - * - * The value of each map entry is a function that must have either a - * single return value, or two return values of which the second has type error. - * - * Example: - * - * r.AddFuncs(map[string]any{ - * ``` - * "toUpper": func(str string) string { - * return strings.ToUppser(str) - * }, - * ... - * ``` - * }) - */ - addFuncs(funcs: _TygojaDict): (Registry | undefined) - } - interface Registry { - /** - * LoadFiles caches (if not already) the specified filenames set as a - * single template and returns a ready to use Renderer instance. - * - * There must be at least 1 filename specified. - */ - loadFiles(...filenames: string[]): (Renderer | undefined) - } - interface Registry { - /** - * LoadString caches (if not already) the specified inline string as a - * single template and returns a ready to use Renderer instance. - */ - loadString(text: string): (Renderer | undefined) - } - interface Registry { - /** - * LoadFS caches (if not already) the specified fs and globPatterns - * pair as single template and returns a ready to use Renderer instance. - * - * There must be at least 1 file matching the provided globPattern(s) - * (note that most file names serves as glob patterns matching themselves). - */ - loadFS(fsys: fs.FS, ...globPatterns: string[]): (Renderer | undefined) - } - /** - * Renderer defines a single parsed template. - */ - interface Renderer { - } - interface Renderer { - /** - * Render executes the template with the specified data as the dot object - * and returns the result as plain string. - */ - render(data: any): string - } -} - /** * Package validation provides configurable and extensible rules for validating data of various types. */ @@ -3400,14 +2921,14 @@ namespace dbx { /** * MssqlBuilder is the builder for SQL Server databases. */ - type _subNbqBX = BaseBuilder - interface MssqlBuilder extends _subNbqBX { + type _subIWmyt = BaseBuilder + interface MssqlBuilder extends _subIWmyt { } /** * MssqlQueryBuilder is the query builder for SQL Server databases. */ - type _subqpAPT = BaseQueryBuilder - interface MssqlQueryBuilder extends _subqpAPT { + type _subSkMfK = BaseQueryBuilder + interface MssqlQueryBuilder extends _subSkMfK { } interface newMssqlBuilder { /** @@ -3478,8 +2999,8 @@ namespace dbx { /** * MysqlBuilder is the builder for MySQL databases. */ - type _subNXhys = BaseBuilder - interface MysqlBuilder extends _subNXhys { + type _subHeXtc = BaseBuilder + interface MysqlBuilder extends _subHeXtc { } interface newMysqlBuilder { /** @@ -3554,14 +3075,14 @@ namespace dbx { /** * OciBuilder is the builder for Oracle databases. */ - type _subDmaZd = BaseBuilder - interface OciBuilder extends _subDmaZd { + type _suboazCg = BaseBuilder + interface OciBuilder extends _suboazCg { } /** * OciQueryBuilder is the query builder for Oracle databases. */ - type _subJSSGN = BaseQueryBuilder - interface OciQueryBuilder extends _subJSSGN { + type _subcmFSz = BaseQueryBuilder + interface OciQueryBuilder extends _subcmFSz { } interface newOciBuilder { /** @@ -3624,8 +3145,8 @@ namespace dbx { /** * PgsqlBuilder is the builder for PostgreSQL databases. */ - type _subWCdEE = BaseBuilder - interface PgsqlBuilder extends _subWCdEE { + type _subJBvyn = BaseBuilder + interface PgsqlBuilder extends _subJBvyn { } interface newPgsqlBuilder { /** @@ -3692,8 +3213,8 @@ namespace dbx { /** * SqliteBuilder is the builder for SQLite databases. */ - type _subhIkZY = BaseBuilder - interface SqliteBuilder extends _subhIkZY { + type _subawKTI = BaseBuilder + interface SqliteBuilder extends _subawKTI { } interface newSqliteBuilder { /** @@ -3792,8 +3313,8 @@ namespace dbx { /** * StandardBuilder is the builder that is used by DB for an unknown driver. */ - type _subfXynk = BaseBuilder - interface StandardBuilder extends _subfXynk { + type _subscLgP = BaseBuilder + interface StandardBuilder extends _subscLgP { } interface newStandardBuilder { /** @@ -3859,8 +3380,8 @@ namespace dbx { * DB enhances sql.DB by providing a set of DB-agnostic query building methods. * DB allows easier query building and population of data into Go variables. */ - type _subpIxBy = Builder - interface DB extends _subpIxBy { + type _subChise = Builder + interface DB extends _subChise { /** * FieldMapper maps struct fields to DB columns. Defaults to DefaultFieldMapFunc. */ @@ -4662,8 +4183,8 @@ namespace dbx { * Rows enhances sql.Rows by providing additional data query methods. * Rows can be obtained by calling Query.Rows(). It is mainly used to populate data row by row. */ - type _subHxAqi = sql.Rows - interface Rows extends _subHxAqi { + type _subZXCLn = sql.Rows + interface Rows extends _subZXCLn { } interface Rows { /** @@ -5020,8 +4541,8 @@ namespace dbx { }): string } interface structInfo { } - type _subQfrNY = structInfo - interface structValue extends _subQfrNY { + type _subXXOGb = structInfo + interface structValue extends _subXXOGb { } interface fieldInfo { } @@ -5060,8 +4581,8 @@ namespace dbx { /** * Tx enhances sql.Tx with additional querying methods. */ - type _subMlMns = Builder - interface Tx extends _subMlMns { + type _subTAeJl = Builder + interface Tx extends _subTAeJl { } interface Tx { /** @@ -5077,6 +4598,380 @@ namespace dbx { } } +/** + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the path/filepath package's Glob function. + * To expand environment variables, use package os's ExpandEnv. + * + * Note that the examples in this package assume a Unix system. + * They may not run on Windows, and they do not run in the Go Playground + * used by golang.org and godoc.org. + */ +namespace exec { + interface command { + /** + * Command returns the Cmd struct to execute the named program with + * the given arguments. + * + * It sets only the Path and Args in the returned structure. + * + * If name contains no path separators, Command uses LookPath to + * resolve name to a complete path if possible. Otherwise it uses name + * directly as Path. + * + * The returned Cmd's Args field is constructed from the command name + * followed by the elements of arg, so arg should not include the + * command name itself. For example, Command("echo", "hello"). + * Args[0] is always name, not the possibly resolved Path. + * + * On Windows, processes receive the whole command line as a single string + * and do their own parsing. Command combines and quotes Args into a command + * line string with an algorithm compatible with applications using + * CommandLineToArgvW (which is the most common way). Notable exceptions are + * msiexec.exe and cmd.exe (and thus, all batch files), which have a different + * unquoting algorithm. In these or other similar cases, you can do the + * quoting yourself and provide the full command line in SysProcAttr.CmdLine, + * leaving Args empty. + */ + (name: string, ...arg: string[]): (Cmd | undefined) + } +} + +namespace security { + interface s256Challenge { + /** + * S256Challenge creates base64 encoded sha256 challenge string derived from code. + * The padding of the result base64 string is stripped per [RFC 7636]. + * + * [RFC 7636]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 + */ + (code: string): string + } + interface md5 { + /** + * MD5 creates md5 hash from the provided plain text. + */ + (text: string): string + } + interface sha256 { + /** + * SHA256 creates sha256 hash as defined in FIPS 180-4 from the provided text. + */ + (text: string): string + } + interface sha512 { + /** + * SHA512 creates sha512 hash as defined in FIPS 180-4 from the provided text. + */ + (text: string): string + } + interface hs256 { + /** + * HS256 creates a HMAC hash with sha256 digest algorithm. + */ + (text: string, secret: string): string + } + interface hs512 { + /** + * HS512 creates a HMAC hash with sha512 digest algorithm. + */ + (text: string, secret: string): string + } + interface equal { + /** + * Equal compares two hash strings for equality without leaking timing information. + */ + (hash1: string, hash2: string): boolean + } + // @ts-ignore + import crand = rand + interface encrypt { + /** + * Encrypt encrypts data with key (must be valid 32 char aes key). + */ + (data: string, key: string): string + } + interface decrypt { + /** + * Decrypt decrypts encrypted text with key (must be valid 32 chars aes key). + */ + (cipherText: string, key: string): string + } + interface parseUnverifiedJWT { + /** + * ParseUnverifiedJWT parses JWT token and returns its claims + * but DOES NOT verify the signature. + * + * It verifies only the exp, iat and nbf claims. + */ + (token: string): jwt.MapClaims + } + interface parseJWT { + /** + * ParseJWT verifies and parses JWT token and returns its claims. + */ + (token: string, verificationKey: string): jwt.MapClaims + } + interface newJWT { + /** + * NewJWT generates and returns new HS256 signed JWT token. + */ + (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string + } + interface newToken { + /** + * Deprecated: + * Consider replacing with NewJWT(). + * + * NewToken is a legacy alias for NewJWT that generates a HS256 signed JWT token. + */ + (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string + } + // @ts-ignore + import cryptoRand = rand + // @ts-ignore + import mathRand = rand + interface randomString { + /** + * RandomString generates a cryptographically random string with the specified length. + * + * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. + */ + (length: number): string + } + interface randomStringWithAlphabet { + /** + * RandomStringWithAlphabet generates a cryptographically random string + * with the specified length and characters set. + * + * It panics if for some reason rand.Int returns a non-nil error. + */ + (length: number, alphabet: string): string + } + interface pseudorandomString { + /** + * PseudorandomString generates a pseudorandom string with the specified length. + * + * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. + * + * For a cryptographically random string (but a little bit slower) use RandomString instead. + */ + (length: number): string + } + interface pseudorandomStringWithAlphabet { + /** + * PseudorandomStringWithAlphabet generates a pseudorandom string + * with the specified length and characters set. + * + * For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead. + */ + (length: number, alphabet: string): string + } +} + +namespace filesystem { + /** + * FileReader defines an interface for a file resource reader. + */ + interface FileReader { + [key:string]: any; + open(): io.ReadSeekCloser + } + /** + * File defines a single file [io.ReadSeekCloser] resource. + * + * The file could be from a local path, multipipart/formdata header, etc. + */ + interface File { + name: string + originalName: string + size: number + reader: FileReader + } + interface newFileFromPath { + /** + * NewFileFromPath creates a new File instance from the provided local file path. + */ + (path: string): (File | undefined) + } + interface newFileFromBytes { + /** + * NewFileFromBytes creates a new File instance from the provided byte slice. + */ + (b: string, name: string): (File | undefined) + } + interface newFileFromMultipart { + /** + * NewFileFromMultipart creates a new File instace from the provided multipart header. + */ + (mh: multipart.FileHeader): (File | undefined) + } + /** + * MultipartReader defines a FileReader from [multipart.FileHeader]. + */ + interface MultipartReader { + header?: multipart.FileHeader + } + interface MultipartReader { + /** + * Open implements the [filesystem.FileReader] interface. + */ + open(): io.ReadSeekCloser + } + /** + * PathReader defines a FileReader from a local file path. + */ + interface PathReader { + path: string + } + interface PathReader { + /** + * Open implements the [filesystem.FileReader] interface. + */ + open(): io.ReadSeekCloser + } + /** + * BytesReader defines a FileReader from bytes content. + */ + interface BytesReader { + bytes: string + } + interface BytesReader { + /** + * Open implements the [filesystem.FileReader] interface. + */ + open(): io.ReadSeekCloser + } + type _subuePGE = bytes.Reader + interface bytesReadSeekCloser extends _subuePGE { + } + interface bytesReadSeekCloser { + /** + * Close implements the [io.ReadSeekCloser] interface. + */ + close(): void + } + interface System { + } + interface newS3 { + /** + * NewS3 initializes an S3 filesystem instance. + * + * NB! Make sure to call `Close()` after you are done working with it. + */ + (bucketName: string, region: string, endpoint: string, accessKey: string, secretKey: string, s3ForcePathStyle: boolean): (System | undefined) + } + interface newLocal { + /** + * NewLocal initializes a new local filesystem instance. + * + * NB! Make sure to call `Close()` after you are done working with it. + */ + (dirPath: string): (System | undefined) + } + interface System { + /** + * SetContext assigns the specified context to the current filesystem. + */ + setContext(ctx: context.Context): void + } + interface System { + /** + * Close releases any resources used for the related filesystem. + */ + close(): void + } + interface System { + /** + * Exists checks if file with fileKey path exists or not. + */ + exists(fileKey: string): boolean + } + interface System { + /** + * Attributes returns the attributes for the file with fileKey path. + */ + attributes(fileKey: string): (blob.Attributes | undefined) + } + interface System { + /** + * GetFile returns a file content reader for the given fileKey. + * + * NB! Make sure to call `Close()` after you are done working with it. + */ + getFile(fileKey: string): (blob.Reader | undefined) + } + interface System { + /** + * List returns a flat list with info for all files under the specified prefix. + */ + list(prefix: string): Array<(blob.ListObject | undefined)> + } + interface System { + /** + * Upload writes content into the fileKey location. + */ + upload(content: string, fileKey: string): void + } + interface System { + /** + * UploadFile uploads the provided multipart file to the fileKey location. + */ + uploadFile(file: File, fileKey: string): void + } + interface System { + /** + * UploadMultipart uploads the provided multipart file to the fileKey location. + */ + uploadMultipart(fh: multipart.FileHeader, fileKey: string): void + } + interface System { + /** + * Delete deletes stored file at fileKey location. + */ + delete(fileKey: string): void + } + interface System { + /** + * DeletePrefix deletes everything starting with the specified prefix. + */ + deletePrefix(prefix: string): Array + } + interface System { + /** + * Serve serves the file at fileKey location to an HTTP response. + * + * If the `download` query parameter is used the file will be always served for + * download no matter of its type (aka. with "Content-Disposition: attachment"). + */ + serve(res: http.ResponseWriter, req: http.Request, fileKey: string, name: string): void + } + interface System { + /** + * CreateThumb creates a new thumb image for the file at originalKey location. + * The new thumb file is stored at thumbKey location. + * + * thumbSize is in the format: + * - 0xH (eg. 0x100) - resize to H height preserving the aspect ratio + * - Wx0 (eg. 300x0) - resize to W width preserving the aspect ratio + * - WxH (eg. 300x100) - resize and crop to WxH viewbox (from center) + * - WxHt (eg. 300x100t) - resize and crop to WxH viewbox (from top) + * - WxHb (eg. 300x100b) - resize and crop to WxH viewbox (from bottom) + * - WxHf (eg. 300x100f) - fit inside a WxH viewbox (without cropping) + */ + createThumb(originalKey: string, thumbKey: string): void + } +} + /** * Package tokens implements various user and admin tokens generation methods. */ @@ -6048,8 +5943,8 @@ namespace forms { /** * SettingsUpsert is a [settings.Settings] upsert (create/update) form. */ - type _sublXRGI = settings.Settings - interface SettingsUpsert extends _sublXRGI { + type _subICAyT = settings.Settings + interface SettingsUpsert extends _subICAyT { } interface newSettingsUpsert { /** @@ -6467,8 +6362,8 @@ namespace pocketbase { /** * appWrapper serves as a private CoreApp instance wrapper. */ - type _submxwhw = CoreApp - interface appWrapper extends _submxwhw { + type _subwSHow = CoreApp + interface appWrapper extends _subwSHow { } /** * PocketBase defines a PocketBase app launcher. @@ -6476,8 +6371,8 @@ namespace pocketbase { * It implements [CoreApp] via embedding and all of the app interface methods * could be accessed directly through the instance (eg. PocketBase.DataDir()). */ - type _subFoSyx = appWrapper - interface PocketBase extends _subFoSyx { + type _subjwgVd = appWrapper + interface PocketBase extends _subjwgVd { /** * RootCmd is the main console command */ @@ -6549,6 +6444,266 @@ namespace pocketbase { } } +/** + * Package template is a thin wrapper around the standard html/template + * and text/template packages that implements a convenient registry to + * load and cache templates on the fly concurrently. + * + * It was created to assist the JSVM plugin HTML rendering, but could be used in other Go code. + * + * Example: + * + * ``` + * registry := template.NewRegistry() + * + * html1, err := registry.LoadFiles( + * // the files set wil be parsed only once and then cached + * "layout.html", + * "content.html", + * ).Render(map[string]any{"name": "John"}) + * + * html2, err := registry.LoadFiles( + * // reuse the already parsed and cached files set + * "layout.html", + * "content.html", + * ).Render(map[string]any{"name": "Jane"}) + * ``` + */ +namespace template { + interface newRegistry { + /** + * NewRegistry creates and initializes a new templates registry with + * some defaults (eg. global "raw" template function for unescaped HTML). + * + * Use the Registry.Load* methods to load templates into the registry. + */ + (): (Registry | undefined) + } + /** + * Registry defines a templates registry that is safe to be used by multiple goroutines. + * + * Use the Registry.Load* methods to load templates into the registry. + */ + interface Registry { + } + interface Registry { + /** + * AddFuncs registers new global template functions. + * + * The key of each map entry is the function name that will be used in the templates. + * If a function with the map entry name already exists it will be replaced with the new one. + * + * The value of each map entry is a function that must have either a + * single return value, or two return values of which the second has type error. + * + * Example: + * + * r.AddFuncs(map[string]any{ + * ``` + * "toUpper": func(str string) string { + * return strings.ToUppser(str) + * }, + * ... + * ``` + * }) + */ + addFuncs(funcs: _TygojaDict): (Registry | undefined) + } + interface Registry { + /** + * LoadFiles caches (if not already) the specified filenames set as a + * single template and returns a ready to use Renderer instance. + * + * There must be at least 1 filename specified. + */ + loadFiles(...filenames: string[]): (Renderer | undefined) + } + interface Registry { + /** + * LoadString caches (if not already) the specified inline string as a + * single template and returns a ready to use Renderer instance. + */ + loadString(text: string): (Renderer | undefined) + } + interface Registry { + /** + * LoadFS caches (if not already) the specified fs and globPatterns + * pair as single template and returns a ready to use Renderer instance. + * + * There must be at least 1 file matching the provided globPattern(s) + * (note that most file names serves as glob patterns matching themselves). + */ + loadFS(fsys: fs.FS, ...globPatterns: string[]): (Renderer | undefined) + } + /** + * Renderer defines a single parsed template. + */ + interface Renderer { + } + interface Renderer { + /** + * Render executes the template with the specified data as the dot object + * and returns the result as plain string. + */ + render(data: any): string + } +} + +/** + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. + * + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. + */ +namespace io { + /** + * Reader is the interface that wraps the basic Read method. + * + * Read reads up to len(p) bytes into p. It returns the number of bytes + * read (0 <= n <= len(p)) and any error encountered. Even if Read + * returns n < len(p), it may use all of p as scratch space during the call. + * If some data is available but not len(p) bytes, Read conventionally + * returns what is available instead of waiting for more. + * + * When Read encounters an error or end-of-file condition after + * successfully reading n > 0 bytes, it returns the number of + * bytes read. It may return the (non-nil) error from the same call + * or return the error (and n == 0) from a subsequent call. + * An instance of this general case is that a Reader returning + * a non-zero number of bytes at the end of the input stream may + * return either err == EOF or err == nil. The next Read should + * return 0, EOF. + * + * Callers should always process the n > 0 bytes returned before + * considering the error err. Doing so correctly handles I/O errors + * that happen after reading some bytes and also both of the + * allowed EOF behaviors. + * + * Implementations of Read are discouraged from returning a + * zero byte count with a nil error, except when len(p) == 0. + * Callers should treat a return of 0 and nil as indicating that + * nothing happened; in particular it does not indicate EOF. + * + * Implementations must not retain p. + */ + interface Reader { + [key:string]: any; + read(p: string): number + } + /** + * Writer is the interface that wraps the basic Write method. + * + * Write writes len(p) bytes from p to the underlying data stream. + * It returns the number of bytes written from p (0 <= n <= len(p)) + * and any error encountered that caused the write to stop early. + * Write must return a non-nil error if it returns n < len(p). + * Write must not modify the slice data, even temporarily. + * + * Implementations must not retain p. + */ + interface Writer { + [key:string]: any; + write(p: string): number + } + /** + * ReadSeekCloser is the interface that groups the basic Read, Seek and Close + * methods. + */ + interface ReadSeekCloser { + [key:string]: any; + } +} + +/** + * Package bytes implements functions for the manipulation of byte slices. + * It is analogous to the facilities of the strings package. + */ +namespace bytes { + /** + * A Reader implements the io.Reader, io.ReaderAt, io.WriterTo, io.Seeker, + * io.ByteScanner, and io.RuneScanner interfaces by reading from + * a byte slice. + * Unlike a Buffer, a Reader is read-only and supports seeking. + * The zero value for Reader operates like a Reader of an empty slice. + */ + interface Reader { + } + interface Reader { + /** + * Len returns the number of bytes of the unread portion of the + * slice. + */ + len(): number + } + interface Reader { + /** + * Size returns the original length of the underlying byte slice. + * Size is the number of bytes available for reading via ReadAt. + * The returned value is always the same and is not affected by calls + * to any other method. + */ + size(): number + } + interface Reader { + /** + * Read implements the io.Reader interface. + */ + read(b: string): number + } + interface Reader { + /** + * ReadAt implements the io.ReaderAt interface. + */ + readAt(b: string, off: number): number + } + interface Reader { + /** + * ReadByte implements the io.ByteReader interface. + */ + readByte(): number + } + interface Reader { + /** + * UnreadByte complements ReadByte in implementing the io.ByteScanner interface. + */ + unreadByte(): void + } + interface Reader { + /** + * ReadRune implements the io.RuneReader interface. + */ + readRune(): [number, number] + } + interface Reader { + /** + * UnreadRune complements ReadRune in implementing the io.RuneScanner interface. + */ + unreadRune(): void + } + interface Reader { + /** + * Seek implements the io.Seeker interface. + */ + seek(offset: number, whence: number): number + } + interface Reader { + /** + * WriteTo implements the io.WriterTo interface. + */ + writeTo(w: io.Writer): number + } + interface Reader { + /** + * Reset resets the Reader to be reading from b. + */ + reset(b: string): void + } +} + /** * Package syscall contains an interface to the low-level operating system * primitives. The details vary depending on the underlying system, and @@ -7213,232 +7368,6 @@ namespace time { } } -/** - * Package context defines the Context type, which carries deadlines, - * cancellation signals, and other request-scoped values across API boundaries - * and between processes. - * - * Incoming requests to a server should create a Context, and outgoing - * calls to servers should accept a Context. The chain of function - * calls between them must propagate the Context, optionally replacing - * it with a derived Context created using WithCancel, WithDeadline, - * WithTimeout, or WithValue. When a Context is canceled, all - * Contexts derived from it are also canceled. - * - * The WithCancel, WithDeadline, and WithTimeout functions take a - * Context (the parent) and return a derived Context (the child) and a - * CancelFunc. Calling the CancelFunc cancels the child and its - * children, removes the parent's reference to the child, and stops - * any associated timers. Failing to call the CancelFunc leaks the - * child and its children until the parent is canceled or the timer - * fires. The go vet tool checks that CancelFuncs are used on all - * control-flow paths. - * - * Programs that use Contexts should follow these rules to keep interfaces - * consistent across packages and enable static analysis tools to check context - * propagation: - * - * Do not store Contexts inside a struct type; instead, pass a Context - * explicitly to each function that needs it. The Context should be the first - * parameter, typically named ctx: - * - * ``` - * func DoSomething(ctx context.Context, arg Arg) error { - * // ... use ctx ... - * } - * ``` - * - * Do not pass a nil Context, even if a function permits it. Pass context.TODO - * if you are unsure about which Context to use. - * - * Use context Values only for request-scoped data that transits processes and - * APIs, not for passing optional parameters to functions. - * - * The same Context may be passed to functions running in different goroutines; - * Contexts are safe for simultaneous use by multiple goroutines. - * - * See https://blog.golang.org/context for example code for a server that uses - * Contexts. - */ -namespace context { - /** - * A Context carries a deadline, a cancellation signal, and other values across - * API boundaries. - * - * Context's methods may be called by multiple goroutines simultaneously. - */ - interface Context { - [key:string]: any; - /** - * Deadline returns the time when work done on behalf of this context - * should be canceled. Deadline returns ok==false when no deadline is - * set. Successive calls to Deadline return the same results. - */ - deadline(): [time.Time, boolean] - /** - * Done returns a channel that's closed when work done on behalf of this - * context should be canceled. Done may return nil if this context can - * never be canceled. Successive calls to Done return the same value. - * The close of the Done channel may happen asynchronously, - * after the cancel function returns. - * - * WithCancel arranges for Done to be closed when cancel is called; - * WithDeadline arranges for Done to be closed when the deadline - * expires; WithTimeout arranges for Done to be closed when the timeout - * elapses. - * - * Done is provided for use in select statements: - * - * // Stream generates values with DoSomething and sends them to out - * // until DoSomething returns an error or ctx.Done is closed. - * func Stream(ctx context.Context, out chan<- Value) error { - * for { - * v, err := DoSomething(ctx) - * if err != nil { - * return err - * } - * select { - * case <-ctx.Done(): - * return ctx.Err() - * case out <- v: - * } - * } - * } - * - * See https://blog.golang.org/pipelines for more examples of how to use - * a Done channel for cancellation. - */ - done(): undefined - /** - * If Done is not yet closed, Err returns nil. - * If Done is closed, Err returns a non-nil error explaining why: - * Canceled if the context was canceled - * or DeadlineExceeded if the context's deadline passed. - * After Err returns a non-nil error, successive calls to Err return the same error. - */ - err(): void - /** - * Value returns the value associated with this context for key, or nil - * if no value is associated with key. Successive calls to Value with - * the same key returns the same result. - * - * Use context values only for request-scoped data that transits - * processes and API boundaries, not for passing optional parameters to - * functions. - * - * A key identifies a specific value in a Context. Functions that wish - * to store values in Context typically allocate a key in a global - * variable then use that key as the argument to context.WithValue and - * Context.Value. A key can be any type that supports equality; - * packages should define keys as an unexported type to avoid - * collisions. - * - * Packages that define a Context key should provide type-safe accessors - * for the values stored using that key: - * - * ``` - * // Package user defines a User type that's stored in Contexts. - * package user - * - * import "context" - * - * // User is the type of value stored in the Contexts. - * type User struct {...} - * - * // key is an unexported type for keys defined in this package. - * // This prevents collisions with keys defined in other packages. - * type key int - * - * // userKey is the key for user.User values in Contexts. It is - * // unexported; clients use user.NewContext and user.FromContext - * // instead of using this key directly. - * var userKey key - * - * // NewContext returns a new Context that carries value u. - * func NewContext(ctx context.Context, u *User) context.Context { - * return context.WithValue(ctx, userKey, u) - * } - * - * // FromContext returns the User value stored in ctx, if any. - * func FromContext(ctx context.Context) (*User, bool) { - * u, ok := ctx.Value(userKey).(*User) - * return u, ok - * } - * ``` - */ - value(key: any): any - } -} - -/** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. - */ -namespace io { - /** - * Reader is the interface that wraps the basic Read method. - * - * Read reads up to len(p) bytes into p. It returns the number of bytes - * read (0 <= n <= len(p)) and any error encountered. Even if Read - * returns n < len(p), it may use all of p as scratch space during the call. - * If some data is available but not len(p) bytes, Read conventionally - * returns what is available instead of waiting for more. - * - * When Read encounters an error or end-of-file condition after - * successfully reading n > 0 bytes, it returns the number of - * bytes read. It may return the (non-nil) error from the same call - * or return the error (and n == 0) from a subsequent call. - * An instance of this general case is that a Reader returning - * a non-zero number of bytes at the end of the input stream may - * return either err == EOF or err == nil. The next Read should - * return 0, EOF. - * - * Callers should always process the n > 0 bytes returned before - * considering the error err. Doing so correctly handles I/O errors - * that happen after reading some bytes and also both of the - * allowed EOF behaviors. - * - * Implementations of Read are discouraged from returning a - * zero byte count with a nil error, except when len(p) == 0. - * Callers should treat a return of 0 and nil as indicating that - * nothing happened; in particular it does not indicate EOF. - * - * Implementations must not retain p. - */ - interface Reader { - [key:string]: any; - read(p: string): number - } - /** - * Writer is the interface that wraps the basic Write method. - * - * Write writes len(p) bytes from p to the underlying data stream. - * It returns the number of bytes written from p (0 <= n <= len(p)) - * and any error encountered that caused the write to stop early. - * Write must return a non-nil error if it returns n < len(p). - * Write must not modify the slice data, even temporarily. - * - * Implementations must not retain p. - */ - interface Writer { - [key:string]: any; - write(p: string): number - } - /** - * ReadSeekCloser is the interface that groups the basic Read, Seek and Close - * methods. - */ - interface ReadSeekCloser { - [key:string]: any; - } -} - /** * Package fs defines basic interfaces to a file system. * A file system can be provided by the host operating system @@ -7631,723 +7560,216 @@ namespace fs { } /** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. + * Package context defines the Context type, which carries deadlines, + * cancellation signals, and other request-scoped values across API boundaries + * and between processes. * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. + * Incoming requests to a server should create a Context, and outgoing + * calls to servers should accept a Context. The chain of function + * calls between them must propagate the Context, optionally replacing + * it with a derived Context created using WithCancel, WithDeadline, + * WithTimeout, or WithValue. When a Context is canceled, all + * Contexts derived from it are also canceled. * - * Drivers that do not support context cancellation will not return until - * after the query is completed. + * The WithCancel, WithDeadline, and WithTimeout functions take a + * Context (the parent) and return a derived Context (the child) and a + * CancelFunc. Calling the CancelFunc cancels the child and its + * children, removes the parent's reference to the child, and stops + * any associated timers. Failing to call the CancelFunc leaks the + * child and its children until the parent is canceled or the timer + * fires. The go vet tool checks that CancelFuncs are used on all + * control-flow paths. * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. + * Programs that use Contexts should follow these rules to keep interfaces + * consistent across packages and enable static analysis tools to check context + * propagation: + * + * Do not store Contexts inside a struct type; instead, pass a Context + * explicitly to each function that needs it. The Context should be the first + * parameter, typically named ctx: + * + * ``` + * func DoSomething(ctx context.Context, arg Arg) error { + * // ... use ctx ... + * } + * ``` + * + * Do not pass a nil Context, even if a function permits it. Pass context.TODO + * if you are unsure about which Context to use. + * + * Use context Values only for request-scoped data that transits processes and + * APIs, not for passing optional parameters to functions. + * + * The same Context may be passed to functions running in different goroutines; + * Contexts are safe for simultaneous use by multiple goroutines. + * + * See https://blog.golang.org/context for example code for a server that uses + * Contexts. */ -namespace sql { +namespace context { /** - * TxOptions holds the transaction options to be used in DB.BeginTx. - */ - interface TxOptions { - /** - * Isolation is the transaction isolation level. - * If zero, the driver or database's default level is used. - */ - isolation: IsolationLevel - readOnly: boolean - } - /** - * DB is a database handle representing a pool of zero or more - * underlying connections. It's safe for concurrent use by multiple - * goroutines. + * A Context carries a deadline, a cancellation signal, and other values across + * API boundaries. * - * The sql package creates and frees connections automatically; it - * also maintains a free pool of idle connections. If the database has - * a concept of per-connection state, such state can be reliably observed - * within a transaction (Tx) or connection (Conn). Once DB.Begin is called, the - * returned Tx is bound to a single connection. Once Commit or - * Rollback is called on the transaction, that transaction's - * connection is returned to DB's idle connection pool. The pool size - * can be controlled with SetMaxIdleConns. + * Context's methods may be called by multiple goroutines simultaneously. */ - interface DB { - } - interface DB { - /** - * PingContext verifies a connection to the database is still alive, - * establishing a connection if necessary. - */ - pingContext(ctx: context.Context): void - } - interface DB { - /** - * Ping verifies a connection to the database is still alive, - * establishing a connection if necessary. - * - * Ping uses context.Background internally; to specify the context, use - * PingContext. - */ - ping(): void - } - interface DB { - /** - * Close closes the database and prevents new queries from starting. - * Close then waits for all queries that have started processing on the server - * to finish. - * - * It is rare to Close a DB, as the DB handle is meant to be - * long-lived and shared between many goroutines. - */ - close(): void - } - interface DB { - /** - * SetMaxIdleConns sets the maximum number of connections in the idle - * connection pool. - * - * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, - * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. - * - * If n <= 0, no idle connections are retained. - * - * The default max idle connections is currently 2. This may change in - * a future release. - */ - setMaxIdleConns(n: number): void - } - interface DB { - /** - * SetMaxOpenConns sets the maximum number of open connections to the database. - * - * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than - * MaxIdleConns, then MaxIdleConns will be reduced to match the new - * MaxOpenConns limit. - * - * If n <= 0, then there is no limit on the number of open connections. - * The default is 0 (unlimited). - */ - setMaxOpenConns(n: number): void - } - interface DB { - /** - * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. - * - * Expired connections may be closed lazily before reuse. - * - * If d <= 0, connections are not closed due to a connection's age. - */ - setConnMaxLifetime(d: time.Duration): void - } - interface DB { - /** - * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. - * - * Expired connections may be closed lazily before reuse. - * - * If d <= 0, connections are not closed due to a connection's idle time. - */ - setConnMaxIdleTime(d: time.Duration): void - } - interface DB { - /** - * Stats returns database statistics. - */ - stats(): DBStats - } - interface DB { - /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's Close method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - */ - prepareContext(ctx: context.Context, query: string): (Stmt | undefined) - } - interface DB { - /** - * Prepare creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's Close method - * when the statement is no longer needed. - * - * Prepare uses context.Background internally; to specify the context, use - * PrepareContext. - */ - prepare(query: string): (Stmt | undefined) - } - interface DB { - /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface DB { - /** - * Exec executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - * - * Exec uses context.Background internally; to specify the context, use - * ExecContext. - */ - exec(query: string, ...args: any[]): Result - } - interface DB { - /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows | undefined) - } - interface DB { - /** - * Query executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - * - * Query uses context.Background internally; to specify the context, use - * QueryContext. - */ - query(query: string, ...args: any[]): (Rows | undefined) - } - interface DB { - /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * Row's Scan method is called. - * If the query selects no rows, the *Row's Scan will return ErrNoRows. - * Otherwise, the *Row's Scan scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row | undefined) - } - interface DB { - /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * Row's Scan method is called. - * If the query selects no rows, the *Row's Scan will return ErrNoRows. - * Otherwise, the *Row's Scan scans the first selected row and discards - * the rest. - * - * QueryRow uses context.Background internally; to specify the context, use - * QueryRowContext. - */ - queryRow(query: string, ...args: any[]): (Row | undefined) - } - interface DB { - /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. Tx.Commit will return an error if the context provided to - * BeginTx is canceled. - * - * The provided TxOptions is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. - */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx | undefined) - } - interface DB { - /** - * Begin starts a transaction. The default isolation level is dependent on - * the driver. - * - * Begin uses context.Background internally; to specify the context, use - * BeginTx. - */ - begin(): (Tx | undefined) - } - interface DB { - /** - * Driver returns the database's underlying driver. - */ - driver(): any - } - interface DB { - /** - * Conn returns a single connection by either opening a new connection - * or returning an existing connection from the connection pool. Conn will - * block until either a connection is returned or ctx is canceled. - * Queries run on the same Conn will be run in the same database session. - * - * Every Conn must be returned to the database pool after use by - * calling Conn.Close. - */ - conn(ctx: context.Context): (Conn | undefined) - } - /** - * Tx is an in-progress database transaction. - * - * A transaction must end with a call to Commit or Rollback. - * - * After a call to Commit or Rollback, all operations on the - * transaction fail with ErrTxDone. - * - * The statements prepared for a transaction by calling - * the transaction's Prepare or Stmt methods are closed - * by the call to Commit or Rollback. - */ - interface Tx { - } - interface Tx { - /** - * Commit commits the transaction. - */ - commit(): void - } - interface Tx { - /** - * Rollback aborts the transaction. - */ - rollback(): void - } - interface Tx { - /** - * PrepareContext creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * To use an existing prepared statement on this transaction, see Tx.Stmt. - * - * The provided context will be used for the preparation of the context, not - * for the execution of the returned statement. The returned statement - * will run in the transaction context. - */ - prepareContext(ctx: context.Context, query: string): (Stmt | undefined) - } - interface Tx { - /** - * Prepare creates a prepared statement for use within a transaction. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * To use an existing prepared statement on this transaction, see Tx.Stmt. - * - * Prepare uses context.Background internally; to specify the context, use - * PrepareContext. - */ - prepare(query: string): (Stmt | undefined) - } - interface Tx { - /** - * StmtContext returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - */ - stmtContext(ctx: context.Context, stmt: Stmt): (Stmt | undefined) - } - interface Tx { - /** - * Stmt returns a transaction-specific prepared statement from - * an existing statement. - * - * Example: - * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") - * ... - * tx, err := db.Begin() - * ... - * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) - * - * The returned statement operates within the transaction and will be closed - * when the transaction has been committed or rolled back. - * - * Stmt uses context.Background internally; to specify the context, use - * StmtContext. - */ - stmt(stmt: Stmt): (Stmt | undefined) - } - interface Tx { - /** - * ExecContext executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. - */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface Tx { - /** - * Exec executes a query that doesn't return rows. - * For example: an INSERT and UPDATE. - * - * Exec uses context.Background internally; to specify the context, use - * ExecContext. - */ - exec(query: string, ...args: any[]): Result - } - interface Tx { - /** - * QueryContext executes a query that returns rows, typically a SELECT. - */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows | undefined) - } - interface Tx { - /** - * Query executes a query that returns rows, typically a SELECT. - * - * Query uses context.Background internally; to specify the context, use - * QueryContext. - */ - query(query: string, ...args: any[]): (Rows | undefined) - } - interface Tx { - /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * Row's Scan method is called. - * If the query selects no rows, the *Row's Scan will return ErrNoRows. - * Otherwise, the *Row's Scan scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row | undefined) - } - interface Tx { - /** - * QueryRow executes a query that is expected to return at most one row. - * QueryRow always returns a non-nil value. Errors are deferred until - * Row's Scan method is called. - * If the query selects no rows, the *Row's Scan will return ErrNoRows. - * Otherwise, the *Row's Scan scans the first selected row and discards - * the rest. - * - * QueryRow uses context.Background internally; to specify the context, use - * QueryRowContext. - */ - queryRow(query: string, ...args: any[]): (Row | undefined) - } - /** - * Stmt is a prepared statement. - * A Stmt is safe for concurrent use by multiple goroutines. - * - * If a Stmt is prepared on a Tx or Conn, it will be bound to a single - * underlying connection forever. If the Tx or Conn closes, the Stmt will - * become unusable and all operations will return an error. - * If a Stmt is prepared on a DB, it will remain usable for the lifetime of the - * DB. When the Stmt needs to execute on a new underlying connection, it will - * prepare itself on the new connection automatically. - */ - interface Stmt { - } - interface Stmt { - /** - * ExecContext executes a prepared statement with the given arguments and - * returns a Result summarizing the effect of the statement. - */ - execContext(ctx: context.Context, ...args: any[]): Result - } - interface Stmt { - /** - * Exec executes a prepared statement with the given arguments and - * returns a Result summarizing the effect of the statement. - * - * Exec uses context.Background internally; to specify the context, use - * ExecContext. - */ - exec(...args: any[]): Result - } - interface Stmt { - /** - * QueryContext executes a prepared query statement with the given arguments - * and returns the query results as a *Rows. - */ - queryContext(ctx: context.Context, ...args: any[]): (Rows | undefined) - } - interface Stmt { - /** - * Query executes a prepared query statement with the given arguments - * and returns the query results as a *Rows. - * - * Query uses context.Background internally; to specify the context, use - * QueryContext. - */ - query(...args: any[]): (Rows | undefined) - } - interface Stmt { - /** - * QueryRowContext executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned *Row, which is always non-nil. - * If the query selects no rows, the *Row's Scan will return ErrNoRows. - * Otherwise, the *Row's Scan scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, ...args: any[]): (Row | undefined) - } - interface Stmt { - /** - * QueryRow executes a prepared query statement with the given arguments. - * If an error occurs during the execution of the statement, that error will - * be returned by a call to Scan on the returned *Row, which is always non-nil. - * If the query selects no rows, the *Row's Scan will return ErrNoRows. - * Otherwise, the *Row's Scan scans the first selected row and discards - * the rest. - * - * Example usage: - * - * var name string - * err := nameByUseridStmt.QueryRow(id).Scan(&name) - * - * QueryRow uses context.Background internally; to specify the context, use - * QueryRowContext. - */ - queryRow(...args: any[]): (Row | undefined) - } - interface Stmt { - /** - * Close closes the statement. - */ - close(): void - } - /** - * Rows is the result of a query. Its cursor starts before the first row - * of the result set. Use Next to advance from row to row. - */ - interface Rows { - } - interface Rows { - /** - * Next prepares the next result row for reading with the Scan method. It - * returns true on success, or false if there is no next result row or an error - * happened while preparing it. Err should be consulted to distinguish between - * the two cases. - * - * Every call to Scan, even the first one, must be preceded by a call to Next. - */ - next(): boolean - } - interface Rows { - /** - * NextResultSet prepares the next result set for reading. It reports whether - * there is further result sets, or false if there is no further result set - * or if there is an error advancing to it. The Err method should be consulted - * to distinguish between the two cases. - * - * After calling NextResultSet, the Next method should always be called before - * scanning. If there are further result sets they may not have rows in the result - * set. - */ - nextResultSet(): boolean - } - interface Rows { - /** - * Err returns the error, if any, that was encountered during iteration. - * Err may be called after an explicit or implicit Close. - */ - err(): void - } - interface Rows { - /** - * Columns returns the column names. - * Columns returns an error if the rows are closed. - */ - columns(): Array - } - interface Rows { - /** - * ColumnTypes returns column information such as column type, length, - * and nullable. Some information may not be available from some drivers. - */ - columnTypes(): Array<(ColumnType | undefined)> - } - interface Rows { - /** - * Scan copies the columns in the current row into the values pointed - * at by dest. The number of values in dest must be the same as the - * number of columns in Rows. - * - * Scan converts columns read from the database into the following - * common Go types and special types provided by the sql package: - * - * ``` - * *string - * *[]byte - * *int, *int8, *int16, *int32, *int64 - * *uint, *uint8, *uint16, *uint32, *uint64 - * *bool - * *float32, *float64 - * *interface{} - * *RawBytes - * *Rows (cursor value) - * any type implementing Scanner (see Scanner docs) - * ``` - * - * In the most simple case, if the type of the value from the source - * column is an integer, bool or string type T and dest is of type *T, - * Scan simply assigns the value through the pointer. - * - * Scan also converts between string and numeric types, as long as no - * information would be lost. While Scan stringifies all numbers - * scanned from numeric database columns into *string, scans into - * numeric types are checked for overflow. For example, a float64 with - * value 300 or a string with value "300" can scan into a uint16, but - * not into a uint8, though float64(255) or "255" can scan into a - * uint8. One exception is that scans of some float64 numbers to - * strings may lose information when stringifying. In general, scan - * floating point columns into *float64. - * - * If a dest argument has type *[]byte, Scan saves in that argument a - * copy of the corresponding data. The copy is owned by the caller and - * can be modified and held indefinitely. The copy can be avoided by - * using an argument of type *RawBytes instead; see the documentation - * for RawBytes for restrictions on its use. - * - * If an argument has type *interface{}, Scan copies the value - * provided by the underlying driver without conversion. When scanning - * from a source value of type []byte to *interface{}, a copy of the - * slice is made and the caller owns the result. - * - * Source values of type time.Time may be scanned into values of type - * *time.Time, *interface{}, *string, or *[]byte. When converting to - * the latter two, time.RFC3339Nano is used. - * - * Source values of type bool may be scanned into types *bool, - * *interface{}, *string, *[]byte, or *RawBytes. - * - * For scanning into *bool, the source may be true, false, 1, 0, or - * string inputs parseable by strconv.ParseBool. - * - * Scan can also convert a cursor returned from a query, such as - * "select cursor(select * from my_table) from dual", into a - * *Rows value that can itself be scanned from. The parent - * select query will close any cursor *Rows if the parent *Rows is closed. - * - * If any of the first arguments implementing Scanner returns an error, - * that error will be wrapped in the returned error - */ - scan(...dest: any[]): void - } - interface Rows { - /** - * Close closes the Rows, preventing further enumeration. If Next is called - * and returns false and there are no further result sets, - * the Rows are closed automatically and it will suffice to check the - * result of Err. Close is idempotent and does not affect the result of Err. - */ - close(): void - } - /** - * A Result summarizes an executed SQL command. - */ - interface Result { + interface Context { [key:string]: any; /** - * LastInsertId returns the integer generated by the database - * in response to a command. Typically this will be from an - * "auto increment" column when inserting a new row. Not all - * databases support this feature, and the syntax of such - * statements varies. + * Deadline returns the time when work done on behalf of this context + * should be canceled. Deadline returns ok==false when no deadline is + * set. Successive calls to Deadline return the same results. */ - lastInsertId(): number + deadline(): [time.Time, boolean] /** - * RowsAffected returns the number of rows affected by an - * update, insert, or delete. Not every database or database - * driver may support this. + * Done returns a channel that's closed when work done on behalf of this + * context should be canceled. Done may return nil if this context can + * never be canceled. Successive calls to Done return the same value. + * The close of the Done channel may happen asynchronously, + * after the cancel function returns. + * + * WithCancel arranges for Done to be closed when cancel is called; + * WithDeadline arranges for Done to be closed when the deadline + * expires; WithTimeout arranges for Done to be closed when the timeout + * elapses. + * + * Done is provided for use in select statements: + * + * // Stream generates values with DoSomething and sends them to out + * // until DoSomething returns an error or ctx.Done is closed. + * func Stream(ctx context.Context, out chan<- Value) error { + * for { + * v, err := DoSomething(ctx) + * if err != nil { + * return err + * } + * select { + * case <-ctx.Done(): + * return ctx.Err() + * case out <- v: + * } + * } + * } + * + * See https://blog.golang.org/pipelines for more examples of how to use + * a Done channel for cancellation. */ - rowsAffected(): number + done(): undefined + /** + * If Done is not yet closed, Err returns nil. + * If Done is closed, Err returns a non-nil error explaining why: + * Canceled if the context was canceled + * or DeadlineExceeded if the context's deadline passed. + * After Err returns a non-nil error, successive calls to Err return the same error. + */ + err(): void + /** + * Value returns the value associated with this context for key, or nil + * if no value is associated with key. Successive calls to Value with + * the same key returns the same result. + * + * Use context values only for request-scoped data that transits + * processes and API boundaries, not for passing optional parameters to + * functions. + * + * A key identifies a specific value in a Context. Functions that wish + * to store values in Context typically allocate a key in a global + * variable then use that key as the argument to context.WithValue and + * Context.Value. A key can be any type that supports equality; + * packages should define keys as an unexported type to avoid + * collisions. + * + * Packages that define a Context key should provide type-safe accessors + * for the values stored using that key: + * + * ``` + * // Package user defines a User type that's stored in Contexts. + * package user + * + * import "context" + * + * // User is the type of value stored in the Contexts. + * type User struct {...} + * + * // key is an unexported type for keys defined in this package. + * // This prevents collisions with keys defined in other packages. + * type key int + * + * // userKey is the key for user.User values in Contexts. It is + * // unexported; clients use user.NewContext and user.FromContext + * // instead of using this key directly. + * var userKey key + * + * // NewContext returns a new Context that carries value u. + * func NewContext(ctx context.Context, u *User) context.Context { + * return context.WithValue(ctx, userKey, u) + * } + * + * // FromContext returns the User value stored in ctx, if any. + * func FromContext(ctx context.Context) (*User, bool) { + * u, ok := ctx.Value(userKey).(*User) + * return u, ok + * } + * ``` + */ + value(key: any): any } } /** - * Package bytes implements functions for the manipulation of byte slices. - * It is analogous to the facilities of the strings package. + * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html + * + * See README.md for more info. */ -namespace bytes { +namespace jwt { /** - * A Reader implements the io.Reader, io.ReaderAt, io.WriterTo, io.Seeker, - * io.ByteScanner, and io.RuneScanner interfaces by reading from - * a byte slice. - * Unlike a Buffer, a Reader is read-only and supports seeking. - * The zero value for Reader operates like a Reader of an empty slice. + * MapClaims is a claims type that uses the map[string]interface{} for JSON decoding. + * This is the default claims type if you don't supply one */ - interface Reader { - } - interface Reader { + interface MapClaims extends _TygojaDict{} + interface MapClaims { /** - * Len returns the number of bytes of the unread portion of the - * slice. + * VerifyAudience Compares the aud claim against cmp. + * If required is false, this method will return true if the value matches or is unset */ - len(): number + verifyAudience(cmp: string, req: boolean): boolean } - interface Reader { + interface MapClaims { /** - * Size returns the original length of the underlying byte slice. - * Size is the number of bytes available for reading via ReadAt. - * The returned value is always the same and is not affected by calls - * to any other method. + * VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). + * If req is false, it will return true, if exp is unset. */ - size(): number + verifyExpiresAt(cmp: number, req: boolean): boolean } - interface Reader { + interface MapClaims { /** - * Read implements the io.Reader interface. + * VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). + * If req is false, it will return true, if iat is unset. */ - read(b: string): number + verifyIssuedAt(cmp: number, req: boolean): boolean } - interface Reader { + interface MapClaims { /** - * ReadAt implements the io.ReaderAt interface. + * VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). + * If req is false, it will return true, if nbf is unset. */ - readAt(b: string, off: number): number + verifyNotBefore(cmp: number, req: boolean): boolean } - interface Reader { + interface MapClaims { /** - * ReadByte implements the io.ByteReader interface. + * VerifyIssuer compares the iss claim against cmp. + * If required is false, this method will return true if the value matches or is unset */ - readByte(): number + verifyIssuer(cmp: string, req: boolean): boolean } - interface Reader { + interface MapClaims { /** - * UnreadByte complements ReadByte in implementing the io.ByteScanner interface. + * Valid validates time based claims "exp, iat, nbf". + * There is no accounting for clock skew. + * As well, if any of the above claims are not in the token, it will still + * be considered a valid claim. */ - unreadByte(): void - } - interface Reader { - /** - * ReadRune implements the io.RuneReader interface. - */ - readRune(): [number, number] - } - interface Reader { - /** - * UnreadRune complements ReadRune in implementing the io.RuneScanner interface. - */ - unreadRune(): void - } - interface Reader { - /** - * Seek implements the io.Seeker interface. - */ - seek(offset: number, whence: number): number - } - interface Reader { - /** - * WriteTo implements the io.WriterTo interface. - */ - writeTo(w: io.Writer): number - } - interface Reader { - /** - * Reset resets the Reader to be reading from b. - */ - reset(b: string): void + valid(): void } } @@ -9272,6 +8694,116 @@ namespace http { } } +namespace auth { + /** + * AuthUser defines a standardized oauth2 user data structure. + */ + interface AuthUser { + id: string + name: string + username: string + email: string + avatarUrl: string + rawUser: _TygojaDict + accessToken: string + refreshToken: string + } + /** + * Provider defines a common interface for an OAuth2 client. + */ + interface Provider { + [key:string]: any; + /** + * Scopes returns the context associated with the provider (if any). + */ + context(): context.Context + /** + * SetContext assigns the specified context to the current provider. + */ + setContext(ctx: context.Context): void + /** + * Scopes returns the provider access permissions that will be requested. + */ + scopes(): Array + /** + * SetScopes sets the provider access permissions that will be requested later. + */ + setScopes(scopes: Array): void + /** + * ClientId returns the provider client's app ID. + */ + clientId(): string + /** + * SetClientId sets the provider client's ID. + */ + setClientId(clientId: string): void + /** + * ClientSecret returns the provider client's app secret. + */ + clientSecret(): string + /** + * SetClientSecret sets the provider client's app secret. + */ + setClientSecret(secret: string): void + /** + * RedirectUrl returns the end address to redirect the user + * going through the OAuth flow. + */ + redirectUrl(): string + /** + * SetRedirectUrl sets the provider's RedirectUrl. + */ + setRedirectUrl(url: string): void + /** + * AuthUrl returns the provider's authorization service url. + */ + authUrl(): string + /** + * SetAuthUrl sets the provider's AuthUrl. + */ + setAuthUrl(url: string): void + /** + * TokenUrl returns the provider's token exchange service url. + */ + tokenUrl(): string + /** + * SetTokenUrl sets the provider's TokenUrl. + */ + setTokenUrl(url: string): void + /** + * UserApiUrl returns the provider's user info api url. + */ + userApiUrl(): string + /** + * SetUserApiUrl sets the provider's UserApiUrl. + */ + setUserApiUrl(url: string): void + /** + * Client returns an http client using the provided token. + */ + client(token: oauth2.Token): (any | undefined) + /** + * BuildAuthUrl returns a URL to the provider's consent page + * that asks for permissions for the required scopes explicitly. + */ + buildAuthUrl(state: string, ...opts: oauth2.AuthCodeOption[]): string + /** + * FetchToken converts an authorization code to token. + */ + fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token | undefined) + /** + * FetchRawUserData requests and marshalizes into `result` the + * the OAuth user api response. + */ + fetchRawUserData(token: oauth2.Token): string + /** + * FetchAuthUser is similar to FetchRawUserData, but normalizes and + * marshalizes the user api response into a standardized AuthUser struct. + */ + fetchAuthUser(token: oauth2.Token): (AuthUser | undefined) + } +} + /** * Package exec runs external commands. It wraps os.StartProcess to make it * easier to remap stdin and stdout, connect I/O with pipes, and do other @@ -9501,471 +9033,6 @@ namespace exec { } } -/** - * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html - * - * See README.md for more info. - */ -namespace jwt { - /** - * MapClaims is a claims type that uses the map[string]interface{} for JSON decoding. - * This is the default claims type if you don't supply one - */ - interface MapClaims extends _TygojaDict{} - interface MapClaims { - /** - * VerifyAudience Compares the aud claim against cmp. - * If required is false, this method will return true if the value matches or is unset - */ - verifyAudience(cmp: string, req: boolean): boolean - } - interface MapClaims { - /** - * VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). - * If req is false, it will return true, if exp is unset. - */ - verifyExpiresAt(cmp: number, req: boolean): boolean - } - interface MapClaims { - /** - * VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). - * If req is false, it will return true, if iat is unset. - */ - verifyIssuedAt(cmp: number, req: boolean): boolean - } - interface MapClaims { - /** - * VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). - * If req is false, it will return true, if nbf is unset. - */ - verifyNotBefore(cmp: number, req: boolean): boolean - } - interface MapClaims { - /** - * VerifyIssuer compares the iss claim against cmp. - * If required is false, this method will return true if the value matches or is unset - */ - verifyIssuer(cmp: string, req: boolean): boolean - } - interface MapClaims { - /** - * Valid validates time based claims "exp, iat, nbf". - * There is no accounting for clock skew. - * As well, if any of the above claims are not in the token, it will still - * be considered a valid claim. - */ - valid(): void - } -} - -/** - * Package blob provides an easy and portable way to interact with blobs - * within a storage location. Subpackages contain driver implementations of - * blob for supported services. - * - * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. - * - * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with - * functions in that package. - * - * # Errors - * - * The errors returned from this package can be inspected in several ways: - * - * The Code function from gocloud.dev/gcerrors will return an error code, also - * defined in that package, when invoked on an error. - * - * The Bucket.ErrorAs method can retrieve the driver error underlying the returned - * error. - * - * # OpenCensus Integration - * - * OpenCensus supports tracing and metric collection for multiple languages and - * backend providers. See https://opencensus.io. - * - * This API collects OpenCensus traces and metrics for the following methods: - * ``` - * - Attributes - * - Copy - * - Delete - * - ListPage - * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll - * are included because they call NewRangeReader.) - * - NewWriter, from creation until the call to Close. - * ``` - * - * All trace and metric names begin with the package import path. - * The traces add the method name. - * For example, "gocloud.dev/blob/Attributes". - * The metrics are "completed_calls", a count of completed method calls by driver, - * method and status (error code); and "latency", a distribution of method latency - * by driver and method. - * For example, "gocloud.dev/blob/latency". - * - * It also collects the following metrics: - * ``` - * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. - * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. - * ``` - * - * To enable trace collection in your application, see "Configure Exporter" at - * https://opencensus.io/quickstart/go/tracing. - * To enable metric collection in your application, see "Exporting stats" at - * https://opencensus.io/quickstart/go/metrics. - */ -namespace blob { - /** - * Reader reads bytes from a blob. - * It implements io.ReadSeekCloser, and must be closed after - * reads are finished. - */ - interface Reader { - } - interface Reader { - /** - * Read implements io.Reader (https://golang.org/pkg/io/#Reader). - */ - read(p: string): number - } - interface Reader { - /** - * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). - */ - seek(offset: number, whence: number): number - } - interface Reader { - /** - * Close implements io.Closer (https://golang.org/pkg/io/#Closer). - */ - close(): void - } - interface Reader { - /** - * ContentType returns the MIME type of the blob. - */ - contentType(): string - } - interface Reader { - /** - * ModTime returns the time the blob was last modified. - */ - modTime(): time.Time - } - interface Reader { - /** - * Size returns the size of the blob content in bytes. - */ - size(): number - } - interface Reader { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } - interface Reader { - /** - * WriteTo reads from r and writes to w until there's no more data or - * an error occurs. - * The return value is the number of bytes written to w. - * - * It implements the io.WriterTo interface. - */ - writeTo(w: io.Writer): number - } - /** - * Attributes contains attributes about a blob. - */ - interface Attributes { - /** - * CacheControl specifies caching attributes that services may use - * when serving the blob. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - */ - cacheControl: string - /** - * ContentDisposition specifies whether the blob content is expected to be - * displayed inline or as an attachment. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition - */ - contentDisposition: string - /** - * ContentEncoding specifies the encoding used for the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding - */ - contentEncoding: string - /** - * ContentLanguage specifies the language used in the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language - */ - contentLanguage: string - /** - * ContentType is the MIME type of the blob. It will not be empty. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type - */ - contentType: string - /** - * Metadata holds key/value pairs associated with the blob. - * Keys are guaranteed to be in lowercase, even if the backend service - * has case-sensitive keys (although note that Metadata written via - * this package will always be lowercased). If there are duplicate - * case-insensitive keys (e.g., "foo" and "FOO"), only one value - * will be kept, and it is undefined which one. - */ - metadata: _TygojaDict - /** - * CreateTime is the time the blob was created, if available. If not available, - * CreateTime will be the zero time. - */ - createTime: time.Time - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time - /** - * Size is the size of the blob's content in bytes. - */ - size: number - /** - * MD5 is an MD5 hash of the blob contents or nil if not available. - */ - md5: string - /** - * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. - */ - eTag: string - } - interface Attributes { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } - /** - * ListObject represents a single blob returned from List. - */ - interface ListObject { - /** - * Key is the key for this blob. - */ - key: string - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time - /** - * Size is the size of the blob's content in bytes. - */ - size: number - /** - * MD5 is an MD5 hash of the blob contents or nil if not available. - */ - md5: string - /** - * IsDir indicates that this result represents a "directory" in the - * hierarchical namespace, ending in ListOptions.Delimiter. Key can be - * passed as ListOptions.Prefix to list items in the "directory". - * Fields other than Key and IsDir will not be set if IsDir is true. - */ - isDir: boolean - } - interface ListObject { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * JsonArray defines a slice that is safe for json and db read/write. - */ - interface JsonArray extends Array{} - interface JsonArray { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string - } - interface JsonArray { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonArray { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonArray[T] instance. - */ - scan(value: any): void - } - /** - * JsonMap defines a map that is safe for json and db read/write. - */ - interface JsonMap extends _TygojaDict{} - interface JsonMap { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string - } - interface JsonMap { - /** - * Get retrieves a single value from the current JsonMap. - * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). - */ - get(key: string): any - } - interface JsonMap { - /** - * Set sets a single value in the current JsonMap. - * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). - */ - set(key: string, value: any): void - } - interface JsonMap { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonMap { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current `JsonMap` instance. - */ - scan(value: any): void - } -} - -/** - * Package schema implements custom Schema and SchemaField datatypes - * for handling the Collection schema definitions. - */ -namespace schema { - // @ts-ignore - import validation = ozzo_validation - /** - * Schema defines a dynamic db schema as a slice of `SchemaField`s. - */ - interface Schema { - } - interface Schema { - /** - * Fields returns the registered schema fields. - */ - fields(): Array<(SchemaField | undefined)> - } - interface Schema { - /** - * InitFieldsOptions calls `InitOptions()` for all schema fields. - */ - initFieldsOptions(): void - } - interface Schema { - /** - * Clone creates a deep clone of the current schema. - */ - clone(): (Schema | undefined) - } - interface Schema { - /** - * AsMap returns a map with all registered schema field. - * The returned map is indexed with each field name. - */ - asMap(): _TygojaDict - } - interface Schema { - /** - * GetFieldById returns a single field by its id. - */ - getFieldById(id: string): (SchemaField | undefined) - } - interface Schema { - /** - * GetFieldByName returns a single field by its name. - */ - getFieldByName(name: string): (SchemaField | undefined) - } - interface Schema { - /** - * RemoveField removes a single schema field by its id. - * - * This method does nothing if field with `id` doesn't exist. - */ - removeField(id: string): void - } - interface Schema { - /** - * AddField registers the provided newField to the current schema. - * - * If field with `newField.Id` already exist, the existing field is - * replaced with the new one. - * - * Otherwise the new field is appended to the other schema fields. - */ - addField(newField: SchemaField): void - } - interface Schema { - /** - * Validate makes Schema validatable by implementing [validation.Validatable] interface. - * - * Internally calls each individual field's validator and additionally - * checks for invalid renamed fields and field name duplications. - */ - validate(): void - } - interface Schema { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string - } - interface Schema { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - * - * On success, all schema field options are auto initialized. - */ - unmarshalJSON(data: string): void - } - interface Schema { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface Schema { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current Schema instance. - */ - scan(value: any): void - } -} - /** * Package echo implements high performance, minimalist Go web framework. * @@ -10542,12 +9609,1137 @@ namespace echo { } } +/** + * Package blob provides an easy and portable way to interact with blobs + * within a storage location. Subpackages contain driver implementations of + * blob for supported services. + * + * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. + * + * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with + * functions in that package. + * + * # Errors + * + * The errors returned from this package can be inspected in several ways: + * + * The Code function from gocloud.dev/gcerrors will return an error code, also + * defined in that package, when invoked on an error. + * + * The Bucket.ErrorAs method can retrieve the driver error underlying the returned + * error. + * + * # OpenCensus Integration + * + * OpenCensus supports tracing and metric collection for multiple languages and + * backend providers. See https://opencensus.io. + * + * This API collects OpenCensus traces and metrics for the following methods: + * ``` + * - Attributes + * - Copy + * - Delete + * - ListPage + * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll + * are included because they call NewRangeReader.) + * - NewWriter, from creation until the call to Close. + * ``` + * + * All trace and metric names begin with the package import path. + * The traces add the method name. + * For example, "gocloud.dev/blob/Attributes". + * The metrics are "completed_calls", a count of completed method calls by driver, + * method and status (error code); and "latency", a distribution of method latency + * by driver and method. + * For example, "gocloud.dev/blob/latency". + * + * It also collects the following metrics: + * ``` + * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. + * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. + * ``` + * + * To enable trace collection in your application, see "Configure Exporter" at + * https://opencensus.io/quickstart/go/tracing. + * To enable metric collection in your application, see "Exporting stats" at + * https://opencensus.io/quickstart/go/metrics. + */ +namespace blob { + /** + * Reader reads bytes from a blob. + * It implements io.ReadSeekCloser, and must be closed after + * reads are finished. + */ + interface Reader { + } + interface Reader { + /** + * Read implements io.Reader (https://golang.org/pkg/io/#Reader). + */ + read(p: string): number + } + interface Reader { + /** + * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). + */ + seek(offset: number, whence: number): number + } + interface Reader { + /** + * Close implements io.Closer (https://golang.org/pkg/io/#Closer). + */ + close(): void + } + interface Reader { + /** + * ContentType returns the MIME type of the blob. + */ + contentType(): string + } + interface Reader { + /** + * ModTime returns the time the blob was last modified. + */ + modTime(): time.Time + } + interface Reader { + /** + * Size returns the size of the blob content in bytes. + */ + size(): number + } + interface Reader { + /** + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. + */ + as(i: { + }): boolean + } + interface Reader { + /** + * WriteTo reads from r and writes to w until there's no more data or + * an error occurs. + * The return value is the number of bytes written to w. + * + * It implements the io.WriterTo interface. + */ + writeTo(w: io.Writer): number + } + /** + * Attributes contains attributes about a blob. + */ + interface Attributes { + /** + * CacheControl specifies caching attributes that services may use + * when serving the blob. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + */ + cacheControl: string + /** + * ContentDisposition specifies whether the blob content is expected to be + * displayed inline or as an attachment. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition + */ + contentDisposition: string + /** + * ContentEncoding specifies the encoding used for the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + */ + contentEncoding: string + /** + * ContentLanguage specifies the language used in the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language + */ + contentLanguage: string + /** + * ContentType is the MIME type of the blob. It will not be empty. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type + */ + contentType: string + /** + * Metadata holds key/value pairs associated with the blob. + * Keys are guaranteed to be in lowercase, even if the backend service + * has case-sensitive keys (although note that Metadata written via + * this package will always be lowercased). If there are duplicate + * case-insensitive keys (e.g., "foo" and "FOO"), only one value + * will be kept, and it is undefined which one. + */ + metadata: _TygojaDict + /** + * CreateTime is the time the blob was created, if available. If not available, + * CreateTime will be the zero time. + */ + createTime: time.Time + /** + * ModTime is the time the blob was last modified. + */ + modTime: time.Time + /** + * Size is the size of the blob's content in bytes. + */ + size: number + /** + * MD5 is an MD5 hash of the blob contents or nil if not available. + */ + md5: string + /** + * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. + */ + eTag: string + } + interface Attributes { + /** + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. + */ + as(i: { + }): boolean + } + /** + * ListObject represents a single blob returned from List. + */ + interface ListObject { + /** + * Key is the key for this blob. + */ + key: string + /** + * ModTime is the time the blob was last modified. + */ + modTime: time.Time + /** + * Size is the size of the blob's content in bytes. + */ + size: number + /** + * MD5 is an MD5 hash of the blob contents or nil if not available. + */ + md5: string + /** + * IsDir indicates that this result represents a "directory" in the + * hierarchical namespace, ending in ListOptions.Delimiter. Key can be + * passed as ListOptions.Prefix to list items in the "directory". + * Fields other than Key and IsDir will not be set if IsDir is true. + */ + isDir: boolean + } + interface ListObject { + /** + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. + */ + as(i: { + }): boolean + } +} + +/** + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. + * + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. + * + * Drivers that do not support context cancellation will not return until + * after the query is completed. + * + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. + */ +namespace sql { + /** + * TxOptions holds the transaction options to be used in DB.BeginTx. + */ + interface TxOptions { + /** + * Isolation is the transaction isolation level. + * If zero, the driver or database's default level is used. + */ + isolation: IsolationLevel + readOnly: boolean + } + /** + * DB is a database handle representing a pool of zero or more + * underlying connections. It's safe for concurrent use by multiple + * goroutines. + * + * The sql package creates and frees connections automatically; it + * also maintains a free pool of idle connections. If the database has + * a concept of per-connection state, such state can be reliably observed + * within a transaction (Tx) or connection (Conn). Once DB.Begin is called, the + * returned Tx is bound to a single connection. Once Commit or + * Rollback is called on the transaction, that transaction's + * connection is returned to DB's idle connection pool. The pool size + * can be controlled with SetMaxIdleConns. + */ + interface DB { + } + interface DB { + /** + * PingContext verifies a connection to the database is still alive, + * establishing a connection if necessary. + */ + pingContext(ctx: context.Context): void + } + interface DB { + /** + * Ping verifies a connection to the database is still alive, + * establishing a connection if necessary. + * + * Ping uses context.Background internally; to specify the context, use + * PingContext. + */ + ping(): void + } + interface DB { + /** + * Close closes the database and prevents new queries from starting. + * Close then waits for all queries that have started processing on the server + * to finish. + * + * It is rare to Close a DB, as the DB handle is meant to be + * long-lived and shared between many goroutines. + */ + close(): void + } + interface DB { + /** + * SetMaxIdleConns sets the maximum number of connections in the idle + * connection pool. + * + * If MaxOpenConns is greater than 0 but less than the new MaxIdleConns, + * then the new MaxIdleConns will be reduced to match the MaxOpenConns limit. + * + * If n <= 0, no idle connections are retained. + * + * The default max idle connections is currently 2. This may change in + * a future release. + */ + setMaxIdleConns(n: number): void + } + interface DB { + /** + * SetMaxOpenConns sets the maximum number of open connections to the database. + * + * If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than + * MaxIdleConns, then MaxIdleConns will be reduced to match the new + * MaxOpenConns limit. + * + * If n <= 0, then there is no limit on the number of open connections. + * The default is 0 (unlimited). + */ + setMaxOpenConns(n: number): void + } + interface DB { + /** + * SetConnMaxLifetime sets the maximum amount of time a connection may be reused. + * + * Expired connections may be closed lazily before reuse. + * + * If d <= 0, connections are not closed due to a connection's age. + */ + setConnMaxLifetime(d: time.Duration): void + } + interface DB { + /** + * SetConnMaxIdleTime sets the maximum amount of time a connection may be idle. + * + * Expired connections may be closed lazily before reuse. + * + * If d <= 0, connections are not closed due to a connection's idle time. + */ + setConnMaxIdleTime(d: time.Duration): void + } + interface DB { + /** + * Stats returns database statistics. + */ + stats(): DBStats + } + interface DB { + /** + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's Close method + * when the statement is no longer needed. + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. + */ + prepareContext(ctx: context.Context, query: string): (Stmt | undefined) + } + interface DB { + /** + * Prepare creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's Close method + * when the statement is no longer needed. + * + * Prepare uses context.Background internally; to specify the context, use + * PrepareContext. + */ + prepare(query: string): (Stmt | undefined) + } + interface DB { + /** + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. + */ + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface DB { + /** + * Exec executes a query without returning any rows. + * The args are for any placeholder parameters in the query. + * + * Exec uses context.Background internally; to specify the context, use + * ExecContext. + */ + exec(query: string, ...args: any[]): Result + } + interface DB { + /** + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + */ + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows | undefined) + } + interface DB { + /** + * Query executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + * + * Query uses context.Background internally; to specify the context, use + * QueryContext. + */ + query(query: string, ...args: any[]): (Rows | undefined) + } + interface DB { + /** + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * Row's Scan method is called. + * If the query selects no rows, the *Row's Scan will return ErrNoRows. + * Otherwise, the *Row's Scan scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row | undefined) + } + interface DB { + /** + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * Row's Scan method is called. + * If the query selects no rows, the *Row's Scan will return ErrNoRows. + * Otherwise, the *Row's Scan scans the first selected row and discards + * the rest. + * + * QueryRow uses context.Background internally; to specify the context, use + * QueryRowContext. + */ + queryRow(query: string, ...args: any[]): (Row | undefined) + } + interface DB { + /** + * BeginTx starts a transaction. + * + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. Tx.Commit will return an error if the context provided to + * BeginTx is canceled. + * + * The provided TxOptions is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. + */ + beginTx(ctx: context.Context, opts: TxOptions): (Tx | undefined) + } + interface DB { + /** + * Begin starts a transaction. The default isolation level is dependent on + * the driver. + * + * Begin uses context.Background internally; to specify the context, use + * BeginTx. + */ + begin(): (Tx | undefined) + } + interface DB { + /** + * Driver returns the database's underlying driver. + */ + driver(): any + } + interface DB { + /** + * Conn returns a single connection by either opening a new connection + * or returning an existing connection from the connection pool. Conn will + * block until either a connection is returned or ctx is canceled. + * Queries run on the same Conn will be run in the same database session. + * + * Every Conn must be returned to the database pool after use by + * calling Conn.Close. + */ + conn(ctx: context.Context): (Conn | undefined) + } + /** + * Tx is an in-progress database transaction. + * + * A transaction must end with a call to Commit or Rollback. + * + * After a call to Commit or Rollback, all operations on the + * transaction fail with ErrTxDone. + * + * The statements prepared for a transaction by calling + * the transaction's Prepare or Stmt methods are closed + * by the call to Commit or Rollback. + */ + interface Tx { + } + interface Tx { + /** + * Commit commits the transaction. + */ + commit(): void + } + interface Tx { + /** + * Rollback aborts the transaction. + */ + rollback(): void + } + interface Tx { + /** + * PrepareContext creates a prepared statement for use within a transaction. + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * To use an existing prepared statement on this transaction, see Tx.Stmt. + * + * The provided context will be used for the preparation of the context, not + * for the execution of the returned statement. The returned statement + * will run in the transaction context. + */ + prepareContext(ctx: context.Context, query: string): (Stmt | undefined) + } + interface Tx { + /** + * Prepare creates a prepared statement for use within a transaction. + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * To use an existing prepared statement on this transaction, see Tx.Stmt. + * + * Prepare uses context.Background internally; to specify the context, use + * PrepareContext. + */ + prepare(query: string): (Stmt | undefined) + } + interface Tx { + /** + * StmtContext returns a transaction-specific prepared statement from + * an existing statement. + * + * Example: + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.StmtContext(ctx, updateMoney).Exec(123.45, 98293203) + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + */ + stmtContext(ctx: context.Context, stmt: Stmt): (Stmt | undefined) + } + interface Tx { + /** + * Stmt returns a transaction-specific prepared statement from + * an existing statement. + * + * Example: + * updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") + * ... + * tx, err := db.Begin() + * ... + * res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) + * + * The returned statement operates within the transaction and will be closed + * when the transaction has been committed or rolled back. + * + * Stmt uses context.Background internally; to specify the context, use + * StmtContext. + */ + stmt(stmt: Stmt): (Stmt | undefined) + } + interface Tx { + /** + * ExecContext executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. + */ + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface Tx { + /** + * Exec executes a query that doesn't return rows. + * For example: an INSERT and UPDATE. + * + * Exec uses context.Background internally; to specify the context, use + * ExecContext. + */ + exec(query: string, ...args: any[]): Result + } + interface Tx { + /** + * QueryContext executes a query that returns rows, typically a SELECT. + */ + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows | undefined) + } + interface Tx { + /** + * Query executes a query that returns rows, typically a SELECT. + * + * Query uses context.Background internally; to specify the context, use + * QueryContext. + */ + query(query: string, ...args: any[]): (Rows | undefined) + } + interface Tx { + /** + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * Row's Scan method is called. + * If the query selects no rows, the *Row's Scan will return ErrNoRows. + * Otherwise, the *Row's Scan scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row | undefined) + } + interface Tx { + /** + * QueryRow executes a query that is expected to return at most one row. + * QueryRow always returns a non-nil value. Errors are deferred until + * Row's Scan method is called. + * If the query selects no rows, the *Row's Scan will return ErrNoRows. + * Otherwise, the *Row's Scan scans the first selected row and discards + * the rest. + * + * QueryRow uses context.Background internally; to specify the context, use + * QueryRowContext. + */ + queryRow(query: string, ...args: any[]): (Row | undefined) + } + /** + * Stmt is a prepared statement. + * A Stmt is safe for concurrent use by multiple goroutines. + * + * If a Stmt is prepared on a Tx or Conn, it will be bound to a single + * underlying connection forever. If the Tx or Conn closes, the Stmt will + * become unusable and all operations will return an error. + * If a Stmt is prepared on a DB, it will remain usable for the lifetime of the + * DB. When the Stmt needs to execute on a new underlying connection, it will + * prepare itself on the new connection automatically. + */ + interface Stmt { + } + interface Stmt { + /** + * ExecContext executes a prepared statement with the given arguments and + * returns a Result summarizing the effect of the statement. + */ + execContext(ctx: context.Context, ...args: any[]): Result + } + interface Stmt { + /** + * Exec executes a prepared statement with the given arguments and + * returns a Result summarizing the effect of the statement. + * + * Exec uses context.Background internally; to specify the context, use + * ExecContext. + */ + exec(...args: any[]): Result + } + interface Stmt { + /** + * QueryContext executes a prepared query statement with the given arguments + * and returns the query results as a *Rows. + */ + queryContext(ctx: context.Context, ...args: any[]): (Rows | undefined) + } + interface Stmt { + /** + * Query executes a prepared query statement with the given arguments + * and returns the query results as a *Rows. + * + * Query uses context.Background internally; to specify the context, use + * QueryContext. + */ + query(...args: any[]): (Rows | undefined) + } + interface Stmt { + /** + * QueryRowContext executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned *Row, which is always non-nil. + * If the query selects no rows, the *Row's Scan will return ErrNoRows. + * Otherwise, the *Row's Scan scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, ...args: any[]): (Row | undefined) + } + interface Stmt { + /** + * QueryRow executes a prepared query statement with the given arguments. + * If an error occurs during the execution of the statement, that error will + * be returned by a call to Scan on the returned *Row, which is always non-nil. + * If the query selects no rows, the *Row's Scan will return ErrNoRows. + * Otherwise, the *Row's Scan scans the first selected row and discards + * the rest. + * + * Example usage: + * + * var name string + * err := nameByUseridStmt.QueryRow(id).Scan(&name) + * + * QueryRow uses context.Background internally; to specify the context, use + * QueryRowContext. + */ + queryRow(...args: any[]): (Row | undefined) + } + interface Stmt { + /** + * Close closes the statement. + */ + close(): void + } + /** + * Rows is the result of a query. Its cursor starts before the first row + * of the result set. Use Next to advance from row to row. + */ + interface Rows { + } + interface Rows { + /** + * Next prepares the next result row for reading with the Scan method. It + * returns true on success, or false if there is no next result row or an error + * happened while preparing it. Err should be consulted to distinguish between + * the two cases. + * + * Every call to Scan, even the first one, must be preceded by a call to Next. + */ + next(): boolean + } + interface Rows { + /** + * NextResultSet prepares the next result set for reading. It reports whether + * there is further result sets, or false if there is no further result set + * or if there is an error advancing to it. The Err method should be consulted + * to distinguish between the two cases. + * + * After calling NextResultSet, the Next method should always be called before + * scanning. If there are further result sets they may not have rows in the result + * set. + */ + nextResultSet(): boolean + } + interface Rows { + /** + * Err returns the error, if any, that was encountered during iteration. + * Err may be called after an explicit or implicit Close. + */ + err(): void + } + interface Rows { + /** + * Columns returns the column names. + * Columns returns an error if the rows are closed. + */ + columns(): Array + } + interface Rows { + /** + * ColumnTypes returns column information such as column type, length, + * and nullable. Some information may not be available from some drivers. + */ + columnTypes(): Array<(ColumnType | undefined)> + } + interface Rows { + /** + * Scan copies the columns in the current row into the values pointed + * at by dest. The number of values in dest must be the same as the + * number of columns in Rows. + * + * Scan converts columns read from the database into the following + * common Go types and special types provided by the sql package: + * + * ``` + * *string + * *[]byte + * *int, *int8, *int16, *int32, *int64 + * *uint, *uint8, *uint16, *uint32, *uint64 + * *bool + * *float32, *float64 + * *interface{} + * *RawBytes + * *Rows (cursor value) + * any type implementing Scanner (see Scanner docs) + * ``` + * + * In the most simple case, if the type of the value from the source + * column is an integer, bool or string type T and dest is of type *T, + * Scan simply assigns the value through the pointer. + * + * Scan also converts between string and numeric types, as long as no + * information would be lost. While Scan stringifies all numbers + * scanned from numeric database columns into *string, scans into + * numeric types are checked for overflow. For example, a float64 with + * value 300 or a string with value "300" can scan into a uint16, but + * not into a uint8, though float64(255) or "255" can scan into a + * uint8. One exception is that scans of some float64 numbers to + * strings may lose information when stringifying. In general, scan + * floating point columns into *float64. + * + * If a dest argument has type *[]byte, Scan saves in that argument a + * copy of the corresponding data. The copy is owned by the caller and + * can be modified and held indefinitely. The copy can be avoided by + * using an argument of type *RawBytes instead; see the documentation + * for RawBytes for restrictions on its use. + * + * If an argument has type *interface{}, Scan copies the value + * provided by the underlying driver without conversion. When scanning + * from a source value of type []byte to *interface{}, a copy of the + * slice is made and the caller owns the result. + * + * Source values of type time.Time may be scanned into values of type + * *time.Time, *interface{}, *string, or *[]byte. When converting to + * the latter two, time.RFC3339Nano is used. + * + * Source values of type bool may be scanned into types *bool, + * *interface{}, *string, *[]byte, or *RawBytes. + * + * For scanning into *bool, the source may be true, false, 1, 0, or + * string inputs parseable by strconv.ParseBool. + * + * Scan can also convert a cursor returned from a query, such as + * "select cursor(select * from my_table) from dual", into a + * *Rows value that can itself be scanned from. The parent + * select query will close any cursor *Rows if the parent *Rows is closed. + * + * If any of the first arguments implementing Scanner returns an error, + * that error will be wrapped in the returned error + */ + scan(...dest: any[]): void + } + interface Rows { + /** + * Close closes the Rows, preventing further enumeration. If Next is called + * and returns false and there are no further result sets, + * the Rows are closed automatically and it will suffice to check the + * result of Err. Close is idempotent and does not affect the result of Err. + */ + close(): void + } + /** + * A Result summarizes an executed SQL command. + */ + interface Result { + [key:string]: any; + /** + * LastInsertId returns the integer generated by the database + * in response to a command. Typically this will be from an + * "auto increment" column when inserting a new row. Not all + * databases support this feature, and the syntax of such + * statements varies. + */ + lastInsertId(): number + /** + * RowsAffected returns the number of rows affected by an + * update, insert, or delete. Not every database or database + * driver may support this. + */ + rowsAffected(): number + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * JsonArray defines a slice that is safe for json and db read/write. + */ + interface JsonArray extends Array{} + interface JsonArray { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string + } + interface JsonArray { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JsonArray { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonArray[T] instance. + */ + scan(value: any): void + } + /** + * JsonMap defines a map that is safe for json and db read/write. + */ + interface JsonMap extends _TygojaDict{} + interface JsonMap { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string + } + interface JsonMap { + /** + * Get retrieves a single value from the current JsonMap. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + */ + get(key: string): any + } + interface JsonMap { + /** + * Set sets a single value in the current JsonMap. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + */ + set(key: string, value: any): void + } + interface JsonMap { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JsonMap { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current `JsonMap` instance. + */ + scan(value: any): void + } +} + +namespace settings { + // @ts-ignore + import validation = ozzo_validation + /** + * Settings defines common app configuration options. + */ + interface Settings { + meta: MetaConfig + logs: LogsConfig + smtp: SmtpConfig + s3: S3Config + backups: BackupsConfig + adminAuthToken: TokenConfig + adminPasswordResetToken: TokenConfig + adminFileToken: TokenConfig + recordAuthToken: TokenConfig + recordPasswordResetToken: TokenConfig + recordEmailChangeToken: TokenConfig + recordVerificationToken: TokenConfig + recordFileToken: TokenConfig + /** + * Deprecated: Will be removed in v0.9+ + */ + emailAuth: EmailAuthConfig + googleAuth: AuthProviderConfig + facebookAuth: AuthProviderConfig + githubAuth: AuthProviderConfig + gitlabAuth: AuthProviderConfig + discordAuth: AuthProviderConfig + twitterAuth: AuthProviderConfig + microsoftAuth: AuthProviderConfig + spotifyAuth: AuthProviderConfig + kakaoAuth: AuthProviderConfig + twitchAuth: AuthProviderConfig + stravaAuth: AuthProviderConfig + giteeAuth: AuthProviderConfig + livechatAuth: AuthProviderConfig + giteaAuth: AuthProviderConfig + oidcAuth: AuthProviderConfig + oidc2Auth: AuthProviderConfig + oidc3Auth: AuthProviderConfig + appleAuth: AuthProviderConfig + instagramAuth: AuthProviderConfig + vkAuth: AuthProviderConfig + yandexAuth: AuthProviderConfig + patreonAuth: AuthProviderConfig + mailcowAuth: AuthProviderConfig + } + interface Settings { + /** + * Validate makes Settings validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface Settings { + /** + * Merge merges `other` settings into the current one. + */ + merge(other: Settings): void + } + interface Settings { + /** + * Clone creates a new deep copy of the current settings. + */ + clone(): (Settings | undefined) + } + interface Settings { + /** + * RedactClone creates a new deep copy of the current settings, + * while replacing the secret values with `******`. + */ + redactClone(): (Settings | undefined) + } + interface Settings { + /** + * NamedAuthProviderConfigs returns a map with all registered OAuth2 + * provider configurations (indexed by their name identifier). + */ + namedAuthProviderConfigs(): _TygojaDict + } +} + +/** + * Package schema implements custom Schema and SchemaField datatypes + * for handling the Collection schema definitions. + */ +namespace schema { + // @ts-ignore + import validation = ozzo_validation + /** + * Schema defines a dynamic db schema as a slice of `SchemaField`s. + */ + interface Schema { + } + interface Schema { + /** + * Fields returns the registered schema fields. + */ + fields(): Array<(SchemaField | undefined)> + } + interface Schema { + /** + * InitFieldsOptions calls `InitOptions()` for all schema fields. + */ + initFieldsOptions(): void + } + interface Schema { + /** + * Clone creates a deep clone of the current schema. + */ + clone(): (Schema | undefined) + } + interface Schema { + /** + * AsMap returns a map with all registered schema field. + * The returned map is indexed with each field name. + */ + asMap(): _TygojaDict + } + interface Schema { + /** + * GetFieldById returns a single field by its id. + */ + getFieldById(id: string): (SchemaField | undefined) + } + interface Schema { + /** + * GetFieldByName returns a single field by its name. + */ + getFieldByName(name: string): (SchemaField | undefined) + } + interface Schema { + /** + * RemoveField removes a single schema field by its id. + * + * This method does nothing if field with `id` doesn't exist. + */ + removeField(id: string): void + } + interface Schema { + /** + * AddField registers the provided newField to the current schema. + * + * If field with `newField.Id` already exist, the existing field is + * replaced with the new one. + * + * Otherwise the new field is appended to the other schema fields. + */ + addField(newField: SchemaField): void + } + interface Schema { + /** + * Validate makes Schema validatable by implementing [validation.Validatable] interface. + * + * Internally calls each individual field's validator and additionally + * checks for invalid renamed fields and field name duplications. + */ + validate(): void + } + interface Schema { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string + } + interface Schema { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + * + * On success, all schema field options are auto initialized. + */ + unmarshalJSON(data: string): void + } + interface Schema { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface Schema { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current Schema instance. + */ + scan(value: any): void + } +} + /** * Package models implements all PocketBase DB models and DTOs. */ namespace models { - type _subJJbtQ = BaseModel - interface Admin extends _subJJbtQ { + type _sublPCRB = BaseModel + interface Admin extends _sublPCRB { avatar: number email: string tokenKey: string @@ -10582,8 +10774,8 @@ namespace models { } // @ts-ignore import validation = ozzo_validation - type _subezALT = BaseModel - interface Collection extends _subezALT { + type _subqvFEb = BaseModel + interface Collection extends _subqvFEb { name: string type: string system: boolean @@ -10676,8 +10868,8 @@ namespace models { */ setOptions(typedOptions: any): void } - type _subRGCGc = BaseModel - interface ExternalAuth extends _subRGCGc { + type _subJAFwR = BaseModel + interface ExternalAuth extends _subJAFwR { collectionId: string recordId: string provider: string @@ -10686,8 +10878,8 @@ namespace models { interface ExternalAuth { tableName(): string } - type _subRjkIh = BaseModel - interface Record extends _subRjkIh { + type _subASWKu = BaseModel + interface Record extends _subASWKu { } interface Record { /** @@ -11085,197 +11277,6 @@ namespace models { } } -namespace auth { - /** - * AuthUser defines a standardized oauth2 user data structure. - */ - interface AuthUser { - id: string - name: string - username: string - email: string - avatarUrl: string - rawUser: _TygojaDict - accessToken: string - refreshToken: string - } - /** - * Provider defines a common interface for an OAuth2 client. - */ - interface Provider { - [key:string]: any; - /** - * Scopes returns the context associated with the provider (if any). - */ - context(): context.Context - /** - * SetContext assigns the specified context to the current provider. - */ - setContext(ctx: context.Context): void - /** - * Scopes returns the provider access permissions that will be requested. - */ - scopes(): Array - /** - * SetScopes sets the provider access permissions that will be requested later. - */ - setScopes(scopes: Array): void - /** - * ClientId returns the provider client's app ID. - */ - clientId(): string - /** - * SetClientId sets the provider client's ID. - */ - setClientId(clientId: string): void - /** - * ClientSecret returns the provider client's app secret. - */ - clientSecret(): string - /** - * SetClientSecret sets the provider client's app secret. - */ - setClientSecret(secret: string): void - /** - * RedirectUrl returns the end address to redirect the user - * going through the OAuth flow. - */ - redirectUrl(): string - /** - * SetRedirectUrl sets the provider's RedirectUrl. - */ - setRedirectUrl(url: string): void - /** - * AuthUrl returns the provider's authorization service url. - */ - authUrl(): string - /** - * SetAuthUrl sets the provider's AuthUrl. - */ - setAuthUrl(url: string): void - /** - * TokenUrl returns the provider's token exchange service url. - */ - tokenUrl(): string - /** - * SetTokenUrl sets the provider's TokenUrl. - */ - setTokenUrl(url: string): void - /** - * UserApiUrl returns the provider's user info api url. - */ - userApiUrl(): string - /** - * SetUserApiUrl sets the provider's UserApiUrl. - */ - setUserApiUrl(url: string): void - /** - * Client returns an http client using the provided token. - */ - client(token: oauth2.Token): (any | undefined) - /** - * BuildAuthUrl returns a URL to the provider's consent page - * that asks for permissions for the required scopes explicitly. - */ - buildAuthUrl(state: string, ...opts: oauth2.AuthCodeOption[]): string - /** - * FetchToken converts an authorization code to token. - */ - fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token | undefined) - /** - * FetchRawUserData requests and marshalizes into `result` the - * the OAuth user api response. - */ - fetchRawUserData(token: oauth2.Token): string - /** - * FetchAuthUser is similar to FetchRawUserData, but normalizes and - * marshalizes the user api response into a standardized AuthUser struct. - */ - fetchAuthUser(token: oauth2.Token): (AuthUser | undefined) - } -} - -namespace settings { - // @ts-ignore - import validation = ozzo_validation - /** - * Settings defines common app configuration options. - */ - interface Settings { - meta: MetaConfig - logs: LogsConfig - smtp: SmtpConfig - s3: S3Config - backups: BackupsConfig - adminAuthToken: TokenConfig - adminPasswordResetToken: TokenConfig - adminFileToken: TokenConfig - recordAuthToken: TokenConfig - recordPasswordResetToken: TokenConfig - recordEmailChangeToken: TokenConfig - recordVerificationToken: TokenConfig - recordFileToken: TokenConfig - /** - * Deprecated: Will be removed in v0.9+ - */ - emailAuth: EmailAuthConfig - googleAuth: AuthProviderConfig - facebookAuth: AuthProviderConfig - githubAuth: AuthProviderConfig - gitlabAuth: AuthProviderConfig - discordAuth: AuthProviderConfig - twitterAuth: AuthProviderConfig - microsoftAuth: AuthProviderConfig - spotifyAuth: AuthProviderConfig - kakaoAuth: AuthProviderConfig - twitchAuth: AuthProviderConfig - stravaAuth: AuthProviderConfig - giteeAuth: AuthProviderConfig - livechatAuth: AuthProviderConfig - giteaAuth: AuthProviderConfig - oidcAuth: AuthProviderConfig - oidc2Auth: AuthProviderConfig - oidc3Auth: AuthProviderConfig - appleAuth: AuthProviderConfig - instagramAuth: AuthProviderConfig - vkAuth: AuthProviderConfig - yandexAuth: AuthProviderConfig - patreonAuth: AuthProviderConfig - } - interface Settings { - /** - * Validate makes Settings validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface Settings { - /** - * Merge merges `other` settings into the current one. - */ - merge(other: Settings): void - } - interface Settings { - /** - * Clone creates a new deep copy of the current settings. - */ - clone(): (Settings | undefined) - } - interface Settings { - /** - * RedactClone creates a new deep copy of the current settings, - * while replacing the secret values with `******`. - */ - redactClone(): (Settings | undefined) - } - interface Settings { - /** - * NamedAuthProviderConfigs returns a map with all registered OAuth2 - * provider configurations (indexed by their name identifier). - */ - namedAuthProviderConfigs(): _TygojaDict - } -} - /** * Package daos handles common PocketBase DB model manipulations. * @@ -12799,36 +12800,6 @@ namespace core { } } -namespace migrate { - /** - * MigrationsList defines a list with migration definitions - */ - interface MigrationsList { - } - interface MigrationsList { - /** - * Item returns a single migration from the list by its index. - */ - item(index: number): (Migration | undefined) - } - interface MigrationsList { - /** - * Items returns the internal migrations list slice. - */ - items(): Array<(Migration | undefined)> - } - interface MigrationsList { - /** - * Register adds new migration definition to the list. - * - * If `optFilename` is not provided, it will try to get the name from its .go file. - * - * The list will be sorted automatically based on the migrations file name. - */ - register(up: (db: dbx.Builder) => void, down: (db: dbx.Builder) => void, ...optFilename: string[]): void - } -} - /** * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. @@ -13866,6 +13837,61 @@ namespace cobra { } } +namespace migrate { + /** + * MigrationsList defines a list with migration definitions + */ + interface MigrationsList { + } + interface MigrationsList { + /** + * Item returns a single migration from the list by its index. + */ + item(index: number): (Migration | undefined) + } + interface MigrationsList { + /** + * Items returns the internal migrations list slice. + */ + items(): Array<(Migration | undefined)> + } + interface MigrationsList { + /** + * Register adds new migration definition to the list. + * + * If `optFilename` is not provided, it will try to get the name from its .go file. + * + * The list will be sorted automatically based on the migrations file name. + */ + register(up: (db: dbx.Builder) => void, down: (db: dbx.Builder) => void, ...optFilename: string[]): void + } +} + +/** + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. + * + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. + */ +namespace io { + /** + * ReadCloser is the interface that groups the basic Read and Close methods. + */ + interface ReadCloser { + [key:string]: any; + } + /** + * WriteCloser is the interface that groups the basic Write and Close methods. + */ + interface WriteCloser { + [key:string]: any; + } +} + /** * Package syscall contains an interface to the low-level operating system * primitives. The details vary depending on the underlying system, and @@ -13924,31 +13950,6 @@ namespace syscall { } } -/** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. - */ -namespace io { - /** - * ReadCloser is the interface that groups the basic Read and Close methods. - */ - interface ReadCloser { - [key:string]: any; - } - /** - * WriteCloser is the interface that groups the basic Write and Close methods. - */ - interface WriteCloser { - [key:string]: any; - } -} - /** * Package time provides functionality for measuring and displaying time. * @@ -14061,6 +14062,14 @@ namespace time { } } +/** + * Package fs defines basic interfaces to a file system. + * A file system can be provided by the host operating system + * but also by other packages. + */ +namespace fs { +} + /** * Package context defines the Context type, which carries deadlines, * cancellation signals, and other request-scoped values across API boundaries @@ -14111,14 +14120,6 @@ namespace time { namespace context { } -/** - * Package fs defines basic interfaces to a file system. - * A file system can be provided by the host operating system - * but also by other packages. - */ -namespace fs { -} - /** * Package net provides a portable interface for network I/O, including * TCP/IP, UDP, domain name resolution, and Unix domain sockets. @@ -14293,6 +14294,77 @@ namespace net { } } +/** + * Package textproto implements generic support for text-based request/response + * protocols in the style of HTTP, NNTP, and SMTP. + * + * The package provides: + * + * Error, which represents a numeric error response from + * a server. + * + * Pipeline, to manage pipelined requests and responses + * in a client. + * + * Reader, to read numeric response code lines, + * key: value headers, lines wrapped with leading spaces + * on continuation lines, and whole text blocks ending + * with a dot on a line by itself. + * + * Writer, to write dot-encoded text blocks. + * + * Conn, a convenient packaging of Reader, Writer, and Pipeline for use + * with a single network connection. + */ +namespace textproto { + /** + * A MIMEHeader represents a MIME-style header mapping + * keys to sets of values. + */ + interface MIMEHeader extends _TygojaDict{} + interface MIMEHeader { + /** + * Add adds the key, value pair to the header. + * It appends to any existing values associated with key. + */ + add(key: string): void + } + interface MIMEHeader { + /** + * Set sets the header entries associated with key to + * the single element value. It replaces any existing + * values associated with key. + */ + set(key: string): void + } + interface MIMEHeader { + /** + * Get gets the first value associated with the given key. + * It is case insensitive; CanonicalMIMEHeaderKey is used + * to canonicalize the provided key. + * If there are no values associated with the key, Get returns "". + * To use non-canonical keys, access the map directly. + */ + get(key: string): string + } + interface MIMEHeader { + /** + * Values returns all values associated with the given key. + * It is case insensitive; CanonicalMIMEHeaderKey is + * used to canonicalize the provided key. To use non-canonical + * keys, access the map directly. + * The returned slice is not a copy. + */ + values(key: string): Array + } + interface MIMEHeader { + /** + * Del deletes the values associated with key. + */ + del(key: string): void + } +} + /** * Package url parses URLs and implements query escaping. */ @@ -14512,401 +14584,6 @@ namespace url { } } -/** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. - */ -namespace cobra { - interface PositionalArgs {(cmd: Command, args: Array): void } - // @ts-ignore - import flag = pflag - /** - * FParseErrWhitelist configures Flag parse errors to be ignored - */ - interface FParseErrWhitelist extends _TygojaAny{} - /** - * Group Structure to manage groups for commands - */ - interface Group { - id: string - title: string - } - /** - * ShellCompDirective is a bit map representing the different behaviors the shell - * can be instructed to have once completions have been provided. - */ - interface ShellCompDirective extends Number{} - /** - * CompletionOptions are the options to control shell completion - */ - interface CompletionOptions { - /** - * DisableDefaultCmd prevents Cobra from creating a default 'completion' command - */ - disableDefaultCmd: boolean - /** - * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag - * for shells that support completion descriptions - */ - disableNoDescFlag: boolean - /** - * DisableDescriptions turns off all completion descriptions for shells - * that support them - */ - disableDescriptions: boolean - /** - * HiddenDefaultCmd makes the default 'completion' command hidden - */ - hiddenDefaultCmd: boolean - } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * DateTime represents a [time.Time] instance in UTC that is wrapped - * and serialized using the app default date layout. - */ - interface DateTime { - } - interface DateTime { - /** - * Time returns the internal [time.Time] instance. - */ - time(): time.Time - } - interface DateTime { - /** - * IsZero checks whether the current DateTime instance has zero time value. - */ - isZero(): boolean - } - interface DateTime { - /** - * String serializes the current DateTime instance into a formatted - * UTC date string. - * - * The zero value is serialized to an empty string. - */ - string(): string - } - interface DateTime { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string - } - interface DateTime { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - */ - unmarshalJSON(b: string): void - } - interface DateTime { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface DateTime { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current DateTime instance. - */ - scan(value: any): void - } -} - -/** - * Package sql provides a generic interface around SQL (or SQL-like) - * databases. - * - * The sql package must be used in conjunction with a database driver. - * See https://golang.org/s/sqldrivers for a list of drivers. - * - * Drivers that do not support context cancellation will not return until - * after the query is completed. - * - * For usage examples, see the wiki page at - * https://golang.org/s/sqlwiki. - */ -namespace sql { - /** - * IsolationLevel is the transaction isolation level used in TxOptions. - */ - interface IsolationLevel extends Number{} - interface IsolationLevel { - /** - * String returns the name of the transaction isolation level. - */ - string(): string - } - /** - * DBStats contains database statistics. - */ - interface DBStats { - maxOpenConnections: number // Maximum number of open connections to the database. - /** - * Pool Status - */ - openConnections: number // The number of established connections both in use and idle. - inUse: number // The number of connections currently in use. - idle: number // The number of idle connections. - /** - * Counters - */ - waitCount: number // The total number of connections waited for. - waitDuration: time.Duration // The total time blocked waiting for a new connection. - maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. - maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. - maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. - } - /** - * Conn represents a single database connection rather than a pool of database - * connections. Prefer running queries from DB unless there is a specific - * need for a continuous single database connection. - * - * A Conn must call Close to return the connection to the database pool - * and may do so concurrently with a running query. - * - * After a call to Close, all operations on the - * connection fail with ErrConnDone. - */ - interface Conn { - } - interface Conn { - /** - * PingContext verifies the connection to the database is still alive. - */ - pingContext(ctx: context.Context): void - } - interface Conn { - /** - * ExecContext executes a query without returning any rows. - * The args are for any placeholder parameters in the query. - */ - execContext(ctx: context.Context, query: string, ...args: any[]): Result - } - interface Conn { - /** - * QueryContext executes a query that returns rows, typically a SELECT. - * The args are for any placeholder parameters in the query. - */ - queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows | undefined) - } - interface Conn { - /** - * QueryRowContext executes a query that is expected to return at most one row. - * QueryRowContext always returns a non-nil value. Errors are deferred until - * Row's Scan method is called. - * If the query selects no rows, the *Row's Scan will return ErrNoRows. - * Otherwise, the *Row's Scan scans the first selected row and discards - * the rest. - */ - queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row | undefined) - } - interface Conn { - /** - * PrepareContext creates a prepared statement for later queries or executions. - * Multiple queries or executions may be run concurrently from the - * returned statement. - * The caller must call the statement's Close method - * when the statement is no longer needed. - * - * The provided context is used for the preparation of the statement, not for the - * execution of the statement. - */ - prepareContext(ctx: context.Context, query: string): (Stmt | undefined) - } - interface Conn { - /** - * Raw executes f exposing the underlying driver connection for the - * duration of f. The driverConn must not be used outside of f. - * - * Once f returns and err is not driver.ErrBadConn, the Conn will continue to be usable - * until Conn.Close is called. - */ - raw(f: (driverConn: any) => void): void - } - interface Conn { - /** - * BeginTx starts a transaction. - * - * The provided context is used until the transaction is committed or rolled back. - * If the context is canceled, the sql package will roll back - * the transaction. Tx.Commit will return an error if the context provided to - * BeginTx is canceled. - * - * The provided TxOptions is optional and may be nil if defaults should be used. - * If a non-default isolation level is used that the driver doesn't support, - * an error will be returned. - */ - beginTx(ctx: context.Context, opts: TxOptions): (Tx | undefined) - } - interface Conn { - /** - * Close returns the connection to the connection pool. - * All operations after a Close will return with ErrConnDone. - * Close is safe to call concurrently with other operations and will - * block until all other operations finish. It may be useful to first - * cancel any used context and then call close directly after. - */ - close(): void - } - /** - * ColumnType contains the name and type of a column. - */ - interface ColumnType { - } - interface ColumnType { - /** - * Name returns the name or alias of the column. - */ - name(): string - } - interface ColumnType { - /** - * Length returns the column type length for variable length column types such - * as text and binary field types. If the type length is unbounded the value will - * be math.MaxInt64 (any database limits will still apply). - * If the column type is not variable length, such as an int, or if not supported - * by the driver ok is false. - */ - length(): [number, boolean] - } - interface ColumnType { - /** - * DecimalSize returns the scale and precision of a decimal type. - * If not applicable or if not supported ok is false. - */ - decimalSize(): [number, boolean] - } - interface ColumnType { - /** - * ScanType returns a Go type suitable for scanning into using Rows.Scan. - * If a driver does not support this property ScanType will return - * the type of an empty interface. - */ - scanType(): any - } - interface ColumnType { - /** - * Nullable reports whether the column may be null. - * If a driver does not support this property ok will be false. - */ - nullable(): boolean - } - interface ColumnType { - /** - * DatabaseTypeName returns the database system name of the column type. If an empty - * string is returned, then the driver type name is not supported. - * Consult your driver documentation for a list of driver data types. Length specifiers - * are not included. - * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - * "INT", and "BIGINT". - */ - databaseTypeName(): string - } - /** - * Row is the result of calling QueryRow to select a single row. - */ - interface Row { - } - interface Row { - /** - * Scan copies the columns from the matched row into the values - * pointed at by dest. See the documentation on Rows.Scan for details. - * If more than one row matches the query, - * Scan uses the first row and discards the rest. If no row matches - * the query, Scan returns ErrNoRows. - */ - scan(...dest: any[]): void - } - interface Row { - /** - * Err provides a way for wrapping packages to check for - * query errors without calling Scan. - * Err returns the error, if any, that was encountered while running the query. - * If this error is not nil, this error will also be returned from Scan. - */ - err(): void - } -} - -/** - * Package textproto implements generic support for text-based request/response - * protocols in the style of HTTP, NNTP, and SMTP. - * - * The package provides: - * - * Error, which represents a numeric error response from - * a server. - * - * Pipeline, to manage pipelined requests and responses - * in a client. - * - * Reader, to read numeric response code lines, - * key: value headers, lines wrapped with leading spaces - * on continuation lines, and whole text blocks ending - * with a dot on a line by itself. - * - * Writer, to write dot-encoded text blocks. - * - * Conn, a convenient packaging of Reader, Writer, and Pipeline for use - * with a single network connection. - */ -namespace textproto { - /** - * A MIMEHeader represents a MIME-style header mapping - * keys to sets of values. - */ - interface MIMEHeader extends _TygojaDict{} - interface MIMEHeader { - /** - * Add adds the key, value pair to the header. - * It appends to any existing values associated with key. - */ - add(key: string): void - } - interface MIMEHeader { - /** - * Set sets the header entries associated with key to - * the single element value. It replaces any existing - * values associated with key. - */ - set(key: string): void - } - interface MIMEHeader { - /** - * Get gets the first value associated with the given key. - * It is case insensitive; CanonicalMIMEHeaderKey is used - * to canonicalize the provided key. - * If there are no values associated with the key, Get returns "". - * To use non-canonical keys, access the map directly. - */ - get(key: string): string - } - interface MIMEHeader { - /** - * Values returns all values associated with the given key. - * It is case insensitive; CanonicalMIMEHeaderKey is - * used to canonicalize the provided key. To use non-canonical - * keys, access the map directly. - * The returned slice is not a copy. - */ - values(key: string): Array - } - interface MIMEHeader { - /** - * Del deletes the values associated with key. - */ - del(key: string): void - } -} - /** * Package multipart implements MIME multipart parsing, as defined in RFC * 2046. @@ -15403,348 +15080,6 @@ namespace http { } } -namespace store { - /** - * Store defines a concurrent safe in memory key-value data store. - */ - interface Store { - } - interface Store { - /** - * Reset clears the store and replaces the store data with a - * shallow copy of the provided newData. - */ - reset(newData: _TygojaDict): void - } - interface Store { - /** - * Length returns the current number of elements in the store. - */ - length(): number - } - interface Store { - /** - * RemoveAll removes all the existing store entries. - */ - removeAll(): void - } - interface Store { - /** - * Remove removes a single entry from the store. - * - * Remove does nothing if key doesn't exist in the store. - */ - remove(key: string): void - } - interface Store { - /** - * Has checks if element with the specified key exist or not. - */ - has(key: string): boolean - } - interface Store { - /** - * Get returns a single element value from the store. - * - * If key is not set, the zero T value is returned. - */ - get(key: string): T - } - interface Store { - /** - * GetAll returns a shallow copy of the current store data. - */ - getAll(): _TygojaDict - } - interface Store { - /** - * Set sets (or overwrite if already exist) a new value for key. - */ - set(key: string, value: T): void - } - interface Store { - /** - * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. - * - * This method is similar to Set() but **it will skip adding new elements** - * to the store if the store length has reached the specified limit. - * false is returned if maxAllowedElements limit is reached. - */ - setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean - } -} - -/** - * Package schema implements custom Schema and SchemaField datatypes - * for handling the Collection schema definitions. - */ -namespace schema { - // @ts-ignore - import validation = ozzo_validation - /** - * SchemaField defines a single schema field structure. - */ - interface SchemaField { - system: boolean - id: string - name: string - type: string - required: boolean - /** - * Presentable indicates whether the field is suitable for - * visualization purposes (eg. in the Admin UI relation views). - */ - presentable: boolean - /** - * Deprecated: This field is no-op and will be removed in future versions. - * Please use the collection.Indexes field to define a unique constraint. - */ - unique: boolean - options: any - } - interface SchemaField { - /** - * ColDefinition returns the field db column type definition as string. - */ - colDefinition(): string - } - interface SchemaField { - /** - * String serializes and returns the current field as string. - */ - string(): string - } - interface SchemaField { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string - } - interface SchemaField { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - * - * The schema field options are auto initialized on success. - */ - unmarshalJSON(data: string): void - } - interface SchemaField { - /** - * Validate makes `SchemaField` validatable by implementing [validation.Validatable] interface. - */ - validate(): void - } - interface SchemaField { - /** - * InitOptions initializes the current field options based on its type. - * - * Returns error on unknown field type. - */ - initOptions(): void - } - interface SchemaField { - /** - * PrepareValue returns normalized and properly formatted field value. - */ - prepareValue(value: any): any - } - interface SchemaField { - /** - * PrepareValueWithModifier returns normalized and properly formatted field value - * by "merging" baseValue with the modifierValue based on the specified modifier (+ or -). - */ - prepareValueWithModifier(baseValue: any, modifier: string, modifierValue: any): any - } -} - -/** - * Package models implements all PocketBase DB models and DTOs. - */ -namespace models { - /** - * Model defines an interface with common methods that all db models should have. - */ - interface Model { - [key:string]: any; - tableName(): string - isNew(): boolean - markAsNew(): void - markAsNotNew(): void - hasId(): boolean - getId(): string - setId(id: string): void - getCreated(): types.DateTime - getUpdated(): types.DateTime - refreshId(): void - refreshCreated(): void - refreshUpdated(): void - } - /** - * BaseModel defines common fields and methods used by all other models. - */ - interface BaseModel { - id: string - created: types.DateTime - updated: types.DateTime - } - interface BaseModel { - /** - * HasId returns whether the model has a nonzero id. - */ - hasId(): boolean - } - interface BaseModel { - /** - * GetId returns the model id. - */ - getId(): string - } - interface BaseModel { - /** - * SetId sets the model id to the provided string value. - */ - setId(id: string): void - } - interface BaseModel { - /** - * MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true). - */ - markAsNew(): void - } - interface BaseModel { - /** - * MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false) - */ - markAsNotNew(): void - } - interface BaseModel { - /** - * IsNew indicates what type of db query (insert or update) - * should be used with the model instance. - */ - isNew(): boolean - } - interface BaseModel { - /** - * GetCreated returns the model Created datetime. - */ - getCreated(): types.DateTime - } - interface BaseModel { - /** - * GetUpdated returns the model Updated datetime. - */ - getUpdated(): types.DateTime - } - interface BaseModel { - /** - * RefreshId generates and sets a new model id. - * - * The generated id is a cryptographically random 15 characters length string. - */ - refreshId(): void - } - interface BaseModel { - /** - * RefreshCreated updates the model Created field with the current datetime. - */ - refreshCreated(): void - } - interface BaseModel { - /** - * RefreshUpdated updates the model Updated field with the current datetime. - */ - refreshUpdated(): void - } - interface BaseModel { - /** - * PostScan implements the [dbx.PostScanner] interface. - * - * It is executed right after the model was populated with the db row values. - */ - postScan(): void - } - // @ts-ignore - import validation = ozzo_validation - /** - * CollectionBaseOptions defines the "base" Collection.Options fields. - */ - interface CollectionBaseOptions { - } - interface CollectionBaseOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - /** - * CollectionAuthOptions defines the "auth" Collection.Options fields. - */ - interface CollectionAuthOptions { - manageRule?: string - allowOAuth2Auth: boolean - allowUsernameAuth: boolean - allowEmailAuth: boolean - requireEmail: boolean - exceptEmailDomains: Array - onlyEmailDomains: Array - minPasswordLength: number - } - interface CollectionAuthOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - /** - * CollectionViewOptions defines the "view" Collection.Options fields. - */ - interface CollectionViewOptions { - query: string - } - interface CollectionViewOptions { - /** - * Validate implements [validation.Validatable] interface. - */ - validate(): void - } - type _subWankq = BaseModel - interface Param extends _subWankq { - key: string - value: types.JsonRaw - } - interface Param { - tableName(): string - } - type _subLYnNl = BaseModel - interface Request extends _subLYnNl { - url: string - method: string - status: number - auth: string - userIp: string - remoteIp: string - referer: string - userAgent: string - meta: types.JsonMap - } - interface Request { - tableName(): string - } - interface TableInfoRow { - /** - * the `db:"pk"` tag has special semantic so we cannot rename - * the original field without specifying a custom mapper - */ - pk: number - index: number - name: string - type: string - notNull: boolean - defaultValue: types.JsonRaw - } -} - /** * Package oauth2 provides support for making * OAuth2 authorized and authenticated HTTP requests, @@ -15835,6 +15170,77 @@ namespace oauth2 { } } +namespace store { + /** + * Store defines a concurrent safe in memory key-value data store. + */ + interface Store { + } + interface Store { + /** + * Reset clears the store and replaces the store data with a + * shallow copy of the provided newData. + */ + reset(newData: _TygojaDict): void + } + interface Store { + /** + * Length returns the current number of elements in the store. + */ + length(): number + } + interface Store { + /** + * RemoveAll removes all the existing store entries. + */ + removeAll(): void + } + interface Store { + /** + * Remove removes a single entry from the store. + * + * Remove does nothing if key doesn't exist in the store. + */ + remove(key: string): void + } + interface Store { + /** + * Has checks if element with the specified key exist or not. + */ + has(key: string): boolean + } + interface Store { + /** + * Get returns a single element value from the store. + * + * If key is not set, the zero T value is returned. + */ + get(key: string): T + } + interface Store { + /** + * GetAll returns a shallow copy of the current store data. + */ + getAll(): _TygojaDict + } + interface Store { + /** + * Set sets (or overwrite if already exist) a new value for key. + */ + set(key: string, value: T): void + } + interface Store { + /** + * SetIfLessThanLimit sets (or overwrite if already exist) a new value for key. + * + * This method is similar to Set() but **it will skip adding new elements** + * to the store if the store length has reached the specified limit. + * false is returned if maxAllowedElements limit is reached. + */ + setIfLessThanLimit(key: string, value: T, maxAllowedElements: number): boolean + } +} + namespace mailer { /** * Mailer defines a base mail client interface. @@ -16304,6 +15710,281 @@ namespace echo { } } +/** + * Package sql provides a generic interface around SQL (or SQL-like) + * databases. + * + * The sql package must be used in conjunction with a database driver. + * See https://golang.org/s/sqldrivers for a list of drivers. + * + * Drivers that do not support context cancellation will not return until + * after the query is completed. + * + * For usage examples, see the wiki page at + * https://golang.org/s/sqlwiki. + */ +namespace sql { + /** + * IsolationLevel is the transaction isolation level used in TxOptions. + */ + interface IsolationLevel extends Number{} + interface IsolationLevel { + /** + * String returns the name of the transaction isolation level. + */ + string(): string + } + /** + * DBStats contains database statistics. + */ + interface DBStats { + maxOpenConnections: number // Maximum number of open connections to the database. + /** + * Pool Status + */ + openConnections: number // The number of established connections both in use and idle. + inUse: number // The number of connections currently in use. + idle: number // The number of idle connections. + /** + * Counters + */ + waitCount: number // The total number of connections waited for. + waitDuration: time.Duration // The total time blocked waiting for a new connection. + maxIdleClosed: number // The total number of connections closed due to SetMaxIdleConns. + maxIdleTimeClosed: number // The total number of connections closed due to SetConnMaxIdleTime. + maxLifetimeClosed: number // The total number of connections closed due to SetConnMaxLifetime. + } + /** + * Conn represents a single database connection rather than a pool of database + * connections. Prefer running queries from DB unless there is a specific + * need for a continuous single database connection. + * + * A Conn must call Close to return the connection to the database pool + * and may do so concurrently with a running query. + * + * After a call to Close, all operations on the + * connection fail with ErrConnDone. + */ + interface Conn { + } + interface Conn { + /** + * PingContext verifies the connection to the database is still alive. + */ + pingContext(ctx: context.Context): void + } + interface Conn { + /** + * ExecContext executes a query without returning any rows. + * The args are for any placeholder parameters in the query. + */ + execContext(ctx: context.Context, query: string, ...args: any[]): Result + } + interface Conn { + /** + * QueryContext executes a query that returns rows, typically a SELECT. + * The args are for any placeholder parameters in the query. + */ + queryContext(ctx: context.Context, query: string, ...args: any[]): (Rows | undefined) + } + interface Conn { + /** + * QueryRowContext executes a query that is expected to return at most one row. + * QueryRowContext always returns a non-nil value. Errors are deferred until + * Row's Scan method is called. + * If the query selects no rows, the *Row's Scan will return ErrNoRows. + * Otherwise, the *Row's Scan scans the first selected row and discards + * the rest. + */ + queryRowContext(ctx: context.Context, query: string, ...args: any[]): (Row | undefined) + } + interface Conn { + /** + * PrepareContext creates a prepared statement for later queries or executions. + * Multiple queries or executions may be run concurrently from the + * returned statement. + * The caller must call the statement's Close method + * when the statement is no longer needed. + * + * The provided context is used for the preparation of the statement, not for the + * execution of the statement. + */ + prepareContext(ctx: context.Context, query: string): (Stmt | undefined) + } + interface Conn { + /** + * Raw executes f exposing the underlying driver connection for the + * duration of f. The driverConn must not be used outside of f. + * + * Once f returns and err is not driver.ErrBadConn, the Conn will continue to be usable + * until Conn.Close is called. + */ + raw(f: (driverConn: any) => void): void + } + interface Conn { + /** + * BeginTx starts a transaction. + * + * The provided context is used until the transaction is committed or rolled back. + * If the context is canceled, the sql package will roll back + * the transaction. Tx.Commit will return an error if the context provided to + * BeginTx is canceled. + * + * The provided TxOptions is optional and may be nil if defaults should be used. + * If a non-default isolation level is used that the driver doesn't support, + * an error will be returned. + */ + beginTx(ctx: context.Context, opts: TxOptions): (Tx | undefined) + } + interface Conn { + /** + * Close returns the connection to the connection pool. + * All operations after a Close will return with ErrConnDone. + * Close is safe to call concurrently with other operations and will + * block until all other operations finish. It may be useful to first + * cancel any used context and then call close directly after. + */ + close(): void + } + /** + * ColumnType contains the name and type of a column. + */ + interface ColumnType { + } + interface ColumnType { + /** + * Name returns the name or alias of the column. + */ + name(): string + } + interface ColumnType { + /** + * Length returns the column type length for variable length column types such + * as text and binary field types. If the type length is unbounded the value will + * be math.MaxInt64 (any database limits will still apply). + * If the column type is not variable length, such as an int, or if not supported + * by the driver ok is false. + */ + length(): [number, boolean] + } + interface ColumnType { + /** + * DecimalSize returns the scale and precision of a decimal type. + * If not applicable or if not supported ok is false. + */ + decimalSize(): [number, boolean] + } + interface ColumnType { + /** + * ScanType returns a Go type suitable for scanning into using Rows.Scan. + * If a driver does not support this property ScanType will return + * the type of an empty interface. + */ + scanType(): any + } + interface ColumnType { + /** + * Nullable reports whether the column may be null. + * If a driver does not support this property ok will be false. + */ + nullable(): boolean + } + interface ColumnType { + /** + * DatabaseTypeName returns the database system name of the column type. If an empty + * string is returned, then the driver type name is not supported. + * Consult your driver documentation for a list of driver data types. Length specifiers + * are not included. + * Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". + */ + databaseTypeName(): string + } + /** + * Row is the result of calling QueryRow to select a single row. + */ + interface Row { + } + interface Row { + /** + * Scan copies the columns from the matched row into the values + * pointed at by dest. See the documentation on Rows.Scan for details. + * If more than one row matches the query, + * Scan uses the first row and discards the rest. If no row matches + * the query, Scan returns ErrNoRows. + */ + scan(...dest: any[]): void + } + interface Row { + /** + * Err provides a way for wrapping packages to check for + * query errors without calling Scan. + * Err returns the error, if any, that was encountered while running the query. + * If this error is not nil, this error will also be returned from Scan. + */ + err(): void + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * DateTime represents a [time.Time] instance in UTC that is wrapped + * and serialized using the app default date layout. + */ + interface DateTime { + } + interface DateTime { + /** + * Time returns the internal [time.Time] instance. + */ + time(): time.Time + } + interface DateTime { + /** + * IsZero checks whether the current DateTime instance has zero time value. + */ + isZero(): boolean + } + interface DateTime { + /** + * String serializes the current DateTime instance into a formatted + * UTC date string. + * + * The zero value is serialized to an empty string. + */ + string(): string + } + interface DateTime { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string + } + interface DateTime { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + */ + unmarshalJSON(b: string): void + } + interface DateTime { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface DateTime { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current DateTime instance. + */ + scan(value: any): void + } +} + namespace settings { // @ts-ignore import validation = ozzo_validation @@ -16450,6 +16131,285 @@ namespace settings { } } +namespace migrate { + interface Migration { + file: string + up: (db: dbx.Builder) => void + down: (db: dbx.Builder) => void + } +} + +/** + * Package schema implements custom Schema and SchemaField datatypes + * for handling the Collection schema definitions. + */ +namespace schema { + // @ts-ignore + import validation = ozzo_validation + /** + * SchemaField defines a single schema field structure. + */ + interface SchemaField { + system: boolean + id: string + name: string + type: string + required: boolean + /** + * Presentable indicates whether the field is suitable for + * visualization purposes (eg. in the Admin UI relation views). + */ + presentable: boolean + /** + * Deprecated: This field is no-op and will be removed in future versions. + * Please use the collection.Indexes field to define a unique constraint. + */ + unique: boolean + options: any + } + interface SchemaField { + /** + * ColDefinition returns the field db column type definition as string. + */ + colDefinition(): string + } + interface SchemaField { + /** + * String serializes and returns the current field as string. + */ + string(): string + } + interface SchemaField { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string + } + interface SchemaField { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + * + * The schema field options are auto initialized on success. + */ + unmarshalJSON(data: string): void + } + interface SchemaField { + /** + * Validate makes `SchemaField` validatable by implementing [validation.Validatable] interface. + */ + validate(): void + } + interface SchemaField { + /** + * InitOptions initializes the current field options based on its type. + * + * Returns error on unknown field type. + */ + initOptions(): void + } + interface SchemaField { + /** + * PrepareValue returns normalized and properly formatted field value. + */ + prepareValue(value: any): any + } + interface SchemaField { + /** + * PrepareValueWithModifier returns normalized and properly formatted field value + * by "merging" baseValue with the modifierValue based on the specified modifier (+ or -). + */ + prepareValueWithModifier(baseValue: any, modifier: string, modifierValue: any): any + } +} + +/** + * Package models implements all PocketBase DB models and DTOs. + */ +namespace models { + /** + * Model defines an interface with common methods that all db models should have. + */ + interface Model { + [key:string]: any; + tableName(): string + isNew(): boolean + markAsNew(): void + markAsNotNew(): void + hasId(): boolean + getId(): string + setId(id: string): void + getCreated(): types.DateTime + getUpdated(): types.DateTime + refreshId(): void + refreshCreated(): void + refreshUpdated(): void + } + /** + * BaseModel defines common fields and methods used by all other models. + */ + interface BaseModel { + id: string + created: types.DateTime + updated: types.DateTime + } + interface BaseModel { + /** + * HasId returns whether the model has a nonzero id. + */ + hasId(): boolean + } + interface BaseModel { + /** + * GetId returns the model id. + */ + getId(): string + } + interface BaseModel { + /** + * SetId sets the model id to the provided string value. + */ + setId(id: string): void + } + interface BaseModel { + /** + * MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true). + */ + markAsNew(): void + } + interface BaseModel { + /** + * MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false) + */ + markAsNotNew(): void + } + interface BaseModel { + /** + * IsNew indicates what type of db query (insert or update) + * should be used with the model instance. + */ + isNew(): boolean + } + interface BaseModel { + /** + * GetCreated returns the model Created datetime. + */ + getCreated(): types.DateTime + } + interface BaseModel { + /** + * GetUpdated returns the model Updated datetime. + */ + getUpdated(): types.DateTime + } + interface BaseModel { + /** + * RefreshId generates and sets a new model id. + * + * The generated id is a cryptographically random 15 characters length string. + */ + refreshId(): void + } + interface BaseModel { + /** + * RefreshCreated updates the model Created field with the current datetime. + */ + refreshCreated(): void + } + interface BaseModel { + /** + * RefreshUpdated updates the model Updated field with the current datetime. + */ + refreshUpdated(): void + } + interface BaseModel { + /** + * PostScan implements the [dbx.PostScanner] interface. + * + * It is executed right after the model was populated with the db row values. + */ + postScan(): void + } + // @ts-ignore + import validation = ozzo_validation + /** + * CollectionBaseOptions defines the "base" Collection.Options fields. + */ + interface CollectionBaseOptions { + } + interface CollectionBaseOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + /** + * CollectionAuthOptions defines the "auth" Collection.Options fields. + */ + interface CollectionAuthOptions { + manageRule?: string + allowOAuth2Auth: boolean + allowUsernameAuth: boolean + allowEmailAuth: boolean + requireEmail: boolean + exceptEmailDomains: Array + onlyEmailDomains: Array + minPasswordLength: number + } + interface CollectionAuthOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + /** + * CollectionViewOptions defines the "view" Collection.Options fields. + */ + interface CollectionViewOptions { + query: string + } + interface CollectionViewOptions { + /** + * Validate implements [validation.Validatable] interface. + */ + validate(): void + } + type _subCVjIK = BaseModel + interface Param extends _subCVjIK { + key: string + value: types.JsonRaw + } + interface Param { + tableName(): string + } + type _subuNCTg = BaseModel + interface Request extends _subuNCTg { + url: string + method: string + status: number + auth: string + userIp: string + remoteIp: string + referer: string + userAgent: string + meta: types.JsonMap + } + interface Request { + tableName(): string + } + interface TableInfoRow { + /** + * the `db:"pk"` tag has special semantic so we cannot rename + * the original field without specifying a custom mapper + */ + pk: number + index: number + name: string + type: string + notNull: boolean + defaultValue: types.JsonRaw + } +} + /** * Package daos handles common PocketBase DB model manipulations. * @@ -16468,6 +16428,92 @@ namespace daos { } } +/** + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. + */ +namespace cobra { + interface PositionalArgs {(cmd: Command, args: Array): void } + // @ts-ignore + import flag = pflag + /** + * FParseErrWhitelist configures Flag parse errors to be ignored + */ + interface FParseErrWhitelist extends _TygojaAny{} + /** + * Group Structure to manage groups for commands + */ + interface Group { + id: string + title: string + } + /** + * ShellCompDirective is a bit map representing the different behaviors the shell + * can be instructed to have once completions have been provided. + */ + interface ShellCompDirective extends Number{} + /** + * CompletionOptions are the options to control shell completion + */ + interface CompletionOptions { + /** + * DisableDefaultCmd prevents Cobra from creating a default 'completion' command + */ + disableDefaultCmd: boolean + /** + * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag + * for shells that support completion descriptions + */ + disableNoDescFlag: boolean + /** + * DisableDescriptions turns off all completion descriptions for shells + * that support them + */ + disableDescriptions: boolean + /** + * HiddenDefaultCmd makes the default 'completion' command hidden + */ + hiddenDefaultCmd: boolean + } +} + +namespace subscriptions { + /** + * Broker defines a struct for managing subscriptions clients. + */ + interface Broker { + } + interface Broker { + /** + * Clients returns a shallow copy of all registered clients indexed + * with their connection id. + */ + clients(): _TygojaDict + } + interface Broker { + /** + * ClientById finds a registered client by its id. + * + * Returns non-nil error when client with clientId is not registered. + */ + clientById(clientId: string): Client + } + interface Broker { + /** + * Register adds a new client to the broker instance. + */ + register(client: Client): void + } + interface Broker { + /** + * Unregister removes a single client by its id. + * + * If client with clientId doesn't exist, this method does nothing. + */ + unregister(clientId: string): void + } +} + namespace hook { /** * Hook defines a concurrent safe structure for handling event hooks @@ -16521,8 +16567,8 @@ namespace hook { * TaggedHook defines a proxy hook which register handlers that are triggered only * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). */ - type _subvTmlD = mainHook - interface TaggedHook extends _subvTmlD { + type _subxtmMm = mainHook + interface TaggedHook extends _subxtmMm { } interface TaggedHook { /** @@ -16549,43 +16595,6 @@ namespace hook { } } -namespace subscriptions { - /** - * Broker defines a struct for managing subscriptions clients. - */ - interface Broker { - } - interface Broker { - /** - * Clients returns a shallow copy of all registered clients indexed - * with their connection id. - */ - clients(): _TygojaDict - } - interface Broker { - /** - * ClientById finds a registered client by its id. - * - * Returns non-nil error when client with clientId is not registered. - */ - clientById(clientId: string): Client - } - interface Broker { - /** - * Register adds a new client to the broker instance. - */ - register(client: Client): void - } - interface Broker { - /** - * Unregister removes a single client by its id. - * - * If client with clientId doesn't exist, this method does nothing. - */ - unregister(clientId: string): void - } -} - /** * Package core is the backbone of PocketBase. * @@ -16608,12 +16617,12 @@ namespace core { httpContext: echo.Context error: Error } - type _subhTcVx = BaseModelEvent - interface ModelEvent extends _subhTcVx { + type _subcxTsi = BaseModelEvent + interface ModelEvent extends _subcxTsi { dao?: daos.Dao } - type _subLLHtF = BaseCollectionEvent - interface MailerRecordEvent extends _subLLHtF { + type _subQspkm = BaseCollectionEvent + interface MailerRecordEvent extends _subQspkm { mailClient: mailer.Mailer message?: mailer.Message record?: models.Record @@ -16653,50 +16662,50 @@ namespace core { oldSettings?: settings.Settings newSettings?: settings.Settings } - type _subkNERX = BaseCollectionEvent - interface RecordsListEvent extends _subkNERX { + type _subGhDjb = BaseCollectionEvent + interface RecordsListEvent extends _subGhDjb { httpContext: echo.Context records: Array<(models.Record | undefined)> result?: search.Result } - type _subRgOQP = BaseCollectionEvent - interface RecordViewEvent extends _subRgOQP { + type _subAepoY = BaseCollectionEvent + interface RecordViewEvent extends _subAepoY { httpContext: echo.Context record?: models.Record } - type _subGwEDI = BaseCollectionEvent - interface RecordCreateEvent extends _subGwEDI { + type _subvSeux = BaseCollectionEvent + interface RecordCreateEvent extends _subvSeux { httpContext: echo.Context record?: models.Record uploadedFiles: _TygojaDict } - type _subBwgAp = BaseCollectionEvent - interface RecordUpdateEvent extends _subBwgAp { + type _subxSniM = BaseCollectionEvent + interface RecordUpdateEvent extends _subxSniM { httpContext: echo.Context record?: models.Record uploadedFiles: _TygojaDict } - type _subWJlVz = BaseCollectionEvent - interface RecordDeleteEvent extends _subWJlVz { + type _subxzYIf = BaseCollectionEvent + interface RecordDeleteEvent extends _subxzYIf { httpContext: echo.Context record?: models.Record } - type _subBJSMe = BaseCollectionEvent - interface RecordAuthEvent extends _subBJSMe { + type _subzWftP = BaseCollectionEvent + interface RecordAuthEvent extends _subzWftP { httpContext: echo.Context record?: models.Record token: string meta: any } - type _subFCNvG = BaseCollectionEvent - interface RecordAuthWithPasswordEvent extends _subFCNvG { + type _subjuwPu = BaseCollectionEvent + interface RecordAuthWithPasswordEvent extends _subjuwPu { httpContext: echo.Context record?: models.Record identity: string password: string } - type _subPtFdI = BaseCollectionEvent - interface RecordAuthWithOAuth2Event extends _subPtFdI { + type _subzMXiv = BaseCollectionEvent + interface RecordAuthWithOAuth2Event extends _subzMXiv { httpContext: echo.Context providerName: string providerClient: auth.Provider @@ -16704,49 +16713,49 @@ namespace core { oAuth2User?: auth.AuthUser isNewRecord: boolean } - type _subJQuFm = BaseCollectionEvent - interface RecordAuthRefreshEvent extends _subJQuFm { + type _subOEVvL = BaseCollectionEvent + interface RecordAuthRefreshEvent extends _subOEVvL { httpContext: echo.Context record?: models.Record } - type _subrDYQF = BaseCollectionEvent - interface RecordRequestPasswordResetEvent extends _subrDYQF { + type _subhPUWl = BaseCollectionEvent + interface RecordRequestPasswordResetEvent extends _subhPUWl { httpContext: echo.Context record?: models.Record } - type _subEeBXd = BaseCollectionEvent - interface RecordConfirmPasswordResetEvent extends _subEeBXd { + type _subezzEF = BaseCollectionEvent + interface RecordConfirmPasswordResetEvent extends _subezzEF { httpContext: echo.Context record?: models.Record } - type _subfHjSM = BaseCollectionEvent - interface RecordRequestVerificationEvent extends _subfHjSM { + type _subEApFS = BaseCollectionEvent + interface RecordRequestVerificationEvent extends _subEApFS { httpContext: echo.Context record?: models.Record } - type _subqwWLS = BaseCollectionEvent - interface RecordConfirmVerificationEvent extends _subqwWLS { + type _subjTiqf = BaseCollectionEvent + interface RecordConfirmVerificationEvent extends _subjTiqf { httpContext: echo.Context record?: models.Record } - type _subfZbZt = BaseCollectionEvent - interface RecordRequestEmailChangeEvent extends _subfZbZt { + type _subaWGAJ = BaseCollectionEvent + interface RecordRequestEmailChangeEvent extends _subaWGAJ { httpContext: echo.Context record?: models.Record } - type _subFuvhR = BaseCollectionEvent - interface RecordConfirmEmailChangeEvent extends _subFuvhR { + type _subiWawa = BaseCollectionEvent + interface RecordConfirmEmailChangeEvent extends _subiWawa { httpContext: echo.Context record?: models.Record } - type _subATfob = BaseCollectionEvent - interface RecordListExternalAuthsEvent extends _subATfob { + type _subFtyjI = BaseCollectionEvent + interface RecordListExternalAuthsEvent extends _subFtyjI { httpContext: echo.Context record?: models.Record externalAuths: Array<(models.ExternalAuth | undefined)> } - type _subGyQyV = BaseCollectionEvent - interface RecordUnlinkExternalAuthEvent extends _subGyQyV { + type _subBhqby = BaseCollectionEvent + interface RecordUnlinkExternalAuthEvent extends _subBhqby { httpContext: echo.Context record?: models.Record externalAuth?: models.ExternalAuth @@ -16800,33 +16809,33 @@ namespace core { collections: Array<(models.Collection | undefined)> result?: search.Result } - type _subYbRiL = BaseCollectionEvent - interface CollectionViewEvent extends _subYbRiL { + type _subnbgWJ = BaseCollectionEvent + interface CollectionViewEvent extends _subnbgWJ { httpContext: echo.Context } - type _subinUqd = BaseCollectionEvent - interface CollectionCreateEvent extends _subinUqd { + type _subXKZcG = BaseCollectionEvent + interface CollectionCreateEvent extends _subXKZcG { httpContext: echo.Context } - type _subxXqPz = BaseCollectionEvent - interface CollectionUpdateEvent extends _subxXqPz { + type _subLHKUm = BaseCollectionEvent + interface CollectionUpdateEvent extends _subLHKUm { httpContext: echo.Context } - type _subclqWb = BaseCollectionEvent - interface CollectionDeleteEvent extends _subclqWb { + type _subJWlQG = BaseCollectionEvent + interface CollectionDeleteEvent extends _subJWlQG { httpContext: echo.Context } interface CollectionsImportEvent { httpContext: echo.Context collections: Array<(models.Collection | undefined)> } - type _subMwIUb = BaseModelEvent - interface FileTokenEvent extends _subMwIUb { + type _subikjgD = BaseModelEvent + interface FileTokenEvent extends _subikjgD { httpContext: echo.Context token: string } - type _subtsmKk = BaseCollectionEvent - interface FileDownloadEvent extends _subtsmKk { + type _subOGfqI = BaseCollectionEvent + interface FileDownloadEvent extends _subOGfqI { httpContext: echo.Context record?: models.Record fileField?: schema.SchemaField @@ -16835,47 +16844,6 @@ namespace core { } } -namespace migrate { - interface Migration { - file: string - up: (db: dbx.Builder) => void - down: (db: dbx.Builder) => void - } -} - -/** - * Package url parses URLs and implements query escaping. - */ -namespace url { - /** - * The Userinfo type is an immutable encapsulation of username and - * password details for a URL. An existing Userinfo value is guaranteed - * to have a username set (potentially empty, as allowed by RFC 2396), - * and optionally a password. - */ - interface Userinfo { - } - interface Userinfo { - /** - * Username returns the username. - */ - username(): string - } - interface Userinfo { - /** - * Password returns the password in case it is set, and whether it is set. - */ - password(): [string, boolean] - } - interface Userinfo { - /** - * String returns the encoded userinfo information in the standard form - * of "username[:password]". - */ - string(): string - } -} - /** * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer * object, creating another object (Reader or Writer) that also implements @@ -16886,8 +16854,8 @@ namespace bufio { * ReadWriter stores pointers to a Reader and a Writer. * It implements io.ReadWriter. */ - type _subuaPmS = Reader&Writer - interface ReadWriter extends _subuaPmS { + type _subfkKQz = Reader&Writer + interface ReadWriter extends _subfkKQz { } } @@ -16985,6 +16953,39 @@ namespace net { } } +/** + * Package url parses URLs and implements query escaping. + */ +namespace url { + /** + * The Userinfo type is an immutable encapsulation of username and + * password details for a URL. An existing Userinfo value is guaranteed + * to have a username set (potentially empty, as allowed by RFC 2396), + * and optionally a password. + */ + interface Userinfo { + } + interface Userinfo { + /** + * Username returns the username. + */ + username(): string + } + interface Userinfo { + /** + * Password returns the password in case it is set, and whether it is set. + */ + password(): [string, boolean] + } + interface Userinfo { + /** + * String returns the encoded userinfo information in the standard form + * of "username[:password]". + */ + string(): string + } +} + namespace subscriptions { /** * Message defines a client's channel data. @@ -17053,22 +17054,6 @@ namespace subscriptions { } } -namespace store { -} - -namespace hook { - /** - * Handler defines a hook handler function. - */ - interface Handler {(e: T): void } - /** - * wrapped local Hook embedded struct to limit the public API surface. - */ - type _subJjeQl = Hook - interface mainHook extends _subJjeQl { - } -} - /** * Package types implements some commonly used db serializable types * like datetime, json, etc. @@ -17111,17 +17096,7 @@ namespace types { } } -namespace search { - /** - * Result defines the returned search result structure. - */ - interface Result { - page: number - perPage: number - totalItems: number - totalPages: number - items: any - } +namespace store { } /** @@ -17301,23 +17276,6 @@ namespace http { import urlpkg = url } -namespace mailer { - /** - * Message defines a generic email message struct. - */ - interface Message { - from: mail.Address - to: Array - bcc: Array - cc: Array - subject: string - html: string - text: string - headers: _TygojaDict - attachments: _TygojaDict - } -} - /** * Package echo implements high performance, minimalist Go web framework. * @@ -17433,6 +17391,49 @@ namespace echo { } } +namespace hook { + /** + * Handler defines a hook handler function. + */ + interface Handler {(e: T): void } + /** + * wrapped local Hook embedded struct to limit the public API surface. + */ + type _subQgFCi = Hook + interface mainHook extends _subQgFCi { + } +} + +namespace mailer { + /** + * Message defines a generic email message struct. + */ + interface Message { + from: mail.Address + to: Array + bcc: Array + cc: Array + subject: string + html: string + text: string + headers: _TygojaDict + attachments: _TygojaDict + } +} + +namespace search { + /** + * Result defines the returned search result structure. + */ + interface Result { + page: number + perPage: number + totalItems: number + totalPages: number + items: any + } +} + namespace settings { // @ts-ignore import validation = ozzo_validation @@ -17476,6 +17477,13 @@ namespace core { } } +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { +} + /** * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer * object, creating another object (Reader or Writer) that also implements @@ -17738,19 +17746,6 @@ namespace bufio { } } -namespace subscriptions { -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { -} - -namespace search { -} - /** * Package mail implements parsing of mail messages. * @@ -17785,3 +17780,9 @@ namespace mail { string(): string } } + +namespace search { +} + +namespace subscriptions { +} diff --git a/tools/auth/auth.go b/tools/auth/auth.go index e6ac3949..ae3982a3 100644 --- a/tools/auth/auth.go +++ b/tools/auth/auth.go @@ -137,6 +137,8 @@ func NewProviderByName(name string) (Provider, error) { return NewYandexProvider(), nil case NamePatreon: return NewPatreonProvider(), nil + case NameMailcow: + return NewMailcowProvider(), nil default: return nil, errors.New("Missing provider " + name) } diff --git a/tools/auth/auth_test.go b/tools/auth/auth_test.go index 8b554085..2606b297 100644 --- a/tools/auth/auth_test.go +++ b/tools/auth/auth_test.go @@ -205,7 +205,7 @@ func TestNewProviderByName(t *testing.T) { t.Errorf("Expected nil, got error %v", err) } if _, ok := p.(*auth.Yandex); !ok { - t.Error("Expected to be instance of *auth.yandex") + t.Error("Expected to be instance of *auth.Yandex") } // patreon @@ -216,4 +216,13 @@ func TestNewProviderByName(t *testing.T) { if _, ok := p.(*auth.Patreon); !ok { t.Error("Expected to be instance of *auth.Patreon") } + + // mailcow + p, err = auth.NewProviderByName(auth.NameMailcow) + if err != nil { + t.Errorf("Expected nil, got error %v", err) + } + if _, ok := p.(*auth.Mailcow); !ok { + t.Error("Expected to be instance of *auth.Mailcow") + } } diff --git a/tools/auth/mailcow.go b/tools/auth/mailcow.go new file mode 100644 index 00000000..cdd3c1ee --- /dev/null +++ b/tools/auth/mailcow.go @@ -0,0 +1,75 @@ +package auth + +import ( + "context" + "encoding/json" + "errors" + "strings" + + "golang.org/x/oauth2" +) + +var _ Provider = (*Mailcow)(nil) + +// NameMailcow is the unique name of the mailcow provider. +const NameMailcow string = "mailcow" + +// Mailcow allows authentication via mailcow OAuth2. +type Mailcow struct { + *baseProvider +} + +// NewMailcowProvider creates a new mailcow provider instance with some defaults. +func NewMailcowProvider() *Mailcow { + return &Mailcow{&baseProvider{ + ctx: context.Background(), + scopes: []string{"profile"}, + }} +} + +// FetchAuthUser returns an AuthUser instance based on mailcow's user api. +// +// API reference: https://github.com/mailcow/mailcow-dockerized/blob/master/data/web/oauth/profile.php +func (p *Mailcow) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) { + data, err := p.FetchRawUserData(token) + if err != nil { + return nil, err + } + + rawUser := map[string]any{} + if err := json.Unmarshal(data, &rawUser); err != nil { + return nil, err + } + + extracted := struct { + Id string `json:"id"` + Username string `json:"username"` + Email string `json:"email"` + FullName string `json:"full_name"` + Active int `json:"active"` + }{} + if err := json.Unmarshal(data, &extracted); err != nil { + return nil, err + } + + if extracted.Active != 1 { + return nil, errors.New("the mailcow user is not active") + } + + user := &AuthUser{ + Id: extracted.Id, + Name: extracted.FullName, + Username: extracted.Username, + Email: extracted.Email, + RawUser: rawUser, + AccessToken: token.AccessToken, + RefreshToken: token.RefreshToken, + } + + // mailcow usernames are usually just the email adresses, so we just take the part in front of the @ + if strings.Contains(user.Username, "@") { + user.Username = strings.Split(user.Username, "@")[0] + } + + return user, nil +} diff --git a/tools/auth/yandex.go b/tools/auth/yandex.go index 8b520619..4befd8e5 100644 --- a/tools/auth/yandex.go +++ b/tools/auth/yandex.go @@ -1,6 +1,7 @@ package auth import ( + "context" "encoding/json" "golang.org/x/oauth2" @@ -22,6 +23,7 @@ type Yandex struct { // Docs: https://yandex.ru/dev/id/doc/en/ func NewYandexProvider() *Yandex { return &Yandex{&baseProvider{ + ctx: context.Background(), scopes: []string{"login:email", "login:avatar", "login:info"}, authUrl: yandex.Endpoint.AuthURL, tokenUrl: yandex.Endpoint.TokenURL, diff --git a/ui/dist/assets/AuthMethodsDocs-17fb0bc2.js b/ui/dist/assets/AuthMethodsDocs-ab7833e1.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-17fb0bc2.js rename to ui/dist/assets/AuthMethodsDocs-ab7833e1.js index d8d547c2..1a68228a 100644 --- a/ui/dist/assets/AuthMethodsDocs-17fb0bc2.js +++ b/ui/dist/assets/AuthMethodsDocs-ab7833e1.js @@ -1,4 +1,4 @@ -import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-aec9c817.js";import{S as Ke}from"./SdkTabs-065ad731.js";import{F as qe}from"./FieldsQueryParam-72392a2a.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` +import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-9f490143.js";import{S as Ke}from"./SdkTabs-f8951db6.js";import{F as qe}from"./FieldsQueryParam-fb32761b.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-b60a2fd5.js b/ui/dist/assets/AuthRefreshDocs-bf429c31.js similarity index 97% rename from ui/dist/assets/AuthRefreshDocs-b60a2fd5.js rename to ui/dist/assets/AuthRefreshDocs-bf429c31.js index 7da1169e..f6fb0ee6 100644 --- a/ui/dist/assets/AuthRefreshDocs-b60a2fd5.js +++ b/ui/dist/assets/AuthRefreshDocs-bf429c31.js @@ -1,4 +1,4 @@ -import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-aec9c817.js";import{S as Ze}from"./SdkTabs-065ad731.js";import{F as et}from"./FieldsQueryParam-72392a2a.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,z,ue,Q,q,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` +import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-9f490143.js";import{S as Ze}from"./SdkTabs-f8951db6.js";import{F as et}from"./FieldsQueryParam-fb32761b.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,z,ue,Q,q,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-10f54027.js b/ui/dist/assets/AuthWithOAuth2Docs-0ed62345.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-10f54027.js rename to ui/dist/assets/AuthWithOAuth2Docs-0ed62345.js index 18015283..b5d80b7a 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-10f54027.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-0ed62345.js @@ -1,4 +1,4 @@ -import{S as Le,i as Ee,s as Je,N as Ve,O as z,e as s,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as We,Q as Ne,k as Qe,R as ze,n as Ie,t as V,a as L,o as c,d as G,C as Ue,p as Ke,r as X,u as Ge}from"./index-aec9c817.js";import{S as Xe}from"./SdkTabs-065ad731.js";import{F as Ye}from"./FieldsQueryParam-72392a2a.js";function Be(i,l,o){const n=i.slice();return n[5]=l[o],n}function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function He(i,l){let o,n=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),f=k(n),g=h(),p(o,"class","tab-item"),X(o,"active",l[1]===l[5].code),this.first=o},m(v,A){r(v,o,A),a(o,f),a(o,g),d||(b=Ge(o,"click",_),d=!0)},p(v,A){l=v,A&4&&n!==(n=l[5].code+"")&&pe(f,n),A&6&&X(o,"active",l[1]===l[5].code)},d(v){v&&c(o),d=!1,b()}}}function je(i,l){let o,n,f,g;return n=new Ve({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),I(n.$$.fragment),f=h(),p(o,"class","tab-item"),X(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),K(n,o,null),a(o,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),n.$set(_),(!g||b&6)&&X(o,"active",l[1]===l[5].code)},i(d){g||(V(n.$$.fragment,d),g=!0)},o(d){L(n.$$.fragment,d),g=!1},d(d){d&&c(o),G(n)}}}function Ze(i){let l,o,n=i[0].name+"",f,g,d,b,_,v,A,P,Y,S,E,be,J,R,me,Z,N=i[0].name+"",ee,fe,te,M,ae,x,le,W,oe,y,se,ge,U,$,ne,ke,ie,_e,m,ve,C,we,Oe,Ae,re,Se,ce,ye,$e,Te,de,Ce,qe,q,ue,B,he,T,F,O=[],De=new Map,Pe,H,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as Le,i as Ee,s as Je,N as Ve,O as z,e as s,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as We,Q as Ne,k as Qe,R as ze,n as Ie,t as V,a as L,o as c,d as G,C as Ue,p as Ke,r as X,u as Ge}from"./index-9f490143.js";import{S as Xe}from"./SdkTabs-f8951db6.js";import{F as Ye}from"./FieldsQueryParam-fb32761b.js";function Be(i,l,o){const n=i.slice();return n[5]=l[o],n}function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function He(i,l){let o,n=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),f=k(n),g=h(),p(o,"class","tab-item"),X(o,"active",l[1]===l[5].code),this.first=o},m(v,A){r(v,o,A),a(o,f),a(o,g),d||(b=Ge(o,"click",_),d=!0)},p(v,A){l=v,A&4&&n!==(n=l[5].code+"")&&pe(f,n),A&6&&X(o,"active",l[1]===l[5].code)},d(v){v&&c(o),d=!1,b()}}}function je(i,l){let o,n,f,g;return n=new Ve({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),I(n.$$.fragment),f=h(),p(o,"class","tab-item"),X(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),K(n,o,null),a(o,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),n.$set(_),(!g||b&6)&&X(o,"active",l[1]===l[5].code)},i(d){g||(V(n.$$.fragment,d),g=!0)},o(d){L(n.$$.fragment,d),g=!1},d(d){d&&c(o),G(n)}}}function Ze(i){let l,o,n=i[0].name+"",f,g,d,b,_,v,A,P,Y,S,E,be,J,R,me,Z,N=i[0].name+"",ee,fe,te,M,ae,x,le,W,oe,y,se,ge,U,$,ne,ke,ie,_e,m,ve,C,we,Oe,Ae,re,Se,ce,ye,$e,Te,de,Ce,qe,q,ue,B,he,T,F,O=[],De=new Map,Pe,H,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-1f709a24.js b/ui/dist/assets/AuthWithPasswordDocs-4cae5a40.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-1f709a24.js rename to ui/dist/assets/AuthWithPasswordDocs-4cae5a40.js index a38dd4e0..6a499845 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-1f709a24.js +++ b/ui/dist/assets/AuthWithPasswordDocs-4cae5a40.js @@ -1,4 +1,4 @@ -import{S as we,i as ye,s as $e,N as ve,O as ot,e as n,w as p,b as d,c as nt,f as m,g as r,h as e,m as st,x as Dt,P as pe,Q as Pe,k as Re,R as Ce,n as Oe,t as Z,a as x,o as c,d as it,C as fe,p as Ae,r as rt,u as Te}from"./index-aec9c817.js";import{S as Ue}from"./SdkTabs-065ad731.js";import{F as Me}from"./FieldsQueryParam-72392a2a.js";function he(s,l,a){const i=s.slice();return i[8]=l[a],i}function be(s,l,a){const i=s.slice();return i[8]=l[a],i}function De(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Ee(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function We(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function me(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _e(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ke(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ge(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),e(a,g),e(a,b),f||(u=Te(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Dt(g,i),C&24&&rt(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function Se(s,l){let a,i,g,b;return i=new ve({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),nt(i.$$.fragment),g=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),st(i,a,null),e(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&rt(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),it(i)}}}function Le(s){var re,ce;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Et,ct,T,dt,N,ut,U,tt,Wt,et,I,Lt,pt,lt=s[0].name+"",ft,Bt,ht,V,bt,M,mt,qt,Q,D,_t,Ft,kt,Ht,$,Yt,gt,St,vt,Nt,wt,yt,j,$t,E,Pt,It,J,W,Rt,Vt,Ct,Qt,k,jt,q,Jt,Kt,zt,Ot,Gt,At,Xt,Zt,xt,Tt,te,ee,F,Ut,K,Mt,L,z,A=[],le=new Map,ae,G,S=[],oe=new Map,H;function ne(t,o){if(t[1]&&t[2])return We;if(t[1])return Ee;if(t[2])return De}let Y=ne(s),P=Y&&Y(s);T=new Ue({props:{js:` +import{S as we,i as ye,s as $e,N as ve,O as ot,e as n,w as p,b as d,c as nt,f as m,g as r,h as e,m as st,x as Dt,P as pe,Q as Pe,k as Re,R as Ce,n as Oe,t as Z,a as x,o as c,d as it,C as fe,p as Ae,r as rt,u as Te}from"./index-9f490143.js";import{S as Ue}from"./SdkTabs-f8951db6.js";import{F as Me}from"./FieldsQueryParam-fb32761b.js";function he(s,l,a){const i=s.slice();return i[8]=l[a],i}function be(s,l,a){const i=s.slice();return i[8]=l[a],i}function De(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Ee(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function We(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function me(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _e(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ke(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ge(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),e(a,g),e(a,b),f||(u=Te(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Dt(g,i),C&24&&rt(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function Se(s,l){let a,i,g,b;return i=new ve({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),nt(i.$$.fragment),g=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),st(i,a,null),e(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&rt(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),it(i)}}}function Le(s){var re,ce;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Et,ct,T,dt,N,ut,U,tt,Wt,et,I,Lt,pt,lt=s[0].name+"",ft,Bt,ht,V,bt,M,mt,qt,Q,D,_t,Ft,kt,Ht,$,Yt,gt,St,vt,Nt,wt,yt,j,$t,E,Pt,It,J,W,Rt,Vt,Ct,Qt,k,jt,q,Jt,Kt,zt,Ot,Gt,At,Xt,Zt,xt,Tt,te,ee,F,Ut,K,Mt,L,z,A=[],le=new Map,ae,G,S=[],oe=new Map,H;function ne(t,o){if(t[1]&&t[2])return We;if(t[1])return Ee;if(t[2])return De}let Y=ne(s),P=Y&&Y(s);T=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[6]}'); diff --git a/ui/dist/assets/CodeEditor-19c882f6.js b/ui/dist/assets/CodeEditor-4c129c80.js similarity index 99% rename from ui/dist/assets/CodeEditor-19c882f6.js rename to ui/dist/assets/CodeEditor-4c129c80.js index 731901ca..44807afe 100644 --- a/ui/dist/assets/CodeEditor-19c882f6.js +++ b/ui/dist/assets/CodeEditor-4c129c80.js @@ -1,4 +1,4 @@ -import{S as ft,i as gt,s as mt,e as Pt,f as Zt,U as K,g as bt,y as ze,o as Xt,J as xt,K as Yt,L as yt,I as kt,C as wt,M as vt}from"./index-aec9c817.js";import{P as Tt,N as _t,u as Wt,D as Ut,v as we,T as ee,I as ve,w as D,x as o,y as Ct,L as J,z as L,A as C,B as F,F as Te,G as M,H as j,J as bO,K as XO,M as xO,E as U,O as YO,Q as P,R as Rt,U as qt,V as yO,W as Vt,X as jt,a as z,h as zt,b as Gt,c as Et,d as At,e as It,s as Nt,t as Bt,f as Dt,g as Jt,r as Lt,i as Ft,k as Mt,j as Kt,l as Ht,m as ea,n as Oa,o as ta,p as aa,q as Ge,C as H}from"./index-808c8630.js";class re{constructor(e,a,t,r,s,i,l,n,Q,d=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=d,this.parent=c}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new re(e,[],a,t,t,0,[],0,r?new Ee(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(r);if(i&&(this.score+=i),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(n==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,n)}storeNode(e,a,t,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(a==t)return;if(i.buffer[l-2]>=a){i.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t){let r=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let s=e,{parser:i}=this.p;(t>this.pos||a<=i.maxNode)&&(this.pos=t,i.stateFlag(s,1)||(this.reducePos=t)),this.pushState(s,r),this.shiftContext(a,r),a<=i.maxNode&&this.buffer.push(a,r,t,4)}}apply(e,a,t){e&65536?this.reduce(e):this.shift(e,a,t)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new re(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new ra(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=t(i,s+1);if(l!=null)return l}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Ee{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class ra{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class ie{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new ie(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ie(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}a?a[r++]=s:a=new e(s)}return a}class Oe{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ae=new Oe;class ia{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ae,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=Ae,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class R{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;kO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}R.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class se{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?I(e):e}token(e,a){let t=e.pos,r=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(kO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}se.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class x{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function kO(O,e,a,t,r,s){let i=0,l=1<0){let S=O[p];if(n.allows(S)&&(e.token.value==-1||e.token.value==S||sa(S,e.token.value,r,s))){e.acceptToken(S);break}}let d=e.next,c=0,u=O[i+2];if(e.next<0&&u>c&&O[Q+u*3-3]==65535&&O[Q+u*3-3]==65535){i=O[Q+u*3-1];continue e}for(;c>1,S=Q+p+(p<<1),f=O[S],g=O[S+1]||65536;if(d=g)c=p+1;else{i=O[S+2],e.advance();continue e}}break}}function Ie(O,e,a){for(let t=e,r;(r=O[t])!=65535;t++)if(r==a)return t-e;return-1}function sa(O,e,a,t){let r=Ie(a,t,e);return r<0||Ie(a,t,O)e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(O.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:O.length}}class la{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ne(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ne(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(s instanceof ee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class oa{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Oe)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:s}=r,i=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let u=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!d.extend&&(t=c,a>u))break}}for(;this.actions.length>a;)this.actions.pop();return n&&e.setLookAhead(n),!t&&e.pos==this.stream.end&&(t=new Oe,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new Oe,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let s=0;se.bufferLength*4?new la(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(l);else{if(this.advanceStack(l,t,e))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Qa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((l,n)=>n.score-l.score);t.length>i;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,d=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let u=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1&&c.length&&(!Q||(c.prop(we.contextHash)||0)==d))return e.useNode(c,u),Z&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof ee)||c.children.length==0||c.positions[0]>0)break;let p=c.children[0];if(p instanceof ee&&c.positions[0]==0)c=p;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Z&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let n=this.tokens.getActions(e);for(let Q=0;Qr?a.push(S):t.push(S)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return Be(e,a),!0}}runRecovery(e,a,t){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let c=l.split(),u=d;for(let p=0;c.forceReduce()&&p<10&&(Z&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)Z&&(u=this.stackID(c)+" -> ");for(let p of l.recoverByInsert(n))Z&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),Be(l,t)):(!r||r.scoreO;class wO{constructor(e){this.start=e.start,this.shift=e.shift||he,this.reduce=e.reduce||he,this.reuse=e.reuse||he,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class T extends Tt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(d,n,l[Q++]);else{let c=l[Q+-d];for(let u=-d;u>0;u--)s(l[Q++],n,c);Q++}}}this.nodeSet=new _t(a.map((l,n)=>Wt.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Ut;let i=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new R(i,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new na(this,e,a,t);for(let s of this.wrappers)r=s(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&t)return n;for(let Q=s+(i>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;r=a(k(this.data,s+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=k(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(T.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(s=>s.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=e.specializers.find(l=>l.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=De(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let s of e.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.scoreO.external(a,t)<<1|e}return O.get}const pa=54,da=1,ha=55,ua=2,Sa=56,$a=3,Je=4,fa=5,le=6,vO=7,TO=8,_O=9,WO=10,ga=11,ma=12,Pa=13,ue=57,Za=14,Le=58,UO=20,ba=22,CO=23,Xa=24,Xe=26,RO=27,xa=28,Ya=31,ya=34,ka=36,wa=37,va=0,Ta=1,_a={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Wa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Fe={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ua(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function qO(O){return O==9||O==10||O==13||O==32}let Me=null,Ke=null,He=0;function xe(O,e){let a=O.pos+e;if(He==a&&Ke==O)return Me;let t=O.peek(e);for(;qO(t);)t=O.peek(++e);let r="";for(;Ua(t);)r+=String.fromCharCode(t),t=O.peek(++e);return Ke=O,He=a,Me=r?r.toLowerCase():t==Ca||t==Ra?void 0:null}const VO=60,oe=62,_e=47,Ca=63,Ra=33,qa=45;function eO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new eO(xe(t,1)||"",O):O},reduce(O,e){return e==UO&&O?O.parent:O},reuse(O,e,a,t){let r=e.type.id;return r==le||r==ka?new eO(xe(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),za=new x((O,e)=>{if(O.next!=VO){O.next<0&&e.context&&O.acceptToken(ue);return}O.advance();let a=O.next==_e;a&&O.advance();let t=xe(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Za:le);let r=e.context?e.context.name:null;if(a){if(t==r)return O.acceptToken(ga);if(r&&Wa[r])return O.acceptToken(ue,-2);if(e.dialectEnabled(va))return O.acceptToken(ma);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Pa)}else{if(t=="script")return O.acceptToken(vO);if(t=="style")return O.acceptToken(TO);if(t=="textarea")return O.acceptToken(_O);if(_a.hasOwnProperty(t))return O.acceptToken(WO);r&&Fe[r]&&Fe[r][t]?O.acceptToken(ue,-1):O.acceptToken(le)}},{contextual:!0}),Ga=new x(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(Le);break}if(O.next==qa)e++;else if(O.next==oe&&e>=2){a>3&&O.acceptToken(Le,-2);break}else e=0;O.advance()}});function Ea(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Aa=new x((O,e)=>{if(O.next==_e&&O.peek(1)==oe){let a=e.dialectEnabled(Ta)||Ea(e.context);O.acceptToken(a?fa:Je,2)}else O.next==oe&&O.acceptToken(Je,1)});function We(O,e,a){let t=2+O.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==VO||s==1&&r.next==_e||s>=2&&si?r.acceptToken(e,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=i=0;r.advance()}})}const Ia=We("script",pa,da),Na=We("style",ha,ua),Ba=We("textarea",Sa,$a),Da=D({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),Ja=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[Da],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==xa)return Se(l,n,a);if(Q==Ya)return Se(l,n,t);if(Q==ya)return Se(l,n,r);if(Q==UO&&s.length){let d=l.node,c=d.firstChild,u=c&&OO(c,n),p;if(u){for(let S of s)if(S.tag==u&&(!S.attrs||S.attrs(p||(p=jO(d,n))))){let f=d.lastChild;return{parser:S.parser,overlay:[{from:c.to,to:f.type.id==wa?f.from:d.to}]}}}}if(i&&Q==CO){let d=l.node,c;if(c=d.firstChild){let u=i[n.read(c.from,c.to)];if(u)for(let p of u){if(p.tagName&&p.tagName!=OO(d.parent,n))continue;let S=d.lastChild;if(S.type.id==Xe){let f=S.from+1,g=S.lastChild,X=S.to-(g&&g.isError?0:1);if(X>f)return{parser:p.parser,overlay:[{from:f,to:X}]}}else if(S.type.id==RO)return{parser:p.parser,overlay:[{from:S.from,to:S.to}]}}}}return null})}const La=96,tO=1,Fa=97,Ma=98,aO=2,GO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ka=58,Ha=40,EO=95,er=91,te=45,Or=46,tr=35,ar=37;function ne(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function rr(O){return O>=48&&O<=57}const ir=new x((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(ne(s)||s==te||s==EO||a&&rr(s))!a&&(s!=te||r>0)&&(a=!0),t===r&&s==te&&t++,O.advance();else{a&&O.acceptToken(s==Ha?Fa:t==2&&e.canShift(aO)?aO:Ma);break}}}),sr=new x(O=>{if(GO.includes(O.peek(-1))){let{next:e}=O;(ne(e)||e==EO||e==tr||e==Or||e==er||e==Ka||e==te)&&O.acceptToken(La)}}),lr=new x(O=>{if(!GO.includes(O.peek(-1))){let{next:e}=O;if(e==ar&&(O.advance(),O.acceptToken(tO)),ne(e)){do O.advance();while(ne(O.next));O.acceptToken(tO)}}}),or=D({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),nr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},cr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Qr={__proto__:null,not:128,only:128},pr=T.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[sr,lr,ir,1,2,3,4,new se("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:O=>nr[O]||-1},{term:56,get:O=>cr[O]||-1},{term:98,get:O=>Qr[O]||-1}],tokenPrec:1169});let $e=null;function fe(){if(!$e&&typeof document=="object"&&document.body){let{style:O}=document.body,e=[],a=new Set;for(let t in O)t!="cssText"&&t!="cssFloat"&&typeof O[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const rO=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(O=>({type:"class",label:O})),iO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(O=>({type:"keyword",label:O})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(O=>({type:"constant",label:O}))),dr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(O=>({type:"type",label:O})),v=/^(\w[\w-]*|-\w[\w-]*|)$/,hr=/^-(-[\w-]*)?$/;function ur(O,e){var a;if((O.name=="("||O.type.isError)&&(O=O.parent||O),O.name!="ArgList")return!1;let t=(a=O.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:e.sliceString(t.from,t.to)=="var"}const sO=new bO,Sr=["Declaration"];function $r(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function AO(O,e,a){if(e.to-e.from>4096){let t=sO.get(e);if(t)return t;let r=[],s=new Set,i=e.cursor(ve.IncludeAnonymous);if(i.firstChild())do for(let l of AO(O,i.node,a))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return sO.set(e,r),r}else{let t=[],r=new Set;return e.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Sr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=O.sliceString(s.from,s.to);r.has(l)||(r.add(l),t.push({label:l,type:"variable"}))}}),t}}const fr=O=>e=>{let{state:a,pos:t}=e,r=j(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:fe(),validFor:v};if(r.name=="ValueName")return{from:r.from,options:iO,validFor:v};if(r.name=="PseudoClassName")return{from:r.from,options:rO,validFor:v};if(O(r)||(e.explicit||s)&&ur(r,a.doc))return{from:O(r)||s?r.from:t,options:AO(a.doc,$r(r),O),validFor:hr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:fe(),validFor:v};return{from:r.from,options:dr,validFor:v}}if(!e.explicit)return null;let i=r.resolve(t),l=i.childBefore(t);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:rO,validFor:v}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:iO,validFor:v}:i.name=="Block"||i.name=="Styles"?{from:t,options:fe(),validFor:v}:null},gr=fr(O=>O.name=="VariableName"),ce=J.define({name:"css",parser:pr.configure({props:[L.add({Declaration:C()}),F.add({"Block KeyframeList":Te})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function mr(){return new M(ce,ce.data.of({autocomplete:gr}))}const Pr=304,lO=1,Zr=2,br=305,Xr=307,xr=308,Yr=3,yr=4,kr=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],IO=125,wr=59,oO=47,vr=42,Tr=43,_r=45,Wr=new wO({start:!1,shift(O,e){return e==Yr||e==yr||e==Xr?O:e==xr},strict:!1}),Ur=new x((O,e)=>{let{next:a}=O;(a==IO||a==-1||e.context)&&O.acceptToken(br)},{contextual:!0,fallback:!0}),Cr=new x((O,e)=>{let{next:a}=O,t;kr.indexOf(a)>-1||a==oO&&((t=O.peek(1))==oO||t==vr)||a!=IO&&a!=wr&&a!=-1&&!e.context&&O.acceptToken(Pr)},{contextual:!0}),Rr=new x((O,e)=>{let{next:a}=O;if((a==Tr||a==_r)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(lO);O.acceptToken(t?lO:Zr)}},{contextual:!0}),qr=D({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),Vr={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},jr={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},zr={__proto__:null,"<":139},Gr=T.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Ji'#JiO%[QUO'#JiOOQO'#Jm'#JmOOQO'#Ia'#IaOBbQWO'#EaOOQ(CW'#E`'#E`OC^Q(C`O'#EaOChQWO'#ETOOQO'#Jl'#JlOC|QWO'#JmOEZQWO'#ETOChQWO'#EaPEhO?MpO'#C`POOO)CDp)CDpOOOO'#IW'#IWOEsOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFRO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFaO07`O,59vOOQ(CY,59v,59vOFoQUO'#I[OGSQSO'#JgOIUQbO'#JgO+}QUO'#JgOI]QSO,59|OIsQSO'#EjOJQQSO'#JuOJ]QSO'#JtOJ]QSO'#JtOJeQSO,5;WOJjQSO'#JsOOQ(CY,5:X,5:XOJqQUO,5:XOLrQ(CjO,5:cOMcQSO,5:kOM|Q(C[O'#JrONTQSO'#JqO9TQSO'#JqONiQSO'#JqONqQSO,5;VONvQSO'#JqO!#OQbO'#JfOOQ(CY'#Cg'#CgO%[QUO'#EPO!#nQ`O,5:pOOQO'#Jn'#JnOOQO-ElOOQQ'#JZ'#JZOOQQ,5>m,5>mOOQQ-ExQ(CjO,5:iOOQO,5@m,5@mO!?iQ,UO,5=WO!?wQ(C[O'#J[O9OQSO'#J[O!@YQ(C[O,59XO!@eQWO,59XO!@mQ,UO,59XO9{Q,UO,59XO!@xQSO,5;TO!AQQSO'#HYO!AcQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AkQSO,5=sO!ApQSO,5=sO!AuQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BTQWO,5=`O!B]Q,UO,5=aO!BhQSO,5=cO!BmQ`O,5=fO!BuQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!BzQSO'#HRO9{Q,UO'#HTO!CPQSO'#HTOOQQ,5=i,5=iO!CUQSO'#HUO!C^QSO'#CmO!CcQSO,58}O!CmQSO,58}O!ErQUO,58}OOQQ,58},58}O!FSQ(C[O,58}O%[QUO,58}O!H_QUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!HuQSO,5=uO`QUO,5={O`QUO,5=}O!HzQSO,5>PO`QUO,5>RO!IPQSO,5>UO!IUQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!M`QSO,5>fOOQQ,5>h,5>hO!M`QSO,5>hOOQQ,5>j,5>jO!MeQWO'#DYO%[QUO'#JiO!NSQWO'#JiO!NqQWO'#DhO# SQWO'#DhO##eQUO'#DhO##lQSO'#JhO##tQSO,5:RO##yQSO'#EnO#$XQSO'#JvO#$aQSO,5;XO#$fQWO'#DhO#$sQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#$zQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%SQSO,5@TO#%XQ!LQO,5:pOOQO-E<_-E<_O#&_Q(C`O,5:{OChQWO,5:oO#&iQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#&vQ(C[O,5:{O#'RQ(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'aQ(C[O,5:{POOO'#IU'#IUP#'uO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#(aQUO'#I[OOQO-ERQ(CjO1G0yO#?yQ(CjO1G0yO#ByQ$IUO'#CgO#DwQ$IUO1G1[O#EOQ$IUO'#JfO!,YQSO1G1bO#E`Q(CjO,5?SOOQ(CW-EeQSO1G3kO$.VQUO1G3mO$2ZQUO'#HlOOQQ1G3p1G3pO$2hQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$2pQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$6wQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$6|Q$IUO,5:SOOQO,5;Y,5;YO$7WQWO'#I]O$7nQSO,5@SOOQ(CY1G/m1G/mO$7vQWO'#IcO$8QQSO,5@bOOQ(CW1G0s1G0sO# SQWO,5:SOOQO'#I`'#I`O$8YQWO,5:nOOQ(CY,5:n,5:nO#$}QSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8aQ(C[O1G0gO$8lQ(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$8zQ(C[O1G0gOOQO1G0Z1G0ZO$9`Q(CjO1G0gPOOO-EvO$9|QSO1G5mO$:UQSO1G5zO$:^QbO1G5{O9TQSO,5>|O$:hQ(CjO1G5xO%[QUO1G5xO$:xQ(C[O1G5xO$;ZQSO1G5wO$;ZQSO1G5wO9TQSO1G5wO$;cQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$;wQSO,5?PO$$XQSO,5?POOQO-ExQ(CjO,5WOOQQ,5>W,5>WO%[QUO'#HmO%(ZQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%(`QWO1G5oO%(tQ$IUO1G0tO%)OQSO1G0tOOQO1G/n1G/nO%)ZQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EjQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9`Q(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%)eQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%)pQ(C[O7+&RO%*OQ(CjO7++dO%[QUO7++dO%*`QSO7++cO%*`QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%*hQSO1G4kOOQO7+%z7+%zO#$}QSO<xOOQO-E<[-E<[O%2^QbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%2hQSO1G5qOOQ(CY<XQ$IUO1G0yO%>`Q$IUO1G0yO%@WQ$IUO1G0yO%@kQ(CjO<XOOQQ,5>Z,5>ZO%NUQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO%NZQ$IUO1G5{O>jQSO7+%YOOQ(CY<jQSO<jQSO7+)dO&5rQSO<{AN>{O%[QUOAN?XOOQO<SQSO7++uO%LgQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&>[QSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#MzQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&>dQSOANBTOOQQ<iQSOLD,jO&>qQ$IUO7+'tO&@gQ$IUO7+'vO&B]Q,UOG26|OOQO<YOPZXYZXlZXzZX{ZX}ZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX!WZX!XZX~O#zZX~P#@sOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO#w:UO(TVO(d$ZO(k#|O(l#}O~O#z.iO~P#CQO#Y:ZO#|:ZO#z(YX!X(YX~P! UO_'[a!W'[a'm'[a'k'[a!h'[a!T'[ap'[a!Y'[a%b'[a!b'[a~P!7zOP#giY#gi_#gil#gi{#gi!W#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(T#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#,gO_#{i!W#{i'm#{i'k#{i!T#{i!h#{ip#{i!Y#{i%b#{i!b#{i~P!7zO$X.nO$Z.nO~O$X.oO$Z.oO~O!b)_O#Y.pO!Y$_X$U$_X$X$_X$Z$_X$b$_X~O!V.qO~O!Y)bO$U.sO$X)aO$Z)aO$b.tO~O!W:VO!X(XX~P#CQO!X.uO~O!b)_O$b(mX~O$b.wO~Or)qO(U)rO(V.zO~O!T/OO~P!&^O!WdX!bdX!hdX!h$tX(ddX~P!/bO!h/UO~P#,gO!W/VO!b#uO(d'gO!h(qX~O!h/[O~O!V*SO'v%`O!h(qP~O#e/^O~O!T$tX!W$tX!b${X~P!/bO!W/_O!T(rX~P#,gO!b/aO~O!T/cO~Ol/gO!b#uO!i%^O(P%RO(d'gO~O'v/iO~O!b+YO~O_%gO!W/mO'm%gO~O!X/oO~P!3`O!^/pO!_/pO'w!lO(W!mO~O}/rO(W!mO~O#U/sO~O'v&QOe'aX!W'aX~O!W*lOe(Qa~Oe/xO~Oz/yO{/yO}/zOhwa(kwa(lwa!Wwa#Ywa~Oewa#zwa~P$ hOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!^Oz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#PO#e/|O~Oe$}a!W$}a#Y$}a#z$}a~P!0kO!b#uO~O#e0PO~O!W*}O_(va'm(va~Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!oiY!oil!oi!W!oi!f!oi!m!oi#h!oi#i!oi#j!oi#k!oi#l!oi#m!oi#n!oi#o!oi#p!oi#r!oi#t!oi#v!oi#w!oi(d!oi(k!oi(l!oi~O_!oi'm!oi'k!oi!T!oi!h!oip!oi!Y!oi%b!oi!b!oi~P$$nOh.UO!Y'VO%b.TO~Oj0ZO'v0YO~P!1]O!b+YO_(Oa!Y(Oa'm(Oa!W(Oa~O#e0aO~OYZX!WdX!XdX~O!W0bO!X(zX~O!X0dO~OY0eO~O'v+bO'xTO'{UO~O!Y%wO'v%`O^'iX!W'iX~O!W+gO^(ya~O!h0jO~P!7zOY0mO~O^0nO~O#Y0qO~Oh0tO!Y$|O~O(W(tO!X(wP~Oh0}O!Y0zO%b0|O(P%RO~OY1XO!W1VO!X(xX~O!X1YO~O^1[O_%gO'm%gO~O'v#mO'xTO'{UO~O#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O#p1_O&S1`O_(YX!g(YX~P$+dO#Y$eO#p1_O&S1`O~O_1bO~P%[O_1dO~O&]1gOP&ZiQ&ZiW&Zi_&Zib&Zic&Zij&Zil&Zim&Zin&Zit&Ziv&Zix&Zi}&Zi!R&Zi!S&Zi!Y&Zi!d&Zi!i&Zi!l&Zi!m&Zi!n&Zi!p&Zi!r&Zi!u&Zi!y&Zi#q&Zi$R&Zi$V&Zi%a&Zi%c&Zi%e&Zi%f&Zi%g&Zi%j&Zi%l&Zi%o&Zi%p&Zi%r&Zi&O&Zi&U&Zi&W&Zi&Y&Zi&[&Zi&_&Zi&e&Zi&k&Zi&m&Zi&o&Zi&q&Zi&s&Zi'k&Zi'v&Zi'x&Zi'{&Zi(T&Zi(c&Zi(p&Zi!X&Zi`&Zi&b&Zi~O`1mO!X1kO&b1lO~P`O!YXO!i1oO~O&i,jOP&diQ&diW&di_&dib&dic&dij&dil&dim&din&dit&div&dix&di}&di!R&di!S&di!Y&di!d&di!i&di!l&di!m&di!n&di!p&di!r&di!u&di!y&di#q&di$R&di$V&di%a&di%c&di%e&di%f&di%g&di%j&di%l&di%o&di%p&di%r&di&O&di&U&di&W&di&Y&di&[&di&_&di&e&di&k&di&m&di&o&di&q&di&s&di'k&di'v&di'x&di'{&di(T&di(c&di(p&di!X&di&]&di`&di&b&di~O!T1uO~O!W![a!X![a~P#CQOm!nO}!oO!V1{O(W!mO!W'PX!X'PX~P@OO!W,zO!X([a~O!W'VX!X'VX~P!7SO!W,}O!X(ja~O!X2SO~P'_O_%gO#Y2]O'm%gO~O_%gO!b#uO#Y2]O'm%gO~O_%gO!b#uO!m2aO#Y2]O'm%gO(d'gO~O_%gO'm%gO~P!7zO!W$aOp$la~O!T'Oi!W'Oi~P!7zO!W'{O!T(Zi~O!W(SO!T(hi~O!T(ii!W(ii~P!7zO!W(fi!h(fi_(fi'm(fi~P!7zO#Y2cO!W(fi!h(fi_(fi'm(fi~O!W(`O!h(ei~O}%aO!Y%bO!y]O#c2hO#d2gO'v%`O~O}%aO!Y%bO#d2gO'v%`O~Oh2oO!Y'VO%b2nO~Oh2oO!Y'VO%b2nO(P%RO~O#ewaPwaYwa_walwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa'mwa(Twa(dwa!hwa!Twa'kwapwa!Ywa%bwa!bwa~P$ hO#e$maP$maY$ma_$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma'm$ma(T$ma(d$ma!h$ma!T$ma'k$map$ma!Y$ma%b$ma!b$ma~P$!^O#e$oaP$oaY$oa_$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa'm$oa(T$oa(d$oa!h$oa!T$oa'k$oap$oa!Y$oa%b$oa!b$oa~P$#PO#e$}aP$}aY$}a_$}al$}a{$}a!W$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a'm$}a(T$}a(d$}a!h$}a!T$}a'k$}a#Y$}ap$}a!Y$}a%b$}a!b$}a~P#,gO_#]q!W#]q'm#]q'k#]q!T#]q!h#]qp#]q!Y#]q%b#]q!b#]q~P!7zOe'QX!W'QX~P!'vO!W._Oe(^a~O!V2wO!W'RX!h'RX~P%[O!W.bO!h(_a~O!W.bO!h(_a~P!7zO!T2zO~O#z!ka!X!ka~PJxO#z!ca!W!ca!X!ca~P#CQO#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,gO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,gOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$I|Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$JoO(d$ZO~P#,gO!V3hO'v%`O!W']X!h']X~O!W/VO!h(qa~O!W/VO!b#uO!h(qa~O!W/VO!b#uO(d'gO!h(qa~Oe$vi!W$vi#Y$vi#z$vi~P!0kO!V3pO'v*XO!T'_X!W'_X~P!1YO!W/_O!T(ra~O!W/_O!T(ra~P#,gO!b#uO#p3xO~Ol3{O!b#uO(d'gO~Oe(Ri!W(Ri~P!0kO#Y4OOe(Ri!W(Ri~P!0kO!h4RO~O_$jq!W$jq'm$jq'k$jq!T$jq!h$jqp$jq!Y$jq%b$jq!b$jq~P!7zO!T4VO~O!W4WO!Y(sX~P#,gO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,gO!Y$|O~P#,gO!W4nO#Y4pO!X(wX~O!X4qO~Om!nO}4rO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!pO#Q!pO#R!pO#U4wO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O!X4vO~P%$nOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O'v#mO!W'gX!X'gX~O!W1VO!X(xa~O'xTO'{UO(W5VO~O^5ZO~O#p5^O&S5_O~PMhO!h5`O~P%[O_5bO~O_5bO~P%[O`1mO!X5gO&b1lO~P`O!b5iO~O!b5kO!W(]i!X(]i!b(]i!i(]i(P(]i~O!W#bi!X#bi~P#CQO#Y5lO!W#bi!X#bi~O!W![i!X![i~P#CQO_%gO#Y5uO'm%gO~O_%gO!b#uO#Y5uO'm%gO~O!W(fq!h(fq_(fq'm(fq~P!7zO!W(`O!h(eq~O}%aO!Y%bO#d5|O'v%`O~O!Y'VO%b6PO~Oh6SO!Y'VO%b6PO~O#e%YiP%YiY%Yi_%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi'm%Yi(T%Yi(d%Yi!h%Yi!T%Yi'k%Yip%Yi!Y%Yi%b%Yi!b%Yi~P$I|O#e%[iP%[iY%[i_%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i'm%[i(T%[i(d%[i!h%[i!T%[i'k%[ip%[i!Y%[i%b%[i!b%[i~P$JoO#e$viP$viY$vi_$vil$vi{$vi!W$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi'm$vi(T$vi(d$vi!h$vi!T$vi'k$vi#Y$vip$vi!Y$vi%b$vi!b$vi~P#,gOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#CQOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gil#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~O#h#gi~P%2}O#h9zO~P%2}OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O(TVOY#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~Ol#gi~P%5YOl9|O~P%5YOP$]Ol9|Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O(TVO#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P%7eOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%7eOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO(TVO#t#gi#v#gi#w#gi#z#gi(d#gi(l#gi!W#gi!X#gi~O(k#gi~P%:PO(k#|O~P%:POP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO(TVO(k#|O#v#gi#w#gi#z#gi(d#gi!W#gi!X#gi~O(l#gi~P%<[O(l#}O~P%<[OP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO(TVO(k#|O(l#}O~O#w#gi#z#gi(d#gi!W#gi!X#gi~P%>gO_#xy!W#xy'm#xy'k#xy!T#xy!h#xyp#xy!Y#xy%b#xy!b#xy~P!7zOh;mOz)vO})wO(k)yO(l){O~OP#giY#gil#gi{#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(T#gi(d#gi!W#gi!X#gi~P%A_O!g#wOP(SXY(SXh(SXl(SXz(SX{(SX}(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX#z(SX(T(SX(d(SX(k(SX(l(SX!W(SX!X(SX~O#z#{i!W#{i!X#{i~P#CQO#z!oi!X!oi~P$$nO!X6`O~O!W'[a!X'[a~P#CQO!b#uO(d'gO!W']a!h']a~O!W/VO!h(qi~O!W/VO!b#uO!h(qi~Oe$vq!W$vq#Y$vq#z$vq~P!0kO!T'_a!W'_a~P#,gO!b6gO~O!W/_O!T(ri~P#,gO!W/_O!T(ri~O!T6kO~O!b#uO#p6pO~Ol6qO!b#uO(d'gO~O!T6sO~Oe$xq!W$xq#Y$xq#z$xq~P!0kO_$jy!W$jy'm$jy'k$jy!T$jy!h$jyp$jy!Y$jy%b$jy!b$jy~P!7zO!b5kO~O!W4WO!Y(sa~O_#]y!W#]y'm#]y'k#]y!T#]y!h#]yp#]y!Y#]y%b#]y!b#]y~P!7zOY6xO~O!W0bO!X(zi~O^7OO~O(W(tO!W'dX!X'dX~O!W4nO!X(wa~OjkO'v7VO~P.iO!X7YO~P%$nOm!nO}7ZO'xTO'{UO(W!mO(c!sO~O!Y0zO~O!Y0zO%b7]O~Oh7`O!Y0zO%b7]O~OY7eO!W'ga!X'ga~O!W1VO!X(xi~O!h7iO~O!h7jO~O!h7mO~O!h7mO~P%[O_7oO~O!b7pO~O!h7qO~O!W(ii!X(ii~P#CQO_%gO#Y7yO'm%gO~O!W(fy!h(fy_(fy'm(fy~P!7zO!W(`O!h(ey~O!Y'VO%b7|O~O#e$vqP$vqY$vq_$vql$vq{$vq!W$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq'm$vq(T$vq(d$vq!h$vq!T$vq'k$vq#Y$vqp$vq!Y$vq%b$vq!b$vq~P#,gO#e$xqP$xqY$xq_$xql$xq{$xq!W$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq'm$xq(T$xq(d$xq!h$xq!T$xq'k$xq#Y$xqp$xq!Y$xq%b$xq!b$xq~P#,gO!W'Ri!h'Ri~P!7zO#z#]q!W#]q!X#]q~P#CQOz/yO{/yO}/zOPwaYwahwalwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa#zwa(Twa(dwa(kwa(lwa!Wwa!Xwa~Oz)vO})wOP$maY$mah$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma#z$ma(T$ma(d$ma(k$ma(l$ma!W$ma!X$ma~Oz)vO})wOP$oaY$oah$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa#z$oa(T$oa(d$oa(k$oa(l$oa!W$oa!X$oa~OP$}aY$}al$}a{$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a#z$}a(T$}a(d$}a!W$}a!X$}a~P%A_O#z$iq!W$iq!X$iq~P#CQO#z$jq!W$jq!X$jq~P#CQO!X8WO~O#z8XO~P!0kO!b#uO!W']i!h']i~O!b#uO(d'gO!W']i!h']i~O!W/VO!h(qq~O!T'_i!W'_i~P#,gO!W/_O!T(rq~O!T8_O~P#,gO!T8_O~Oe(Ry!W(Ry~P!0kO!W'ba!Y'ba~P#,gO_%Uq!Y%Uq'm%Uq!W%Uq~P#,gOY8dO~O!W0bO!X(zq~O#Y8hO!W'da!X'da~O!W4nO!X(wi~P#CQOPZXYZXlZXzZX{ZX}ZX!TZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!b%SX#p%SX~P&2_O!Y0zO%b8lO~O'xTO'{UO(W8qO~O!W1VO!X(xq~O!h8tO~O!h8uO~O!h8vO~O!h8vO~P%[O#Y8yO!W#by!X#by~O!W#by!X#by~P#CQO!Y'VO%b9OO~O#z#xy!W#xy!X#xy~P#CQOP$viY$vil$vi{$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi#z$vi(T$vi(d$vi!W$vi!X$vi~P%A_Oz)vO})wO(l){OP%YiY%Yih%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi#z%Yi(T%Yi(d%Yi(k%Yi!W%Yi!X%Yi~Oz)vO})wOP%[iY%[ih%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i#z%[i(T%[i(d%[i(k%[i(l%[i!W%[i!X%[i~O#z$jy!W$jy!X$jy~P#CQO#z#]y!W#]y!X#]y~P#CQO!b#uO!W']q!h']q~O!W/VO!h(qy~O!T'_q!W'_q~P#,gO!T9VO~P#,gO!W0bO!X(zy~O!W4nO!X(wq~O!Y0zO%b9^O~O!h9aO~O!Y'VO%b9fO~OP$vqY$vql$vq{$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq#z$vq(T$vq(d$vq!W$vq!X$vq~P%A_OP$xqY$xql$xq{$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq#z$xq(T$xq(d$xq!W$xq!X$xq~P%A_Oe%^!Z!W%^!Z#Y%^!Z#z%^!Z~P!0kO!W'dq!X'dq~P#CQO!W#b!Z!X#b!Z~P#CQO#e%^!ZP%^!ZY%^!Z_%^!Zl%^!Z{%^!Z!W%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z'm%^!Z(T%^!Z(d%^!Z!h%^!Z!T%^!Z'k%^!Z#Y%^!Zp%^!Z!Y%^!Z%b%^!Z!b%^!Z~P#,gOP%^!ZY%^!Zl%^!Z{%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z#z%^!Z(T%^!Z(d%^!Z!W%^!Z!X%^!Z~P%A_Op(XX~P1qO'w!lO~P!*SO!TdX!WdX#YdX~P&2_OPZXYZXlZXzZX{ZX}ZX!WZX!WdX!fZX!gZX!iZX!mZX#YZX#YdX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!bdX!hZX!hdX(ddX~P&GuOP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!YXO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O!W:VO!X$la~Oj%SOl$tOm$sOn$sOt%TOv%UOx:]O}${O!Y$|O!d;gO!i$xO#d:cO$R%YO$n:_O$p:aO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#q)]O~P&LkO!XZX!XdX~P&GuO#e9yO~O!b#uO#e9yO~O#Y:ZO~O#p:OO~O#Y:eO!W(iX!X(iX~O#Y:ZO!W(gX!X(gX~O#e:fO~Oe:hO~P!0kO#e:mO~O#e:nO~O!b#uO#e:oO~O!b#uO#e:fO~O#z:pO~P#CQO#e:qO~O#e:rO~O#e:sO~O#e:tO~O#e:uO~O#e:vO~O#z:wO~P!0kO#z:xO~P!0kO$V~!g!}#O#Q#R#U#c#d#o(p$n$p$s%V%a%b%c%j%l%o%p%r%t~'qR$V(p#i!S'o'w#jm#h#klz'p(W'p'v$X$Z$X~",goto:"$'R)OPPPP)PPP)SP)eP*t.xPPPP5YPP5pP;l>sP?WP?WPPP?WP@xP?WP?WP?WP@|PPARPAlPFdPPPFhPPPPFhIiPPPIoJjPFhPLxPPPP! WFhPPPFhPFhP!#fFhP!&z!'|!(VP!(y!(}!(yPPPPP!,Y!'|PP!,v!-pP!0dFhFh!0i!3s!8Y!8Y!wP#@W#@_#@gPPPP#Du#Gl#NT#NW#NZ$ S$ V$ Y$ a$ iPP$ o$ s$!k$#j$#n$$SPP$$W$$^$$bP$$e$$i$$l$%b$%y$&b$&f$&i$&l$&r$&u$&y$&}R!{RoqOXst!Z#c%f&i&k&l&n,b,g1g1jY!uQ'V-S0z4uQ%lvQ%tyQ%{|Q&a!VS&}!e,zQ']!iS'c!r!xS*_$|*dQ+`%uQ+m%}Q,R&ZQ-Q'UQ-['^Q-d'dQ/p*fQ1U,SR:d9u%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7yS#p]9r!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ*o%VQ+e%wQ,T&^Q,[&fQ.X:[Q0W+WQ0[+YQ0g+fQ1^,YQ2k.UQ4`0bQ5T1VQ6R2oQ6X:]Q6z4aR8P6S&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;ct!nQ!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4w$^$si#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ&O|Q&{!eS'R%b,}Q+e%wQ/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5W1XQ5X1[Q6z4aQ6}4fQ7h5ZQ8g7OR8r7ernOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR,V&b&v^OPXYstuvwz!Z!`!g!j!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;b;c[#[WZ#V#Y'O'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q%oxQ%syS%x|%}Q&U!TQ'Y!hQ'[!iQ(g#rS*R$x*VS+_%t%uQ+c%wQ+|&XQ,Q&ZS-Z']'^Q.W(hQ/Z*SQ0`+`Q0f+fQ0h+gQ0k+kQ1P+}S1T,R,SQ2X-[Q3g/VQ4_0bQ4c0eQ4h0mQ5S1UQ6d3hQ6y4aQ6|4eQ8c6xR9X8dv$zi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i!S%qy!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zQ+X%oQ+r&RQ+u&SQ,P&ZQ.V(gQ1O+|U1S,Q,R,SQ2p.WQ4}1PS5R1T1UQ7d5S#O;d#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg;e:X:Y:_:a:c:j:l:n:r:t:xW%Pi%R*l;`S&R!Q&`Q&S!RQ&T!SR+p&P$_%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mT)r$u)sV*p%V:[:]U'R!e%b,}S(u#y#zQ+j%zS.P(c(dQ0u+vQ4P/yR7S4n&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c$i$`c#X#d%j%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.j.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VT#SV#T&}kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ'P!eR1|,zv!nQ!e!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4wS*^$|*dS/h*_*fQ/q*gQ0w+xQ3z/pR3}/snqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&p!^Q'm!wS(i#t9yQ+]%rQ+z&UQ+{&WQ-X'ZQ-f'fS.](n:fS0O*x:oQ0^+^Q0y+yQ1n,iQ1p,jQ1x,uQ2V-YQ2Y-^S4U0P:uQ4Z0_S4^0a:vQ5m1zQ5q2WQ5v2_Q6w4[Q7t5oQ7u5rQ7x5wR8x7q$d$_c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(f#o'`U*i$}(m3ZS+S%j.jQ2l0WQ6O2kQ8O6RR9P8P$d$^c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(e#o'`S(w#z$_S+R%j.jS.Q(d(fQ.m)XQ0T+SR2i.R&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS#p]9rQ&k!XQ&l!YQ&n![Q&o!]R1f,eQ'W!hQ+U%oQ-V'YS.S(g+XQ2T-UW2m.V.W0V0XQ5p2UU5}2j2l2pS7{6O6QS8}7}8OS9d8|9PQ9l9eR9o9mU!vQ'V-ST4s0z4u!Q_OXZ`st!V!Z#c#g%^%f&`&b&i&k&l&n(`,b,g-y1g1j]!pQ!r'V-S0z4uT#p]9r%Y{OPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS(u#y#zS.P(c(d!s:|$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cY!tQ'V-S0z4uQ'b!rS'l!u!xS'n!y4wS-c'c'dQ-e'eR2`-dQ'k!tS([#f1aS-b'b'nQ/Y*RQ/f*^Q2a-eQ3l/ZS3u/g/qQ6c3gS6n3{3}Q8Z6dR8b6qQ#vbQ'j!tS(Z#f1aS(]#l*wQ*y%_Q+Z%pQ+a%vU-a'b'k'nQ-u([Q/X*RQ/e*^Q/k*aQ0]+[Q1Q,OS2^-b-eQ2f-}S3k/Y/ZS3t/f/qQ3w/jQ3y/lQ5P1RQ5x2aQ6b3gQ6f3lS6j3u3}Q6o3|Q7b5QS8Y6c6dQ8^6kQ8`6nQ8o7cQ9T8ZQ9U8_Q9W8bQ9`8pQ9h9VQ;P:zQ;[;TR;];UV!vQ'V-S%YaOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS#vz!j!r:y$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;P;b%YbOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yQ%_j!S%py!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zS%vz!jQ+[%qQ,O&ZW1R,P,Q,R,SU5Q1S1T1US7c5R5SQ8p7d!r:z$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ;T;aR;U;b$|eOPXYstuvw!Z!`!g!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yY#aWZ#V#Y'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q,]&f!p:{$[$m)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;O'OS'S!e%bR2O,}%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7y!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ,[&fQ0W+WQ2k.UQ6R2oR8P6S!f$Uc#X%j'x(O(j(q)Q)R)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!T:Q)V)h,x.j1v1y2{3T3U3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!b$Wc#X%j'x(O(j(q)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!P:S)V)h,x.j1v1y2{3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!^$[c#X%j'x(O(j(q)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9sQ3f/Tz;c)V)h,x.j1v1y2{3[3b5n6W6]6^7U7s8Q8U8V9Z9b;VQ;h;jR;i;k&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS$nh$oR3_.p'TgOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$jf$pQ$hfS)a$k)eR)m$pT$if$pT)c$k)e'ThOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$nh$oQ$qhR)l$o%YjOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7y!s;a$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c#clOPXZst!Z!`!o#R#c#n#{$m%f&b&e&f&i&k&l&n&r&z'X(v)j*|+W,_,b,g-W.U.q/z0}1_1`1b1d1g1j1l2o3^4r4|5^5_5b6S7Z7`7ov$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mQ*t%ZQ.|)vg3Z:X:Y:_:a:c:j:l:n:r:t:xv$yi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;iQ*W$zS*a$|*dQ*u%[Q/l*b#O;R#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mf;S:X:Y:_:a:c:j:l:n:r:t:xQ;W;dQ;X;eQ;Y;fR;Z;gv$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg3Z:X:Y:_:a:c:j:l:n:r:t:xnoOXst!Z#c%f&i&k&l&n,b,g1g1jQ*Z${Q,p&uQ,q&wR3o/_$^%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ+s&SQ0s+uQ4l0rR7R4mT*c$|*dS*c$|*dT4t0z4uS/j*`4rT3|/r7ZQ+Z%pQ/k*aQ0]+[Q1Q,OQ5P1RQ7b5QQ8o7cR9`8pn)z$v(o*v/]/t/u2t3m4S6a6r9S;Q;^;_!Y:i(k)[*Q*Y.[.x.}/T/b0U0p0r2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k]:j3Y6[8R9Q9R9pp)|$v(o*v/R/]/t/u2t3m4S6a6r9S;Q;^;_![:k(k)[*Q*Y.[.x.}/T/b0U0p0r2q2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k_:l3Y6[8R8S9Q9R9prnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ&]!UR,_&frnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR&]!UQ+w&TR0o+psnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ0{+|S4z1O1PU7[4x4y4}S8k7^7_S9[8j8mQ9i9]R9n9jQ&d!VR,W&`R5W1XS%x|%}R0h+gQ&i!WR,b&jR,h&oT1h,g1jR,l&pQ,k&pR1q,lQ'p!zR-h'pSsOtQ#cXT%is#cQ!}TR'r!}Q#QUR't#QQ)s$uR.y)sQ#TVR'v#TQ#WWU'|#W'}-oQ'}#XR-o(OQ,{'PR1},{Q.`(oR2u.`Q.c(qS2x.c2yR2y.dQ-S'VR2R-SY!rQ'V-S0z4uR'a!rS#^W%aU(T#^(U-pQ(U#_R-p(PQ-O'SR2P-Ot`OXst!V!Z#c%f&`&b&i&k&l&n,b,g1g1jS#gZ%^U#q`#g-yR-y(`Q(a#iQ-v(]W.O(a-v2d5zQ2d-wR5z2eQ)e$kR.r)eQ$ohR)k$oQ$bcU)Z$b-k:WQ-k9sR:W)hQ/W*RW3i/W3j6e8[U3j/X/Y/ZS6e3k3lR8[6f#o)x$v(k(o)[*Q*Y*q*r*v.Y.Z.[.x.}/R/S/T/]/b/t/u0U0p0r2q2r2s2t3Y3m3n3r4S4k4m6T6U6Y6Z6[6a6h6l6r6t6v8R8S8T8]8a9Q9R9S9g9p;Q;^;_;j;kQ/`*YU3q/`3s6iQ3s/bR6i3rQ*d$|R/n*dQ*m%QR/w*mQ4X0UR6u4XQ+O%dR0S+OQ4o0uS7T4o8iR8i7UQ+y&UR0x+yQ4u0zR7X4uQ1W,TS5U1W7fR7f5WQ0c+cW4b0c4d6{8eQ4d0fQ6{4cR8e6|Q+h%xR0i+hQ1j,gR5f1jYrOXst#cQ&m!ZQ+Q%fQ,a&iQ,c&kQ,d&lQ,f&nQ1e,bS1h,g1jR5e1gQ%hpQ&q!_Q&t!aQ&v!bQ&x!cQ'h!tQ+P%eQ+]%rQ+o&OQ,V&dQ,n&sW-_'b'j'k'nQ-f'fQ/m*cQ0^+^S1Z,W,ZQ1r,mQ1s,pQ1t,qQ2Y-^W2[-a-b-e-gQ4Z0_Q4g0lQ4j0pQ5O1QQ5Y1]Q5d1fU5s2Z2^2aQ5v2_Q6w4[Q7P4iQ7Q4kQ7W4tQ7a5PQ7g5XS7v5t5xQ7x5wQ8f6}Q8n7bQ8s7hQ8z7wQ9Y8gQ9_8oQ9c8{R9k9`Q%ryQ'Z!iQ'f!tU+^%s%t%uQ,u&|U-Y'[']'^S-^'b'lQ/d*^S0_+_+`Q1z,wS2W-Z-[Q2_-cQ3v/hQ4[0`Q5o2QQ5r2XQ5w2`R6m3zS$wi;`R*n%RU%Qi%R;`R/v*lQ$viS(k#u+YQ(o#wS)[$c$dQ*Q$xQ*Y${Q*q%WQ*r%XQ*v%]Q.Y:^Q.Z:`Q.[:bQ.x)qS.})w/PQ/R)zQ/S)|Q/T)}Q/]*UQ/b*[Q/t*jQ/u*kh0U+V.T0|2n4{6P7]7|8l9O9^9fQ0p+qQ0r+tQ2q:iQ2r:kQ2s:mQ2t._S3Y:X:YQ3m/^Q3n/_Q3r/aQ4S/|Q4k0qQ4m0tQ6T:qQ6U:sQ6Y:_Q6Z:aQ6[:cQ6a3fQ6h3pQ6l3xQ6r4OQ6t4WQ6v4YQ8R:nQ8S:jQ8T:lQ8]6gQ8a6pQ9Q:rQ9R:tQ9S8XQ9g:wQ9p:xQ;Q;`Q;^;hQ;_;iQ;j;lR;k;mnpOXst!Z#c%f&i&k&l&n,b,g1g1jQ!fPS#eZ#nQ&s!`U'_!o4r7ZQ'u#RQ(x#{Q)i$mS,Z&b&eQ,`&fQ,m&rQ,r&zQ-U'XQ.f(vQ.v)jQ0Q*|Q0X+WQ1c,_Q2U-WQ2l.UQ3a.qQ4Q/zQ4y0}Q5[1_Q5]1`Q5a1bQ5c1dQ5h1lQ6O2oQ6_3^Q7_4|Q7k5^Q7l5_Q7n5bQ8O6SQ8m7`R8w7o#WcOPXZst!Z!`!o#c#n#{%f&b&e&f&i&k&l&n&r&z'X(v*|+W,_,b,g-W.U/z0}1_1`1b1d1g1j1l2o4r4|5^5_5b6S7Z7`7oQ#XWQ#dYQ%juQ%kvS%mw!gS'x#V'{Q(O#YQ(j#tQ(q#xQ(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)T$YQ)V$[Q)Y$aQ)^$eW)h$m)j.q3^Q+T%lQ+i%yS,x'O1{Q-g'iS-l'y-nQ-q(RQ-s(YQ.^(nQ.d(rQ.h9qQ.j9tQ.k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:367,context:Wr,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[qr],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'yp'|!b'o(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'z#S$e&j'p(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'yp'|!b'p(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'x$(n$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'|!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'yp'|!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS'|!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'ypOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'ypOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'yp'|!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j'|!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Vr[O]||-1},{term:330,get:O=>jr[O]||-1},{term:68,get:O=>zr[O]||-1}],tokenPrec:12827}),NO=[P("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),P("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),P("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),P("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),P("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),P(`try { +import{S as ft,i as gt,s as mt,e as Pt,f as Zt,U as K,g as bt,y as ze,o as Xt,J as xt,K as Yt,L as yt,I as kt,C as wt,M as vt}from"./index-9f490143.js";import{P as Tt,N as _t,u as Wt,D as Ut,v as we,T as ee,I as ve,w as D,x as o,y as Ct,L as J,z as L,A as C,B as F,F as Te,G as M,H as j,J as bO,K as XO,M as xO,E as U,O as YO,Q as P,R as Rt,U as qt,V as yO,W as Vt,X as jt,a as z,h as zt,b as Gt,c as Et,d as At,e as It,s as Nt,t as Bt,f as Dt,g as Jt,r as Lt,i as Ft,k as Mt,j as Kt,l as Ht,m as ea,n as Oa,o as ta,p as aa,q as Ge,C as H}from"./index-808c8630.js";class re{constructor(e,a,t,r,s,i,l,n,Q,d=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=d,this.parent=c}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new re(e,[],a,t,t,0,[],0,r?new Ee(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(r);if(i&&(this.score+=i),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(n==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,n)}storeNode(e,a,t,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(a==t)return;if(i.buffer[l-2]>=a){i.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t){let r=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let s=e,{parser:i}=this.p;(t>this.pos||a<=i.maxNode)&&(this.pos=t,i.stateFlag(s,1)||(this.reducePos=t)),this.pushState(s,r),this.shiftContext(a,r),a<=i.maxNode&&this.buffer.push(a,r,t,4)}}apply(e,a,t){e&65536?this.reduce(e):this.shift(e,a,t)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new re(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new ra(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=t(i,s+1);if(l!=null)return l}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Ee{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class ra{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class ie{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new ie(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ie(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}a?a[r++]=s:a=new e(s)}return a}class Oe{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ae=new Oe;class ia{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ae,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=Ae,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class R{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;kO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}R.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class se{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?I(e):e}token(e,a){let t=e.pos,r=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(kO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}se.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class x{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function kO(O,e,a,t,r,s){let i=0,l=1<0){let S=O[p];if(n.allows(S)&&(e.token.value==-1||e.token.value==S||sa(S,e.token.value,r,s))){e.acceptToken(S);break}}let d=e.next,c=0,u=O[i+2];if(e.next<0&&u>c&&O[Q+u*3-3]==65535&&O[Q+u*3-3]==65535){i=O[Q+u*3-1];continue e}for(;c>1,S=Q+p+(p<<1),f=O[S],g=O[S+1]||65536;if(d=g)c=p+1;else{i=O[S+2],e.advance();continue e}}break}}function Ie(O,e,a){for(let t=e,r;(r=O[t])!=65535;t++)if(r==a)return t-e;return-1}function sa(O,e,a,t){let r=Ie(a,t,e);return r<0||Ie(a,t,O)e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(O.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:O.length}}class la{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ne(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ne(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(s instanceof ee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class oa{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Oe)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:s}=r,i=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let u=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!d.extend&&(t=c,a>u))break}}for(;this.actions.length>a;)this.actions.pop();return n&&e.setLookAhead(n),!t&&e.pos==this.stream.end&&(t=new Oe,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new Oe,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let s=0;se.bufferLength*4?new la(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(l);else{if(this.advanceStack(l,t,e))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Qa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((l,n)=>n.score-l.score);t.length>i;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,d=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let u=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1&&c.length&&(!Q||(c.prop(we.contextHash)||0)==d))return e.useNode(c,u),Z&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof ee)||c.children.length==0||c.positions[0]>0)break;let p=c.children[0];if(p instanceof ee&&c.positions[0]==0)c=p;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Z&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let n=this.tokens.getActions(e);for(let Q=0;Qr?a.push(S):t.push(S)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return Be(e,a),!0}}runRecovery(e,a,t){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let c=l.split(),u=d;for(let p=0;c.forceReduce()&&p<10&&(Z&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)Z&&(u=this.stackID(c)+" -> ");for(let p of l.recoverByInsert(n))Z&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),Be(l,t)):(!r||r.scoreO;class wO{constructor(e){this.start=e.start,this.shift=e.shift||he,this.reduce=e.reduce||he,this.reuse=e.reuse||he,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class T extends Tt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(d,n,l[Q++]);else{let c=l[Q+-d];for(let u=-d;u>0;u--)s(l[Q++],n,c);Q++}}}this.nodeSet=new _t(a.map((l,n)=>Wt.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Ut;let i=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new R(i,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new na(this,e,a,t);for(let s of this.wrappers)r=s(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&t)return n;for(let Q=s+(i>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;r=a(k(this.data,s+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=k(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(T.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(s=>s.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=e.specializers.find(l=>l.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=De(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let s of e.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.scoreO.external(a,t)<<1|e}return O.get}const pa=54,da=1,ha=55,ua=2,Sa=56,$a=3,Je=4,fa=5,le=6,vO=7,TO=8,_O=9,WO=10,ga=11,ma=12,Pa=13,ue=57,Za=14,Le=58,UO=20,ba=22,CO=23,Xa=24,Xe=26,RO=27,xa=28,Ya=31,ya=34,ka=36,wa=37,va=0,Ta=1,_a={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Wa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Fe={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ua(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function qO(O){return O==9||O==10||O==13||O==32}let Me=null,Ke=null,He=0;function xe(O,e){let a=O.pos+e;if(He==a&&Ke==O)return Me;let t=O.peek(e);for(;qO(t);)t=O.peek(++e);let r="";for(;Ua(t);)r+=String.fromCharCode(t),t=O.peek(++e);return Ke=O,He=a,Me=r?r.toLowerCase():t==Ca||t==Ra?void 0:null}const VO=60,oe=62,_e=47,Ca=63,Ra=33,qa=45;function eO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new eO(xe(t,1)||"",O):O},reduce(O,e){return e==UO&&O?O.parent:O},reuse(O,e,a,t){let r=e.type.id;return r==le||r==ka?new eO(xe(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),za=new x((O,e)=>{if(O.next!=VO){O.next<0&&e.context&&O.acceptToken(ue);return}O.advance();let a=O.next==_e;a&&O.advance();let t=xe(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Za:le);let r=e.context?e.context.name:null;if(a){if(t==r)return O.acceptToken(ga);if(r&&Wa[r])return O.acceptToken(ue,-2);if(e.dialectEnabled(va))return O.acceptToken(ma);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Pa)}else{if(t=="script")return O.acceptToken(vO);if(t=="style")return O.acceptToken(TO);if(t=="textarea")return O.acceptToken(_O);if(_a.hasOwnProperty(t))return O.acceptToken(WO);r&&Fe[r]&&Fe[r][t]?O.acceptToken(ue,-1):O.acceptToken(le)}},{contextual:!0}),Ga=new x(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(Le);break}if(O.next==qa)e++;else if(O.next==oe&&e>=2){a>3&&O.acceptToken(Le,-2);break}else e=0;O.advance()}});function Ea(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Aa=new x((O,e)=>{if(O.next==_e&&O.peek(1)==oe){let a=e.dialectEnabled(Ta)||Ea(e.context);O.acceptToken(a?fa:Je,2)}else O.next==oe&&O.acceptToken(Je,1)});function We(O,e,a){let t=2+O.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==VO||s==1&&r.next==_e||s>=2&&si?r.acceptToken(e,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=i=0;r.advance()}})}const Ia=We("script",pa,da),Na=We("style",ha,ua),Ba=We("textarea",Sa,$a),Da=D({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),Ja=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[Da],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==xa)return Se(l,n,a);if(Q==Ya)return Se(l,n,t);if(Q==ya)return Se(l,n,r);if(Q==UO&&s.length){let d=l.node,c=d.firstChild,u=c&&OO(c,n),p;if(u){for(let S of s)if(S.tag==u&&(!S.attrs||S.attrs(p||(p=jO(d,n))))){let f=d.lastChild;return{parser:S.parser,overlay:[{from:c.to,to:f.type.id==wa?f.from:d.to}]}}}}if(i&&Q==CO){let d=l.node,c;if(c=d.firstChild){let u=i[n.read(c.from,c.to)];if(u)for(let p of u){if(p.tagName&&p.tagName!=OO(d.parent,n))continue;let S=d.lastChild;if(S.type.id==Xe){let f=S.from+1,g=S.lastChild,X=S.to-(g&&g.isError?0:1);if(X>f)return{parser:p.parser,overlay:[{from:f,to:X}]}}else if(S.type.id==RO)return{parser:p.parser,overlay:[{from:S.from,to:S.to}]}}}}return null})}const La=96,tO=1,Fa=97,Ma=98,aO=2,GO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ka=58,Ha=40,EO=95,er=91,te=45,Or=46,tr=35,ar=37;function ne(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function rr(O){return O>=48&&O<=57}const ir=new x((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(ne(s)||s==te||s==EO||a&&rr(s))!a&&(s!=te||r>0)&&(a=!0),t===r&&s==te&&t++,O.advance();else{a&&O.acceptToken(s==Ha?Fa:t==2&&e.canShift(aO)?aO:Ma);break}}}),sr=new x(O=>{if(GO.includes(O.peek(-1))){let{next:e}=O;(ne(e)||e==EO||e==tr||e==Or||e==er||e==Ka||e==te)&&O.acceptToken(La)}}),lr=new x(O=>{if(!GO.includes(O.peek(-1))){let{next:e}=O;if(e==ar&&(O.advance(),O.acceptToken(tO)),ne(e)){do O.advance();while(ne(O.next));O.acceptToken(tO)}}}),or=D({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),nr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},cr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Qr={__proto__:null,not:128,only:128},pr=T.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[sr,lr,ir,1,2,3,4,new se("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:O=>nr[O]||-1},{term:56,get:O=>cr[O]||-1},{term:98,get:O=>Qr[O]||-1}],tokenPrec:1169});let $e=null;function fe(){if(!$e&&typeof document=="object"&&document.body){let{style:O}=document.body,e=[],a=new Set;for(let t in O)t!="cssText"&&t!="cssFloat"&&typeof O[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const rO=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(O=>({type:"class",label:O})),iO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(O=>({type:"keyword",label:O})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(O=>({type:"constant",label:O}))),dr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(O=>({type:"type",label:O})),v=/^(\w[\w-]*|-\w[\w-]*|)$/,hr=/^-(-[\w-]*)?$/;function ur(O,e){var a;if((O.name=="("||O.type.isError)&&(O=O.parent||O),O.name!="ArgList")return!1;let t=(a=O.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:e.sliceString(t.from,t.to)=="var"}const sO=new bO,Sr=["Declaration"];function $r(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function AO(O,e,a){if(e.to-e.from>4096){let t=sO.get(e);if(t)return t;let r=[],s=new Set,i=e.cursor(ve.IncludeAnonymous);if(i.firstChild())do for(let l of AO(O,i.node,a))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return sO.set(e,r),r}else{let t=[],r=new Set;return e.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Sr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=O.sliceString(s.from,s.to);r.has(l)||(r.add(l),t.push({label:l,type:"variable"}))}}),t}}const fr=O=>e=>{let{state:a,pos:t}=e,r=j(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:fe(),validFor:v};if(r.name=="ValueName")return{from:r.from,options:iO,validFor:v};if(r.name=="PseudoClassName")return{from:r.from,options:rO,validFor:v};if(O(r)||(e.explicit||s)&&ur(r,a.doc))return{from:O(r)||s?r.from:t,options:AO(a.doc,$r(r),O),validFor:hr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:fe(),validFor:v};return{from:r.from,options:dr,validFor:v}}if(!e.explicit)return null;let i=r.resolve(t),l=i.childBefore(t);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:rO,validFor:v}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:iO,validFor:v}:i.name=="Block"||i.name=="Styles"?{from:t,options:fe(),validFor:v}:null},gr=fr(O=>O.name=="VariableName"),ce=J.define({name:"css",parser:pr.configure({props:[L.add({Declaration:C()}),F.add({"Block KeyframeList":Te})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function mr(){return new M(ce,ce.data.of({autocomplete:gr}))}const Pr=304,lO=1,Zr=2,br=305,Xr=307,xr=308,Yr=3,yr=4,kr=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],IO=125,wr=59,oO=47,vr=42,Tr=43,_r=45,Wr=new wO({start:!1,shift(O,e){return e==Yr||e==yr||e==Xr?O:e==xr},strict:!1}),Ur=new x((O,e)=>{let{next:a}=O;(a==IO||a==-1||e.context)&&O.acceptToken(br)},{contextual:!0,fallback:!0}),Cr=new x((O,e)=>{let{next:a}=O,t;kr.indexOf(a)>-1||a==oO&&((t=O.peek(1))==oO||t==vr)||a!=IO&&a!=wr&&a!=-1&&!e.context&&O.acceptToken(Pr)},{contextual:!0}),Rr=new x((O,e)=>{let{next:a}=O;if((a==Tr||a==_r)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(lO);O.acceptToken(t?lO:Zr)}},{contextual:!0}),qr=D({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),Vr={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},jr={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},zr={__proto__:null,"<":139},Gr=T.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Ji'#JiO%[QUO'#JiOOQO'#Jm'#JmOOQO'#Ia'#IaOBbQWO'#EaOOQ(CW'#E`'#E`OC^Q(C`O'#EaOChQWO'#ETOOQO'#Jl'#JlOC|QWO'#JmOEZQWO'#ETOChQWO'#EaPEhO?MpO'#C`POOO)CDp)CDpOOOO'#IW'#IWOEsOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFRO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFaO07`O,59vOOQ(CY,59v,59vOFoQUO'#I[OGSQSO'#JgOIUQbO'#JgO+}QUO'#JgOI]QSO,59|OIsQSO'#EjOJQQSO'#JuOJ]QSO'#JtOJ]QSO'#JtOJeQSO,5;WOJjQSO'#JsOOQ(CY,5:X,5:XOJqQUO,5:XOLrQ(CjO,5:cOMcQSO,5:kOM|Q(C[O'#JrONTQSO'#JqO9TQSO'#JqONiQSO'#JqONqQSO,5;VONvQSO'#JqO!#OQbO'#JfOOQ(CY'#Cg'#CgO%[QUO'#EPO!#nQ`O,5:pOOQO'#Jn'#JnOOQO-ElOOQQ'#JZ'#JZOOQQ,5>m,5>mOOQQ-ExQ(CjO,5:iOOQO,5@m,5@mO!?iQ,UO,5=WO!?wQ(C[O'#J[O9OQSO'#J[O!@YQ(C[O,59XO!@eQWO,59XO!@mQ,UO,59XO9{Q,UO,59XO!@xQSO,5;TO!AQQSO'#HYO!AcQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AkQSO,5=sO!ApQSO,5=sO!AuQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BTQWO,5=`O!B]Q,UO,5=aO!BhQSO,5=cO!BmQ`O,5=fO!BuQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!BzQSO'#HRO9{Q,UO'#HTO!CPQSO'#HTOOQQ,5=i,5=iO!CUQSO'#HUO!C^QSO'#CmO!CcQSO,58}O!CmQSO,58}O!ErQUO,58}OOQQ,58},58}O!FSQ(C[O,58}O%[QUO,58}O!H_QUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!HuQSO,5=uO`QUO,5={O`QUO,5=}O!HzQSO,5>PO`QUO,5>RO!IPQSO,5>UO!IUQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!M`QSO,5>fOOQQ,5>h,5>hO!M`QSO,5>hOOQQ,5>j,5>jO!MeQWO'#DYO%[QUO'#JiO!NSQWO'#JiO!NqQWO'#DhO# SQWO'#DhO##eQUO'#DhO##lQSO'#JhO##tQSO,5:RO##yQSO'#EnO#$XQSO'#JvO#$aQSO,5;XO#$fQWO'#DhO#$sQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#$zQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%SQSO,5@TO#%XQ!LQO,5:pOOQO-E<_-E<_O#&_Q(C`O,5:{OChQWO,5:oO#&iQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#&vQ(C[O,5:{O#'RQ(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'aQ(C[O,5:{POOO'#IU'#IUP#'uO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#(aQUO'#I[OOQO-ERQ(CjO1G0yO#?yQ(CjO1G0yO#ByQ$IUO'#CgO#DwQ$IUO1G1[O#EOQ$IUO'#JfO!,YQSO1G1bO#E`Q(CjO,5?SOOQ(CW-EeQSO1G3kO$.VQUO1G3mO$2ZQUO'#HlOOQQ1G3p1G3pO$2hQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$2pQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$6wQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$6|Q$IUO,5:SOOQO,5;Y,5;YO$7WQWO'#I]O$7nQSO,5@SOOQ(CY1G/m1G/mO$7vQWO'#IcO$8QQSO,5@bOOQ(CW1G0s1G0sO# SQWO,5:SOOQO'#I`'#I`O$8YQWO,5:nOOQ(CY,5:n,5:nO#$}QSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8aQ(C[O1G0gO$8lQ(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$8zQ(C[O1G0gOOQO1G0Z1G0ZO$9`Q(CjO1G0gPOOO-EvO$9|QSO1G5mO$:UQSO1G5zO$:^QbO1G5{O9TQSO,5>|O$:hQ(CjO1G5xO%[QUO1G5xO$:xQ(C[O1G5xO$;ZQSO1G5wO$;ZQSO1G5wO9TQSO1G5wO$;cQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$;wQSO,5?PO$$XQSO,5?POOQO-ExQ(CjO,5WOOQQ,5>W,5>WO%[QUO'#HmO%(ZQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%(`QWO1G5oO%(tQ$IUO1G0tO%)OQSO1G0tOOQO1G/n1G/nO%)ZQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EjQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9`Q(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%)eQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%)pQ(C[O7+&RO%*OQ(CjO7++dO%[QUO7++dO%*`QSO7++cO%*`QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%*hQSO1G4kOOQO7+%z7+%zO#$}QSO<xOOQO-E<[-E<[O%2^QbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%2hQSO1G5qOOQ(CY<XQ$IUO1G0yO%>`Q$IUO1G0yO%@WQ$IUO1G0yO%@kQ(CjO<XOOQQ,5>Z,5>ZO%NUQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO%NZQ$IUO1G5{O>jQSO7+%YOOQ(CY<jQSO<jQSO7+)dO&5rQSO<{AN>{O%[QUOAN?XOOQO<SQSO7++uO%LgQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&>[QSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#MzQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&>dQSOANBTOOQQ<iQSOLD,jO&>qQ$IUO7+'tO&@gQ$IUO7+'vO&B]Q,UOG26|OOQO<YOPZXYZXlZXzZX{ZX}ZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX!WZX!XZX~O#zZX~P#@sOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO#w:UO(TVO(d$ZO(k#|O(l#}O~O#z.iO~P#CQO#Y:ZO#|:ZO#z(YX!X(YX~P! UO_'[a!W'[a'm'[a'k'[a!h'[a!T'[ap'[a!Y'[a%b'[a!b'[a~P!7zOP#giY#gi_#gil#gi{#gi!W#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(T#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#,gO_#{i!W#{i'm#{i'k#{i!T#{i!h#{ip#{i!Y#{i%b#{i!b#{i~P!7zO$X.nO$Z.nO~O$X.oO$Z.oO~O!b)_O#Y.pO!Y$_X$U$_X$X$_X$Z$_X$b$_X~O!V.qO~O!Y)bO$U.sO$X)aO$Z)aO$b.tO~O!W:VO!X(XX~P#CQO!X.uO~O!b)_O$b(mX~O$b.wO~Or)qO(U)rO(V.zO~O!T/OO~P!&^O!WdX!bdX!hdX!h$tX(ddX~P!/bO!h/UO~P#,gO!W/VO!b#uO(d'gO!h(qX~O!h/[O~O!V*SO'v%`O!h(qP~O#e/^O~O!T$tX!W$tX!b${X~P!/bO!W/_O!T(rX~P#,gO!b/aO~O!T/cO~Ol/gO!b#uO!i%^O(P%RO(d'gO~O'v/iO~O!b+YO~O_%gO!W/mO'm%gO~O!X/oO~P!3`O!^/pO!_/pO'w!lO(W!mO~O}/rO(W!mO~O#U/sO~O'v&QOe'aX!W'aX~O!W*lOe(Qa~Oe/xO~Oz/yO{/yO}/zOhwa(kwa(lwa!Wwa#Ywa~Oewa#zwa~P$ hOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!^Oz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#PO#e/|O~Oe$}a!W$}a#Y$}a#z$}a~P!0kO!b#uO~O#e0PO~O!W*}O_(va'm(va~Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!oiY!oil!oi!W!oi!f!oi!m!oi#h!oi#i!oi#j!oi#k!oi#l!oi#m!oi#n!oi#o!oi#p!oi#r!oi#t!oi#v!oi#w!oi(d!oi(k!oi(l!oi~O_!oi'm!oi'k!oi!T!oi!h!oip!oi!Y!oi%b!oi!b!oi~P$$nOh.UO!Y'VO%b.TO~Oj0ZO'v0YO~P!1]O!b+YO_(Oa!Y(Oa'm(Oa!W(Oa~O#e0aO~OYZX!WdX!XdX~O!W0bO!X(zX~O!X0dO~OY0eO~O'v+bO'xTO'{UO~O!Y%wO'v%`O^'iX!W'iX~O!W+gO^(ya~O!h0jO~P!7zOY0mO~O^0nO~O#Y0qO~Oh0tO!Y$|O~O(W(tO!X(wP~Oh0}O!Y0zO%b0|O(P%RO~OY1XO!W1VO!X(xX~O!X1YO~O^1[O_%gO'm%gO~O'v#mO'xTO'{UO~O#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O#p1_O&S1`O_(YX!g(YX~P$+dO#Y$eO#p1_O&S1`O~O_1bO~P%[O_1dO~O&]1gOP&ZiQ&ZiW&Zi_&Zib&Zic&Zij&Zil&Zim&Zin&Zit&Ziv&Zix&Zi}&Zi!R&Zi!S&Zi!Y&Zi!d&Zi!i&Zi!l&Zi!m&Zi!n&Zi!p&Zi!r&Zi!u&Zi!y&Zi#q&Zi$R&Zi$V&Zi%a&Zi%c&Zi%e&Zi%f&Zi%g&Zi%j&Zi%l&Zi%o&Zi%p&Zi%r&Zi&O&Zi&U&Zi&W&Zi&Y&Zi&[&Zi&_&Zi&e&Zi&k&Zi&m&Zi&o&Zi&q&Zi&s&Zi'k&Zi'v&Zi'x&Zi'{&Zi(T&Zi(c&Zi(p&Zi!X&Zi`&Zi&b&Zi~O`1mO!X1kO&b1lO~P`O!YXO!i1oO~O&i,jOP&diQ&diW&di_&dib&dic&dij&dil&dim&din&dit&div&dix&di}&di!R&di!S&di!Y&di!d&di!i&di!l&di!m&di!n&di!p&di!r&di!u&di!y&di#q&di$R&di$V&di%a&di%c&di%e&di%f&di%g&di%j&di%l&di%o&di%p&di%r&di&O&di&U&di&W&di&Y&di&[&di&_&di&e&di&k&di&m&di&o&di&q&di&s&di'k&di'v&di'x&di'{&di(T&di(c&di(p&di!X&di&]&di`&di&b&di~O!T1uO~O!W![a!X![a~P#CQOm!nO}!oO!V1{O(W!mO!W'PX!X'PX~P@OO!W,zO!X([a~O!W'VX!X'VX~P!7SO!W,}O!X(ja~O!X2SO~P'_O_%gO#Y2]O'm%gO~O_%gO!b#uO#Y2]O'm%gO~O_%gO!b#uO!m2aO#Y2]O'm%gO(d'gO~O_%gO'm%gO~P!7zO!W$aOp$la~O!T'Oi!W'Oi~P!7zO!W'{O!T(Zi~O!W(SO!T(hi~O!T(ii!W(ii~P!7zO!W(fi!h(fi_(fi'm(fi~P!7zO#Y2cO!W(fi!h(fi_(fi'm(fi~O!W(`O!h(ei~O}%aO!Y%bO!y]O#c2hO#d2gO'v%`O~O}%aO!Y%bO#d2gO'v%`O~Oh2oO!Y'VO%b2nO~Oh2oO!Y'VO%b2nO(P%RO~O#ewaPwaYwa_walwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa'mwa(Twa(dwa!hwa!Twa'kwapwa!Ywa%bwa!bwa~P$ hO#e$maP$maY$ma_$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma'm$ma(T$ma(d$ma!h$ma!T$ma'k$map$ma!Y$ma%b$ma!b$ma~P$!^O#e$oaP$oaY$oa_$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa'm$oa(T$oa(d$oa!h$oa!T$oa'k$oap$oa!Y$oa%b$oa!b$oa~P$#PO#e$}aP$}aY$}a_$}al$}a{$}a!W$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a'm$}a(T$}a(d$}a!h$}a!T$}a'k$}a#Y$}ap$}a!Y$}a%b$}a!b$}a~P#,gO_#]q!W#]q'm#]q'k#]q!T#]q!h#]qp#]q!Y#]q%b#]q!b#]q~P!7zOe'QX!W'QX~P!'vO!W._Oe(^a~O!V2wO!W'RX!h'RX~P%[O!W.bO!h(_a~O!W.bO!h(_a~P!7zO!T2zO~O#z!ka!X!ka~PJxO#z!ca!W!ca!X!ca~P#CQO#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,gO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,gOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$I|Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$JoO(d$ZO~P#,gO!V3hO'v%`O!W']X!h']X~O!W/VO!h(qa~O!W/VO!b#uO!h(qa~O!W/VO!b#uO(d'gO!h(qa~Oe$vi!W$vi#Y$vi#z$vi~P!0kO!V3pO'v*XO!T'_X!W'_X~P!1YO!W/_O!T(ra~O!W/_O!T(ra~P#,gO!b#uO#p3xO~Ol3{O!b#uO(d'gO~Oe(Ri!W(Ri~P!0kO#Y4OOe(Ri!W(Ri~P!0kO!h4RO~O_$jq!W$jq'm$jq'k$jq!T$jq!h$jqp$jq!Y$jq%b$jq!b$jq~P!7zO!T4VO~O!W4WO!Y(sX~P#,gO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,gO!Y$|O~P#,gO!W4nO#Y4pO!X(wX~O!X4qO~Om!nO}4rO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!pO#Q!pO#R!pO#U4wO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O!X4vO~P%$nOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O'v#mO!W'gX!X'gX~O!W1VO!X(xa~O'xTO'{UO(W5VO~O^5ZO~O#p5^O&S5_O~PMhO!h5`O~P%[O_5bO~O_5bO~P%[O`1mO!X5gO&b1lO~P`O!b5iO~O!b5kO!W(]i!X(]i!b(]i!i(]i(P(]i~O!W#bi!X#bi~P#CQO#Y5lO!W#bi!X#bi~O!W![i!X![i~P#CQO_%gO#Y5uO'm%gO~O_%gO!b#uO#Y5uO'm%gO~O!W(fq!h(fq_(fq'm(fq~P!7zO!W(`O!h(eq~O}%aO!Y%bO#d5|O'v%`O~O!Y'VO%b6PO~Oh6SO!Y'VO%b6PO~O#e%YiP%YiY%Yi_%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi'm%Yi(T%Yi(d%Yi!h%Yi!T%Yi'k%Yip%Yi!Y%Yi%b%Yi!b%Yi~P$I|O#e%[iP%[iY%[i_%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i'm%[i(T%[i(d%[i!h%[i!T%[i'k%[ip%[i!Y%[i%b%[i!b%[i~P$JoO#e$viP$viY$vi_$vil$vi{$vi!W$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi'm$vi(T$vi(d$vi!h$vi!T$vi'k$vi#Y$vip$vi!Y$vi%b$vi!b$vi~P#,gOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#CQOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gil#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~O#h#gi~P%2}O#h9zO~P%2}OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O(TVOY#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~Ol#gi~P%5YOl9|O~P%5YOP$]Ol9|Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O(TVO#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P%7eOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%7eOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO(TVO#t#gi#v#gi#w#gi#z#gi(d#gi(l#gi!W#gi!X#gi~O(k#gi~P%:PO(k#|O~P%:POP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO(TVO(k#|O#v#gi#w#gi#z#gi(d#gi!W#gi!X#gi~O(l#gi~P%<[O(l#}O~P%<[OP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO(TVO(k#|O(l#}O~O#w#gi#z#gi(d#gi!W#gi!X#gi~P%>gO_#xy!W#xy'm#xy'k#xy!T#xy!h#xyp#xy!Y#xy%b#xy!b#xy~P!7zOh;mOz)vO})wO(k)yO(l){O~OP#giY#gil#gi{#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(T#gi(d#gi!W#gi!X#gi~P%A_O!g#wOP(SXY(SXh(SXl(SXz(SX{(SX}(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX#z(SX(T(SX(d(SX(k(SX(l(SX!W(SX!X(SX~O#z#{i!W#{i!X#{i~P#CQO#z!oi!X!oi~P$$nO!X6`O~O!W'[a!X'[a~P#CQO!b#uO(d'gO!W']a!h']a~O!W/VO!h(qi~O!W/VO!b#uO!h(qi~Oe$vq!W$vq#Y$vq#z$vq~P!0kO!T'_a!W'_a~P#,gO!b6gO~O!W/_O!T(ri~P#,gO!W/_O!T(ri~O!T6kO~O!b#uO#p6pO~Ol6qO!b#uO(d'gO~O!T6sO~Oe$xq!W$xq#Y$xq#z$xq~P!0kO_$jy!W$jy'm$jy'k$jy!T$jy!h$jyp$jy!Y$jy%b$jy!b$jy~P!7zO!b5kO~O!W4WO!Y(sa~O_#]y!W#]y'm#]y'k#]y!T#]y!h#]yp#]y!Y#]y%b#]y!b#]y~P!7zOY6xO~O!W0bO!X(zi~O^7OO~O(W(tO!W'dX!X'dX~O!W4nO!X(wa~OjkO'v7VO~P.iO!X7YO~P%$nOm!nO}7ZO'xTO'{UO(W!mO(c!sO~O!Y0zO~O!Y0zO%b7]O~Oh7`O!Y0zO%b7]O~OY7eO!W'ga!X'ga~O!W1VO!X(xi~O!h7iO~O!h7jO~O!h7mO~O!h7mO~P%[O_7oO~O!b7pO~O!h7qO~O!W(ii!X(ii~P#CQO_%gO#Y7yO'm%gO~O!W(fy!h(fy_(fy'm(fy~P!7zO!W(`O!h(ey~O!Y'VO%b7|O~O#e$vqP$vqY$vq_$vql$vq{$vq!W$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq'm$vq(T$vq(d$vq!h$vq!T$vq'k$vq#Y$vqp$vq!Y$vq%b$vq!b$vq~P#,gO#e$xqP$xqY$xq_$xql$xq{$xq!W$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq'm$xq(T$xq(d$xq!h$xq!T$xq'k$xq#Y$xqp$xq!Y$xq%b$xq!b$xq~P#,gO!W'Ri!h'Ri~P!7zO#z#]q!W#]q!X#]q~P#CQOz/yO{/yO}/zOPwaYwahwalwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa#zwa(Twa(dwa(kwa(lwa!Wwa!Xwa~Oz)vO})wOP$maY$mah$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma#z$ma(T$ma(d$ma(k$ma(l$ma!W$ma!X$ma~Oz)vO})wOP$oaY$oah$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa#z$oa(T$oa(d$oa(k$oa(l$oa!W$oa!X$oa~OP$}aY$}al$}a{$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a#z$}a(T$}a(d$}a!W$}a!X$}a~P%A_O#z$iq!W$iq!X$iq~P#CQO#z$jq!W$jq!X$jq~P#CQO!X8WO~O#z8XO~P!0kO!b#uO!W']i!h']i~O!b#uO(d'gO!W']i!h']i~O!W/VO!h(qq~O!T'_i!W'_i~P#,gO!W/_O!T(rq~O!T8_O~P#,gO!T8_O~Oe(Ry!W(Ry~P!0kO!W'ba!Y'ba~P#,gO_%Uq!Y%Uq'm%Uq!W%Uq~P#,gOY8dO~O!W0bO!X(zq~O#Y8hO!W'da!X'da~O!W4nO!X(wi~P#CQOPZXYZXlZXzZX{ZX}ZX!TZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!b%SX#p%SX~P&2_O!Y0zO%b8lO~O'xTO'{UO(W8qO~O!W1VO!X(xq~O!h8tO~O!h8uO~O!h8vO~O!h8vO~P%[O#Y8yO!W#by!X#by~O!W#by!X#by~P#CQO!Y'VO%b9OO~O#z#xy!W#xy!X#xy~P#CQOP$viY$vil$vi{$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi#z$vi(T$vi(d$vi!W$vi!X$vi~P%A_Oz)vO})wO(l){OP%YiY%Yih%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi#z%Yi(T%Yi(d%Yi(k%Yi!W%Yi!X%Yi~Oz)vO})wOP%[iY%[ih%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i#z%[i(T%[i(d%[i(k%[i(l%[i!W%[i!X%[i~O#z$jy!W$jy!X$jy~P#CQO#z#]y!W#]y!X#]y~P#CQO!b#uO!W']q!h']q~O!W/VO!h(qy~O!T'_q!W'_q~P#,gO!T9VO~P#,gO!W0bO!X(zy~O!W4nO!X(wq~O!Y0zO%b9^O~O!h9aO~O!Y'VO%b9fO~OP$vqY$vql$vq{$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq#z$vq(T$vq(d$vq!W$vq!X$vq~P%A_OP$xqY$xql$xq{$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq#z$xq(T$xq(d$xq!W$xq!X$xq~P%A_Oe%^!Z!W%^!Z#Y%^!Z#z%^!Z~P!0kO!W'dq!X'dq~P#CQO!W#b!Z!X#b!Z~P#CQO#e%^!ZP%^!ZY%^!Z_%^!Zl%^!Z{%^!Z!W%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z'm%^!Z(T%^!Z(d%^!Z!h%^!Z!T%^!Z'k%^!Z#Y%^!Zp%^!Z!Y%^!Z%b%^!Z!b%^!Z~P#,gOP%^!ZY%^!Zl%^!Z{%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z#z%^!Z(T%^!Z(d%^!Z!W%^!Z!X%^!Z~P%A_Op(XX~P1qO'w!lO~P!*SO!TdX!WdX#YdX~P&2_OPZXYZXlZXzZX{ZX}ZX!WZX!WdX!fZX!gZX!iZX!mZX#YZX#YdX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!bdX!hZX!hdX(ddX~P&GuOP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!YXO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O!W:VO!X$la~Oj%SOl$tOm$sOn$sOt%TOv%UOx:]O}${O!Y$|O!d;gO!i$xO#d:cO$R%YO$n:_O$p:aO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#q)]O~P&LkO!XZX!XdX~P&GuO#e9yO~O!b#uO#e9yO~O#Y:ZO~O#p:OO~O#Y:eO!W(iX!X(iX~O#Y:ZO!W(gX!X(gX~O#e:fO~Oe:hO~P!0kO#e:mO~O#e:nO~O!b#uO#e:oO~O!b#uO#e:fO~O#z:pO~P#CQO#e:qO~O#e:rO~O#e:sO~O#e:tO~O#e:uO~O#e:vO~O#z:wO~P!0kO#z:xO~P!0kO$V~!g!}#O#Q#R#U#c#d#o(p$n$p$s%V%a%b%c%j%l%o%p%r%t~'qR$V(p#i!S'o'w#jm#h#klz'p(W'p'v$X$Z$X~",goto:"$'R)OPPPP)PPP)SP)eP*t.xPPPP5YPP5pP;l>sP?WP?WPPP?WP@xP?WP?WP?WP@|PPARPAlPFdPPPFhPPPPFhIiPPPIoJjPFhPLxPPPP! WFhPPPFhPFhP!#fFhP!&z!'|!(VP!(y!(}!(yPPPPP!,Y!'|PP!,v!-pP!0dFhFh!0i!3s!8Y!8Y!wP#@W#@_#@gPPPP#Du#Gl#NT#NW#NZ$ S$ V$ Y$ a$ iPP$ o$ s$!k$#j$#n$$SPP$$W$$^$$bP$$e$$i$$l$%b$%y$&b$&f$&i$&l$&r$&u$&y$&}R!{RoqOXst!Z#c%f&i&k&l&n,b,g1g1jY!uQ'V-S0z4uQ%lvQ%tyQ%{|Q&a!VS&}!e,zQ']!iS'c!r!xS*_$|*dQ+`%uQ+m%}Q,R&ZQ-Q'UQ-['^Q-d'dQ/p*fQ1U,SR:d9u%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7yS#p]9r!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ*o%VQ+e%wQ,T&^Q,[&fQ.X:[Q0W+WQ0[+YQ0g+fQ1^,YQ2k.UQ4`0bQ5T1VQ6R2oQ6X:]Q6z4aR8P6S&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;ct!nQ!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4w$^$si#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ&O|Q&{!eS'R%b,}Q+e%wQ/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5W1XQ5X1[Q6z4aQ6}4fQ7h5ZQ8g7OR8r7ernOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR,V&b&v^OPXYstuvwz!Z!`!g!j!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;b;c[#[WZ#V#Y'O'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q%oxQ%syS%x|%}Q&U!TQ'Y!hQ'[!iQ(g#rS*R$x*VS+_%t%uQ+c%wQ+|&XQ,Q&ZS-Z']'^Q.W(hQ/Z*SQ0`+`Q0f+fQ0h+gQ0k+kQ1P+}S1T,R,SQ2X-[Q3g/VQ4_0bQ4c0eQ4h0mQ5S1UQ6d3hQ6y4aQ6|4eQ8c6xR9X8dv$zi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i!S%qy!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zQ+X%oQ+r&RQ+u&SQ,P&ZQ.V(gQ1O+|U1S,Q,R,SQ2p.WQ4}1PS5R1T1UQ7d5S#O;d#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg;e:X:Y:_:a:c:j:l:n:r:t:xW%Pi%R*l;`S&R!Q&`Q&S!RQ&T!SR+p&P$_%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mT)r$u)sV*p%V:[:]U'R!e%b,}S(u#y#zQ+j%zS.P(c(dQ0u+vQ4P/yR7S4n&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c$i$`c#X#d%j%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.j.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VT#SV#T&}kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ'P!eR1|,zv!nQ!e!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4wS*^$|*dS/h*_*fQ/q*gQ0w+xQ3z/pR3}/snqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&p!^Q'm!wS(i#t9yQ+]%rQ+z&UQ+{&WQ-X'ZQ-f'fS.](n:fS0O*x:oQ0^+^Q0y+yQ1n,iQ1p,jQ1x,uQ2V-YQ2Y-^S4U0P:uQ4Z0_S4^0a:vQ5m1zQ5q2WQ5v2_Q6w4[Q7t5oQ7u5rQ7x5wR8x7q$d$_c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(f#o'`U*i$}(m3ZS+S%j.jQ2l0WQ6O2kQ8O6RR9P8P$d$^c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(e#o'`S(w#z$_S+R%j.jS.Q(d(fQ.m)XQ0T+SR2i.R&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS#p]9rQ&k!XQ&l!YQ&n![Q&o!]R1f,eQ'W!hQ+U%oQ-V'YS.S(g+XQ2T-UW2m.V.W0V0XQ5p2UU5}2j2l2pS7{6O6QS8}7}8OS9d8|9PQ9l9eR9o9mU!vQ'V-ST4s0z4u!Q_OXZ`st!V!Z#c#g%^%f&`&b&i&k&l&n(`,b,g-y1g1j]!pQ!r'V-S0z4uT#p]9r%Y{OPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS(u#y#zS.P(c(d!s:|$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cY!tQ'V-S0z4uQ'b!rS'l!u!xS'n!y4wS-c'c'dQ-e'eR2`-dQ'k!tS([#f1aS-b'b'nQ/Y*RQ/f*^Q2a-eQ3l/ZS3u/g/qQ6c3gS6n3{3}Q8Z6dR8b6qQ#vbQ'j!tS(Z#f1aS(]#l*wQ*y%_Q+Z%pQ+a%vU-a'b'k'nQ-u([Q/X*RQ/e*^Q/k*aQ0]+[Q1Q,OS2^-b-eQ2f-}S3k/Y/ZS3t/f/qQ3w/jQ3y/lQ5P1RQ5x2aQ6b3gQ6f3lS6j3u3}Q6o3|Q7b5QS8Y6c6dQ8^6kQ8`6nQ8o7cQ9T8ZQ9U8_Q9W8bQ9`8pQ9h9VQ;P:zQ;[;TR;];UV!vQ'V-S%YaOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS#vz!j!r:y$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;P;b%YbOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yQ%_j!S%py!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zS%vz!jQ+[%qQ,O&ZW1R,P,Q,R,SU5Q1S1T1US7c5R5SQ8p7d!r:z$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ;T;aR;U;b$|eOPXYstuvw!Z!`!g!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yY#aWZ#V#Y'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q,]&f!p:{$[$m)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;O'OS'S!e%bR2O,}%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7y!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ,[&fQ0W+WQ2k.UQ6R2oR8P6S!f$Uc#X%j'x(O(j(q)Q)R)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!T:Q)V)h,x.j1v1y2{3T3U3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!b$Wc#X%j'x(O(j(q)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!P:S)V)h,x.j1v1y2{3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!^$[c#X%j'x(O(j(q)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9sQ3f/Tz;c)V)h,x.j1v1y2{3[3b5n6W6]6^7U7s8Q8U8V9Z9b;VQ;h;jR;i;k&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS$nh$oR3_.p'TgOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$jf$pQ$hfS)a$k)eR)m$pT$if$pT)c$k)e'ThOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$nh$oQ$qhR)l$o%YjOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7y!s;a$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c#clOPXZst!Z!`!o#R#c#n#{$m%f&b&e&f&i&k&l&n&r&z'X(v)j*|+W,_,b,g-W.U.q/z0}1_1`1b1d1g1j1l2o3^4r4|5^5_5b6S7Z7`7ov$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mQ*t%ZQ.|)vg3Z:X:Y:_:a:c:j:l:n:r:t:xv$yi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;iQ*W$zS*a$|*dQ*u%[Q/l*b#O;R#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mf;S:X:Y:_:a:c:j:l:n:r:t:xQ;W;dQ;X;eQ;Y;fR;Z;gv$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg3Z:X:Y:_:a:c:j:l:n:r:t:xnoOXst!Z#c%f&i&k&l&n,b,g1g1jQ*Z${Q,p&uQ,q&wR3o/_$^%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ+s&SQ0s+uQ4l0rR7R4mT*c$|*dS*c$|*dT4t0z4uS/j*`4rT3|/r7ZQ+Z%pQ/k*aQ0]+[Q1Q,OQ5P1RQ7b5QQ8o7cR9`8pn)z$v(o*v/]/t/u2t3m4S6a6r9S;Q;^;_!Y:i(k)[*Q*Y.[.x.}/T/b0U0p0r2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k]:j3Y6[8R9Q9R9pp)|$v(o*v/R/]/t/u2t3m4S6a6r9S;Q;^;_![:k(k)[*Q*Y.[.x.}/T/b0U0p0r2q2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k_:l3Y6[8R8S9Q9R9prnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ&]!UR,_&frnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR&]!UQ+w&TR0o+psnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ0{+|S4z1O1PU7[4x4y4}S8k7^7_S9[8j8mQ9i9]R9n9jQ&d!VR,W&`R5W1XS%x|%}R0h+gQ&i!WR,b&jR,h&oT1h,g1jR,l&pQ,k&pR1q,lQ'p!zR-h'pSsOtQ#cXT%is#cQ!}TR'r!}Q#QUR't#QQ)s$uR.y)sQ#TVR'v#TQ#WWU'|#W'}-oQ'}#XR-o(OQ,{'PR1},{Q.`(oR2u.`Q.c(qS2x.c2yR2y.dQ-S'VR2R-SY!rQ'V-S0z4uR'a!rS#^W%aU(T#^(U-pQ(U#_R-p(PQ-O'SR2P-Ot`OXst!V!Z#c%f&`&b&i&k&l&n,b,g1g1jS#gZ%^U#q`#g-yR-y(`Q(a#iQ-v(]W.O(a-v2d5zQ2d-wR5z2eQ)e$kR.r)eQ$ohR)k$oQ$bcU)Z$b-k:WQ-k9sR:W)hQ/W*RW3i/W3j6e8[U3j/X/Y/ZS6e3k3lR8[6f#o)x$v(k(o)[*Q*Y*q*r*v.Y.Z.[.x.}/R/S/T/]/b/t/u0U0p0r2q2r2s2t3Y3m3n3r4S4k4m6T6U6Y6Z6[6a6h6l6r6t6v8R8S8T8]8a9Q9R9S9g9p;Q;^;_;j;kQ/`*YU3q/`3s6iQ3s/bR6i3rQ*d$|R/n*dQ*m%QR/w*mQ4X0UR6u4XQ+O%dR0S+OQ4o0uS7T4o8iR8i7UQ+y&UR0x+yQ4u0zR7X4uQ1W,TS5U1W7fR7f5WQ0c+cW4b0c4d6{8eQ4d0fQ6{4cR8e6|Q+h%xR0i+hQ1j,gR5f1jYrOXst#cQ&m!ZQ+Q%fQ,a&iQ,c&kQ,d&lQ,f&nQ1e,bS1h,g1jR5e1gQ%hpQ&q!_Q&t!aQ&v!bQ&x!cQ'h!tQ+P%eQ+]%rQ+o&OQ,V&dQ,n&sW-_'b'j'k'nQ-f'fQ/m*cQ0^+^S1Z,W,ZQ1r,mQ1s,pQ1t,qQ2Y-^W2[-a-b-e-gQ4Z0_Q4g0lQ4j0pQ5O1QQ5Y1]Q5d1fU5s2Z2^2aQ5v2_Q6w4[Q7P4iQ7Q4kQ7W4tQ7a5PQ7g5XS7v5t5xQ7x5wQ8f6}Q8n7bQ8s7hQ8z7wQ9Y8gQ9_8oQ9c8{R9k9`Q%ryQ'Z!iQ'f!tU+^%s%t%uQ,u&|U-Y'[']'^S-^'b'lQ/d*^S0_+_+`Q1z,wS2W-Z-[Q2_-cQ3v/hQ4[0`Q5o2QQ5r2XQ5w2`R6m3zS$wi;`R*n%RU%Qi%R;`R/v*lQ$viS(k#u+YQ(o#wS)[$c$dQ*Q$xQ*Y${Q*q%WQ*r%XQ*v%]Q.Y:^Q.Z:`Q.[:bQ.x)qS.})w/PQ/R)zQ/S)|Q/T)}Q/]*UQ/b*[Q/t*jQ/u*kh0U+V.T0|2n4{6P7]7|8l9O9^9fQ0p+qQ0r+tQ2q:iQ2r:kQ2s:mQ2t._S3Y:X:YQ3m/^Q3n/_Q3r/aQ4S/|Q4k0qQ4m0tQ6T:qQ6U:sQ6Y:_Q6Z:aQ6[:cQ6a3fQ6h3pQ6l3xQ6r4OQ6t4WQ6v4YQ8R:nQ8S:jQ8T:lQ8]6gQ8a6pQ9Q:rQ9R:tQ9S8XQ9g:wQ9p:xQ;Q;`Q;^;hQ;_;iQ;j;lR;k;mnpOXst!Z#c%f&i&k&l&n,b,g1g1jQ!fPS#eZ#nQ&s!`U'_!o4r7ZQ'u#RQ(x#{Q)i$mS,Z&b&eQ,`&fQ,m&rQ,r&zQ-U'XQ.f(vQ.v)jQ0Q*|Q0X+WQ1c,_Q2U-WQ2l.UQ3a.qQ4Q/zQ4y0}Q5[1_Q5]1`Q5a1bQ5c1dQ5h1lQ6O2oQ6_3^Q7_4|Q7k5^Q7l5_Q7n5bQ8O6SQ8m7`R8w7o#WcOPXZst!Z!`!o#c#n#{%f&b&e&f&i&k&l&n&r&z'X(v*|+W,_,b,g-W.U/z0}1_1`1b1d1g1j1l2o4r4|5^5_5b6S7Z7`7oQ#XWQ#dYQ%juQ%kvS%mw!gS'x#V'{Q(O#YQ(j#tQ(q#xQ(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)T$YQ)V$[Q)Y$aQ)^$eW)h$m)j.q3^Q+T%lQ+i%yS,x'O1{Q-g'iS-l'y-nQ-q(RQ-s(YQ.^(nQ.d(rQ.h9qQ.j9tQ.k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:367,context:Wr,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[qr],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'yp'|!b'o(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'z#S$e&j'p(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'yp'|!b'p(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'x$(n$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'|!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'yp'|!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS'|!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'ypOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'ypOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'yp'|!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j'|!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Vr[O]||-1},{term:330,get:O=>jr[O]||-1},{term:68,get:O=>zr[O]||-1}],tokenPrec:12827}),NO=[P("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),P("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),P("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),P("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),P("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),P(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-19103f76.js b/ui/dist/assets/ConfirmEmailChangeDocs-036e7a03.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-19103f76.js rename to ui/dist/assets/ConfirmEmailChangeDocs-036e7a03.js index 439d384d..210e8327 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-19103f76.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-036e7a03.js @@ -1,4 +1,4 @@ -import{S as $e,i as Pe,s as Se,O as Y,e as r,w as v,b as k,c as ge,f as b,g as d,h as o,m as ve,x as j,P as ue,Q as we,k as Oe,R as Re,n as Te,t as x,a as ee,o as m,d as Ce,C as ye,p as Ee,r as H,u as Be,N as qe}from"./index-aec9c817.js";import{S as Ae}from"./SdkTabs-065ad731.js";function be(n,l,s){const a=n.slice();return a[5]=l[s],a}function _e(n,l,s){const a=n.slice();return a[5]=l[s],a}function he(n,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),o(s,_),o(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ke(n,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){s=r("div"),ge(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),ve(a,s,null),o(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(x(a.$$.fragment,i),u=!0)},o(i){ee(a.$$.fragment,i),u=!1},d(i){i&&m(s),Ce(a)}}}function Ue(n){var de,me;let l,s,a=n[0].name+"",_,u,i,p,f,C,$,D=n[0].name+"",F,te,I,P,L,R,Q,S,N,le,K,T,se,z,M=n[0].name+"",G,ae,J,y,V,E,X,B,Z,w,q,g=[],ne=new Map,oe,A,h=[],ie=new Map,O;P=new Ae({props:{js:` +import{S as $e,i as Pe,s as Se,O as Y,e as r,w as v,b as k,c as ge,f as b,g as d,h as o,m as ve,x as j,P as ue,Q as we,k as Oe,R as Re,n as Te,t as x,a as ee,o as m,d as Ce,C as ye,p as Ee,r as H,u as Be,N as qe}from"./index-9f490143.js";import{S as Ae}from"./SdkTabs-f8951db6.js";function be(n,l,s){const a=n.slice();return a[5]=l[s],a}function _e(n,l,s){const a=n.slice();return a[5]=l[s],a}function he(n,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),o(s,_),o(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ke(n,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){s=r("div"),ge(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),ve(a,s,null),o(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(x(a.$$.fragment,i),u=!0)},o(i){ee(a.$$.fragment,i),u=!1},d(i){i&&m(s),Ce(a)}}}function Ue(n){var de,me;let l,s,a=n[0].name+"",_,u,i,p,f,C,$,D=n[0].name+"",F,te,I,P,L,R,Q,S,N,le,K,T,se,z,M=n[0].name+"",G,ae,J,y,V,E,X,B,Z,w,q,g=[],ne=new Map,oe,A,h=[],ie=new Map,O;P=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-86e54f25.js b/ui/dist/assets/ConfirmPasswordResetDocs-1b30e67d.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-86e54f25.js rename to ui/dist/assets/ConfirmPasswordResetDocs-1b30e67d.js index 5b1c8a59..ad31ee50 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-86e54f25.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-1b30e67d.js @@ -1,4 +1,4 @@ -import{S as Re,i as Oe,s as Ce,O as K,e as r,w,b as h,c as ge,f as b,g as d,h as n,m as Pe,x as U,P as _e,Q as Ne,k as We,R as $e,n as Ee,t as ee,a as te,o as p,d as Se,C as ye,p as Ae,r as j,u as Te,N as De}from"./index-aec9c817.js";import{S as qe}from"./SdkTabs-065ad731.js";function ke(o,s,l){const a=o.slice();return a[5]=s[l],a}function he(o,s,l){const a=o.slice();return a[5]=s[l],a}function ve(o,s){let l,a=s[5].code+"",_,u,i,f;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=w(a),u=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(g,P){d(g,l,P),n(l,_),n(l,u),i||(f=Te(l,"click",m),i=!0)},p(g,P){s=g,P&4&&a!==(a=s[5].code+"")&&U(_,a),P&6&&j(l,"active",s[1]===s[5].code)},d(g){g&&p(l),i=!1,f()}}}function we(o,s){let l,a,_,u;return a=new De({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ge(a.$$.fragment),_=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(i,f){d(i,l,f),Pe(a,l,null),n(l,_),u=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[5].body),a.$set(m),(!u||f&6)&&j(l,"active",s[1]===s[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&p(l),Se(a)}}}function Be(o){var fe,me;let s,l,a=o[0].name+"",_,u,i,f,m,g,P,q=o[0].name+"",H,se,le,L,Q,S,z,N,G,R,B,ae,M,W,ne,J,F=o[0].name+"",V,oe,X,$,Y,E,Z,y,x,O,A,v=[],ie=new Map,ce,T,k=[],re=new Map,C;S=new qe({props:{js:` +import{S as Re,i as Oe,s as Ce,O as K,e as r,w,b as h,c as ge,f as b,g as d,h as n,m as Pe,x as U,P as _e,Q as Ne,k as We,R as $e,n as Ee,t as ee,a as te,o as p,d as Se,C as ye,p as Ae,r as j,u as Te,N as De}from"./index-9f490143.js";import{S as qe}from"./SdkTabs-f8951db6.js";function ke(o,s,l){const a=o.slice();return a[5]=s[l],a}function he(o,s,l){const a=o.slice();return a[5]=s[l],a}function ve(o,s){let l,a=s[5].code+"",_,u,i,f;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=w(a),u=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(g,P){d(g,l,P),n(l,_),n(l,u),i||(f=Te(l,"click",m),i=!0)},p(g,P){s=g,P&4&&a!==(a=s[5].code+"")&&U(_,a),P&6&&j(l,"active",s[1]===s[5].code)},d(g){g&&p(l),i=!1,f()}}}function we(o,s){let l,a,_,u;return a=new De({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ge(a.$$.fragment),_=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(i,f){d(i,l,f),Pe(a,l,null),n(l,_),u=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[5].body),a.$set(m),(!u||f&6)&&j(l,"active",s[1]===s[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&p(l),Se(a)}}}function Be(o){var fe,me;let s,l,a=o[0].name+"",_,u,i,f,m,g,P,q=o[0].name+"",H,se,le,L,Q,S,z,N,G,R,B,ae,M,W,ne,J,F=o[0].name+"",V,oe,X,$,Y,E,Z,y,x,O,A,v=[],ie=new Map,ce,T,k=[],re=new Map,C;S=new qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmVerificationDocs-67060e24.js b/ui/dist/assets/ConfirmVerificationDocs-6f5834ff.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-67060e24.js rename to ui/dist/assets/ConfirmVerificationDocs-6f5834ff.js index 92358284..5cdff820 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-67060e24.js +++ b/ui/dist/assets/ConfirmVerificationDocs-6f5834ff.js @@ -1,4 +1,4 @@ -import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-aec9c817.js";import{S as Ae}from"./SdkTabs-065ad731.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` +import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-9f490143.js";import{S as Ae}from"./SdkTabs-f8951db6.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/CreateApiDocs-21fe1a54.js b/ui/dist/assets/CreateApiDocs-60d7d195.js similarity index 98% rename from ui/dist/assets/CreateApiDocs-21fe1a54.js rename to ui/dist/assets/CreateApiDocs-60d7d195.js index a890273d..95210918 100644 --- a/ui/dist/assets/CreateApiDocs-21fe1a54.js +++ b/ui/dist/assets/CreateApiDocs-60d7d195.js @@ -1,4 +1,4 @@ -import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-aec9c817.js";import{S as At}from"./SdkTabs-065ad731.js";import{F as Bt}from"./FieldsQueryParam-72392a2a.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
Optional username
String The username of the auth record. +import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-9f490143.js";import{S as At}from"./SdkTabs-f8951db6.js";import{F as Bt}from"./FieldsQueryParam-fb32761b.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
Optional username
String The username of the auth record.
If not set, it will be auto generated.`,f=u(),m=i("tr"),c=i("td"),p=i("div"),F.c(),y=u(),S=i("span"),S.textContent="email",T=u(),w=i("td"),w.innerHTML='String',H=u(),D=i("td"),D.textContent="Auth record email address.",E=u(),P=i("tr"),P.innerHTML='
Optional emailVisibility
Boolean Whether to show/hide the auth record email when fetching the record data.',I=u(),j=i("tr"),j.innerHTML='
Required password
String Auth record password.',B=u(),$=i("tr"),$.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',N=u(),q=i("tr"),q.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
diff --git a/ui/dist/assets/DeleteApiDocs-3b1ae28b.js b/ui/dist/assets/DeleteApiDocs-6483c004.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-3b1ae28b.js rename to ui/dist/assets/DeleteApiDocs-6483c004.js index 065e281a..32c12896 100644 --- a/ui/dist/assets/DeleteApiDocs-3b1ae28b.js +++ b/ui/dist/assets/DeleteApiDocs-6483c004.js @@ -1,4 +1,4 @@ -import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-aec9c817.js";import{S as He}from"./SdkTabs-065ad731.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` +import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-9f490143.js";import{S as He}from"./SdkTabs-f8951db6.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/FieldsQueryParam-72392a2a.js b/ui/dist/assets/FieldsQueryParam-fb32761b.js similarity index 95% rename from ui/dist/assets/FieldsQueryParam-72392a2a.js rename to ui/dist/assets/FieldsQueryParam-fb32761b.js index d0cd55fa..ac521731 100644 --- a/ui/dist/assets/FieldsQueryParam-72392a2a.js +++ b/ui/dist/assets/FieldsQueryParam-fb32761b.js @@ -1,4 +1,4 @@ -import{S as L,i as S,s as k,N as E,e as s,b as o,w as $,c as F,f as H,g as M,h as e,m as T,y as q,t as N,a as B,o as I,d as J}from"./index-aec9c817.js";function O(v){let t,i,x,p,g,n,a,h,c,_,r,b,f,y,u,C,m,d;return r=new E({props:{content:` +import{S as L,i as S,s as k,N as E,e as s,b as o,w as $,c as F,f as H,g as M,h as e,m as T,y as q,t as N,a as B,o as I,d as J}from"./index-9f490143.js";function O(v){let t,i,x,p,g,n,a,h,c,_,r,b,f,y,u,C,m,d;return r=new E({props:{content:` ?fields=*,expand.relField.name `}}),{c(){t=s("tr"),i=s("td"),i.textContent="fields",x=o(),p=s("td"),p.innerHTML='String',g=o(),n=s("td"),a=s("p"),h=$(`Comma separated string of the fields to return in the JSON response `),c=s("em"),c.textContent="(by default returns all fields)",_=$(`. Ex.: diff --git a/ui/dist/assets/FilterAutocompleteInput-67803140.js b/ui/dist/assets/FilterAutocompleteInput-4cde62df.js similarity index 99% rename from ui/dist/assets/FilterAutocompleteInput-67803140.js rename to ui/dist/assets/FilterAutocompleteInput-4cde62df.js index 8d4f83c7..e566bd81 100644 --- a/ui/dist/assets/FilterAutocompleteInput-67803140.js +++ b/ui/dist/assets/FilterAutocompleteInput-4cde62df.js @@ -1 +1 @@ -import{S as se,i as ae,s as le,e as ue,f as ce,g as de,y as M,o as fe,J as he,K as ge,L as pe,I as ye,C as f,M as ke}from"./index-aec9c817.js";import{E as K,a as C,h as xe,b as me,c as be,d as we,e as Ee,s as Se,f as Ke,g as Ce,r as qe,i as Re,k as Le,j as Ie,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as L,S as Me,t as De}from"./index-808c8630.js";function He(e){Z(e,"start");var r={},n=e.languageData||{},p=!1;for(var y in e)if(y!=n&&e.hasOwnProperty(y))for(var h=r[y]=[],s=e[y],i=0;i2&&s.token&&typeof s.token!="string"){n.pending=[];for(var a=2;a-1)return null;var y=n.indent.length-1,h=e[n.state];e:for(;;){for(var s=0;sn(21,p=t));const y=pe();let{id:h=""}=r,{value:s=""}=r,{disabled:i=!1}=r,{placeholder:l=""}=r,{baseCollection:a=null}=r,{singleLine:m=!1}=r,{extraAutocompleteKeys:I=[]}=r,{disableRequestKeys:w=!1}=r,{disableIndirectCollectionsKeys:E=!1}=r,d,b,A=i,D=new L,H=new L,F=new L,T=new L,q=[],U=[],W=[],N=[],R="",B="";function O(){d==null||d.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{q=$(p),N=ee(),U=w?[]:te(),W=E?[]:ne()},300)}function $(t){let o=t.slice();return a&&f.pushOrReplaceByKey(o,a,"id"),o}function J(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0}))}function P(){if(!h)return;const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.removeEventListener("click",O)}function V(){if(!h)return;P();const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.addEventListener("click",O)}function S(t,o="",c=0){var x,z,Q;let g=q.find(k=>k.name==t||k.id==t);if(!g||c>=4)return[];let u=f.getAllCollectionIdentifiers(g,o);for(const k of(g==null?void 0:g.schema)||[]){const v=o+k.name;if(k.type==="relation"&&((x=k.options)!=null&&x.collectionId)){const X=S(k.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}k.type==="select"&&((z=k.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=k.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(k.type)&&u.push(v+":length")}return u}function ee(){return S(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.headers."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const o=q.filter(g=>g.type==="auth");for(const g of o){const u=S(g.id,"@request.auth.");for(const x of u)f.pushUnique(t,x)}const c=["created","updated"];if(a!=null&&a.id){const g=S(a.name,"@request.data.");for(const u of g){t.push(u);const x=u.split(".");x.length===3&&x[2].indexOf(":")===-1&&!c.includes(x[2])&&t.push(u+":isset")}}return t}function ne(){const t=[];for(const o of q){const c="@collection."+o.name+".",g=S(o.name,c);for(const u of g)t.push(u)}return t}function re(t=!0,o=!0){let c=[].concat(I);return c=c.concat(N||[]),t&&(c=c.concat(U||[])),o&&(c=c.concat(W||[])),c.sort(function(g,u){return u.length-g.length}),c}function ie(t){let o=t.matchBefore(/[\'\"\@\w\.]*/);if(o&&o.from==o.to&&!t.explicit)return null;let c=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];E||c.push({label:"@collection.*",apply:"@collection."});const g=re(!w,!w&&o.text.startsWith("@c"));for(const u of g)c.push({label:u.endsWith(".")?u+"*":u,apply:u});return{from:o.from,options:c}}function G(){return Me.define(He({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:f.escapeRegExp("@now"),token:"keyword"},{regex:f.escapeRegExp("@second"),token:"keyword"},{regex:f.escapeRegExp("@minute"),token:"keyword"},{regex:f.escapeRegExp("@hour"),token:"keyword"},{regex:f.escapeRegExp("@year"),token:"keyword"},{regex:f.escapeRegExp("@day"),token:"keyword"},{regex:f.escapeRegExp("@month"),token:"keyword"},{regex:f.escapeRegExp("@weekday"),token:"keyword"},{regex:f.escapeRegExp("@todayStart"),token:"keyword"},{regex:f.escapeRegExp("@todayEnd"),token:"keyword"},{regex:f.escapeRegExp("@monthStart"),token:"keyword"},{regex:f.escapeRegExp("@monthEnd"),token:"keyword"},{regex:f.escapeRegExp("@yearStart"),token:"keyword"},{regex:f.escapeRegExp("@yearEnd"),token:"keyword"},{regex:f.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:o=>{m&&y("submit",s)}};return V(),n(11,d=new K({parent:b,state:C.create({doc:s,extensions:[xe(),me(),be(),we(),Ee(),C.allowMultipleSelections.of(!0),Se(De,{fallback:!0}),Ke(),Ce(),qe(),Re(),Le.of([t,...Ie,...Ae,Be.find(o=>o.key==="Mod-d"),...Oe,..._e]),K.lineWrapping,ve({override:[ie],icons:!1}),T.of(Y(l)),H.of(K.editable.of(!i)),F.of(C.readOnly.of(i)),D.of(G()),C.transactionFilter.of(o=>m&&o.newDoc.lines>1?[]:o),K.updateListener.of(o=>{!o.docChanged||i||(n(1,s=o.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),d==null||d.destroy()}});function oe(t){ke[t?"unshift":"push"](()=>{b=t,n(0,b)})}return e.$$set=t=>{"id"in t&&n(2,h=t.id),"value"in t&&n(1,s=t.value),"disabled"in t&&n(3,i=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,m=t.singleLine),"extraAutocompleteKeys"in t&&n(7,I=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,w=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,E=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,R=Pe(a)),e.$$.dirty[0]&25352&&!i&&(B!=R||w!==-1||E!==-1)&&(n(14,B=R),j()),e.$$.dirty[0]&4&&h&&V(),e.$$.dirty[0]&2080&&d&&a!=null&&a.schema&&d.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&d&&A!=i&&(d.dispatch({effects:[H.reconfigure(K.editable.of(!i)),F.reconfigure(C.readOnly.of(i))]}),n(12,A=i),J()),e.$$.dirty[0]&2050&&d&&s!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:s}}),e.$$.dirty[0]&2064&&d&&typeof l<"u"&&d.dispatch({effects:[T.reconfigure(Y(l))]})},[b,s,h,i,l,a,m,I,w,E,O,d,A,R,B,oe]}class Qe extends se{constructor(r){super(),ae(this,r,Ve,Je,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Qe as default}; +import{S as se,i as ae,s as le,e as ue,f as ce,g as de,y as M,o as fe,J as he,K as ge,L as pe,I as ye,C as f,M as ke}from"./index-9f490143.js";import{E as K,a as C,h as xe,b as me,c as be,d as we,e as Ee,s as Se,f as Ke,g as Ce,r as qe,i as Re,k as Le,j as Ie,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as L,S as Me,t as De}from"./index-808c8630.js";function He(e){Z(e,"start");var r={},n=e.languageData||{},p=!1;for(var y in e)if(y!=n&&e.hasOwnProperty(y))for(var h=r[y]=[],s=e[y],i=0;i2&&s.token&&typeof s.token!="string"){n.pending=[];for(var a=2;a-1)return null;var y=n.indent.length-1,h=e[n.state];e:for(;;){for(var s=0;sn(21,p=t));const y=pe();let{id:h=""}=r,{value:s=""}=r,{disabled:i=!1}=r,{placeholder:l=""}=r,{baseCollection:a=null}=r,{singleLine:m=!1}=r,{extraAutocompleteKeys:I=[]}=r,{disableRequestKeys:w=!1}=r,{disableIndirectCollectionsKeys:E=!1}=r,d,b,A=i,D=new L,H=new L,F=new L,T=new L,q=[],U=[],W=[],N=[],R="",B="";function O(){d==null||d.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{q=$(p),N=ee(),U=w?[]:te(),W=E?[]:ne()},300)}function $(t){let o=t.slice();return a&&f.pushOrReplaceByKey(o,a,"id"),o}function J(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0}))}function P(){if(!h)return;const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.removeEventListener("click",O)}function V(){if(!h)return;P();const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.addEventListener("click",O)}function S(t,o="",c=0){var x,z,Q;let g=q.find(k=>k.name==t||k.id==t);if(!g||c>=4)return[];let u=f.getAllCollectionIdentifiers(g,o);for(const k of(g==null?void 0:g.schema)||[]){const v=o+k.name;if(k.type==="relation"&&((x=k.options)!=null&&x.collectionId)){const X=S(k.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}k.type==="select"&&((z=k.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=k.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(k.type)&&u.push(v+":length")}return u}function ee(){return S(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.headers."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const o=q.filter(g=>g.type==="auth");for(const g of o){const u=S(g.id,"@request.auth.");for(const x of u)f.pushUnique(t,x)}const c=["created","updated"];if(a!=null&&a.id){const g=S(a.name,"@request.data.");for(const u of g){t.push(u);const x=u.split(".");x.length===3&&x[2].indexOf(":")===-1&&!c.includes(x[2])&&t.push(u+":isset")}}return t}function ne(){const t=[];for(const o of q){const c="@collection."+o.name+".",g=S(o.name,c);for(const u of g)t.push(u)}return t}function re(t=!0,o=!0){let c=[].concat(I);return c=c.concat(N||[]),t&&(c=c.concat(U||[])),o&&(c=c.concat(W||[])),c.sort(function(g,u){return u.length-g.length}),c}function ie(t){let o=t.matchBefore(/[\'\"\@\w\.]*/);if(o&&o.from==o.to&&!t.explicit)return null;let c=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];E||c.push({label:"@collection.*",apply:"@collection."});const g=re(!w,!w&&o.text.startsWith("@c"));for(const u of g)c.push({label:u.endsWith(".")?u+"*":u,apply:u});return{from:o.from,options:c}}function G(){return Me.define(He({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:f.escapeRegExp("@now"),token:"keyword"},{regex:f.escapeRegExp("@second"),token:"keyword"},{regex:f.escapeRegExp("@minute"),token:"keyword"},{regex:f.escapeRegExp("@hour"),token:"keyword"},{regex:f.escapeRegExp("@year"),token:"keyword"},{regex:f.escapeRegExp("@day"),token:"keyword"},{regex:f.escapeRegExp("@month"),token:"keyword"},{regex:f.escapeRegExp("@weekday"),token:"keyword"},{regex:f.escapeRegExp("@todayStart"),token:"keyword"},{regex:f.escapeRegExp("@todayEnd"),token:"keyword"},{regex:f.escapeRegExp("@monthStart"),token:"keyword"},{regex:f.escapeRegExp("@monthEnd"),token:"keyword"},{regex:f.escapeRegExp("@yearStart"),token:"keyword"},{regex:f.escapeRegExp("@yearEnd"),token:"keyword"},{regex:f.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:o=>{m&&y("submit",s)}};return V(),n(11,d=new K({parent:b,state:C.create({doc:s,extensions:[xe(),me(),be(),we(),Ee(),C.allowMultipleSelections.of(!0),Se(De,{fallback:!0}),Ke(),Ce(),qe(),Re(),Le.of([t,...Ie,...Ae,Be.find(o=>o.key==="Mod-d"),...Oe,..._e]),K.lineWrapping,ve({override:[ie],icons:!1}),T.of(Y(l)),H.of(K.editable.of(!i)),F.of(C.readOnly.of(i)),D.of(G()),C.transactionFilter.of(o=>m&&o.newDoc.lines>1?[]:o),K.updateListener.of(o=>{!o.docChanged||i||(n(1,s=o.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),d==null||d.destroy()}});function oe(t){ke[t?"unshift":"push"](()=>{b=t,n(0,b)})}return e.$$set=t=>{"id"in t&&n(2,h=t.id),"value"in t&&n(1,s=t.value),"disabled"in t&&n(3,i=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,m=t.singleLine),"extraAutocompleteKeys"in t&&n(7,I=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,w=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,E=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,R=Pe(a)),e.$$.dirty[0]&25352&&!i&&(B!=R||w!==-1||E!==-1)&&(n(14,B=R),j()),e.$$.dirty[0]&4&&h&&V(),e.$$.dirty[0]&2080&&d&&a!=null&&a.schema&&d.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&d&&A!=i&&(d.dispatch({effects:[H.reconfigure(K.editable.of(!i)),F.reconfigure(C.readOnly.of(i))]}),n(12,A=i),J()),e.$$.dirty[0]&2050&&d&&s!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:s}}),e.$$.dirty[0]&2064&&d&&typeof l<"u"&&d.dispatch({effects:[T.reconfigure(Y(l))]})},[b,s,h,i,l,a,m,I,w,E,O,d,A,R,B,oe]}class Qe extends se{constructor(r){super(),ae(this,r,Ve,Je,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Qe as default}; diff --git a/ui/dist/assets/ListApiDocs-be91ffbc.js b/ui/dist/assets/ListApiDocs-361e5923.js similarity index 99% rename from ui/dist/assets/ListApiDocs-be91ffbc.js rename to ui/dist/assets/ListApiDocs-361e5923.js index 8ddd7690..f83b2fa0 100644 --- a/ui/dist/assets/ListApiDocs-be91ffbc.js +++ b/ui/dist/assets/ListApiDocs-361e5923.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-aec9c817.js";import{S as dl}from"./SdkTabs-065ad731.js";import{F as pl}from"./FieldsQueryParam-72392a2a.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-9f490143.js";import{S as dl}from"./SdkTabs-f8951db6.js";import{F as pl}from"./FieldsQueryParam-fb32761b.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",$=_(` - is one of: `),C=e("br"),g=s(),p=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),E=e("span"),E.textContent="Equal",Kt=s(),H=e("li"),rt=e("code"),rt.textContent="!=",R=s(),et=e("span"),et.textContent="NOT equal",ne=s(),Q=e("li"),U=e("code"),U.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",j=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/ListExternalAuthsDocs-3af7454a.js b/ui/dist/assets/ListExternalAuthsDocs-c1cb832e.js similarity index 97% rename from ui/dist/assets/ListExternalAuthsDocs-3af7454a.js rename to ui/dist/assets/ListExternalAuthsDocs-c1cb832e.js index ad9845ec..00367c85 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-3af7454a.js +++ b/ui/dist/assets/ListExternalAuthsDocs-c1cb832e.js @@ -1,4 +1,4 @@ -import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-aec9c817.js";import{S as Ye}from"./SdkTabs-065ad731.js";import{F as Ze}from"./FieldsQueryParam-72392a2a.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` +import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-9f490143.js";import{S as Ye}from"./SdkTabs-f8951db6.js";import{F as Ze}from"./FieldsQueryParam-fb32761b.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-5a295016.js b/ui/dist/assets/PageAdminConfirmPasswordReset-579fcad9.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-5a295016.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-579fcad9.js index 890fc3b9..8bc7e01b 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-5a295016.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-579fcad9.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-aec9c817.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-9f490143.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password `),m&&m.c(),t=k(),R(u.$$.fragment),p=k(),R(d.$$.fragment),r=k(),a=_("button"),g=_("span"),g.textContent="Set new password",S=k(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],L(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),A(u,e,null),c(e,p),A(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),h=!0,F||(z=[j(e,"submit",O(i[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=y(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:o}),u.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:o}),d.$set(H),(!h||$&4)&&(a.disabled=o[2]),(!h||$&4)&&L(a,"btn-loading",o[2])},i(o){h||(B(u.$$.fragment,o),B(d.$$.fragment,o),h=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),h=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(u),T(d),F=!1,V(z)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},m(s,l){A(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-d1821282.js b/ui/dist/assets/PageAdminRequestPasswordReset-95849736.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-d1821282.js rename to ui/dist/assets/PageAdminRequestPasswordReset-95849736.js index bf4d1c21..53847c50 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-d1821282.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-95849736.js @@ -1 +1 @@ -import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-aec9c817.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),R(l.$$.fragment),t=v(),o=_("button"),c=_("i"),m=v(),r=_("span"),r.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(r,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=u[1],F(o,"btn-loading",u[1]),p(e,"class","m-b-base")},m(i,$){g(i,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,o),d(o,c),d(o,m),d(o,r),a=!0,b||(f=H(e,"submit",I(u[3])),b=!0)},p(i,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:i}),l.$set(q),(!a||$&2)&&(o.disabled=i[1]),(!a||$&2)&&F(o,"btn-loading",i[1])},i(i){a||(w(l.$$.fragment,i),a=!0)},o(i){y(l.$$.fragment,i),a=!1},d(i){i&&k(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,o,c,m,r;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=v(),l=_("div"),t=_("p"),o=h("Check "),c=_("strong"),m=h(u[0]),r=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,c),d(c,m),d(t,r)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,o,c,m;return{c(){e=_("label"),s=h("Email"),l=v(),t=_("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",o=u[5]),t.required=!0,t.autofocus=!0},m(r,a){g(r,e,a),d(e,s),g(r,l,a),g(r,t,a),L(t,u[0]),t.focus(),c||(m=H(t,"input",u[4]),c=!0)},p(r,a){a&32&&n!==(n=r[5])&&p(e,"for",n),a&32&&o!==(o=r[5])&&p(t,"id",o),a&1&&t.value!==r[0]&&L(t,r[0])},d(r){r&&(k(e),k(l),k(t)),c=!1,m()}}}function U(u){let e,s,n,l,t,o,c,m;const r=[O,K],a=[];function b(f,i){return f[2]?0:1}return e=b(u),s=a[e]=r[e](u),{c(){s.c(),n=v(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,i){a[e].m(f,i),g(f,n,i),g(f,l,i),d(l,t),o=!0,c||(m=A(B.call(null,t)),c=!0)},p(f,i){let $=e;e=b(f),e===$?a[e].p(f,i):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,i):(s=a[e]=r[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){o||(w(s),o=!0)},o(f){y(s),o=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,m()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){R(e.$$.fragment)},m(n,l){S(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){E(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.error(m)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,o,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; +import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-9f490143.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),R(l.$$.fragment),t=v(),o=_("button"),c=_("i"),m=v(),r=_("span"),r.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(r,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=u[1],F(o,"btn-loading",u[1]),p(e,"class","m-b-base")},m(i,$){g(i,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,o),d(o,c),d(o,m),d(o,r),a=!0,b||(f=H(e,"submit",I(u[3])),b=!0)},p(i,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:i}),l.$set(q),(!a||$&2)&&(o.disabled=i[1]),(!a||$&2)&&F(o,"btn-loading",i[1])},i(i){a||(w(l.$$.fragment,i),a=!0)},o(i){y(l.$$.fragment,i),a=!1},d(i){i&&k(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,o,c,m,r;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=v(),l=_("div"),t=_("p"),o=h("Check "),c=_("strong"),m=h(u[0]),r=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,c),d(c,m),d(t,r)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,o,c,m;return{c(){e=_("label"),s=h("Email"),l=v(),t=_("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",o=u[5]),t.required=!0,t.autofocus=!0},m(r,a){g(r,e,a),d(e,s),g(r,l,a),g(r,t,a),L(t,u[0]),t.focus(),c||(m=H(t,"input",u[4]),c=!0)},p(r,a){a&32&&n!==(n=r[5])&&p(e,"for",n),a&32&&o!==(o=r[5])&&p(t,"id",o),a&1&&t.value!==r[0]&&L(t,r[0])},d(r){r&&(k(e),k(l),k(t)),c=!1,m()}}}function U(u){let e,s,n,l,t,o,c,m;const r=[O,K],a=[];function b(f,i){return f[2]?0:1}return e=b(u),s=a[e]=r[e](u),{c(){s.c(),n=v(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,i){a[e].m(f,i),g(f,n,i),g(f,l,i),d(l,t),o=!0,c||(m=A(B.call(null,t)),c=!0)},p(f,i){let $=e;e=b(f),e===$?a[e].p(f,i):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,i):(s=a[e]=r[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){o||(w(s),o=!0)},o(f){y(s),o=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,m()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){R(e.$$.fragment)},m(n,l){S(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){E(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.error(m)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,o,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageOAuth2Redirect-b5bd7fcc.js b/ui/dist/assets/PageOAuth2Redirect-06c771f6.js similarity index 87% rename from ui/dist/assets/PageOAuth2Redirect-b5bd7fcc.js rename to ui/dist/assets/PageOAuth2Redirect-06c771f6.js index 11b93280..a0270d1f 100644 --- a/ui/dist/assets/PageOAuth2Redirect-b5bd7fcc.js +++ b/ui/dist/assets/PageOAuth2Redirect-06c771f6.js @@ -1 +1 @@ -import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,I as h}from"./index-aec9c817.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can go back to the app if this window is not automatically closed.
',l(t,"class","content txt-hint txt-center p-base")},m(e,a){u(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function m(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,m,f,c,{})}}export{x as default}; +import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,I as h}from"./index-9f490143.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can go back to the app if this window is not automatically closed.
',l(t,"class","content txt-hint txt-center p-base")},m(e,a){u(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function m(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,m,f,c,{})}}export{x as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-c25d0a1e.js b/ui/dist/assets/PageRecordConfirmEmailChange-4d5a703c.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-c25d0a1e.js rename to ui/dist/assets/PageRecordConfirmEmailChange-4d5a703c.js index ba2671f6..4e676f4a 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-c25d0a1e.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-4d5a703c.js @@ -1,2 +1,2 @@ -import{S as G,i as I,s as J,F as M,c as S,m as L,t as h,a as v,d as z,C as N,E as R,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as y,b as C,f as p,r as T,h as g,u as P,v as K,y as E,x as O,z as F}from"./index-aec9c817.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address +import{S as G,i as I,s as J,F as M,c as S,m as L,t as h,a as v,d as z,C as N,E as R,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as y,b as C,f as p,r as T,h as g,u as P,v as K,y as E,x as O,z as F}from"./index-9f490143.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address `),d&&d.c(),s=C(),S(o.$$.fragment),f=C(),a=m("button"),r=m("span"),r.textContent="Confirm new email",p(t,"class","content txt-center m-b-base"),p(r,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block"),a.disabled=i[1],T(a,"btn-loading",i[1])},m(c,w){_(c,e,w),g(e,t),g(t,n),g(n,l),d&&d.m(n,null),g(e,s),L(o,e,null),g(e,f),g(e,a),g(a,r),u=!0,k||($=P(e,"submit",K(i[4])),k=!0)},p(c,w){c[3]?d?d.p(c,w):(d=H(c),d.c(),d.m(n,null)):d&&(d.d(1),d=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:c}),o.$set(q),(!u||w&2)&&(a.disabled=c[1]),(!u||w&2)&&T(a,"btn-loading",c[1])},i(c){u||(h(o.$$.fragment,c),u=!0)},o(c){v(o.$$.fragment,c),u=!1},d(c){c&&b(e),d&&d.d(),z(o),k=!1,$()}}}function U(i){let e,t,n,l,s;return{c(){e=m("div"),e.innerHTML='

Successfully changed the user email address.

You can now sign in with your new email address.

',t=C(),n=m("button"),n.textContent="Close",p(e,"class","alert alert-success"),p(n,"type","button"),p(n,"class","btn btn-transparent btn-block")},m(o,f){_(o,e,f),_(o,t,f),_(o,n,f),l||(s=P(n,"click",i[6]),l=!0)},p:E,i:E,o:E,d(o){o&&(b(e),b(t),b(n)),l=!1,s()}}}function H(i){let e,t,n;return{c(){e=y("to "),t=m("strong"),n=y(i[3]),p(t,"class","txt-nowrap")},m(l,s){_(l,e,s),_(l,t,s),g(t,n)},p(l,s){s&8&&O(n,l[3])},d(l){l&&(b(e),b(t))}}}function V(i){let e,t,n,l,s,o,f,a;return{c(){e=m("label"),t=y("Password"),l=C(),s=m("input"),p(e,"for",n=i[8]),p(s,"type","password"),p(s,"id",o=i[8]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),g(e,t),_(r,l,u),_(r,s,u),F(s,i[0]),s.focus(),f||(a=P(s,"input",i[7]),f=!0)},p(r,u){u&256&&n!==(n=r[8])&&p(e,"for",n),u&256&&o!==(o=r[8])&&p(s,"id",o),u&1&&s.value!==r[0]&&F(s,r[0])},d(r){r&&(b(e),b(l),b(s)),f=!1,a()}}}function X(i){let e,t,n,l;const s=[U,Q],o=[];function f(a,r){return a[2]?0:1}return e=f(i),t=o[e]=s[e](i),{c(){t.c(),n=R()},m(a,r){o[e].m(a,r),_(a,n,r),l=!0},p(a,r){let u=e;e=f(a),e===u?o[e].p(a,r):(W(),v(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),h(t,1),t.m(n.parentNode,n))},i(a){l||(h(t),l=!0)},o(a){v(t),l=!1},d(a){a&&b(n),o[e].d(a)}}}function Z(i){let e,t;return e=new M({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){S(e.$$.fragment)},m(n,l){L(e,n,l),t=!0},p(n,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:n}),e.$set(s)},i(n){t||(h(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function x(i,e,t){let n,{params:l}=e,s="",o=!1,f=!1;async function a(){if(o)return;t(1,o=!0);const k=new j("../");try{const $=A(l==null?void 0:l.token);await k.collection($.collectionId).confirmEmailChange(l==null?void 0:l.token,s),t(2,f=!0)}catch($){B.error($)}t(1,o=!1)}const r=()=>window.close();function u(){s=this.value,t(0,s)}return i.$$set=k=>{"params"in k&&t(5,l=k.params)},i.$$.update=()=>{i.$$.dirty&32&&t(3,n=N.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[s,o,f,n,a,l,r,u]}class te extends G{constructor(e){super(),I(this,e,x,Z,J,{params:5})}}export{te as default}; diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-fa2a1b3b.js b/ui/dist/assets/PageRecordConfirmPasswordReset-10a23d65.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-fa2a1b3b.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-10a23d65.js index 34288f95..5e924eab 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-fa2a1b3b.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-10a23d65.js @@ -1,2 +1,2 @@ -import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as y,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as q,b as C,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-aec9c817.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&I(a);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=q(`Reset your user password +import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as y,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as q,b as C,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-9f490143.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&I(a);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=q(`Reset your user password `),d&&d.c(),t=C(),H(o.$$.fragment),c=C(),H(r.$$.fragment),i=C(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=a[2],G(u,"btn-loading",a[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),N(o,e,null),w(e,c),N(r,e,null),w(e,i),w(e,u),w(u,v),g=!0,k||(h=S(e,"submit",U(a[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=I(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const L={};$&3073&&(L.$$scope={dirty:$,ctx:f}),o.$set(L);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),r.$set(z),(!g||$&4)&&(u.disabled=f[2]),(!g||$&4)&&G(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(r.$$.fragment,f),g=!0)},o(f){y(o.$$.fragment,f),y(r.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),T(o),T(r),k=!1,h()}}}function Z(a){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML='

Successfully changed the user password.

You can now sign in with your new password.

',l=C(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=S(s,"click",a[7]),n=!0)},p:F,i:F,o:F,d(o){o&&(m(e),m(l),m(s)),n=!1,t()}}}function I(a){let e,l,s;return{c(){e=q("for "),l=b("strong"),s=q(a[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&(m(e),m(l))}}}function x(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[0]),t.focus(),c||(r=S(t,"input",a[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function ee(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password confirm"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[1]),c||(r=S(t,"input",a[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&R(t,i[1])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function te(a){let e,l,s,n;const t=[Z,X],o=[];function c(r,i){return r[3]?0:1}return e=c(a),l=o[e]=t[e](a),{c(){l.c(),s=A()},m(r,i){o[e].m(r,i),_(r,s,i),n=!0},p(r,i){let u=e;e=c(r),e===u?o[e].p(r,i):(B(),y(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(r,i):(l=o[e]=t[e](r),l.c()),P(l,1),l.m(s.parentNode,s))},i(r){n||(P(l),n=!0)},o(r){y(l),n=!1},d(r){r&&m(s),o[e].d(r)}}}function se(a){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){H(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){y(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(a,e,l){let s,{params:n}=e,t="",o="",c=!1,r=!1;async function i(){if(c)return;l(2,c=!0);const k=new K("../");try{const h=O(n==null?void 0:n.token);await k.collection(h.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,r=!0)}catch(h){Q.error(h)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return a.$$set=k=>{"params"in k&&l(6,n=k.params)},a.$$.update=()=>{a.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default}; diff --git a/ui/dist/assets/PageRecordConfirmVerification-e61306a8.js b/ui/dist/assets/PageRecordConfirmVerification-de4f1a8c.js similarity index 97% rename from ui/dist/assets/PageRecordConfirmVerification-e61306a8.js rename to ui/dist/assets/PageRecordConfirmVerification-de4f1a8c.js index 69bd4382..f1825c30 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-e61306a8.js +++ b/ui/dist/assets/PageRecordConfirmVerification-de4f1a8c.js @@ -1 +1 @@ -import{S as v,i as y,s as g,F as w,c as C,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as a,o as r,e as f,b as _,f as d,u as b,y as p}from"./index-aec9c817.js";function S(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Invalid or expired verification token.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-danger"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[4]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function h(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){C(t.$$.fragment)},m(e,n){x(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; +import{S as v,i as y,s as g,F as w,c as C,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as a,o as r,e as f,b as _,f as d,u as b,y as p}from"./index-9f490143.js";function S(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Invalid or expired verification token.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-danger"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[4]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function h(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){C(t.$$.fragment)},m(e,n){x(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-12687e5c.js b/ui/dist/assets/RealtimeApiDocs-a6768892.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-12687e5c.js rename to ui/dist/assets/RealtimeApiDocs-a6768892.js index 257a3bae..beb30e97 100644 --- a/ui/dist/assets/RealtimeApiDocs-12687e5c.js +++ b/ui/dist/assets/RealtimeApiDocs-a6768892.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-aec9c817.js";import{S as de}from"./SdkTabs-065ad731.js";function fe(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,D,f,_,$,k,l,S,g,C,v,w,h,E,r,R;return l=new de({props:{js:` +import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-9f490143.js";import{S as de}from"./SdkTabs-f8951db6.js";function fe(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,D,f,_,$,k,l,S,g,C,v,w,h,E,r,R;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${t[1]}'); diff --git a/ui/dist/assets/RequestEmailChangeDocs-b6e056f4.js b/ui/dist/assets/RequestEmailChangeDocs-b6287ca5.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-b6e056f4.js rename to ui/dist/assets/RequestEmailChangeDocs-b6287ca5.js index f3f41f91..31aaf805 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-b6e056f4.js +++ b/ui/dist/assets/RequestEmailChangeDocs-b6287ca5.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-aec9c817.js";import{S as je}from"./SdkTabs-065ad731.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` +import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-9f490143.js";import{S as je}from"./SdkTabs-f8951db6.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestPasswordResetDocs-8e1c8ea3.js b/ui/dist/assets/RequestPasswordResetDocs-6dc15257.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-8e1c8ea3.js rename to ui/dist/assets/RequestPasswordResetDocs-6dc15257.js index 32d97df4..5b346edd 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-8e1c8ea3.js +++ b/ui/dist/assets/RequestPasswordResetDocs-6dc15257.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-aec9c817.js";import{S as Ue}from"./SdkTabs-065ad731.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-9f490143.js";import{S as Ue}from"./SdkTabs-f8951db6.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestVerificationDocs-260f7b66.js b/ui/dist/assets/RequestVerificationDocs-1001dd67.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-260f7b66.js rename to ui/dist/assets/RequestVerificationDocs-1001dd67.js index 07782d5e..abb6c70c 100644 --- a/ui/dist/assets/RequestVerificationDocs-260f7b66.js +++ b/ui/dist/assets/RequestVerificationDocs-1001dd67.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-aec9c817.js";import{S as Ae}from"./SdkTabs-065ad731.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` +import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-9f490143.js";import{S as Ae}from"./SdkTabs-f8951db6.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/SdkTabs-065ad731.js b/ui/dist/assets/SdkTabs-f8951db6.js similarity index 98% rename from ui/dist/assets/SdkTabs-065ad731.js rename to ui/dist/assets/SdkTabs-f8951db6.js index fb2dde2a..93faf204 100644 --- a/ui/dist/assets/SdkTabs-065ad731.js +++ b/ui/dist/assets/SdkTabs-f8951db6.js @@ -1 +1 @@ -import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as w,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,w as E,r as y,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-aec9c817.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(_,f){w(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&y(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(b,t){w(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&y(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; +import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as w,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,w as E,r as y,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-9f490143.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(_,f){w(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&y(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(b,t){w(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&y(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-33be0955.js b/ui/dist/assets/UnlinkExternalAuthDocs-49b32d70.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-33be0955.js rename to ui/dist/assets/UnlinkExternalAuthDocs-49b32d70.js index 132f16f7..2628c2d4 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-33be0955.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-49b32d70.js @@ -1,4 +1,4 @@ -import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-aec9c817.js";import{S as Ke}from"./SdkTabs-065ad731.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` +import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-9f490143.js";import{S as Ke}from"./SdkTabs-f8951db6.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/UpdateApiDocs-4ef0014c.js b/ui/dist/assets/UpdateApiDocs-8b967d6d.js similarity index 98% rename from ui/dist/assets/UpdateApiDocs-4ef0014c.js rename to ui/dist/assets/UpdateApiDocs-8b967d6d.js index d9ac7969..ebe558e6 100644 --- a/ui/dist/assets/UpdateApiDocs-4ef0014c.js +++ b/ui/dist/assets/UpdateApiDocs-8b967d6d.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-aec9c817.js";import{S as Ft}from"./SdkTabs-065ad731.js";import{F as Nt}from"./FieldsQueryParam-72392a2a.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-9f490143.js";import{S as Ft}from"./SdkTabs-f8951db6.js";import{F as Nt}from"./FieldsQueryParam-fb32761b.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function gt(c){let e;return{c(){e=r("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function wt(c){let e,t,n,u,m,o,p,h,w,S,g,$,P,E,M,U,F;return{c(){e=r("tr"),e.innerHTML='Auth fields',t=f(),n=r("tr"),n.innerHTML='
Optional username
String The username of the auth record.',u=f(),m=r("tr"),m.innerHTML=`
Optional email
String The auth record email address.
diff --git a/ui/dist/assets/ViewApiDocs-07cf54b1.js b/ui/dist/assets/ViewApiDocs-dbbbc92f.js similarity index 97% rename from ui/dist/assets/ViewApiDocs-07cf54b1.js rename to ui/dist/assets/ViewApiDocs-dbbbc92f.js index a1b1d3d8..ff341bf8 100644 --- a/ui/dist/assets/ViewApiDocs-07cf54b1.js +++ b/ui/dist/assets/ViewApiDocs-dbbbc92f.js @@ -1,4 +1,4 @@ -import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-aec9c817.js";import{S as pt}from"./SdkTabs-065ad731.js";import{F as ut}from"./FieldsQueryParam-72392a2a.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` +import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-9f490143.js";import{S as pt}from"./SdkTabs-f8951db6.js";import{F as ut}from"./FieldsQueryParam-fb32761b.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-aec9c817.js b/ui/dist/assets/index-9f490143.js similarity index 72% rename from ui/dist/assets/index-aec9c817.js rename to ui/dist/assets/index-9f490143.js index d3a1c9e4..8df67dc7 100644 --- a/ui/dist/assets/index-aec9c817.js +++ b/ui/dist/assets/index-9f490143.js @@ -1,160 +1,160 @@ -var s0=Object.defineProperty;var l0=(n,e,t)=>e in n?s0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ir=(n,e,t)=>(l0(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function x(){}const Sl=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function o0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function __(n){return n()}function cu(){return Object.create(null)}function $e(n){n.forEach(__)}function Et(n){return typeof n=="function"}function ge(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Fl;function un(n,e){return n===e?!0:(Fl||(Fl=document.createElement("a")),Fl.href=e,n===Fl.href)}function r0(n){return Object.keys(n).length===0}function ma(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function a0(n){let e;return ma(n,t=>e=t)(),e}function Ge(n,e,t){n.$$.on_destroy.push(ma(e,t))}function Ct(n,e,t,i){if(n){const s=b_(n,e,t,i);return n[0](s)}}function b_(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function $t(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ga=v_?n=>requestAnimationFrame(n):x;const ys=new Set;function y_(n){ys.forEach(e=>{e.c(n)||(ys.delete(e),e.f())}),ys.size!==0&&ga(y_)}function qo(n){let e;return ys.size===0&&ga(y_),{promise:new Promise(t=>{ys.add(e={c:n,f:t})}),abort(){ys.delete(e)}}}function b(n,e){n.appendChild(e)}function k_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function u0(n){const e=v("style");return e.textContent="/* empty */",f0(k_(n),e),e.sheet}function f0(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function bt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Ze(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Sn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const c0=["width","height"];function di(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&c0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function d0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function vt(n){return n===""?null:+n}function p0(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function Vr(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList.toggle(e,!!t)}function w_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Lt(n,e){return new n(e)}const mo=new Map;let go=0;function h0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function m0(n,e){const t={stylesheet:u0(e),rules:{}};return mo.set(n,t),t}function cl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ +var i0=Object.defineProperty;var s0=(n,e,t)=>e in n?i0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var sr=(n,e,t)=>(s0(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function x(){}const Tl=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function l0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function g_(n){return n()}function cu(){return Object.create(null)}function $e(n){n.forEach(g_)}function Et(n){return typeof n=="function"}function ge(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function un(n,e){return n===e?!0:(Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href)}function o0(n){return Object.keys(n).length===0}function ma(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function r0(n){let e;return ma(n,t=>e=t)(),e}function Ge(n,e,t){n.$$.on_destroy.push(ma(e,t))}function Ct(n,e,t,i){if(n){const s=__(n,e,t,i);return n[0](s)}}function __(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function $t(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ga=b_?n=>requestAnimationFrame(n):x;const ks=new Set;function v_(n){ks.forEach(e=>{e.c(n)||(ks.delete(e),e.f())}),ks.size!==0&&ga(v_)}function jo(n){let e;return ks.size===0&&ga(v_),{promise:new Promise(t=>{ks.add(e={c:n,f:t})}),abort(){ks.delete(e)}}}function b(n,e){n.appendChild(e)}function y_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function a0(n){const e=v("style");return e.textContent="/* empty */",u0(y_(n),e),e.sheet}function u0(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function vt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Ze(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Sn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const f0=["width","height"];function di(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&f0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function c0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function yt(n){return n===""?null:+n}function d0(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function de(n,e){n.value=e??""}function Vr(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList.toggle(e,!!t)}function k_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Pt(n,e){return new n(e)}const go=new Map;let _o=0;function p0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function h0(n,e){const t={stylesheet:a0(e),rules:{}};return go.set(n,t),t}function dl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ `;for(let _=0;_<=1;_+=a){const y=e+(t-e)*l(_);u+=_*100+`%{${o(y,1-y)}} `}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${h0(f)}_${r}`,d=k_(n),{stylesheet:h,rules:g}=mo.get(d)||m0(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const m=n.style.animation||"";return n.style.animation=`${m?`${m}, `:""}${c} ${i}ms linear ${s}ms 1 both`,go+=1,c}function dl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),go-=s,go||g0())}function g0(){ga(()=>{go||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),mo.clear())})}function _0(n,e,t,i){if(!e)return x;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return x;const{delay:l=0,duration:o=300,easing:r=Sl,start:a=Ro()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function m(){c&&(g=cl(n,0,1,o,l,r,c)),l||(h=!0)}function _(){c&&dl(n,g),d=!1}return qo(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),m(),f(0,1),_}function b0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,S_(n,s)}}function S_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let pl;function wi(n){pl=n}function Tl(){if(!pl)throw new Error("Function called outside component initialization");return pl}function Kt(n){Tl().$$.on_mount.push(n)}function v0(n){Tl().$$.after_update.push(n)}function Ls(n){Tl().$$.on_destroy.push(n)}function dt(){const n=Tl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=w_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const vs=[],te=[];let ks=[];const zr=[],T_=Promise.resolve();let Br=!1;function C_(){Br||(Br=!0,T_.then(_a))}function sn(){return C_(),T_}function xe(n){ks.push(n)}function ve(n){zr.push(n)}const sr=new Set;let hs=0;function _a(){if(hs!==0)return;const n=pl;do{try{for(;hsn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ks=e}let Vs;function ba(){return Vs||(Vs=Promise.resolve(),Vs.then(()=>{Vs=null})),Vs}function ss(n,e,t){n.dispatchEvent(w_(`${e?"intro":"outro"}${t}`))}const lo=new Set;let ui;function re(){ui={r:0,c:[],p:ui}}function ae(){ui.r||$e(ui.c),ui=ui.p}function A(n,e){n&&n.i&&(lo.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(lo.has(n))return;lo.add(n),ui.c.push(()=>{lo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const va={duration:0};function $_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&dl(n,o)}function f(){const{delay:d=0,duration:h=300,easing:g=Sl,tick:m=x,css:_}=s||va;_&&(o=cl(n,0,1,h,d,g,_,a++)),m(0,1);const y=Ro()+d,S=y+h;r&&r.abort(),l=!0,xe(()=>ss(n,!0,"start")),r=qo(C=>{if(l){if(C>=S)return m(1,0),ss(n,!0,"end"),u(),l=!1;if(C>=y){const T=g((C-y)/h);m(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,dl(n),Et(s)?(s=s(i),ba().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function ya(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=ui;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=Sl,tick:h=x,css:g}=s||va;g&&(o=cl(n,1,0,c,f,d,g));const m=Ro()+f,_=m+c;xe(()=>ss(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),qo(y=>{if(l){if(y>=_)return h(0,1),ss(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=m){const S=d((y-m)/c);h(1-S,S)}}return l})}return Et(s)?ba().then(()=>{s=s(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&s.tick&&s.tick(1,0),l&&(o&&dl(n,o),l=!1)}}}function He(n,e,t,i){let l=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&dl(n,u)}function d(g,m){const _=g.b-o;return m*=Math.abs(_),{a:o,b:g.b,d:_,duration:m,start:g.start,end:g.start+m,group:g.group}}function h(g){const{delay:m=0,duration:_=300,easing:y=Sl,tick:S=x,css:C}=l||va,T={start:Ro()+m,b:g};g||(T.group=ui,ui.r+=1),"inert"in n&&(g?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:(C&&(c(),u=cl(n,o,g,_,m,y,C)),g&&S(0,1),r=d(T,_),xe(()=>ss(n,g,"start")),qo($=>{if(a&&$>a.start&&(r=d(a,_),a=null,ss(n,r.b,"start"),C&&(c(),u=cl(n,o,r.b,r.duration,0,y,l.css))),r){if($>=r.end)S(o=r.b,1-o),ss(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if($>=r.start){const O=$-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(g){Et(l)?ba().then(()=>{l=l({direction:g?"in":"out"}),h(g)}):h(g)},end(){c(),r=a=null}}}function pu(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(re(),I(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&_a()}if(o0(n)){const s=Tl();if(n.then(l=>{wi(s),i(e.then,1,e.value,l),wi(null)},l=>{if(wi(s),i(e.catch,2,e.error,l),wi(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function w0(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function pe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ui(n,e){n.d(1),e.delete(n.key)}function Rt(n,e){I(n,1,1,()=>{e.delete(n.key)})}function S0(n,e){n.f(),Rt(n,e)}function gt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const m={};for(;g--;)m[n[g].key]=g;const _=[],y=new Map,S=new Map,C=[];for(g=h;g--;){const M=c(s,l,g),D=t(M);let L=o.get(D);L?i&&C.push(()=>L.p(M,e)):(L=u(D,M),L.c()),y.set(D,_[g]=L),D in m&&S.set(D,Math.abs(g-m[D]))}const T=new Set,$=new Set;function O(M){A(M,1),M.m(r,f),o.set(M.key,M),f=M.first,h--}for(;d&&h;){const M=_[h-1],D=n[d-1],L=M.key,N=D.key;M===D?(f=M.first,d--,h--):y.has(N)?!o.has(L)||T.has(L)?O(M):$.has(N)?d--:S.get(L)>S.get(N)?($.add(L),O(M)):(T.add(N),d--):(a(D,o),d--)}for(;d--;){const M=n[d];y.has(M.key)||a(M,o)}for(;h;)O(_[h-1]);return $e(C),_}function kt(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Pt(n){return typeof n=="object"&&n!==null?n:{}}function he(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function H(n,e,t){const{fragment:i,after_update:s}=n.$$;i&&i.m(e,t),xe(()=>{const l=n.$$.on_mount.map(__).filter(Et);n.$$.on_destroy?n.$$.on_destroy.push(...l):$e(l),n.$$.on_mount=[]}),s.forEach(xe)}function V(n,e){const t=n.$$;t.fragment!==null&&(k0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function T0(n,e){n.$$.dirty[0]===-1&&(vs.push(n),C_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&T0(n,c)),d}):[],u.update(),f=!0,$e(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=p0(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),H(n,e.target,e.anchor),_a()}wi(a)}class be{constructor(){ir(this,"$$");ir(this,"$$set")}$destroy(){V(this,1),this.$destroy=x}$on(e,t){if(!Et(t))return x;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!r0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const C0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(C0);function jt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function O_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return M_(t,(o,r)=>{let a=!1;const u=[];let f=0,c=x;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,o,r);l?o(g):c=Et(g)?g:x},h=s.map((g,m)=>ma(g,_=>{u[m]=_,f&=~(1<{f|=1<{V(u,1)}),ae()}l?(e=Lt(l,o(r,a)),e.$on("routeEvent",r[7]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a&4?kt(s,[Pt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function M0(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r,a){let u={};if(a!==void 0&&a&6)u=kt(s,[a&2&&{params:r[1]},a&4&&Pt(r[2])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Lt(l,o(r,a)),e.$on("routeEvent",r[6]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a&6?kt(s,[a&2&&{params:r[1]},a&4&&Pt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function O0(n){let e,t,i,s;const l=[M0,$0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function hu(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const jo=M_(null,function(e){e(hu());const t=()=>{e(hu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});O_(jo,n=>n.location);const ka=O_(jo,n=>n.querystring),mu=Ln(void 0);async function us(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await sn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function dn(n,e){if(e=_u(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return gu(n,e),{update(t){t=_u(t),gu(n,t)}}}function E0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function gu(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||D0(i.currentTarget.getAttribute("href"))})}function _u(n){return n&&typeof n=="string"?{href:n}:n||{}}function D0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function A0(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor($,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!$||typeof $=="string"&&($.length<1||$.charAt(0)!="/"&&$.charAt(0)!="*")||typeof $=="object"&&!($ instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:M,keys:D}=E_($);this.path=$,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=M,this._keys=D}match($){if(s){if(typeof s=="string")if($.startsWith(s))$=$.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const L=$.match(s);if(L&&L[0])$=$.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec($);if(O===null)return null;if(this._keys===!1)return O;const M={};let D=0;for(;D{r.push(new o($,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=dt();async function d(T,$){await sn(),c(T,$)}let h=null,g=null;l&&(g=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?h=T.state:h=null},window.addEventListener("popstate",g),v0(()=>{E0(h)}));let m=null,_=null;const y=jo.subscribe(async T=>{m=T;let $=0;for(;${mu.set(u)});return}t(0,a=null),_=null,mu.set(void 0)});Ls(()=>{y(),g&&window.removeEventListener("popstate",g)});function S(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,C]}class I0 extends be{constructor(e){super(),_e(this,e,A0,O0,ge,{routes:3,prefix:4,restoreScrollState:5})}}const oo=[];let D_;function A_(n){const e=n.pattern.test(D_);bu(n,n.className,e),bu(n,n.inactiveClassName,!e)}function bu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}jo.subscribe(n=>{D_=n.location+(n.querystring?"?"+n.querystring:""),oo.map(A_)});function zn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?E_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return oo.push(i),A_(i),{destroy(){oo.splice(oo.indexOf(i),1)}}}const L0="modulepreload",P0=function(n,e){return new URL(n,e).href},vu={},ut=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=P0(l,i),l in vu)return;vu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":L0,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})};function Zt(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}class Kn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Kn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Kn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)===null||t===void 0?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((l=(s=(i=this.originalError)===null||i===void 0?void 0:i.cause)===null||s===void 0?void 0:s.message)===null||l===void 0)&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return Object.assign({},this)}}const Rl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function N0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||F0;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}I_=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const ku="pb_auth";class q0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!wa(this.token)}get isAdmin(){return ro(this.token).type==="admin"}get isAuthRecord(){return ro(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ku){const i=N0(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(e,t=ku){var i,s;const l={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},o=ro(this.token);o!=null&&o.exp?l.expires=new Date(1e3*o.exp):l.expires=new Date("1970-01-01"),e=Object.assign({},l,e);const r={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let a=yu(t,JSON.stringify(r),e);const u=typeof Blob<"u"?new Blob([a]).size:a.length;if(r.model&&u>4096){r.model={id:(i=r==null?void 0:r.model)===null||i===void 0?void 0:i.id,email:(s=r==null?void 0:r.model)===null||s===void 0?void 0:s.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(r.model[c]=this.model[c]);a=yu(t,JSON.stringify(r),e)}return a}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class L_ extends q0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)===null||t===void 0||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class fs{constructor(e){this.client=e}}class j0 extends fs{getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class Sa extends fs{decode(e){return e}getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(s=>{var l;return s.items=((l=s.items)===null||l===void 0?void 0:l.map(o=>this.decode(o)))||[],s})}getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var s;if(!(!((s=i==null?void 0:i.items)===null||s===void 0)&&s.length))throw new Kn({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(s=>this.decode(s))}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],s=l=>Zt(this,void 0,void 0,function*(){return this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i})});return s(1)}}function En(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function lr(n){var e,t;(t=(e=n)._resetAutoRefresh)===null||t===void 0||t.call(e)}class H0 extends Sa{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)===s.id&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l;return i&&((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)===e&&((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}authWithPassword(e,t,i,s){return Zt(this,void 0,void 0,function*(){let l={method:"POST",body:{identity:e,password:t}};l=En("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",l,i,s);const o=l.autoRefreshThreshold;delete l.autoRefreshThreshold,l.autoRefresh||lr(this.client);let r=yield this.client.send(this.baseCrudPath+"/auth-with-password",l);return r=this.authResponse(r),o&&function(u,f,c,d){lr(u);const h=u.beforeSend,g=u.authStore.model,m=u.authStore.onChange((_,y)=>{(!_||(y==null?void 0:y.id)!=(g==null?void 0:g.id)||(y!=null&&y.collectionId||g!=null&&g.collectionId)&&(y==null?void 0:y.collectionId)!=(g==null?void 0:g.collectionId))&&lr(u)});u._resetAutoRefresh=function(){m(),u.beforeSend=h,delete u._resetAutoRefresh},u.beforeSend=(_,y)=>Zt(this,void 0,void 0,function*(){var S;const C=u.authStore.token;if(!((S=y.query)===null||S===void 0)&&S.autoRefresh)return h?h(_,y):{url:_,sendOptions:y};let T=u.authStore.isValid;if(T&&wa(u.authStore.token,f))try{yield c()}catch{T=!1}T||(yield d());const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&C==$[O]&&u.authStore.token){$[O]=u.authStore.token;break}return y.headers=$,h?h(_,y):{url:_,sendOptions:y}})}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},l))),r})}authRefresh(e,t){let i={method:"POST"};return i=En("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=En("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}class P_ extends fs{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentTopics=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}subscribe(e,t){var i;return Zt(this,void 0,void 0,function*(){if(!e)throw new Error("topic must be set.");const s=function(l){const o=l;let r;try{r=JSON.parse(o==null?void 0:o.data)}catch{}t(r||{})};return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e].push(s),this.isConnected?this.subscriptions[e].length===1?yield this.submitSubscriptions():(i=this.eventSource)===null||i===void 0||i.addEventListener(e,s):yield this.connect(),()=>Zt(this,void 0,void 0,function*(){return this.unsubscribeByTopicAndListener(e,s)})})}unsubscribe(e){var t;return Zt(this,void 0,void 0,function*(){if(this.hasSubscriptionListeners(e)){if(e){for(let i of this.subscriptions[e])(t=this.eventSource)===null||t===void 0||t.removeEventListener(e,i);delete this.subscriptions[e]}else this.subscriptions={};this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect()}})}unsubscribeByPrefix(e){var t;return Zt(this,void 0,void 0,function*(){let i=!1;for(let s in this.subscriptions)if(s.startsWith(e)){i=!0;for(let l of this.subscriptions[s])(t=this.eventSource)===null||t===void 0||t.removeEventListener(s,l);delete this.subscriptions[s]}i&&(this.hasSubscriptionListeners()?yield this.submitSubscriptions():this.disconnect())})}unsubscribeByTopicAndListener(e,t){var i;return Zt(this,void 0,void 0,function*(){if(!Array.isArray(this.subscriptions[e])||!this.subscriptions[e].length)return;let s=!1;for(let l=this.subscriptions[e].length-1;l>=0;l--)this.subscriptions[e][l]===t&&(s=!0,delete this.subscriptions[e][l],this.subscriptions[e].splice(l,1),(i=this.eventSource)===null||i===void 0||i.removeEventListener(e,t));s&&(this.subscriptions[e].length||delete this.subscriptions[e],this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect())})}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!(!((t=this.subscriptions[e])===null||t===void 0)&&t.length);for(let s in this.subscriptions)if(!((i=this.subscriptions[s])===null||i===void 0)&&i.length)return!0;return!1}submitSubscriptions(){return Zt(this,void 0,void 0,function*(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},query:{requestKey:this.getSubscriptionsCancelKey()}}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getNonEmptySubscriptionTopics(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}connect(){return Zt(this,void 0,void 0,function*(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(()=>Zt(this,void 0,void 0,function*(){let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,yield this.submitSubscriptions()})).then(()=>{for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionTopics();if(e.length!=this.lastSentTopics.length)return!0;for(const t of e)if(!this.lastSentTopics.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Kn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)===null||t===void 0||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class V0 extends Sa{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}subscribeOne(e,t){return Zt(this,void 0,void 0,function*(){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t)})}subscribe(e,t){return Zt(this,void 0,void 0,function*(){if(typeof e=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),this.client.realtime.subscribe(this.collectionIdOrName,e);if(!t)throw new Error("Missing subscription callback.");if(e==="")throw new Error("Missing topic.");let i=this.collectionIdOrName;return e!=="*"&&(i+="/"+e),this.client.realtime.subscribe(i,t)})}unsubscribe(e){return Zt(this,void 0,void 0,function*(){return e==="*"?this.client.realtime.unsubscribe(this.collectionIdOrName):e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)})}getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}getList(e=1,t=30,i){return super.getList(e,t,i)}getFirstListItem(e,t){return super.getFirstListItem(e,t)}getOne(e,t){return super.getOne(e,t)}create(e,t){return super.create(e,t)}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o,r;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)!==(s==null?void 0:s.id)||((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)===null||r===void 0?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)!==e||((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}authWithPassword(e,t,i,s){let l={method:"POST",body:{identity:e,password:t}};return l=En("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/auth-with-password",l).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:s,createData:l}};return a=En("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){return Zt(this,void 0,void 0,function*(){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(yield this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new Kn(new Error(`Missing or invalid provider "${t.provider}".`));const s=this.client.buildUrl("/api/oauth2-redirect"),l=new P_(this.client);let o=null;function r(){o==null||o.close(),l.unsubscribe()}return t.urlCallback||(o=wu(void 0)),new Promise((a,u)=>Zt(this,void 0,void 0,function*(){var f;try{yield l.subscribe("@oauth2",g=>Zt(this,void 0,void 0,function*(){const m=l.clientId;try{if(!g.state||m!==g.state)throw new Error("State parameters don't match.");const _=Object.assign({},t);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback;const y=yield this.authWithOAuth2Code(i.name,g.code,i.codeVerifier,s,t.createData,_);a(y)}catch(_){u(new Kn(_))}r()}));const c={state:l.clientId};!((f=t.scopes)===null||f===void 0)&&f.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+s,c);yield(t.urlCallback||function(g){o?o.location.href=g:o=wu(g)})(d)}catch(c){r(),u(new Kn(c))}}))})}authRefresh(e,t){let i={method:"POST"};return i=En("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(s=>this.authResponse(s))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=En("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=En("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>!0)}requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=En("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=En("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>!0)}listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}}function wu(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Kn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,s=window.innerHeight;e=e>i?i:e,t=t>s?s:t;let l=i/2-e/2,o=s/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+l+",resizable,menubar=no")}class z0 extends Sa{get baseCrudPath(){return"/api/collections"}import(e,t=!1,i){return Zt(this,void 0,void 0,function*(){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)})}}class B0 extends fs{getRequestsList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs/requests",i)}getRequest(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/requests/"+encodeURIComponent(e),t)}getRequestsStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/requests/stats",e)}}class U0 extends fs{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class W0 extends fs{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildUrl(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class Y0 extends fs{getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}const K0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];class Ho{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new L_,this.admins=new H0(this),this.collections=new z0(this),this.files=new W0(this),this.logs=new B0(this),this.settings=new j0(this),this.realtime=new P_(this),this.health=new U0(this),this.backups=new Y0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new V0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var t;let i=this.baseUrl;return typeof window>"u"||!window.location||i.startsWith("https://")||i.startsWith("http://")||(i=!((t=window.location.origin)===null||t===void 0)&&t.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(i+=window.location.pathname||"/",i+=i.endsWith("/")?"":"/"),i+=this.baseUrl),e&&(i+=i.endsWith("/")?"":"/",i+=e.startsWith("/")?e.substring(1):e),i}send(e,t){return Zt(this,void 0,void 0,function*(){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const s=Object.assign({},yield this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const s=this.serializeQueryParams(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(s=>Zt(this,void 0,void 0,function*(){let l={};try{l=yield s.json()}catch{}if(this.afterSend&&(l=yield this.afterSend(s,l)),s.status>=400)throw new Kn({url:s.url,status:s.status,data:l});return l})).catch(s=>{throw new Kn(s)})})}initSendOptions(e,t){(t=Object.assign({method:"GET"},t)).query=t.query||{},t.body=this.convertToFormDataIfNeeded(t.body);for(let i in t)K0.includes(i)||(t.query[i]=t[i],delete t[i]);if(t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const s=new AbortController;this.cancelControllers[i]=s,t.signal=s.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const s=Array.isArray(e[i])?e[i]:[e[i]];for(let l of s)t.append(i,l)}return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let s of i)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(const o of s)t.push(l+"="+encodeURIComponent(o));else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")}}class cs extends Error{}class J0 extends cs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class G0 extends cs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Z0 extends cs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class xs extends cs{}class N_ extends cs{constructor(e){super(`Invalid unit ${e}`)}}class Un extends cs{}class Ii extends cs{constructor(){super("Zone is an abstract class")}}const Le="numeric",si="short",In="long",Ur={year:Le,month:Le,day:Le},F_={year:Le,month:si,day:Le},X0={year:Le,month:si,day:Le,weekday:si},R_={year:Le,month:In,day:Le},q_={year:Le,month:In,day:Le,weekday:In},j_={hour:Le,minute:Le},H_={hour:Le,minute:Le,second:Le},V_={hour:Le,minute:Le,second:Le,timeZoneName:si},z_={hour:Le,minute:Le,second:Le,timeZoneName:In},B_={hour:Le,minute:Le,hourCycle:"h23"},U_={hour:Le,minute:Le,second:Le,hourCycle:"h23"},W_={hour:Le,minute:Le,second:Le,hourCycle:"h23",timeZoneName:si},Y_={hour:Le,minute:Le,second:Le,hourCycle:"h23",timeZoneName:In},K_={year:Le,month:Le,day:Le,hour:Le,minute:Le},J_={year:Le,month:Le,day:Le,hour:Le,minute:Le,second:Le},G_={year:Le,month:si,day:Le,hour:Le,minute:Le},Z_={year:Le,month:si,day:Le,hour:Le,minute:Le,second:Le},Q0={year:Le,month:si,day:Le,weekday:si,hour:Le,minute:Le},X_={year:Le,month:In,day:Le,hour:Le,minute:Le,timeZoneName:si},Q_={year:Le,month:In,day:Le,hour:Le,minute:Le,second:Le,timeZoneName:si},x_={year:Le,month:In,day:Le,weekday:In,hour:Le,minute:Le,timeZoneName:In},eb={year:Le,month:In,day:Le,weekday:In,hour:Le,minute:Le,second:Le,timeZoneName:In};function ot(n){return typeof n>"u"}function ls(n){return typeof n=="number"}function Vo(n){return typeof n=="number"&&n%1===0}function x0(n){return typeof n=="string"}function ev(n){return Object.prototype.toString.call(n)==="[object Date]"}function tb(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tv(n){return Array.isArray(n)?n:[n]}function Su(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function nv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ms(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Si(n,e,t){return Vo(n)&&n>=e&&n<=t}function iv(n,e){return n-e*Math.floor(n/e)}function Gt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Pi(n){if(!(ot(n)||n===null||n===""))return parseInt(n,10)}function Ki(n){if(!(ot(n)||n===null||n===""))return parseFloat(n)}function Ta(n){if(!(ot(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Ca(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Cl(n){return n%4===0&&(n%100!==0||n%400===0)}function il(n){return Cl(n)?366:365}function _o(n,e){const t=iv(e-1,12)+1,i=n+(e-t)/12;return t===2?Cl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function $a(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function bo(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Wr(n){return n>99?n:n>60?1900+n:2e3+n}function nb(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function zo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function ib(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Un(`Invalid unit value ${n}`);return e}function vo(n,e){const t={};for(const i in n)if(Ms(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=ib(s)}return t}function sl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Gt(t,2)}:${Gt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Gt(t,2)}${Gt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Bo(n){return nv(n,["hour","minute","second","millisecond"])}const sb=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,sv=["January","February","March","April","May","June","July","August","September","October","November","December"],lb=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lv=["J","F","M","A","M","J","J","A","S","O","N","D"];function ob(n){switch(n){case"narrow":return[...lv];case"short":return[...lb];case"long":return[...sv];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const rb=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ab=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ov=["M","T","W","T","F","S","S"];function ub(n){switch(n){case"narrow":return[...ov];case"short":return[...ab];case"long":return[...rb];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const fb=["AM","PM"],rv=["Before Christ","Anno Domini"],av=["BC","AD"],uv=["B","A"];function cb(n){switch(n){case"narrow":return[...uv];case"short":return[...av];case"long":return[...rv];default:return null}}function fv(n){return fb[n.hour<12?0:1]}function cv(n,e){return ub(e)[n.weekday-1]}function dv(n,e){return ob(e)[n.month-1]}function pv(n,e){return cb(e)[n.year<0?0:1]}function hv(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Tu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const mv={D:Ur,DD:F_,DDD:R_,DDDD:q_,t:j_,tt:H_,ttt:V_,tttt:z_,T:B_,TT:U_,TTT:W_,TTTT:Y_,f:K_,ff:G_,fff:X_,ffff:x_,F:J_,FF:Z_,FFF:Q_,FFFF:eb};class wn{static create(e,t={}){return new wn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return mv[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Gt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?fv(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?dv(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?cv(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=wn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},c=h=>i?pv(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return Tu(wn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=wn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Tu(l,s(r))}}class ti{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class $l{get type(){throw new Ii}get name(){throw new Ii}get ianaName(){return this.name}get isUniversal(){throw new Ii}offsetName(e,t){throw new Ii}formatOffset(e,t){throw new Ii}offset(e){throw new Ii}equals(e){throw new Ii}get isValid(){throw new Ii}}let or=null;class Ma extends $l{static get instance(){return or===null&&(or=new Ma),or}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return nb(e,t,i)}formatOffset(e,t){return sl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ao={};function gv(n){return ao[n]||(ao[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ao[n]}const _v={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function bv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function vv(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?g:1e3+g,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let rr=null;class bn extends $l{static get utcInstance(){return rr===null&&(rr=new bn(0)),rr}static instance(e){return e===0?bn.utcInstance:new bn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new bn(zo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${sl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${sl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return sl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class yv extends $l{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Fi(n,e){if(ot(n)||n===null)return e;if(n instanceof $l)return n;if(x0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?bn.utcInstance:bn.parseSpecifier(t)||Ti.create(n)}else return ls(n)?bn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new yv(n)}let Cu=()=>Date.now(),$u="system",Mu=null,Ou=null,Eu=null,Du;class tn{static get now(){return Cu}static set now(e){Cu=e}static set defaultZone(e){$u=e}static get defaultZone(){return Fi($u,Ma.instance)}static get defaultLocale(){return Mu}static set defaultLocale(e){Mu=e}static get defaultNumberingSystem(){return Ou}static set defaultNumberingSystem(e){Ou=e}static get defaultOutputCalendar(){return Eu}static set defaultOutputCalendar(e){Eu=e}static get throwOnInvalid(){return Du}static set throwOnInvalid(e){Du=e}static resetCaches(){Ft.resetCache(),Ti.resetCache()}}let Au={};function kv(n,e={}){const t=JSON.stringify([n,e]);let i=Au[t];return i||(i=new Intl.ListFormat(n,e),Au[t]=i),i}let Yr={};function Kr(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.DateTimeFormat(n,e),Yr[t]=i),i}let Jr={};function wv(n,e={}){const t=JSON.stringify([n,e]);let i=Jr[t];return i||(i=new Intl.NumberFormat(n,e),Jr[t]=i),i}let Gr={};function Sv(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Gr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Gr[s]=l),l}let el=null;function Tv(){return el||(el=new Intl.DateTimeFormat().resolvedOptions().locale,el)}function Cv(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Kr(n).resolvedOptions()}catch{t=Kr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function $v(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Mv(n){const e=[];for(let t=1;t<=12;t++){const i=Ye.utc(2016,t,1);e.push(n(i))}return e}function Ov(n){const e=[];for(let t=1;t<=7;t++){const i=Ye.utc(2016,11,13+t);e.push(n(i))}return e}function jl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function Ev(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class Dv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=wv(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Ca(e,3);return Gt(t,this.padTo)}}}class Av{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Ti.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Ye.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Kr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Iv{constructor(e,t,i){this.opts={style:"long",...i},!t&&tb()&&(this.rtf=Sv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):hv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ft{static fromOpts(e){return Ft.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||tn.defaultLocale,o=l||(s?"en-US":Tv()),r=t||tn.defaultNumberingSystem,a=i||tn.defaultOutputCalendar;return new Ft(o,r,a,l)}static resetCache(){el=null,Yr={},Jr={},Gr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Ft.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=Cv(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=$v(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ev(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Ft.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return jl(this,e,i,ob,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=Mv(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return jl(this,e,i,ub,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=Ov(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return jl(this,void 0,e,()=>fb,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ye.utc(2016,11,13,9),Ye.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return jl(this,e,t,cb,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ye.utc(-40,1,1),Ye.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new Dv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Av(e,this.intl,t)}relFormatter(e={}){return new Iv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return kv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ps(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ns(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Fs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function db(...n){return(e,t)=>{const i={};let s;for(s=0;sh!==void 0&&(g||h&&f)?-h:h;return[{years:d(Ki(t)),months:d(Ki(i)),weeks:d(Ki(s)),days:d(Ki(l)),hours:d(Ki(o)),minutes:d(Ki(r)),seconds:d(Ki(a),a==="-0"),milliseconds:d(Ta(u),c)}]}const Wv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Da(n,e,t,i,s,l,o){const r={year:e.length===2?Wr(Pi(e)):Pi(e),month:lb.indexOf(t)+1,day:Pi(i),hour:Pi(s),minute:Pi(l)};return o&&(r.second=Pi(o)),n&&(r.weekday=n.length>3?rb.indexOf(n)+1:ab.indexOf(n)+1),r}const Yv=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Kv(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Da(e,s,i,t,l,o,r);let h;return a?h=Wv[a]:u?h=0:h=zo(f,c),[d,new bn(h)]}function Jv(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Gv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Zv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Xv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Iu(n){const[,e,t,i,s,l,o,r]=n;return[Da(e,s,i,t,l,o,r),bn.utcInstance]}function Qv(n){const[,e,t,i,s,l,o,r]=n;return[Da(e,r,t,i,s,l,o),bn.utcInstance]}const xv=Ps(Pv,Ea),ey=Ps(Nv,Ea),ty=Ps(Fv,Ea),ny=Ps(hb),gb=Ns(Vv,Rs,Ml,Ol),iy=Ns(Rv,Rs,Ml,Ol),sy=Ns(qv,Rs,Ml,Ol),ly=Ns(Rs,Ml,Ol);function oy(n){return Fs(n,[xv,gb],[ey,iy],[ty,sy],[ny,ly])}function ry(n){return Fs(Jv(n),[Yv,Kv])}function ay(n){return Fs(n,[Gv,Iu],[Zv,Iu],[Xv,Qv])}function uy(n){return Fs(n,[Bv,Uv])}const fy=Ns(Rs);function cy(n){return Fs(n,[zv,fy])}const dy=Ps(jv,Hv),py=Ps(mb),hy=Ns(Rs,Ml,Ol);function my(n){return Fs(n,[dy,gb],[py,hy])}const gy="Invalid Duration",_b={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},_y={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},..._b},qn=146097/400,gs=146097/4800,by={years:{quarters:4,months:12,weeks:qn/7,days:qn,hours:qn*24,minutes:qn*24*60,seconds:qn*24*60*60,milliseconds:qn*24*60*60*1e3},quarters:{months:3,weeks:qn/28,days:qn/4,hours:qn*24/4,minutes:qn*24*60/4,seconds:qn*24*60*60/4,milliseconds:qn*24*60*60*1e3/4},months:{weeks:gs/7,days:gs,hours:gs*24,minutes:gs*24*60,seconds:gs*24*60*60,milliseconds:gs*24*60*60*1e3},..._b},xi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],vy=xi.slice(0).reverse();function Ji(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new ft(i)}function yy(n){return n<0?Math.floor(n):Math.ceil(n)}function bb(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?yy(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function ky(n,e){vy.reduce((t,i)=>ot(e[i])?t:(t&&bb(n,e,t,e,i),i),null)}class ft{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Ft.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?by:_y,this.isLuxonDuration=!0}static fromMillis(e,t){return ft.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Un(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ft({values:vo(e,ft.normalizeUnit),loc:Ft.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ls(e))return ft.fromMillis(e);if(ft.isDuration(e))return e;if(typeof e=="object")return ft.fromObject(e);throw new Un(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=uy(e);return i?ft.fromObject(i,t):ft.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=cy(e);return i?ft.fromObject(i,t):ft.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the Duration is invalid");const i=e instanceof ti?e:new ti(e,t);if(tn.throwOnInvalid)throw new Z0(i);return new ft({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new N_(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?wn.create(this.loc,i).formatDurationFromString(this,e):gy}toHuman(e={}){const t=xi.map(i=>{const s=this.values[i];return ot(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Ca(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ft.fromDurationLike(e),i={};for(const s of xi)(Ms(t.values,s)||Ms(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Ji(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ft.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=ib(e(this.values[i],i));return Ji(this,{values:t},!0)}get(e){return this[ft.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...vo(e,ft.normalizeUnit)};return Ji(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Ji(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return ky(this.matrix,e),Ji(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ft.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of xi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;ls(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)xi.indexOf(u)>xi.indexOf(o)&&bb(this.matrix,s,u,t,o)}else ls(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Ji(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Ji(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of xi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const zs="Invalid Interval";function wy(n,e){return!n||!n.isValid?Ht.invalid("missing or invalid start"):!e||!e.isValid?Ht.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ht.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ws).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Ht.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=ft.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Ht.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Ht.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ht.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Ht.fromDateTimes(t,a.time)),t=null);return Ht.merge(s)}difference(...e){return Ht.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:zs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:zs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:zs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:zs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:zs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ft.invalid(this.invalidReason)}mapEndpoints(e){return Ht.fromDateTimes(e(this.s),e(this.e))}}class Hl{static hasDST(e=tn.defaultZone){const t=Ye.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ti.isValidZone(e)}static normalizeZone(e){return Fi(e,tn.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Ft.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Ft.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Ft.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Ft.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ft.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ft.create(t,null,"gregory").eras(e)}static features(){return{relative:tb()}}}function Lu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ft.fromMillis(i).as("days"))}function Sy(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=Lu(r,a);return(u-u%7)/7}],["days",Lu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function Ty(n,e,t,i){let[s,l,o,r]=Sy(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?ft.fromMillis(a,i).shiftTo(...u).plus(f):f}const Aa={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Pu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Cy=Aa.hanidec.replace(/[\[|\]]/g,"").split("");function $y(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function xn({numberingSystem:n},e=""){return new RegExp(`${Aa[n||"latn"]}${e}`)}const My="missing Intl.DateTimeFormat.formatToParts support";function ht(n,e=t=>t){return{regex:n,deser:([t])=>e($y(t))}}const Oy=String.fromCharCode(160),vb=`[ ${Oy}]`,yb=new RegExp(vb,"g");function Ey(n){return n.replace(/\./g,"\\.?").replace(yb,vb)}function Nu(n){return n.replace(/\./g,"").replace(yb," ").toLowerCase()}function ei(n,e){return n===null?null:{regex:RegExp(n.map(Ey).join("|")),deser:([t])=>n.findIndex(i=>Nu(t)===Nu(i))+e}}function Fu(n,e){return{regex:n,deser:([,t,i])=>zo(t,i),groups:e}}function ar(n){return{regex:n,deser:([e])=>e}}function Dy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ay(n,e){const t=xn(e),i=xn(e,"{2}"),s=xn(e,"{3}"),l=xn(e,"{4}"),o=xn(e,"{6}"),r=xn(e,"{1,2}"),a=xn(e,"{1,3}"),u=xn(e,"{1,6}"),f=xn(e,"{1,9}"),c=xn(e,"{2,4}"),d=xn(e,"{4,6}"),h=_=>({regex:RegExp(Dy(_.val)),deser:([y])=>y,literal:!0}),m=(_=>{if(n.literal)return h(_);switch(_.val){case"G":return ei(e.eras("short",!1),0);case"GG":return ei(e.eras("long",!1),0);case"y":return ht(u);case"yy":return ht(c,Wr);case"yyyy":return ht(l);case"yyyyy":return ht(d);case"yyyyyy":return ht(o);case"M":return ht(r);case"MM":return ht(i);case"MMM":return ei(e.months("short",!0,!1),1);case"MMMM":return ei(e.months("long",!0,!1),1);case"L":return ht(r);case"LL":return ht(i);case"LLL":return ei(e.months("short",!1,!1),1);case"LLLL":return ei(e.months("long",!1,!1),1);case"d":return ht(r);case"dd":return ht(i);case"o":return ht(a);case"ooo":return ht(s);case"HH":return ht(i);case"H":return ht(r);case"hh":return ht(i);case"h":return ht(r);case"mm":return ht(i);case"m":return ht(r);case"q":return ht(r);case"qq":return ht(i);case"s":return ht(r);case"ss":return ht(i);case"S":return ht(a);case"SSS":return ht(s);case"u":return ar(f);case"uu":return ar(r);case"uuu":return ht(t);case"a":return ei(e.meridiems(),0);case"kkkk":return ht(l);case"kk":return ht(c,Wr);case"W":return ht(r);case"WW":return ht(i);case"E":case"c":return ht(t);case"EEE":return ei(e.weekdays("short",!1,!1),1);case"EEEE":return ei(e.weekdays("long",!1,!1),1);case"ccc":return ei(e.weekdays("short",!0,!1),1);case"cccc":return ei(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Fu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Fu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ar(/[a-z_+-/]{1,256}?/i);default:return h(_)}})(n)||{invalidReason:My};return m.token=n,m}const Iy={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function Ly(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=Iy[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function Py(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Ny(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ms(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function Fy(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return ot(n.z)||(t=Ti.create(n.z)),ot(n.Z)||(t||(t=new bn(n.Z)),i=n.Z),ot(n.q)||(n.M=(n.q-1)*3+1),ot(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),ot(n.u)||(n.S=Ta(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ur=null;function Ry(){return ur||(ur=Ye.fromMillis(1555555555555)),ur}function qy(n,e){if(n.literal)return n;const t=wn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=wn.create(e,t).formatDateTimeParts(Ry()).map(o=>Ly(o,e,t));return l.includes(void 0)?n:l}function jy(n,e){return Array.prototype.concat(...n.map(t=>qy(t,e)))}function kb(n,e,t){const i=jy(wn.parseFormat(t),n),s=i.map(o=>Ay(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=Py(s),a=RegExp(o,"i"),[u,f]=Ny(e,a,r),[c,d,h]=f?Fy(f):[null,null,void 0];if(Ms(f,"a")&&Ms(f,"H"))throw new xs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function Hy(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=kb(n,e,t);return[i,s,l,o]}const wb=[0,31,59,90,120,151,181,212,243,273,304,334],Sb=[0,31,60,91,121,152,182,213,244,274,305,335];function Yn(n,e){return new ti("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Tb(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function Cb(n,e,t){return t+(Cl(n)?Sb:wb)[e-1]}function $b(n,e){const t=Cl(n)?Sb:wb,i=t.findIndex(l=>lbo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Bo(n)}}function Ru(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Tb(e,1,4),l=il(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=il(r)):o>l?(r=e+1,o-=il(e)):r=e;const{month:a,day:u}=$b(r,o);return{year:r,month:a,day:u,...Bo(n)}}function fr(n){const{year:e,month:t,day:i}=n,s=Cb(e,t,i);return{year:e,ordinal:s,...Bo(n)}}function qu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=$b(e,t);return{year:e,month:i,day:s,...Bo(n)}}function Vy(n){const e=Vo(n.weekYear),t=Si(n.weekNumber,1,bo(n.weekYear)),i=Si(n.weekday,1,7);return e?t?i?!1:Yn("weekday",n.weekday):Yn("week",n.week):Yn("weekYear",n.weekYear)}function zy(n){const e=Vo(n.year),t=Si(n.ordinal,1,il(n.year));return e?t?!1:Yn("ordinal",n.ordinal):Yn("year",n.year)}function Mb(n){const e=Vo(n.year),t=Si(n.month,1,12),i=Si(n.day,1,_o(n.year,n.month));return e?t?i?!1:Yn("day",n.day):Yn("month",n.month):Yn("year",n.year)}function Ob(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=Si(e,0,23)||e===24&&t===0&&i===0&&s===0,o=Si(t,0,59),r=Si(i,0,59),a=Si(s,0,999);return l?o?r?a?!1:Yn("millisecond",s):Yn("second",i):Yn("minute",t):Yn("hour",e)}const cr="Invalid DateTime",ju=864e13;function Vl(n){return new ti("unsupported zone",`the zone "${n.name}" is not supported`)}function dr(n){return n.weekData===null&&(n.weekData=Zr(n.c)),n.weekData}function Bs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Ye({...t,...e,old:t})}function Eb(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Hu(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function uo(n,e,t){return Eb($a(n),e,t)}function Vu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,_o(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ft.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=$a(l);let[a,u]=Eb(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Us(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Ye.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Ye.invalid(new ti("unparsable",`the input "${s}" can't be parsed as ${i}`))}function zl(n,e,t=!0){return n.isValid?wn.create(Ft.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function pr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Gt(n.c.year,t?6:4),e?(i+="-",i+=Gt(n.c.month),i+="-",i+=Gt(n.c.day)):(i+=Gt(n.c.month),i+=Gt(n.c.day)),i}function zu(n,e,t,i,s,l){let o=Gt(n.c.hour);return e?(o+=":",o+=Gt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Gt(n.c.minute),(n.c.second!==0||!t)&&(o+=Gt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Gt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Gt(Math.trunc(-n.o/60)),o+=":",o+=Gt(Math.trunc(-n.o%60))):(o+="+",o+=Gt(Math.trunc(n.o/60)),o+=":",o+=Gt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Db={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},By={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Uy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ab=["year","month","day","hour","minute","second","millisecond"],Wy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Yy=["year","ordinal","hour","minute","second","millisecond"];function Bu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new N_(n);return e}function Uu(n,e){const t=Fi(e.zone,tn.defaultZone),i=Ft.fromObject(e),s=tn.now();let l,o;if(ot(n.year))l=s;else{for(const u of Ab)ot(n[u])&&(n[u]=Db[u]);const r=Mb(n)||Ob(n);if(r)return Ye.invalid(r);const a=t.offset(s);[l,o]=uo(n,a,t)}return new Ye({ts:l,zone:t,loc:i,o})}function Wu(n,e,t){const i=ot(t.round)?!0:t.round,s=(o,r)=>(o=Ca(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Yu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Ye{constructor(e){const t=e.zone||tn.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ti("invalid input"):null)||(t.isValid?null:Vl(t));this.ts=ot(e.ts)?tn.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Hu(this.ts,r),i=Number.isNaN(s.year)?new ti("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Ft.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Ye({})}static local(){const[e,t]=Yu(arguments),[i,s,l,o,r,a,u]=t;return Uu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Yu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=bn.utcInstance,Uu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=ev(e)?e.valueOf():NaN;if(Number.isNaN(i))return Ye.invalid("invalid input");const s=Fi(t.zone,tn.defaultZone);return s.isValid?new Ye({ts:i,zone:s,loc:Ft.fromObject(t)}):Ye.invalid(Vl(s))}static fromMillis(e,t={}){if(ls(e))return e<-ju||e>ju?Ye.invalid("Timestamp out of range"):new Ye({ts:e,zone:Fi(t.zone,tn.defaultZone),loc:Ft.fromObject(t)});throw new Un(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ls(e))return new Ye({ts:e*1e3,zone:Fi(t.zone,tn.defaultZone),loc:Ft.fromObject(t)});throw new Un("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Fi(t.zone,tn.defaultZone);if(!i.isValid)return Ye.invalid(Vl(i));const s=tn.now(),l=ot(t.specificOffset)?i.offset(s):t.specificOffset,o=vo(e,Bu),r=!ot(o.ordinal),a=!ot(o.year),u=!ot(o.month)||!ot(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Ft.fromObject(t);if((f||r)&&c)throw new xs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new xs("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let g,m,_=Hu(s,l);h?(g=Wy,m=By,_=Zr(_)):r?(g=Yy,m=Uy,_=fr(_)):(g=Ab,m=Db);let y=!1;for(const D of g){const L=o[D];ot(L)?y?o[D]=m[D]:o[D]=_[D]:y=!0}const S=h?Vy(o):r?zy(o):Mb(o),C=S||Ob(o);if(C)return Ye.invalid(C);const T=h?Ru(o):r?qu(o):o,[$,O]=uo(T,l,i),M=new Ye({ts:$,zone:i,o:O,loc:d});return o.weekday&&f&&e.weekday!==M.weekday?Ye.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${M.toISO()}`):M}static fromISO(e,t={}){const[i,s]=oy(e);return Us(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=ry(e);return Us(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=ay(e);return Us(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(ot(e)||ot(t))throw new Un("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Ft.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=Hy(o,e,t);return f?Ye.invalid(f):Us(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Ye.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=my(e);return Us(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the DateTime is invalid");const i=e instanceof ti?e:new ti(e,t);if(tn.throwOnInvalid)throw new J0(i);return new Ye({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?dr(this).weekYear:NaN}get weekNumber(){return this.isValid?dr(this).weekNumber:NaN}get weekday(){return this.isValid?dr(this).weekday:NaN}get ordinal(){return this.isValid?fr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Hl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Hl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Hl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Hl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Cl(this.year)}get daysInMonth(){return _o(this.year,this.month)}get daysInYear(){return this.isValid?il(this.year):NaN}get weeksInWeekYear(){return this.isValid?bo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=wn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(bn.instance(e),t)}toLocal(){return this.setZone(tn.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Fi(e,tn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=uo(o,l,e)}return Bs(this,{ts:s,zone:e})}else return Ye.invalid(Vl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Bs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=vo(e,Bu),i=!ot(t.weekYear)||!ot(t.weekNumber)||!ot(t.weekday),s=!ot(t.ordinal),l=!ot(t.year),o=!ot(t.month)||!ot(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new xs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new xs("Can't mix ordinal dates with month/day");let u;i?u=Ru({...Zr(this.c),...t}):ot(t.ordinal)?(u={...this.toObject(),...t},ot(t.day)&&(u.day=Math.min(_o(u.year,u.month),u.day))):u=qu({...fr(this.c),...t});const[f,c]=uo(u,this.o,this.zone);return Bs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=ft.fromDurationLike(e);return Bs(this,Vu(this,t))}minus(e){if(!this.isValid)return this;const t=ft.fromDurationLike(e).negate();return Bs(this,Vu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ft.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?wn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):cr}toLocaleString(e=Ur,t={}){return this.isValid?wn.create(this.loc.clone(t),e).formatDateTime(this):cr}toLocaleParts(e={}){return this.isValid?wn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=pr(this,o);return r+="T",r+=zu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?pr(this,e==="extended"):null}toISOWeekDate(){return zl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+zu(this,o==="extended",t,e,i,l):null}toRFC2822(){return zl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return zl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?pr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),zl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():cr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return ft.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=tv(t).map(ft.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Ty(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Ye.now(),e,t)}until(e){return this.isValid?Ht.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Ye.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Ye.isDateTime))throw new Un("max requires all arguments be DateTimes");return Su(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Ft.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return kb(o,e,t)}static fromStringExplain(e,t,i={}){return Ye.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ur}static get DATE_MED(){return F_}static get DATE_MED_WITH_WEEKDAY(){return X0}static get DATE_FULL(){return R_}static get DATE_HUGE(){return q_}static get TIME_SIMPLE(){return j_}static get TIME_WITH_SECONDS(){return H_}static get TIME_WITH_SHORT_OFFSET(){return V_}static get TIME_WITH_LONG_OFFSET(){return z_}static get TIME_24_SIMPLE(){return B_}static get TIME_24_WITH_SECONDS(){return U_}static get TIME_24_WITH_SHORT_OFFSET(){return W_}static get TIME_24_WITH_LONG_OFFSET(){return Y_}static get DATETIME_SHORT(){return K_}static get DATETIME_SHORT_WITH_SECONDS(){return J_}static get DATETIME_MED(){return G_}static get DATETIME_MED_WITH_SECONDS(){return Z_}static get DATETIME_MED_WITH_WEEKDAY(){return Q0}static get DATETIME_FULL(){return X_}static get DATETIME_FULL_WITH_SECONDS(){return Q_}static get DATETIME_HUGE(){return x_}static get DATETIME_HUGE_WITH_SECONDS(){return eb}}function Ws(n){if(Ye.isDateTime(n))return n;if(n&&n.valueOf&&ls(n.valueOf()))return Ye.fromJSDate(n);if(n&&typeof n=="object")return Ye.fromObject(n);throw new Un(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Ky=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Jy=[".mp4",".avi",".mov",".3gp",".wmv"],Gy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Zy=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=j.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!j.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):j.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||j.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,l.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let s="";for(let l=0;ll.replaceAll("{_PB_ESCAPED_}",t));for(let l of s)l=l.trim(),j.isEmpty(l)||i.push(l);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],s=t.length>1?t.trim():t;for(let l of e)l=typeof l=="string"?l.trim():"",j.isEmpty(l)||i.push(l.replaceAll(s,"\\"+s));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Ye.fromFormat(e,i,{zone:"UTC"})}return Ye.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.click(),i.remove()}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2));t=t.endsWith(".json")?t:t+".json",j.download(i,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!Ky.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Jy.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Gy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Zy.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)j.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,u,f,c,d,h,g;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",s=(e==null?void 0:e.type)==="view",l={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(l.username="username123",l.verified=!1,l.emailVisibility=!0,l.email="test@example.com"),(!s||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(l.created="2022-01-01 01:00:00.123Z"),(!s||j.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(l.updated="2022-01-01 23:59:59.456Z");for(const m of t){let _=null;m.type==="number"?_=123:m.type==="date"?_="2022-01-01 10:00:00.123Z":m.type==="bool"?_=!0:m.type==="email"?_="test@example.com":m.type==="url"?_="https://example.com":m.type==="json"?_="JSON":m.type==="file"?(_="filename.jpg",((f=m.options)==null?void 0:f.maxSelect)!==1&&(_=[_])):m.type==="select"?(_=(d=(c=m.options)==null?void 0:c.values)==null?void 0:d[0],((h=m.options)==null?void 0:h.maxSelect)!==1&&(_=[_])):m.type==="relation"?(_="RELATION_RECORD_ID",((g=m.options)==null?void 0:g.maxSelect)!==1&&(_=[_])):_="test",l[m.name]=_}return l}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=j.isObject(u)&&j.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(s){let l=s.parentNode;for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}function i(s){if(s){for(const l of s.children)i(l);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(s,l)=>{i(l.node)},file_picker_types:"image",file_picker_callback:(s,l,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,h=f.result.split(",")[1],g=d.create(c,u,h);d.add(g),s(g.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:s=>{s.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&s.formElement&&(o.preventDefault(),o.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const l="tinymce_last_direction";s.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(l);!s.isDirty()&&s.getContent()==""&&o=="rtl"&&s.execCommand("mceDirectionRTL")}),s.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"ltr"),s.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"rtl"),s.execCommand("mceDirectionRTL")}}])}}),s.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{s.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{s.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of l){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A"){if(j.isEmpty(e))return t;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e)||t;if(Array.isArray(e))return e.join(",");if(typeof e=="object")try{return j.truncate(JSON.stringify(e))||t}catch{return t}return""+e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+l);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const s=e.schema||[];for(const l of s)j.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let h of r){h=h.trim().replaceAll("{PB_TEMP}",",");const m=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(h);if((m==null?void 0:m.length)!=4)continue;const _=(c=(f=m[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");_&&t.columns.push({name:_,collate:m[2]||"",sort:((d=m[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` +}`,c=`__svelte_${p0(f)}_${r}`,d=y_(n),{stylesheet:h,rules:g}=go.get(d)||h0(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const m=n.style.animation||"";return n.style.animation=`${m?`${m}, `:""}${c} ${i}ms linear ${s}ms 1 both`,_o+=1,c}function pl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),_o-=s,_o||m0())}function m0(){ga(()=>{_o||(go.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),go.clear())})}function g0(n,e,t,i){if(!e)return x;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return x;const{delay:l=0,duration:o=300,easing:r=Tl,start:a=qo()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function m(){c&&(g=dl(n,0,1,o,l,r,c)),l||(h=!0)}function _(){c&&pl(n,g),d=!1}return jo(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),m(),f(0,1),_}function _0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,w_(n,s)}}function w_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let hl;function wi(n){hl=n}function Cl(){if(!hl)throw new Error("Function called outside component initialization");return hl}function Kt(n){Cl().$$.on_mount.push(n)}function b0(n){Cl().$$.after_update.push(n)}function Ps(n){Cl().$$.on_destroy.push(n)}function dt(){const n=Cl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=k_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ys=[],te=[];let ws=[];const zr=[],S_=Promise.resolve();let Br=!1;function T_(){Br||(Br=!0,S_.then(_a))}function sn(){return T_(),S_}function xe(n){ws.push(n)}function _e(n){zr.push(n)}const lr=new Set;let hs=0;function _a(){if(hs!==0)return;const n=hl;do{try{for(;hsn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ws=e}let zs;function ba(){return zs||(zs=Promise.resolve(),zs.then(()=>{zs=null})),zs}function ss(n,e,t){n.dispatchEvent(k_(`${e?"intro":"outro"}${t}`))}const oo=new Set;let ui;function re(){ui={r:0,c:[],p:ui}}function ae(){ui.r||$e(ui.c),ui=ui.p}function A(n,e){n&&n.i&&(oo.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(oo.has(n))return;oo.add(n),ui.c.push(()=>{oo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const va={duration:0};function C_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&pl(n,o)}function f(){const{delay:d=0,duration:h=300,easing:g=Tl,tick:m=x,css:_}=s||va;_&&(o=dl(n,0,1,h,d,g,_,a++)),m(0,1);const y=qo()+d,S=y+h;r&&r.abort(),l=!0,xe(()=>ss(n,!0,"start")),r=jo(C=>{if(l){if(C>=S)return m(1,0),ss(n,!0,"end"),u(),l=!1;if(C>=y){const T=g((C-y)/h);m(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,pl(n),Et(s)?(s=s(i),ba().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function ya(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=ui;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=Tl,tick:h=x,css:g}=s||va;g&&(o=dl(n,1,0,c,f,d,g));const m=qo()+f,_=m+c;xe(()=>ss(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),jo(y=>{if(l){if(y>=_)return h(0,1),ss(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=m){const S=d((y-m)/c);h(1-S,S)}}return l})}return Et(s)?ba().then(()=>{s=s(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&s.tick&&s.tick(1,0),l&&(o&&pl(n,o),l=!1)}}}function He(n,e,t,i){let l=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&pl(n,u)}function d(g,m){const _=g.b-o;return m*=Math.abs(_),{a:o,b:g.b,d:_,duration:m,start:g.start,end:g.start+m,group:g.group}}function h(g){const{delay:m=0,duration:_=300,easing:y=Tl,tick:S=x,css:C}=l||va,T={start:qo()+m,b:g};g||(T.group=ui,ui.r+=1),"inert"in n&&(g?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:(C&&(c(),u=dl(n,o,g,_,m,y,C)),g&&S(0,1),r=d(T,_),xe(()=>ss(n,g,"start")),jo($=>{if(a&&$>a.start&&(r=d(a,_),a=null,ss(n,r.b,"start"),C&&(c(),u=dl(n,o,r.b,r.duration,0,y,l.css))),r){if($>=r.end)S(o=r.b,1-o),ss(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if($>=r.start){const O=$-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(g){Et(l)?ba().then(()=>{l=l({direction:g?"in":"out"}),h(g)}):h(g)},end(){c(),r=a=null}}}function pu(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(re(),I(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&_a()}if(l0(n)){const s=Cl();if(n.then(l=>{wi(s),i(e.then,1,e.value,l),wi(null)},l=>{if(wi(s),i(e.catch,2,e.error,l),wi(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function k0(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function pe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ui(n,e){n.d(1),e.delete(n.key)}function Rt(n,e){I(n,1,1,()=>{e.delete(n.key)})}function w0(n,e){n.f(),Rt(n,e)}function gt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const m={};for(;g--;)m[n[g].key]=g;const _=[],y=new Map,S=new Map,C=[];for(g=h;g--;){const M=c(s,l,g),D=t(M);let L=o.get(D);L?i&&C.push(()=>L.p(M,e)):(L=u(D,M),L.c()),y.set(D,_[g]=L),D in m&&S.set(D,Math.abs(g-m[D]))}const T=new Set,$=new Set;function O(M){A(M,1),M.m(r,f),o.set(M.key,M),f=M.first,h--}for(;d&&h;){const M=_[h-1],D=n[d-1],L=M.key,N=D.key;M===D?(f=M.first,d--,h--):y.has(N)?!o.has(L)||T.has(L)?O(M):$.has(N)?d--:S.get(L)>S.get(N)?($.add(L),O(M)):(T.add(N),d--):(a(D,o),d--)}for(;d--;){const M=n[d];y.has(M.key)||a(M,o)}for(;h;)O(_[h-1]);return $e(C),_}function _t(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Dt(n){return typeof n=="object"&&n!==null?n:{}}function he(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function H(n,e,t){const{fragment:i,after_update:s}=n.$$;i&&i.m(e,t),xe(()=>{const l=n.$$.on_mount.map(g_).filter(Et);n.$$.on_destroy?n.$$.on_destroy.push(...l):$e(l),n.$$.on_mount=[]}),s.forEach(xe)}function V(n,e){const t=n.$$;t.fragment!==null&&(y0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function S0(n,e){n.$$.dirty[0]===-1&&(ys.push(n),T_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&S0(n,c)),d}):[],u.update(),f=!0,$e(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=d0(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),H(n,e.target,e.anchor),_a()}wi(a)}class ve{constructor(){sr(this,"$$");sr(this,"$$set")}$destroy(){V(this,1),this.$destroy=x}$on(e,t){if(!Et(t))return x;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!o0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const T0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(T0);function jt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function M_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return $_(t,(o,r)=>{let a=!1;const u=[];let f=0,c=x;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,o,r);l?o(g):c=Et(g)?g:x},h=s.map((g,m)=>ma(g,_=>{u[m]=_,f&=~(1<{f|=1<{V(u,1)}),ae()}l?(e=Pt(l,o(r,a)),e.$on("routeEvent",r[7]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a&4?_t(s,[Dt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function $0(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r,a){let u={};if(a!==void 0&&a&6)u=_t(s,[a&2&&{params:r[1]},a&4&&Dt(r[2])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Pt(l,o(r,a)),e.$on("routeEvent",r[6]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a&6?_t(s,[a&2&&{params:r[1]},a&4&&Dt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function M0(n){let e,t,i,s;const l=[$0,C0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function hu(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ho=$_(null,function(e){e(hu());const t=()=>{e(hu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});M_(Ho,n=>n.location);const ka=M_(Ho,n=>n.querystring),mu=Ln(void 0);async function us(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await sn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function dn(n,e){if(e=_u(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return gu(n,e),{update(t){t=_u(t),gu(n,t)}}}function O0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function gu(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||E0(i.currentTarget.getAttribute("href"))})}function _u(n){return n&&typeof n=="string"?{href:n}:n||{}}function E0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function D0(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor($,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!$||typeof $=="string"&&($.length<1||$.charAt(0)!="/"&&$.charAt(0)!="*")||typeof $=="object"&&!($ instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:M,keys:D}=O_($);this.path=$,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=M,this._keys=D}match($){if(s){if(typeof s=="string")if($.startsWith(s))$=$.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const L=$.match(s);if(L&&L[0])$=$.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec($);if(O===null)return null;if(this._keys===!1)return O;const M={};let D=0;for(;D{r.push(new o($,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=dt();async function d(T,$){await sn(),c(T,$)}let h=null,g=null;l&&(g=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?h=T.state:h=null},window.addEventListener("popstate",g),b0(()=>{O0(h)}));let m=null,_=null;const y=Ho.subscribe(async T=>{m=T;let $=0;for(;${mu.set(u)});return}t(0,a=null),_=null,mu.set(void 0)});Ps(()=>{y(),g&&window.removeEventListener("popstate",g)});function S(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,C]}class A0 extends ve{constructor(e){super(),be(this,e,D0,M0,ge,{routes:3,prefix:4,restoreScrollState:5})}}const ro=[];let E_;function D_(n){const e=n.pattern.test(E_);bu(n,n.className,e),bu(n,n.inactiveClassName,!e)}function bu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ho.subscribe(n=>{E_=n.location+(n.querystring?"?"+n.querystring:""),ro.map(D_)});function zn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?O_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ro.push(i),D_(i),{destroy(){ro.splice(ro.indexOf(i),1)}}}const I0="modulepreload",L0=function(n,e){return new URL(n,e).href},vu={},ut=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=L0(l,i),l in vu)return;vu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":I0,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})};function Zt(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}class Kn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Kn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Kn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)===null||t===void 0?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((l=(s=(i=this.originalError)===null||i===void 0?void 0:i.cause)===null||s===void 0?void 0:s.message)===null||l===void 0)&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return Object.assign({},this)}}const ql=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function P0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||N0;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}A_=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const ku="pb_auth";class R0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!wa(this.token)}get isAdmin(){return ao(this.token).type==="admin"}get isAuthRecord(){return ao(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ku){const i=P0(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(e,t=ku){var i,s;const l={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},o=ao(this.token);o!=null&&o.exp?l.expires=new Date(1e3*o.exp):l.expires=new Date("1970-01-01"),e=Object.assign({},l,e);const r={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let a=yu(t,JSON.stringify(r),e);const u=typeof Blob<"u"?new Blob([a]).size:a.length;if(r.model&&u>4096){r.model={id:(i=r==null?void 0:r.model)===null||i===void 0?void 0:i.id,email:(s=r==null?void 0:r.model)===null||s===void 0?void 0:s.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(r.model[c]=this.model[c]);a=yu(t,JSON.stringify(r),e)}return a}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class I_ extends R0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)===null||t===void 0||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class fs{constructor(e){this.client=e}}class q0 extends fs{getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class Sa extends fs{decode(e){return e}getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(s=>{var l;return s.items=((l=s.items)===null||l===void 0?void 0:l.map(o=>this.decode(o)))||[],s})}getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var s;if(!(!((s=i==null?void 0:i.items)===null||s===void 0)&&s.length))throw new Kn({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(s=>this.decode(s))}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],s=l=>Zt(this,void 0,void 0,function*(){return this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i})});return s(1)}}function En(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function or(n){var e,t;(t=(e=n)._resetAutoRefresh)===null||t===void 0||t.call(e)}class j0 extends Sa{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)===s.id&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l;return i&&((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)===e&&((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}authWithPassword(e,t,i,s){return Zt(this,void 0,void 0,function*(){let l={method:"POST",body:{identity:e,password:t}};l=En("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",l,i,s);const o=l.autoRefreshThreshold;delete l.autoRefreshThreshold,l.autoRefresh||or(this.client);let r=yield this.client.send(this.baseCrudPath+"/auth-with-password",l);return r=this.authResponse(r),o&&function(u,f,c,d){or(u);const h=u.beforeSend,g=u.authStore.model,m=u.authStore.onChange((_,y)=>{(!_||(y==null?void 0:y.id)!=(g==null?void 0:g.id)||(y!=null&&y.collectionId||g!=null&&g.collectionId)&&(y==null?void 0:y.collectionId)!=(g==null?void 0:g.collectionId))&&or(u)});u._resetAutoRefresh=function(){m(),u.beforeSend=h,delete u._resetAutoRefresh},u.beforeSend=(_,y)=>Zt(this,void 0,void 0,function*(){var S;const C=u.authStore.token;if(!((S=y.query)===null||S===void 0)&&S.autoRefresh)return h?h(_,y):{url:_,sendOptions:y};let T=u.authStore.isValid;if(T&&wa(u.authStore.token,f))try{yield c()}catch{T=!1}T||(yield d());const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&C==$[O]&&u.authStore.token){$[O]=u.authStore.token;break}return y.headers=$,h?h(_,y):{url:_,sendOptions:y}})}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},l))),r})}authRefresh(e,t){let i={method:"POST"};return i=En("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=En("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}class L_ extends fs{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentTopics=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}subscribe(e,t){var i;return Zt(this,void 0,void 0,function*(){if(!e)throw new Error("topic must be set.");const s=function(l){const o=l;let r;try{r=JSON.parse(o==null?void 0:o.data)}catch{}t(r||{})};return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e].push(s),this.isConnected?this.subscriptions[e].length===1?yield this.submitSubscriptions():(i=this.eventSource)===null||i===void 0||i.addEventListener(e,s):yield this.connect(),()=>Zt(this,void 0,void 0,function*(){return this.unsubscribeByTopicAndListener(e,s)})})}unsubscribe(e){var t;return Zt(this,void 0,void 0,function*(){if(this.hasSubscriptionListeners(e)){if(e){for(let i of this.subscriptions[e])(t=this.eventSource)===null||t===void 0||t.removeEventListener(e,i);delete this.subscriptions[e]}else this.subscriptions={};this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect()}})}unsubscribeByPrefix(e){var t;return Zt(this,void 0,void 0,function*(){let i=!1;for(let s in this.subscriptions)if(s.startsWith(e)){i=!0;for(let l of this.subscriptions[s])(t=this.eventSource)===null||t===void 0||t.removeEventListener(s,l);delete this.subscriptions[s]}i&&(this.hasSubscriptionListeners()?yield this.submitSubscriptions():this.disconnect())})}unsubscribeByTopicAndListener(e,t){var i;return Zt(this,void 0,void 0,function*(){if(!Array.isArray(this.subscriptions[e])||!this.subscriptions[e].length)return;let s=!1;for(let l=this.subscriptions[e].length-1;l>=0;l--)this.subscriptions[e][l]===t&&(s=!0,delete this.subscriptions[e][l],this.subscriptions[e].splice(l,1),(i=this.eventSource)===null||i===void 0||i.removeEventListener(e,t));s&&(this.subscriptions[e].length||delete this.subscriptions[e],this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect())})}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!(!((t=this.subscriptions[e])===null||t===void 0)&&t.length);for(let s in this.subscriptions)if(!((i=this.subscriptions[s])===null||i===void 0)&&i.length)return!0;return!1}submitSubscriptions(){return Zt(this,void 0,void 0,function*(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},query:{requestKey:this.getSubscriptionsCancelKey()}}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getNonEmptySubscriptionTopics(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}connect(){return Zt(this,void 0,void 0,function*(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(()=>Zt(this,void 0,void 0,function*(){let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,yield this.submitSubscriptions()})).then(()=>{for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionTopics();if(e.length!=this.lastSentTopics.length)return!0;for(const t of e)if(!this.lastSentTopics.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Kn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)===null||t===void 0||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class H0 extends Sa{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}subscribeOne(e,t){return Zt(this,void 0,void 0,function*(){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t)})}subscribe(e,t){return Zt(this,void 0,void 0,function*(){if(typeof e=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),this.client.realtime.subscribe(this.collectionIdOrName,e);if(!t)throw new Error("Missing subscription callback.");if(e==="")throw new Error("Missing topic.");let i=this.collectionIdOrName;return e!=="*"&&(i+="/"+e),this.client.realtime.subscribe(i,t)})}unsubscribe(e){return Zt(this,void 0,void 0,function*(){return e==="*"?this.client.realtime.unsubscribe(this.collectionIdOrName):e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)})}getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}getList(e=1,t=30,i){return super.getList(e,t,i)}getFirstListItem(e,t){return super.getFirstListItem(e,t)}getOne(e,t){return super.getOne(e,t)}create(e,t){return super.create(e,t)}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o,r;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)!==(s==null?void 0:s.id)||((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)===null||r===void 0?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)!==e||((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}authWithPassword(e,t,i,s){let l={method:"POST",body:{identity:e,password:t}};return l=En("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/auth-with-password",l).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:s,createData:l}};return a=En("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){return Zt(this,void 0,void 0,function*(){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(yield this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new Kn(new Error(`Missing or invalid provider "${t.provider}".`));const s=this.client.buildUrl("/api/oauth2-redirect"),l=new L_(this.client);let o=null;function r(){o==null||o.close(),l.unsubscribe()}return t.urlCallback||(o=wu(void 0)),new Promise((a,u)=>Zt(this,void 0,void 0,function*(){var f;try{yield l.subscribe("@oauth2",g=>Zt(this,void 0,void 0,function*(){const m=l.clientId;try{if(!g.state||m!==g.state)throw new Error("State parameters don't match.");const _=Object.assign({},t);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback;const y=yield this.authWithOAuth2Code(i.name,g.code,i.codeVerifier,s,t.createData,_);a(y)}catch(_){u(new Kn(_))}r()}));const c={state:l.clientId};!((f=t.scopes)===null||f===void 0)&&f.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+s,c);yield(t.urlCallback||function(g){o?o.location.href=g:o=wu(g)})(d)}catch(c){r(),u(new Kn(c))}}))})}authRefresh(e,t){let i={method:"POST"};return i=En("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(s=>this.authResponse(s))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=En("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=En("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>!0)}requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=En("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=En("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>!0)}listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}}function wu(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Kn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,s=window.innerHeight;e=e>i?i:e,t=t>s?s:t;let l=i/2-e/2,o=s/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+l+",resizable,menubar=no")}class V0 extends Sa{get baseCrudPath(){return"/api/collections"}import(e,t=!1,i){return Zt(this,void 0,void 0,function*(){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)})}}class z0 extends fs{getRequestsList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs/requests",i)}getRequest(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/requests/"+encodeURIComponent(e),t)}getRequestsStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/requests/stats",e)}}class B0 extends fs{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class U0 extends fs{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildUrl(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class W0 extends fs{getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}const Y0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];class Vo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new I_,this.admins=new j0(this),this.collections=new V0(this),this.files=new U0(this),this.logs=new z0(this),this.settings=new q0(this),this.realtime=new L_(this),this.health=new B0(this),this.backups=new W0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new H0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var t;let i=this.baseUrl;return typeof window>"u"||!window.location||i.startsWith("https://")||i.startsWith("http://")||(i=!((t=window.location.origin)===null||t===void 0)&&t.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(i+=window.location.pathname||"/",i+=i.endsWith("/")?"":"/"),i+=this.baseUrl),e&&(i+=i.endsWith("/")?"":"/",i+=e.startsWith("/")?e.substring(1):e),i}send(e,t){return Zt(this,void 0,void 0,function*(){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const s=Object.assign({},yield this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const s=this.serializeQueryParams(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(s=>Zt(this,void 0,void 0,function*(){let l={};try{l=yield s.json()}catch{}if(this.afterSend&&(l=yield this.afterSend(s,l)),s.status>=400)throw new Kn({url:s.url,status:s.status,data:l});return l})).catch(s=>{throw new Kn(s)})})}initSendOptions(e,t){(t=Object.assign({method:"GET"},t)).query=t.query||{},t.body=this.convertToFormDataIfNeeded(t.body);for(let i in t)Y0.includes(i)||(t.query[i]=t[i],delete t[i]);if(t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const s=new AbortController;this.cancelControllers[i]=s,t.signal=s.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const s=Array.isArray(e[i])?e[i]:[e[i]];for(let l of s)t.append(i,l)}return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let s of i)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(const o of s)t.push(l+"="+encodeURIComponent(o));else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")}}class cs extends Error{}class K0 extends cs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class J0 extends cs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class G0 extends cs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class el extends cs{}class P_ extends cs{constructor(e){super(`Invalid unit ${e}`)}}class Un extends cs{}class Ii extends cs{constructor(){super("Zone is an abstract class")}}const Le="numeric",si="short",In="long",Ur={year:Le,month:Le,day:Le},N_={year:Le,month:si,day:Le},Z0={year:Le,month:si,day:Le,weekday:si},F_={year:Le,month:In,day:Le},R_={year:Le,month:In,day:Le,weekday:In},q_={hour:Le,minute:Le},j_={hour:Le,minute:Le,second:Le},H_={hour:Le,minute:Le,second:Le,timeZoneName:si},V_={hour:Le,minute:Le,second:Le,timeZoneName:In},z_={hour:Le,minute:Le,hourCycle:"h23"},B_={hour:Le,minute:Le,second:Le,hourCycle:"h23"},U_={hour:Le,minute:Le,second:Le,hourCycle:"h23",timeZoneName:si},W_={hour:Le,minute:Le,second:Le,hourCycle:"h23",timeZoneName:In},Y_={year:Le,month:Le,day:Le,hour:Le,minute:Le},K_={year:Le,month:Le,day:Le,hour:Le,minute:Le,second:Le},J_={year:Le,month:si,day:Le,hour:Le,minute:Le},G_={year:Le,month:si,day:Le,hour:Le,minute:Le,second:Le},X0={year:Le,month:si,day:Le,weekday:si,hour:Le,minute:Le},Z_={year:Le,month:In,day:Le,hour:Le,minute:Le,timeZoneName:si},X_={year:Le,month:In,day:Le,hour:Le,minute:Le,second:Le,timeZoneName:si},Q_={year:Le,month:In,day:Le,weekday:In,hour:Le,minute:Le,timeZoneName:In},x_={year:Le,month:In,day:Le,weekday:In,hour:Le,minute:Le,second:Le,timeZoneName:In};function ot(n){return typeof n>"u"}function ls(n){return typeof n=="number"}function zo(n){return typeof n=="number"&&n%1===0}function Q0(n){return typeof n=="string"}function x0(n){return Object.prototype.toString.call(n)==="[object Date]"}function eb(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function ev(n){return Array.isArray(n)?n:[n]}function Su(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function tv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Os(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Si(n,e,t){return zo(n)&&n>=e&&n<=t}function nv(n,e){return n-e*Math.floor(n/e)}function Gt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Pi(n){if(!(ot(n)||n===null||n===""))return parseInt(n,10)}function Ki(n){if(!(ot(n)||n===null||n===""))return parseFloat(n)}function Ta(n){if(!(ot(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Ca(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function $l(n){return n%4===0&&(n%100!==0||n%400===0)}function sl(n){return $l(n)?366:365}function bo(n,e){const t=nv(e-1,12)+1,i=n+(e-t)/12;return t===2?$l(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function $a(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function vo(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Wr(n){return n>99?n:n>60?1900+n:2e3+n}function tb(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Bo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function nb(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Un(`Invalid unit value ${n}`);return e}function yo(n,e){const t={};for(const i in n)if(Os(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=nb(s)}return t}function ll(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Gt(t,2)}:${Gt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Gt(t,2)}${Gt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Uo(n){return tv(n,["hour","minute","second","millisecond"])}const ib=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,iv=["January","February","March","April","May","June","July","August","September","October","November","December"],sb=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],sv=["J","F","M","A","M","J","J","A","S","O","N","D"];function lb(n){switch(n){case"narrow":return[...sv];case"short":return[...sb];case"long":return[...iv];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ob=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],rb=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],lv=["M","T","W","T","F","S","S"];function ab(n){switch(n){case"narrow":return[...lv];case"short":return[...rb];case"long":return[...ob];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ub=["AM","PM"],ov=["Before Christ","Anno Domini"],rv=["BC","AD"],av=["B","A"];function fb(n){switch(n){case"narrow":return[...av];case"short":return[...rv];case"long":return[...ov];default:return null}}function uv(n){return ub[n.hour<12?0:1]}function fv(n,e){return ab(e)[n.weekday-1]}function cv(n,e){return lb(e)[n.month-1]}function dv(n,e){return fb(e)[n.year<0?0:1]}function pv(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Tu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const hv={D:Ur,DD:N_,DDD:F_,DDDD:R_,t:q_,tt:j_,ttt:H_,tttt:V_,T:z_,TT:B_,TTT:U_,TTTT:W_,f:Y_,ff:J_,fff:Z_,ffff:Q_,F:K_,FF:G_,FFF:X_,FFFF:x_};class wn{static create(e,t={}){return new wn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return hv[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Gt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?uv(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?cv(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?fv(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=wn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},c=h=>i?dv(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return Tu(wn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=wn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Tu(l,s(r))}}class ti{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ml{get type(){throw new Ii}get name(){throw new Ii}get ianaName(){return this.name}get isUniversal(){throw new Ii}offsetName(e,t){throw new Ii}formatOffset(e,t){throw new Ii}offset(e){throw new Ii}equals(e){throw new Ii}get isValid(){throw new Ii}}let rr=null;class Ma extends Ml{static get instance(){return rr===null&&(rr=new Ma),rr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return tb(e,t,i)}formatOffset(e,t){return ll(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function mv(n){return uo[n]||(uo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),uo[n]}const gv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function _v(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function bv(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?g:1e3+g,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ar=null;class bn extends Ml{static get utcInstance(){return ar===null&&(ar=new bn(0)),ar}static instance(e){return e===0?bn.utcInstance:new bn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new bn(Bo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ll(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ll(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ll(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class vv extends Ml{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Fi(n,e){if(ot(n)||n===null)return e;if(n instanceof Ml)return n;if(Q0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?bn.utcInstance:bn.parseSpecifier(t)||Ti.create(n)}else return ls(n)?bn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new vv(n)}let Cu=()=>Date.now(),$u="system",Mu=null,Ou=null,Eu=null,Du;class tn{static get now(){return Cu}static set now(e){Cu=e}static set defaultZone(e){$u=e}static get defaultZone(){return Fi($u,Ma.instance)}static get defaultLocale(){return Mu}static set defaultLocale(e){Mu=e}static get defaultNumberingSystem(){return Ou}static set defaultNumberingSystem(e){Ou=e}static get defaultOutputCalendar(){return Eu}static set defaultOutputCalendar(e){Eu=e}static get throwOnInvalid(){return Du}static set throwOnInvalid(e){Du=e}static resetCaches(){Ft.resetCache(),Ti.resetCache()}}let Au={};function yv(n,e={}){const t=JSON.stringify([n,e]);let i=Au[t];return i||(i=new Intl.ListFormat(n,e),Au[t]=i),i}let Yr={};function Kr(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.DateTimeFormat(n,e),Yr[t]=i),i}let Jr={};function kv(n,e={}){const t=JSON.stringify([n,e]);let i=Jr[t];return i||(i=new Intl.NumberFormat(n,e),Jr[t]=i),i}let Gr={};function wv(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Gr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Gr[s]=l),l}let tl=null;function Sv(){return tl||(tl=new Intl.DateTimeFormat().resolvedOptions().locale,tl)}function Tv(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Kr(n).resolvedOptions()}catch{t=Kr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function Cv(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function $v(n){const e=[];for(let t=1;t<=12;t++){const i=Ye.utc(2016,t,1);e.push(n(i))}return e}function Mv(n){const e=[];for(let t=1;t<=7;t++){const i=Ye.utc(2016,11,13+t);e.push(n(i))}return e}function Hl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function Ov(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class Ev{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=kv(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Ca(e,3);return Gt(t,this.padTo)}}}class Dv{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Ti.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Ye.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Kr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Av{constructor(e,t,i){this.opts={style:"long",...i},!t&&eb()&&(this.rtf=wv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):pv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ft{static fromOpts(e){return Ft.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||tn.defaultLocale,o=l||(s?"en-US":Sv()),r=t||tn.defaultNumberingSystem,a=i||tn.defaultOutputCalendar;return new Ft(o,r,a,l)}static resetCache(){tl=null,Yr={},Jr={},Gr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Ft.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=Tv(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=Cv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ov(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Ft.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Hl(this,e,i,lb,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=$v(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Hl(this,e,i,ab,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=Mv(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Hl(this,void 0,e,()=>ub,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ye.utc(2016,11,13,9),Ye.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Hl(this,e,t,fb,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ye.utc(-40,1,1),Ye.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new Ev(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Dv(e,this.intl,t)}relFormatter(e={}){return new Av(this.intl,this.isEnglish(),e)}listFormatter(e={}){return yv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ns(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Fs(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Rs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function cb(...n){return(e,t)=>{const i={};let s;for(s=0;sh!==void 0&&(g||h&&f)?-h:h;return[{years:d(Ki(t)),months:d(Ki(i)),weeks:d(Ki(s)),days:d(Ki(l)),hours:d(Ki(o)),minutes:d(Ki(r)),seconds:d(Ki(a),a==="-0"),milliseconds:d(Ta(u),c)}]}const Uv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Da(n,e,t,i,s,l,o){const r={year:e.length===2?Wr(Pi(e)):Pi(e),month:sb.indexOf(t)+1,day:Pi(i),hour:Pi(s),minute:Pi(l)};return o&&(r.second=Pi(o)),n&&(r.weekday=n.length>3?ob.indexOf(n)+1:rb.indexOf(n)+1),r}const Wv=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Yv(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Da(e,s,i,t,l,o,r);let h;return a?h=Uv[a]:u?h=0:h=Bo(f,c),[d,new bn(h)]}function Kv(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Jv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Gv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Zv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Iu(n){const[,e,t,i,s,l,o,r]=n;return[Da(e,s,i,t,l,o,r),bn.utcInstance]}function Xv(n){const[,e,t,i,s,l,o,r]=n;return[Da(e,r,t,i,s,l,o),bn.utcInstance]}const Qv=Ns(Lv,Ea),xv=Ns(Pv,Ea),ey=Ns(Nv,Ea),ty=Ns(pb),mb=Fs(Hv,qs,Ol,El),ny=Fs(Fv,qs,Ol,El),iy=Fs(Rv,qs,Ol,El),sy=Fs(qs,Ol,El);function ly(n){return Rs(n,[Qv,mb],[xv,ny],[ey,iy],[ty,sy])}function oy(n){return Rs(Kv(n),[Wv,Yv])}function ry(n){return Rs(n,[Jv,Iu],[Gv,Iu],[Zv,Xv])}function ay(n){return Rs(n,[zv,Bv])}const uy=Fs(qs);function fy(n){return Rs(n,[Vv,uy])}const cy=Ns(qv,jv),dy=Ns(hb),py=Fs(qs,Ol,El);function hy(n){return Rs(n,[cy,mb],[dy,py])}const my="Invalid Duration",gb={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},gy={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...gb},qn=146097/400,gs=146097/4800,_y={years:{quarters:4,months:12,weeks:qn/7,days:qn,hours:qn*24,minutes:qn*24*60,seconds:qn*24*60*60,milliseconds:qn*24*60*60*1e3},quarters:{months:3,weeks:qn/28,days:qn/4,hours:qn*24/4,minutes:qn*24*60/4,seconds:qn*24*60*60/4,milliseconds:qn*24*60*60*1e3/4},months:{weeks:gs/7,days:gs,hours:gs*24,minutes:gs*24*60,seconds:gs*24*60*60,milliseconds:gs*24*60*60*1e3},...gb},xi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],by=xi.slice(0).reverse();function Ji(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new ft(i)}function vy(n){return n<0?Math.floor(n):Math.ceil(n)}function _b(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?vy(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function yy(n,e){by.reduce((t,i)=>ot(e[i])?t:(t&&_b(n,e,t,e,i),i),null)}class ft{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Ft.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?_y:gy,this.isLuxonDuration=!0}static fromMillis(e,t){return ft.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Un(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ft({values:yo(e,ft.normalizeUnit),loc:Ft.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ls(e))return ft.fromMillis(e);if(ft.isDuration(e))return e;if(typeof e=="object")return ft.fromObject(e);throw new Un(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=ay(e);return i?ft.fromObject(i,t):ft.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=fy(e);return i?ft.fromObject(i,t):ft.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the Duration is invalid");const i=e instanceof ti?e:new ti(e,t);if(tn.throwOnInvalid)throw new G0(i);return new ft({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new P_(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?wn.create(this.loc,i).formatDurationFromString(this,e):my}toHuman(e={}){const t=xi.map(i=>{const s=this.values[i];return ot(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Ca(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ft.fromDurationLike(e),i={};for(const s of xi)(Os(t.values,s)||Os(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Ji(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ft.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=nb(e(this.values[i],i));return Ji(this,{values:t},!0)}get(e){return this[ft.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...yo(e,ft.normalizeUnit)};return Ji(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Ji(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return yy(this.matrix,e),Ji(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ft.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of xi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;ls(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)xi.indexOf(u)>xi.indexOf(o)&&_b(this.matrix,s,u,t,o)}else ls(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Ji(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Ji(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of xi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Bs="Invalid Interval";function ky(n,e){return!n||!n.isValid?Ht.invalid("missing or invalid start"):!e||!e.isValid?Ht.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ht.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ys).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Ht.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=ft.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Ht.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Ht.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ht.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Ht.fromDateTimes(t,a.time)),t=null);return Ht.merge(s)}difference(...e){return Ht.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Bs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Bs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Bs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Bs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Bs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ft.invalid(this.invalidReason)}mapEndpoints(e){return Ht.fromDateTimes(e(this.s),e(this.e))}}class Vl{static hasDST(e=tn.defaultZone){const t=Ye.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ti.isValidZone(e)}static normalizeZone(e){return Fi(e,tn.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Ft.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Ft.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Ft.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Ft.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ft.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ft.create(t,null,"gregory").eras(e)}static features(){return{relative:eb()}}}function Lu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ft.fromMillis(i).as("days"))}function wy(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=Lu(r,a);return(u-u%7)/7}],["days",Lu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function Sy(n,e,t,i){let[s,l,o,r]=wy(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?ft.fromMillis(a,i).shiftTo(...u).plus(f):f}const Aa={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Pu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ty=Aa.hanidec.replace(/[\[|\]]/g,"").split("");function Cy(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function xn({numberingSystem:n},e=""){return new RegExp(`${Aa[n||"latn"]}${e}`)}const $y="missing Intl.DateTimeFormat.formatToParts support";function ht(n,e=t=>t){return{regex:n,deser:([t])=>e(Cy(t))}}const My=String.fromCharCode(160),bb=`[ ${My}]`,vb=new RegExp(bb,"g");function Oy(n){return n.replace(/\./g,"\\.?").replace(vb,bb)}function Nu(n){return n.replace(/\./g,"").replace(vb," ").toLowerCase()}function ei(n,e){return n===null?null:{regex:RegExp(n.map(Oy).join("|")),deser:([t])=>n.findIndex(i=>Nu(t)===Nu(i))+e}}function Fu(n,e){return{regex:n,deser:([,t,i])=>Bo(t,i),groups:e}}function ur(n){return{regex:n,deser:([e])=>e}}function Ey(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Dy(n,e){const t=xn(e),i=xn(e,"{2}"),s=xn(e,"{3}"),l=xn(e,"{4}"),o=xn(e,"{6}"),r=xn(e,"{1,2}"),a=xn(e,"{1,3}"),u=xn(e,"{1,6}"),f=xn(e,"{1,9}"),c=xn(e,"{2,4}"),d=xn(e,"{4,6}"),h=_=>({regex:RegExp(Ey(_.val)),deser:([y])=>y,literal:!0}),m=(_=>{if(n.literal)return h(_);switch(_.val){case"G":return ei(e.eras("short",!1),0);case"GG":return ei(e.eras("long",!1),0);case"y":return ht(u);case"yy":return ht(c,Wr);case"yyyy":return ht(l);case"yyyyy":return ht(d);case"yyyyyy":return ht(o);case"M":return ht(r);case"MM":return ht(i);case"MMM":return ei(e.months("short",!0,!1),1);case"MMMM":return ei(e.months("long",!0,!1),1);case"L":return ht(r);case"LL":return ht(i);case"LLL":return ei(e.months("short",!1,!1),1);case"LLLL":return ei(e.months("long",!1,!1),1);case"d":return ht(r);case"dd":return ht(i);case"o":return ht(a);case"ooo":return ht(s);case"HH":return ht(i);case"H":return ht(r);case"hh":return ht(i);case"h":return ht(r);case"mm":return ht(i);case"m":return ht(r);case"q":return ht(r);case"qq":return ht(i);case"s":return ht(r);case"ss":return ht(i);case"S":return ht(a);case"SSS":return ht(s);case"u":return ur(f);case"uu":return ur(r);case"uuu":return ht(t);case"a":return ei(e.meridiems(),0);case"kkkk":return ht(l);case"kk":return ht(c,Wr);case"W":return ht(r);case"WW":return ht(i);case"E":case"c":return ht(t);case"EEE":return ei(e.weekdays("short",!1,!1),1);case"EEEE":return ei(e.weekdays("long",!1,!1),1);case"ccc":return ei(e.weekdays("short",!0,!1),1);case"cccc":return ei(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Fu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Fu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ur(/[a-z_+-/]{1,256}?/i);default:return h(_)}})(n)||{invalidReason:$y};return m.token=n,m}const Ay={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function Iy(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=Ay[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function Ly(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Py(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Os(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function Ny(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return ot(n.z)||(t=Ti.create(n.z)),ot(n.Z)||(t||(t=new bn(n.Z)),i=n.Z),ot(n.q)||(n.M=(n.q-1)*3+1),ot(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),ot(n.u)||(n.S=Ta(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let fr=null;function Fy(){return fr||(fr=Ye.fromMillis(1555555555555)),fr}function Ry(n,e){if(n.literal)return n;const t=wn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=wn.create(e,t).formatDateTimeParts(Fy()).map(o=>Iy(o,e,t));return l.includes(void 0)?n:l}function qy(n,e){return Array.prototype.concat(...n.map(t=>Ry(t,e)))}function yb(n,e,t){const i=qy(wn.parseFormat(t),n),s=i.map(o=>Dy(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=Ly(s),a=RegExp(o,"i"),[u,f]=Py(e,a,r),[c,d,h]=f?Ny(f):[null,null,void 0];if(Os(f,"a")&&Os(f,"H"))throw new el("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function jy(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=yb(n,e,t);return[i,s,l,o]}const kb=[0,31,59,90,120,151,181,212,243,273,304,334],wb=[0,31,60,91,121,152,182,213,244,274,305,335];function Yn(n,e){return new ti("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Sb(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function Tb(n,e,t){return t+($l(n)?wb:kb)[e-1]}function Cb(n,e){const t=$l(n)?wb:kb,i=t.findIndex(l=>lvo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Uo(n)}}function Ru(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Sb(e,1,4),l=sl(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=sl(r)):o>l?(r=e+1,o-=sl(e)):r=e;const{month:a,day:u}=Cb(r,o);return{year:r,month:a,day:u,...Uo(n)}}function cr(n){const{year:e,month:t,day:i}=n,s=Tb(e,t,i);return{year:e,ordinal:s,...Uo(n)}}function qu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Cb(e,t);return{year:e,month:i,day:s,...Uo(n)}}function Hy(n){const e=zo(n.weekYear),t=Si(n.weekNumber,1,vo(n.weekYear)),i=Si(n.weekday,1,7);return e?t?i?!1:Yn("weekday",n.weekday):Yn("week",n.week):Yn("weekYear",n.weekYear)}function Vy(n){const e=zo(n.year),t=Si(n.ordinal,1,sl(n.year));return e?t?!1:Yn("ordinal",n.ordinal):Yn("year",n.year)}function $b(n){const e=zo(n.year),t=Si(n.month,1,12),i=Si(n.day,1,bo(n.year,n.month));return e?t?i?!1:Yn("day",n.day):Yn("month",n.month):Yn("year",n.year)}function Mb(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=Si(e,0,23)||e===24&&t===0&&i===0&&s===0,o=Si(t,0,59),r=Si(i,0,59),a=Si(s,0,999);return l?o?r?a?!1:Yn("millisecond",s):Yn("second",i):Yn("minute",t):Yn("hour",e)}const dr="Invalid DateTime",ju=864e13;function zl(n){return new ti("unsupported zone",`the zone "${n.name}" is not supported`)}function pr(n){return n.weekData===null&&(n.weekData=Zr(n.c)),n.weekData}function Us(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Ye({...t,...e,old:t})}function Ob(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Hu(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function fo(n,e,t){return Ob($a(n),e,t)}function Vu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,bo(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ft.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=$a(l);let[a,u]=Ob(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Ws(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Ye.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Ye.invalid(new ti("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Bl(n,e,t=!0){return n.isValid?wn.create(Ft.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function hr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Gt(n.c.year,t?6:4),e?(i+="-",i+=Gt(n.c.month),i+="-",i+=Gt(n.c.day)):(i+=Gt(n.c.month),i+=Gt(n.c.day)),i}function zu(n,e,t,i,s,l){let o=Gt(n.c.hour);return e?(o+=":",o+=Gt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Gt(n.c.minute),(n.c.second!==0||!t)&&(o+=Gt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Gt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Gt(Math.trunc(-n.o/60)),o+=":",o+=Gt(Math.trunc(-n.o%60))):(o+="+",o+=Gt(Math.trunc(n.o/60)),o+=":",o+=Gt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Eb={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},zy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},By={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Db=["year","month","day","hour","minute","second","millisecond"],Uy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Wy=["year","ordinal","hour","minute","second","millisecond"];function Bu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new P_(n);return e}function Uu(n,e){const t=Fi(e.zone,tn.defaultZone),i=Ft.fromObject(e),s=tn.now();let l,o;if(ot(n.year))l=s;else{for(const u of Db)ot(n[u])&&(n[u]=Eb[u]);const r=$b(n)||Mb(n);if(r)return Ye.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new Ye({ts:l,zone:t,loc:i,o})}function Wu(n,e,t){const i=ot(t.round)?!0:t.round,s=(o,r)=>(o=Ca(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Yu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Ye{constructor(e){const t=e.zone||tn.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ti("invalid input"):null)||(t.isValid?null:zl(t));this.ts=ot(e.ts)?tn.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Hu(this.ts,r),i=Number.isNaN(s.year)?new ti("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Ft.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Ye({})}static local(){const[e,t]=Yu(arguments),[i,s,l,o,r,a,u]=t;return Uu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Yu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=bn.utcInstance,Uu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=x0(e)?e.valueOf():NaN;if(Number.isNaN(i))return Ye.invalid("invalid input");const s=Fi(t.zone,tn.defaultZone);return s.isValid?new Ye({ts:i,zone:s,loc:Ft.fromObject(t)}):Ye.invalid(zl(s))}static fromMillis(e,t={}){if(ls(e))return e<-ju||e>ju?Ye.invalid("Timestamp out of range"):new Ye({ts:e,zone:Fi(t.zone,tn.defaultZone),loc:Ft.fromObject(t)});throw new Un(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ls(e))return new Ye({ts:e*1e3,zone:Fi(t.zone,tn.defaultZone),loc:Ft.fromObject(t)});throw new Un("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Fi(t.zone,tn.defaultZone);if(!i.isValid)return Ye.invalid(zl(i));const s=tn.now(),l=ot(t.specificOffset)?i.offset(s):t.specificOffset,o=yo(e,Bu),r=!ot(o.ordinal),a=!ot(o.year),u=!ot(o.month)||!ot(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Ft.fromObject(t);if((f||r)&&c)throw new el("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new el("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let g,m,_=Hu(s,l);h?(g=Uy,m=zy,_=Zr(_)):r?(g=Wy,m=By,_=cr(_)):(g=Db,m=Eb);let y=!1;for(const D of g){const L=o[D];ot(L)?y?o[D]=m[D]:o[D]=_[D]:y=!0}const S=h?Hy(o):r?Vy(o):$b(o),C=S||Mb(o);if(C)return Ye.invalid(C);const T=h?Ru(o):r?qu(o):o,[$,O]=fo(T,l,i),M=new Ye({ts:$,zone:i,o:O,loc:d});return o.weekday&&f&&e.weekday!==M.weekday?Ye.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${M.toISO()}`):M}static fromISO(e,t={}){const[i,s]=ly(e);return Ws(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=oy(e);return Ws(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=ry(e);return Ws(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(ot(e)||ot(t))throw new Un("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Ft.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=jy(o,e,t);return f?Ye.invalid(f):Ws(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Ye.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=hy(e);return Ws(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the DateTime is invalid");const i=e instanceof ti?e:new ti(e,t);if(tn.throwOnInvalid)throw new K0(i);return new Ye({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?pr(this).weekYear:NaN}get weekNumber(){return this.isValid?pr(this).weekNumber:NaN}get weekday(){return this.isValid?pr(this).weekday:NaN}get ordinal(){return this.isValid?cr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Vl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Vl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Vl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Vl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return $l(this.year)}get daysInMonth(){return bo(this.year,this.month)}get daysInYear(){return this.isValid?sl(this.year):NaN}get weeksInWeekYear(){return this.isValid?vo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=wn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(bn.instance(e),t)}toLocal(){return this.setZone(tn.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Fi(e,tn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=fo(o,l,e)}return Us(this,{ts:s,zone:e})}else return Ye.invalid(zl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Us(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=yo(e,Bu),i=!ot(t.weekYear)||!ot(t.weekNumber)||!ot(t.weekday),s=!ot(t.ordinal),l=!ot(t.year),o=!ot(t.month)||!ot(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new el("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new el("Can't mix ordinal dates with month/day");let u;i?u=Ru({...Zr(this.c),...t}):ot(t.ordinal)?(u={...this.toObject(),...t},ot(t.day)&&(u.day=Math.min(bo(u.year,u.month),u.day))):u=qu({...cr(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return Us(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=ft.fromDurationLike(e);return Us(this,Vu(this,t))}minus(e){if(!this.isValid)return this;const t=ft.fromDurationLike(e).negate();return Us(this,Vu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ft.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?wn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):dr}toLocaleString(e=Ur,t={}){return this.isValid?wn.create(this.loc.clone(t),e).formatDateTime(this):dr}toLocaleParts(e={}){return this.isValid?wn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=hr(this,o);return r+="T",r+=zu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?hr(this,e==="extended"):null}toISOWeekDate(){return Bl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+zu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Bl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Bl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?hr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Bl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():dr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return ft.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=ev(t).map(ft.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Sy(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Ye.now(),e,t)}until(e){return this.isValid?Ht.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Ye.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Ye.isDateTime))throw new Un("max requires all arguments be DateTimes");return Su(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Ft.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return yb(o,e,t)}static fromStringExplain(e,t,i={}){return Ye.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ur}static get DATE_MED(){return N_}static get DATE_MED_WITH_WEEKDAY(){return Z0}static get DATE_FULL(){return F_}static get DATE_HUGE(){return R_}static get TIME_SIMPLE(){return q_}static get TIME_WITH_SECONDS(){return j_}static get TIME_WITH_SHORT_OFFSET(){return H_}static get TIME_WITH_LONG_OFFSET(){return V_}static get TIME_24_SIMPLE(){return z_}static get TIME_24_WITH_SECONDS(){return B_}static get TIME_24_WITH_SHORT_OFFSET(){return U_}static get TIME_24_WITH_LONG_OFFSET(){return W_}static get DATETIME_SHORT(){return Y_}static get DATETIME_SHORT_WITH_SECONDS(){return K_}static get DATETIME_MED(){return J_}static get DATETIME_MED_WITH_SECONDS(){return G_}static get DATETIME_MED_WITH_WEEKDAY(){return X0}static get DATETIME_FULL(){return Z_}static get DATETIME_FULL_WITH_SECONDS(){return X_}static get DATETIME_HUGE(){return Q_}static get DATETIME_HUGE_WITH_SECONDS(){return x_}}function Ys(n){if(Ye.isDateTime(n))return n;if(n&&n.valueOf&&ls(n.valueOf()))return Ye.fromJSDate(n);if(n&&typeof n=="object")return Ye.fromObject(n);throw new Un(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Yy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Ky=[".mp4",".avi",".mov",".3gp",".wmv"],Jy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Gy=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=j.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!j.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):j.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||j.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,l.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let s="";for(let l=0;ll.replaceAll("{_PB_ESCAPED_}",t));for(let l of s)l=l.trim(),j.isEmpty(l)||i.push(l);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],s=t.length>1?t.trim():t;for(let l of e)l=typeof l=="string"?l.trim():"",j.isEmpty(l)||i.push(l.replaceAll(s,"\\"+s));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Ye.fromFormat(e,i,{zone:"UTC"})}return Ye.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.click(),i.remove()}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2));t=t.endsWith(".json")?t:t+".json",j.download(i,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!Yy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Ky.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Jy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Gy.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)j.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,u,f,c,d,h,g;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",s=(e==null?void 0:e.type)==="view",l={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(l.username="username123",l.verified=!1,l.emailVisibility=!0,l.email="test@example.com"),(!s||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(l.created="2022-01-01 01:00:00.123Z"),(!s||j.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(l.updated="2022-01-01 23:59:59.456Z");for(const m of t){let _=null;m.type==="number"?_=123:m.type==="date"?_="2022-01-01 10:00:00.123Z":m.type==="bool"?_=!0:m.type==="email"?_="test@example.com":m.type==="url"?_="https://example.com":m.type==="json"?_="JSON":m.type==="file"?(_="filename.jpg",((f=m.options)==null?void 0:f.maxSelect)!==1&&(_=[_])):m.type==="select"?(_=(d=(c=m.options)==null?void 0:c.values)==null?void 0:d[0],((h=m.options)==null?void 0:h.maxSelect)!==1&&(_=[_])):m.type==="relation"?(_="RELATION_RECORD_ID",((g=m.options)==null?void 0:g.maxSelect)!==1&&(_=[_])):_="test",l[m.name]=_}return l}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=j.isObject(u)&&j.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(s){let l=s.parentNode;for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}function i(s){if(s){for(const l of s.children)i(l);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(s,l)=>{i(l.node)},file_picker_types:"image",file_picker_callback:(s,l,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,h=f.result.split(",")[1],g=d.create(c,u,h);d.add(g),s(g.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:s=>{s.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&s.formElement&&(o.preventDefault(),o.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const l="tinymce_last_direction";s.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(l);!s.isDirty()&&s.getContent()==""&&o=="rtl"&&s.execCommand("mceDirectionRTL")}),s.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"ltr"),s.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"rtl"),s.execCommand("mceDirectionRTL")}}])}}),s.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{s.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{s.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of l){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A"){if(j.isEmpty(e))return t;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e)||t;if(Array.isArray(e))return e.join(",");if(typeof e=="object")try{return j.truncate(JSON.stringify(e))||t}catch{return t}return""+e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+l);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const s=e.schema||[];for(const l of s)j.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let h of r){h=h.trim().replaceAll("{PB_TEMP}",",");const m=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(h);if((m==null?void 0:m.length)!=4)continue;const _=(c=(f=m[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");_&&t.columns.push({name:_,collate:m[2]||"",sort:((d=m[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=j.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?j.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getQueryParams(){let e="",t=window.location.href;const i=t.indexOf("?");return i>-1&&(e=t.substring(i+1),t=t.substring(0,i)),Object.fromEntries(new URLSearchParams(e))}static replaceQueryParams(e){e=e||{};let t="",i=window.location.href;const s=i.indexOf("?");s>-1&&(t=i.substring(s+1),i=i.substring(0,s));const l=new URLSearchParams(t);for(let o in e){const r=e[o];r===null?l.delete(o):l.set(o,r)}t=l.toString(),t!=""&&(i+="?"+t),window.location.replace(i)}}const Uo=Ln([]);function yo(n,e=4e3){return Wo(n,"info",e)}function zt(n,e=3e3){return Wo(n,"success",e)}function Ci(n,e=4500){return Wo(n,"error",e)}function Xy(n,e=4500){return Wo(n,"warning",e)}function Wo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Ib(i)},t)};Uo.update(s=>(La(s,i.message),j.pushOrReplaceByKey(s,i,"message"),s))}function Ib(n){Uo.update(e=>(La(e,n),e))}function Ia(){Uo.update(n=>{for(let e of n)La(n,e);return[]})}function La(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const Mi=Ln({});function ln(n){Mi.set(n||{})}function pi(n){Mi.update(e=>(j.deleteByPath(e,n),e))}const Pa=Ln({});function Xr(n){Pa.set(n||{})}const Zn=Ln([]),hi=Ln({}),ko=Ln(!1),Lb=Ln({});function Qy(n){Zn.update(e=>{const t=j.findByKey(e,"id",n);return t?hi.set(t):e.length&&hi.set(e[0]),e})}function xy(n){hi.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Zn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Na(),j.sortCollections(e)))}function ek(n){Zn.update(e=>(j.removeByKey(e,"id",n.id),hi.update(t=>t.id===n.id?e[0]:t),Na(),e))}async function tk(n=null){ko.set(!0);try{let e=await de.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Zn.set(e);const t=n&&j.findByKey(e,"id",n);t?hi.set(t):e.length&&hi.set(e[0]),Na()}catch(e){de.error(e)}ko.set(!1)}function Na(){Lb.update(n=>(Zn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const hr="pb_admin_file_token";Ho.prototype.logout=function(n=!0){this.authStore.clear(),n&&us("/login")};Ho.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Ci(l),j.isEmpty(s.data)||ln(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),us("/")};Ho.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=a0(Lb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(hr)||"";return(!t||wa(t,10))&&(t&&localStorage.removeItem(hr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(hr,t),this._adminFileTokenRequest=null),t};class nk extends L_{save(e,t){super.save(e,t),t&&!t.collectionId&&Xr(t)}clear(){super.clear(),Xr(null)}}const de=new Ho("../",new nk("pb_admin_auth"));de.authStore.model&&!de.authStore.model.collectionId&&Xr(de.authStore.model);const ik=n=>({}),Ku=n=>({});function sk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;const g=n[3].default,m=Ct(g,n,n[2],null),_=n[3].footer,y=Ct(_,n,n[2],Ku);return{c(){e=v("div"),t=v("main"),m&&m.c(),i=E(),s=v("footer"),y&&y.c(),l=E(),o=v("a"),o.innerHTML=' Docs',r=E(),a=v("span"),a.textContent="|",u=E(),f=v("a"),c=v("span"),c.textContent="PocketBase v0.18.10",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(f,"href","https://github.com/pocketbase/pocketbase/releases"),p(f,"target","_blank"),p(f,"rel","noopener noreferrer"),p(f,"title","Releases"),p(s,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(S,C){w(S,e,C),b(e,t),m&&m.m(t,null),b(e,i),b(e,s),y&&y.m(s,null),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(s,f),b(f,c),h=!0},p(S,[C]){m&&m.p&&(!h||C&4)&&Mt(m,g,S,S[2],h?$t(g,S[2],C,null):Ot(S[2]),null),y&&y.p&&(!h||C&4)&&Mt(y,_,S,S[2],h?$t(_,S[2],C,ik):Ot(S[2]),Ku),(!h||C&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!h||C&3)&&Q(e,"center-content",S[0])},i(S){h||(A(m,S),A(y,S),h=!0)},o(S){I(m,S),I(y,S),h=!1},d(S){S&&k(e),m&&m.d(S),y&&y.d(S)}}}function lk(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Tn extends be{constructor(e){super(),_e(this,e,lk,sk,ge,{center:0,class:1})}}function Ju(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',t=E(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function ok(n){let e,t,i,s=!n[0]&&Ju();const l=n[1].default,o=Ct(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=E(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Ju(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Mt(o,l,r,r[2],i?$t(l,r[2],a,null):Ot(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function rk(n){let e,t;return e=new Tn({props:{class:"full-page",center:!0,$$slots:{default:[ok]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ak(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Pb extends be{constructor(e){super(),_e(this,e,ak,rk,ge,{nobranding:0})}}function Yo(n){const e=n-1;return e*e*e+1}function hl(n,{delay:e=0,duration:t=400,easing:i=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function mi(n,{delay:e=0,duration:t=400,easing:i=Yo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=du(s),[h,g]=du(l);return{delay:e,duration:t,easing:i,css:(m,_)=>` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=j.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?j.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getQueryParams(){let e="",t=window.location.href;const i=t.indexOf("?");return i>-1&&(e=t.substring(i+1),t=t.substring(0,i)),Object.fromEntries(new URLSearchParams(e))}static replaceQueryParams(e){e=e||{};let t="",i=window.location.href;const s=i.indexOf("?");s>-1&&(t=i.substring(s+1),i=i.substring(0,s));const l=new URLSearchParams(t);for(let o in e){const r=e[o];r===null?l.delete(o):l.set(o,r)}t=l.toString(),t!=""&&(i+="?"+t),window.location.replace(i)}}const Wo=Ln([]);function ko(n,e=4e3){return Yo(n,"info",e)}function zt(n,e=3e3){return Yo(n,"success",e)}function Ci(n,e=4500){return Yo(n,"error",e)}function Zy(n,e=4500){return Yo(n,"warning",e)}function Yo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Ab(i)},t)};Wo.update(s=>(La(s,i.message),j.pushOrReplaceByKey(s,i,"message"),s))}function Ab(n){Wo.update(e=>(La(e,n),e))}function Ia(){Wo.update(n=>{for(let e of n)La(n,e);return[]})}function La(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const Mi=Ln({});function ln(n){Mi.set(n||{})}function pi(n){Mi.update(e=>(j.deleteByPath(e,n),e))}const Pa=Ln({});function Xr(n){Pa.set(n||{})}const Zn=Ln([]),hi=Ln({}),wo=Ln(!1),Ib=Ln({});function Xy(n){Zn.update(e=>{const t=j.findByKey(e,"id",n);return t?hi.set(t):e.length&&hi.set(e[0]),e})}function Qy(n){hi.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Zn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Na(),j.sortCollections(e)))}function xy(n){Zn.update(e=>(j.removeByKey(e,"id",n.id),hi.update(t=>t.id===n.id?e[0]:t),Na(),e))}async function ek(n=null){wo.set(!0);try{let e=await ce.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Zn.set(e);const t=n&&j.findByKey(e,"id",n);t?hi.set(t):e.length&&hi.set(e[0]),Na()}catch(e){ce.error(e)}wo.set(!1)}function Na(){Ib.update(n=>(Zn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const mr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&us("/login")};Vo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Ci(l),j.isEmpty(s.data)||ln(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),us("/")};Vo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=r0(Ib);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(mr)||"";return(!t||wa(t,10))&&(t&&localStorage.removeItem(mr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(mr,t),this._adminFileTokenRequest=null),t};class tk extends I_{save(e,t){super.save(e,t),t&&!t.collectionId&&Xr(t)}clear(){super.clear(),Xr(null)}}const ce=new Vo("../",new tk("pb_admin_auth"));ce.authStore.model&&!ce.authStore.model.collectionId&&Xr(ce.authStore.model);const nk=n=>({}),Ku=n=>({});function ik(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;const g=n[3].default,m=Ct(g,n,n[2],null),_=n[3].footer,y=Ct(_,n,n[2],Ku);return{c(){e=v("div"),t=v("main"),m&&m.c(),i=E(),s=v("footer"),y&&y.c(),l=E(),o=v("a"),o.innerHTML=' Docs',r=E(),a=v("span"),a.textContent="|",u=E(),f=v("a"),c=v("span"),c.textContent="PocketBase v0.18.10",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(f,"href","https://github.com/pocketbase/pocketbase/releases"),p(f,"target","_blank"),p(f,"rel","noopener noreferrer"),p(f,"title","Releases"),p(s,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(S,C){w(S,e,C),b(e,t),m&&m.m(t,null),b(e,i),b(e,s),y&&y.m(s,null),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(s,f),b(f,c),h=!0},p(S,[C]){m&&m.p&&(!h||C&4)&&Mt(m,g,S,S[2],h?$t(g,S[2],C,null):Ot(S[2]),null),y&&y.p&&(!h||C&4)&&Mt(y,_,S,S[2],h?$t(_,S[2],C,nk):Ot(S[2]),Ku),(!h||C&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!h||C&3)&&Q(e,"center-content",S[0])},i(S){h||(A(m,S),A(y,S),h=!0)},o(S){I(m,S),I(y,S),h=!1},d(S){S&&k(e),m&&m.d(S),y&&y.d(S)}}}function sk(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Tn extends ve{constructor(e){super(),be(this,e,sk,ik,ge,{center:0,class:1})}}function Ju(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',t=E(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function lk(n){let e,t,i,s=!n[0]&&Ju();const l=n[1].default,o=Ct(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=E(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Ju(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Mt(o,l,r,r[2],i?$t(l,r[2],a,null):Ot(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function ok(n){let e,t;return e=new Tn({props:{class:"full-page",center:!0,$$slots:{default:[lk]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rk(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Lb extends ve{constructor(e){super(),be(this,e,rk,ok,ge,{nobranding:0})}}function Ko(n){const e=n-1;return e*e*e+1}function ml(n,{delay:e=0,duration:t=400,easing:i=Tl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function mi(n,{delay:e=0,duration:t=400,easing:i=Ko,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=du(s),[h,g]=du(l);return{delay:e,duration:t,easing:i,css:(m,_)=>` transform: ${u} translate(${(1-m)*c}${d}, ${(1-m)*h}${g}); - opacity: ${a-f*_}`}}function lt(n,{delay:e=0,duration:t=400,easing:i=Yo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),h=parseFloat(l[`margin${f[0]}`]),g=parseFloat(l[`margin${f[1]}`]),m=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*h}px;margin-${u[1]}: ${y*g}px;border-${u[0]}-width: ${y*m}px;border-${u[1]}-width: ${y*_}px;`}}function Qt(n,{delay:e=0,duration:t=400,easing:i=Yo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` + opacity: ${a-f*_}`}}function lt(n,{delay:e=0,duration:t=400,easing:i=Ko,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),h=parseFloat(l[`margin${f[0]}`]),g=parseFloat(l[`margin${f[1]}`]),m=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*h}px;margin-${u[1]}: ${y*g}px;border-${u[0]}-width: ${y*m}px;border-${u[1]}-width: ${y*_}px;`}}function Qt(n,{delay:e=0,duration:t=400,easing:i=Ko,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} - `}}let Qr,Gi;const xr="app-tooltip";function Gu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Hi(){return Gi=Gi||document.querySelector("."+xr),Gi||(Gi=document.createElement("div"),Gi.classList.add(xr),document.body.appendChild(Gi)),Gi}function Nb(n,e){let t=Hi();if(!t.classList.contains("active")||!(e!=null&&e.text)){ea();return}t.textContent=e.text,t.className=xr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function ea(){clearTimeout(Qr),Hi().classList.remove("active"),Hi().activeNode=void 0}function uk(n,e){Hi().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Hi().classList.add("active"),Nb(n,e)},isNaN(e.delay)?0:e.delay)}function Be(n,e){let t=Gu(e);function i(){uk(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",s),Hi(),{update(l){var o,r;t=Gu(l),(r=(o=Hi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Nb(n,t)},destroy(){var l,o;(o=(l=Hi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Zu(n,e,t){const i=n.slice();return i[12]=e[t],i}const fk=n=>({}),Xu=n=>({uniqueId:n[4]});function ck(n){let e,t,i=pe(n[3]),s=[];for(let o=0;oI(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=He(t,Qt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=He(t,Qt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Qu(n){let e,t,i=wo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=wo(a[12])+"")&&le(s,i)},i(a){r||(a&&xe(()=>{r&&(o||(o=He(e,lt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,lt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function pk(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Ct(a,n,n[8],Xu),f=[dk,ck],c=[];function d(h,g){return h[0]&&h[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(h,g){w(h,e,g),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(h,[g]){u&&u.p&&(!l||g&256)&&Mt(u,a,h,h[8],l?$t(a,h[8],g,fk):Ot(h[8]),Xu);let m=i;i=d(h),i===m?c[i].p(h,g):(re(),I(c[m],1,1,()=>{c[m]=null}),ae(),s=c[i],s?s.p(h,g):(s=c[i]=f[i](h),s.c()),A(s,1),s.m(e,null)),(!l||g&2)&&p(e,"class",h[1]),(!l||g&10)&&Q(e,"error",h[3].length)},i(h){l||(A(u,h),A(s),l=!0)},o(h){I(u,h),I(s),l=!1},d(h){h&&k(e),u&&u.d(h),c[i].d(),n[11](null),o=!1,r()}}}const xu="Invalid value";function wo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||xu:n||xu}function hk(n,e,t){let i;Ge(n,Mi,m=>t(7,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){pi(r)}Kt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function h(m){Fe.call(this,n,m)}function g(m){te[m?"unshift":"push"](()=>{f=m,t(2,f)})}return n.$$set=m=>{"name"in m&&t(5,r=m.name),"inlineError"in m&&t(0,a=m.inlineError),"class"in m&&t(1,u=m.class),"$$scope"in m&&t(8,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,h,g]}class me extends be{constructor(e){super(),_e(this,e,hk,pk,ge,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function mk(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&ce(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function gk(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ce(l,n[1]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&ce(l,c[1])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function _k(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&ce(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function bk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new me({props:{class:"form-field required",name:"email",$$slots:{default:[mk,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[gk,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[_k,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

Create your first admin account in order to continue

",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("button"),f.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,m){w(g,e,m),b(e,t),b(e,i),H(s,e,null),b(e,l),H(o,e,null),b(e,r),H(a,e,null),b(e,u),b(e,f),c=!0,d||(h=Y(e,"submit",Ze(n[4])),d=!0)},p(g,[m]){const _={};m&1537&&(_.$$scope={dirty:m,ctx:g}),s.$set(_);const y={};m&1538&&(y.$$scope={dirty:m,ctx:g}),o.$set(y);const S={};m&1540&&(S.$$scope={dirty:m,ctx:g}),a.$set(S),(!c||m&8)&&Q(f,"btn-disabled",g[3]),(!c||m&8)&&Q(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){I(s.$$.fragment,g),I(o.$$.fragment,g),I(a.$$.fragment,g),c=!1},d(g){g&&k(e),V(s),V(o),V(a),d=!1,h()}}}function vk(n,e,t){const i=dt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await de.admins.create({email:s,password:l,passwordConfirm:o}),await de.admins.authWithPassword(s,l),i("submit")}catch(d){de.error(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class yk extends be{constructor(e){super(),_e(this,e,vk,bk,ge,{})}}function ef(n){let e,t;return e=new Pb({props:{$$slots:{default:[kk]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function kk(n){let e,t;return e=new yk({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function wk(n){let e,t,i=n[0]&&ef(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=ef(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function Sk(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){de.logout(!1),t(0,i=!0);return}de.authStore.isValid?us("/collections"):de.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class Tk extends be{constructor(e){super(),_e(this,e,Sk,wk,ge,{})}}const Nt=Ln(""),So=Ln(""),Os=Ln(!1);function Ck(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),ce(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&ce(e,l[7])},i:x,o:x,d(l){l&&k(e),n[13](null),i=!1,s()}}}function $k(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=Lt(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Lt(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ve(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function tf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,mi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function nf(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[15]),s=!0)},p:x,i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,mi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Mk(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[$k,Ck],h=[];function g(y,S){return y[4]&&!y[5]?0:1}l=g(n),o=h[l]=d[l](n);let m=(n[0].length||n[7].length)&&n[7]!=n[0]&&tf(),_=(n[0].length||n[7].length)&&nf(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=E(),o.c(),r=E(),m&&m.c(),a=E(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),b(e,t),b(t,i),b(e,s),h[l].m(e,null),b(e,r),m&&m.m(e,null),b(e,a),_&&_.m(e,null),u=!0,f||(c=[Y(e,"click",Sn(n[11])),Y(e,"submit",Ze(n[10]))],f=!0)},p(y,[S]){let C=l;l=g(y),l===C?h[l].p(y,S):(re(),I(h[C],1,1,()=>{h[C]=null}),ae(),o=h[l],o?o.p(y,S):(o=h[l]=d[l](y),o.c()),A(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?m?S&129&&A(m,1):(m=tf(),m.c(),A(m,1),m.m(e,a)):m&&(re(),I(m,1,1,()=>{m=null}),ae()),y[0].length||y[7].length?_?(_.p(y,S),S&129&&A(_,1)):(_=nf(y),_.c(),A(_,1),_.m(e,null)):_&&(re(),I(_,1,1,()=>{_=null}),ae())},i(y){u||(A(o),A(m),A(_),u=!0)},o(y){I(o),I(m),I(_),u=!1},d(y){y&&k(e),h[l].d(),m&&m.d(),_&&_.d(),f=!1,$e(c)}}}function Ok(n,e,t){const i=dt(),s="search_"+j.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h($=!0){t(7,d=""),$&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function m(){u||f||(t(5,f=!0),t(4,u=(await ut(()=>import("./FilterAutocompleteInput-67803140.js"),["./FilterAutocompleteInput-67803140.js","./index-808c8630.js"],import.meta.url)).default),t(5,f=!1))}Kt(()=>{m()});function _($){Fe.call(this,n,$)}function y($){d=$,t(7,d),t(0,l)}function S($){te[$?"unshift":"push"](()=>{c=$,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const T=()=>{h(!1),g()};return n.$$set=$=>{"value"in $&&t(0,l=$.value),"placeholder"in $&&t(1,o=$.placeholder),"autocompleteCollection"in $&&t(2,r=$.autocompleteCollection),"extraAutocompleteKeys"in $&&t(3,a=$.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,_,y,S,C,T]}class El extends be{constructor(e){super(),_e(this,e,Ok,Mk,ge,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Ek(n){let e,t,i,s,l,o;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),Q(e,"refreshing",n[2])},m(r,a){w(r,e,a),b(e,t),l||(o=[Te(s=Be.call(null,e,n[0])),Y(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&Et(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:x,o:x,d(r){r&&k(e),l=!1,$e(o)}}}function Dk(n,e,t){const i=dt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return Kt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Ko extends be{constructor(e){super(),_e(this,e,Dk,Ek,ge,{tooltip:0,class:1})}}function Ak(n){let e,t,i,s,l;const o=n[6].default,r=Ct(o,n,n[5],null);return{c(){e=v("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Mt(r,o,a,a[5],i?$t(o,a[5],u,null):Ot(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function Ik(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class hn extends be{constructor(e){super(),_e(this,e,Ik,Ak,ge,{class:1,name:2,sort:0,disable:3})}}function Lk(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Pk(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("div"),t=v("div"),i=U(n[2]),s=E(),l=v("div"),o=U(n[1]),r=U(" UTC"),p(t,"class","date"),p(l,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(l,r),a||(u=Te(Be.call(null,e,n[3])),a=!0)},p(f,c){c&4&&le(i,f[2]),c&2&&le(o,f[1])},d(f){f&&k(e),a=!1,u()}}}function Nk(n){let e;function t(l,o){return l[0]?Pk:Lk}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function Fk(n,e,t){let i,s,{date:l=""}=e;const o={get text(){return j.formatToLocalDate(l)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,l=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i,o]}class $i extends be{constructor(e){super(),_e(this,e,Fk,Nk,ge,{date:0})}}const Rk=n=>({}),sf=n=>({}),qk=n=>({}),lf=n=>({});function jk(n){let e,t,i,s,l,o,r,a;const u=n[11].before,f=Ct(u,n,n[10],lf),c=n[11].default,d=Ct(c,n,n[10],null),h=n[11].after,g=Ct(h,n,n[10],sf);return{c(){e=v("div"),f&&f.c(),t=E(),i=v("div"),d&&d.c(),l=E(),g&&g.c(),p(i,"class",s="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(m,_){w(m,e,_),f&&f.m(e,null),b(e,t),b(e,i),d&&d.m(i,null),n[12](i),b(e,l),g&&g.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(m,[_]){f&&f.p&&(!o||_&1024)&&Mt(f,u,m,m[10],o?$t(u,m[10],_,qk):Ot(m[10]),lf),d&&d.p&&(!o||_&1024)&&Mt(d,c,m,m[10],o?$t(c,m[10],_,null):Ot(m[10]),null),(!o||_&9&&s!==(s="scroller "+m[0]+" "+m[3]+" svelte-3a0gfs"))&&p(i,"class",s),g&&g.p&&(!o||_&1024)&&Mt(g,h,m,m[10],o?$t(h,m[10],_,Rk):Ot(m[10]),sf)},i(m){o||(A(f,m),A(d,m),A(g,m),o=!0)},o(m){I(f,m),I(d,m),I(g,m),o=!1},d(m){m&&k(e),f&&f.d(m),d&&d.d(m),n[12](null),g&&g.d(m),r=!1,$e(a)}}}function Hk(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=dt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,h,g,m,_,y;function S(){f&&t(2,f.scrollTop=0,f)}function C(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),m=f.clientWidth+2,_=f.clientHeight+2,h=f.scrollWidth-m,g=f.scrollHeight-_,g>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),l("vScrollStart")),f.scrollTop+r>=g&&(t(3,c+=" v-scroll-end"),l("vScrollEnd"))):u&&l("vScrollEnd"),h>0?(t(3,c+=" h-scroll"),a>=m&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),l("hScrollStart")),f.scrollLeft+a>=h&&(t(3,c+=" h-scroll-end"),l("hScrollEnd"))):u&&l("hScrollEnd"))}function $(){d||(d=setTimeout(()=>{T(),d=null},150))}Kt(()=>($(),y=new MutationObserver($),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(M){te[M?"unshift":"push"](()=>{f=M,t(2,f)})}return n.$$set=M=>{"class"in M&&t(0,o=M.class),"vThreshold"in M&&t(4,r=M.vThreshold),"hThreshold"in M&&t(5,a=M.hThreshold),"dispatchOnNoScroll"in M&&t(6,u=M.dispatchOnNoScroll),"$$scope"in M&&t(10,s=M.$$scope)},[o,$,f,c,r,a,u,S,C,T,s,i,O]}class Jo extends be{constructor(e){super(),_e(this,e,Hk,jk,ge,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function of(n,e,t){const i=n.slice();return i[23]=e[t],i}function Vk(n){let e;return{c(){e=v("div"),e.innerHTML=' Method',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zk(n){let e;return{c(){e=v("div"),e.innerHTML=` URL`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Bk(n){let e;return{c(){e=v("div"),e.innerHTML=` Referer`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Uk(n){let e;return{c(){e=v("div"),e.innerHTML=` User IP`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Wk(n){let e;return{c(){e=v("div"),e.innerHTML=` Status`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Yk(n){let e;return{c(){e=v("div"),e.innerHTML=` Created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rf(n){let e;function t(l,o){return l[6]?Jk:Kk}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function Kk(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&af(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=af(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Jk(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function af(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function uf(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ff(n,e){var Me,Je,ct;let t,i,s,l=((Me=e[23].method)==null?void 0:Me.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,h,g,m,_,y,S=(e[23].referer||"N/A")+"",C,T,$,O,M,D=(e[23].userIp||"N/A")+"",L,N,P,F,R,q=e[23].status+"",B,G,X,J,W,oe,ee,se,Ee,Re,Ve=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((ct=e[23].meta)==null?void 0:ct.errorData))&&uf();J=new $i({props:{date:e[23].created}});function We(){return e[17](e[23])}function ke(...Se){return e[18](e[23],...Se)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=E(),u=v("td"),f=v("span"),d=U(c),g=E(),Ve&&Ve.c(),m=E(),_=v("td"),y=v("span"),C=U(S),$=E(),O=v("td"),M=v("span"),L=U(D),P=E(),F=v("td"),R=v("span"),B=U(q),G=E(),X=v("td"),z(J.$$.fragment),W=E(),oe=v("td"),oe.innerHTML='',ee=E(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",T=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(_,"class","col-type-text col-field-referer"),p(M,"class","txt txt-ellipsis"),p(M,"title",N=e[23].userIp),Q(M,"txt-hint",!e[23].userIp),p(O,"class","col-type-number col-field-userIp"),p(R,"class","label"),Q(R,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(oe,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Se,we){w(Se,t,we),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,g),Ve&&Ve.m(u,null),b(t,m),b(t,_),b(_,y),b(y,C),b(t,$),b(t,O),b(O,M),b(M,L),b(t,P),b(t,F),b(F,R),b(R,B),b(t,G),b(t,X),H(J,X,null),b(t,W),b(t,oe),b(t,ee),se=!0,Ee||(Re=[Y(t,"click",We),Y(t,"keydown",ke)],Ee=!0)},p(Se,we){var it,ne,qe;e=Se,(!se||we&8)&&l!==(l=((it=e[23].method)==null?void 0:it.toUpperCase())+"")&&le(o,l),(!se||we&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!se||we&8)&&c!==(c=e[23].url+"")&&le(d,c),(!se||we&8&&h!==(h=e[23].url))&&p(f,"title",h),(ne=e[23].meta)!=null&&ne.errorMessage||(qe=e[23].meta)!=null&&qe.errorData?Ve||(Ve=uf(),Ve.c(),Ve.m(u,null)):Ve&&(Ve.d(1),Ve=null),(!se||we&8)&&S!==(S=(e[23].referer||"N/A")+"")&&le(C,S),(!se||we&8&&T!==(T=e[23].referer))&&p(y,"title",T),(!se||we&8)&&Q(y,"txt-hint",!e[23].referer),(!se||we&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&le(L,D),(!se||we&8&&N!==(N=e[23].userIp))&&p(M,"title",N),(!se||we&8)&&Q(M,"txt-hint",!e[23].userIp),(!se||we&8)&&q!==(q=e[23].status+"")&&le(B,q),(!se||we&8)&&Q(R,"label-danger",e[23].status>=400);const Ue={};we&8&&(Ue.date=e[23].created),J.$set(Ue)},i(Se){se||(A(J.$$.fragment,Se),se=!0)},o(Se){I(J.$$.fragment,Se),se=!1},d(Se){Se&&k(t),Ve&&Ve.d(),V(J),Ee=!1,$e(Re)}}}function Gk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L=[],N=new Map,P;function F(ke){n[11](ke)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Vk]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new hn({props:R}),te.push(()=>he(s,"sort",F));function q(ke){n[12](ke)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[zk]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new hn({props:B}),te.push(()=>he(r,"sort",q));function G(ke){n[13](ke)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Bk]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new hn({props:X}),te.push(()=>he(f,"sort",G));function J(ke){n[14](ke)}let W={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Uk]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),h=new hn({props:W}),te.push(()=>he(h,"sort",J));function oe(ke){n[15](ke)}let ee={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Wk]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),_=new hn({props:ee}),te.push(()=>he(_,"sort",oe));function se(ke){n[16](ke)}let Ee={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Yk]},$$scope:{ctx:n}};n[1]!==void 0&&(Ee.sort=n[1]),C=new hn({props:Ee}),te.push(()=>he(C,"sort",se));let Re=pe(n[3]);const Ve=ke=>ke[23].id;for(let ke=0;kel=!1)),s.$set(Je);const ct={};Me&67108864&&(ct.$$scope={dirty:Me,ctx:ke}),!a&&Me&2&&(a=!0,ct.sort=ke[1],ve(()=>a=!1)),r.$set(ct);const Se={};Me&67108864&&(Se.$$scope={dirty:Me,ctx:ke}),!c&&Me&2&&(c=!0,Se.sort=ke[1],ve(()=>c=!1)),f.$set(Se);const we={};Me&67108864&&(we.$$scope={dirty:Me,ctx:ke}),!g&&Me&2&&(g=!0,we.sort=ke[1],ve(()=>g=!1)),h.$set(we);const Ue={};Me&67108864&&(Ue.$$scope={dirty:Me,ctx:ke}),!y&&Me&2&&(y=!0,Ue.sort=ke[1],ve(()=>y=!1)),_.$set(Ue);const it={};Me&67108864&&(it.$$scope={dirty:Me,ctx:ke}),!T&&Me&2&&(T=!0,it.sort=ke[1],ve(()=>T=!1)),C.$set(it),Me&841&&(Re=pe(ke[3]),re(),L=gt(L,Me,Ve,1,ke,Re,N,D,Rt,ff,null,of),ae(),!Re.length&&We?We.p(ke,Me):Re.length?We&&(We.d(1),We=null):(We=rf(ke),We.c(),We.m(D,null))),(!P||Me&64)&&Q(e,"table-loading",ke[6])},i(ke){if(!P){A(s.$$.fragment,ke),A(r.$$.fragment,ke),A(f.$$.fragment,ke),A(h.$$.fragment,ke),A(_.$$.fragment,ke),A(C.$$.fragment,ke);for(let Me=0;Me{if(N<=1&&m(),t(6,d=!1),t(5,f=F.page),t(4,c=F.totalItems),s("load",u.concat(F.items)),P){const R=++h;for(;F.items.length&&h==R;)t(3,u=u.concat(F.items.splice(0,10))),await j.yieldToMain()}else t(3,u=u.concat(F.items))}).catch(F=>{F!=null&&F.isAbort||(t(6,d=!1),console.warn(F),m(),de.error(F,(F==null?void 0:F.status)!=400))})}function m(){t(3,u=[]),t(5,f=1),t(4,c=0)}function _(N){a=N,t(1,a)}function y(N){a=N,t(1,a)}function S(N){a=N,t(1,a)}function C(N){a=N,t(1,a)}function T(N){a=N,t(1,a)}function $(N){a=N,t(1,a)}const O=N=>s("select",N),M=(N,P)=>{P.code==="Enter"&&(P.preventDefault(),s("select",N))},D=()=>t(0,o=""),L=()=>g(f+1);return n.$$set=N=>{"filter"in N&&t(0,o=N.filter),"presets"in N&&t(10,r=N.presets),"sort"in N&&t(1,a=N.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(m(),g(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,g,u,c,f,d,i,s,l,r,_,y,S,C,T,$,O,M,D,L]}class Qk extends be{constructor(e){super(),_e(this,e,Xk,Zk,ge,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! + `}}let Qr,Gi;const xr="app-tooltip";function Gu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Hi(){return Gi=Gi||document.querySelector("."+xr),Gi||(Gi=document.createElement("div"),Gi.classList.add(xr),document.body.appendChild(Gi)),Gi}function Pb(n,e){let t=Hi();if(!t.classList.contains("active")||!(e!=null&&e.text)){ea();return}t.textContent=e.text,t.className=xr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function ea(){clearTimeout(Qr),Hi().classList.remove("active"),Hi().activeNode=void 0}function ak(n,e){Hi().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Hi().classList.add("active"),Pb(n,e)},isNaN(e.delay)?0:e.delay)}function Be(n,e){let t=Gu(e);function i(){ak(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",s),Hi(),{update(l){var o,r;t=Gu(l),(r=(o=Hi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Pb(n,t)},destroy(){var l,o;(o=(l=Hi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Zu(n,e,t){const i=n.slice();return i[12]=e[t],i}const uk=n=>({}),Xu=n=>({uniqueId:n[4]});function fk(n){let e,t,i=pe(n[3]),s=[];for(let o=0;oI(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=He(t,Qt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=He(t,Qt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Qu(n){let e,t,i=So(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=W(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=So(a[12])+"")&&le(s,i)},i(a){r||(a&&xe(()=>{r&&(o||(o=He(e,lt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,lt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function dk(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Ct(a,n,n[8],Xu),f=[ck,fk],c=[];function d(h,g){return h[0]&&h[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(h,g){w(h,e,g),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(h,[g]){u&&u.p&&(!l||g&256)&&Mt(u,a,h,h[8],l?$t(a,h[8],g,uk):Ot(h[8]),Xu);let m=i;i=d(h),i===m?c[i].p(h,g):(re(),I(c[m],1,1,()=>{c[m]=null}),ae(),s=c[i],s?s.p(h,g):(s=c[i]=f[i](h),s.c()),A(s,1),s.m(e,null)),(!l||g&2)&&p(e,"class",h[1]),(!l||g&10)&&Q(e,"error",h[3].length)},i(h){l||(A(u,h),A(s),l=!0)},o(h){I(u,h),I(s),l=!1},d(h){h&&k(e),u&&u.d(h),c[i].d(),n[11](null),o=!1,r()}}}const xu="Invalid value";function So(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||xu:n||xu}function pk(n,e,t){let i;Ge(n,Mi,m=>t(7,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){pi(r)}Kt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function h(m){Fe.call(this,n,m)}function g(m){te[m?"unshift":"push"](()=>{f=m,t(2,f)})}return n.$$set=m=>{"name"in m&&t(5,r=m.name),"inlineError"in m&&t(0,a=m.inlineError),"class"in m&&t(1,u=m.class),"$$scope"in m&&t(8,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,h,g]}class me extends ve{constructor(e){super(),be(this,e,pk,dk,ge,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function hk(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Email"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&de(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function mk(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=W("Password"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),de(l,n[1]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&de(l,c[1])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function gk(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Password confirm"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&de(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function _k(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new me({props:{class:"form-field required",name:"email",$$slots:{default:[hk,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[mk,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[gk,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

Create your first admin account in order to continue

",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("button"),f.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,m){w(g,e,m),b(e,t),b(e,i),H(s,e,null),b(e,l),H(o,e,null),b(e,r),H(a,e,null),b(e,u),b(e,f),c=!0,d||(h=Y(e,"submit",Ze(n[4])),d=!0)},p(g,[m]){const _={};m&1537&&(_.$$scope={dirty:m,ctx:g}),s.$set(_);const y={};m&1538&&(y.$$scope={dirty:m,ctx:g}),o.$set(y);const S={};m&1540&&(S.$$scope={dirty:m,ctx:g}),a.$set(S),(!c||m&8)&&Q(f,"btn-disabled",g[3]),(!c||m&8)&&Q(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){I(s.$$.fragment,g),I(o.$$.fragment,g),I(a.$$.fragment,g),c=!1},d(g){g&&k(e),V(s),V(o),V(a),d=!1,h()}}}function bk(n,e,t){const i=dt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ce.admins.create({email:s,password:l,passwordConfirm:o}),await ce.admins.authWithPassword(s,l),i("submit")}catch(d){ce.error(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class vk extends ve{constructor(e){super(),be(this,e,bk,_k,ge,{})}}function ef(n){let e,t;return e=new Lb({props:{$$slots:{default:[yk]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function yk(n){let e,t;return e=new vk({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function kk(n){let e,t,i=n[0]&&ef(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=ef(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function wk(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ce.logout(!1),t(0,i=!0);return}ce.authStore.isValid?us("/collections"):ce.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class Sk extends ve{constructor(e){super(),be(this,e,wk,kk,ge,{})}}const Nt=Ln(""),To=Ln(""),Es=Ln(!1);function Tk(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),de(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&de(e,l[7])},i:x,o:x,d(l){l&&k(e),n[13](null),i=!1,s()}}}function Ck(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=Pt(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Pt(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],_e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function tf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,mi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function nf(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[15]),s=!0)},p:x,i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,mi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function $k(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[Ck,Tk],h=[];function g(y,S){return y[4]&&!y[5]?0:1}l=g(n),o=h[l]=d[l](n);let m=(n[0].length||n[7].length)&&n[7]!=n[0]&&tf(),_=(n[0].length||n[7].length)&&nf(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=E(),o.c(),r=E(),m&&m.c(),a=E(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),b(e,t),b(t,i),b(e,s),h[l].m(e,null),b(e,r),m&&m.m(e,null),b(e,a),_&&_.m(e,null),u=!0,f||(c=[Y(e,"click",Sn(n[11])),Y(e,"submit",Ze(n[10]))],f=!0)},p(y,[S]){let C=l;l=g(y),l===C?h[l].p(y,S):(re(),I(h[C],1,1,()=>{h[C]=null}),ae(),o=h[l],o?o.p(y,S):(o=h[l]=d[l](y),o.c()),A(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?m?S&129&&A(m,1):(m=tf(),m.c(),A(m,1),m.m(e,a)):m&&(re(),I(m,1,1,()=>{m=null}),ae()),y[0].length||y[7].length?_?(_.p(y,S),S&129&&A(_,1)):(_=nf(y),_.c(),A(_,1),_.m(e,null)):_&&(re(),I(_,1,1,()=>{_=null}),ae())},i(y){u||(A(o),A(m),A(_),u=!0)},o(y){I(o),I(m),I(_),u=!1},d(y){y&&k(e),h[l].d(),m&&m.d(),_&&_.d(),f=!1,$e(c)}}}function Mk(n,e,t){const i=dt(),s="search_"+j.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h($=!0){t(7,d=""),$&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function m(){u||f||(t(5,f=!0),t(4,u=(await ut(()=>import("./FilterAutocompleteInput-4cde62df.js"),["./FilterAutocompleteInput-4cde62df.js","./index-808c8630.js"],import.meta.url)).default),t(5,f=!1))}Kt(()=>{m()});function _($){Fe.call(this,n,$)}function y($){d=$,t(7,d),t(0,l)}function S($){te[$?"unshift":"push"](()=>{c=$,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const T=()=>{h(!1),g()};return n.$$set=$=>{"value"in $&&t(0,l=$.value),"placeholder"in $&&t(1,o=$.placeholder),"autocompleteCollection"in $&&t(2,r=$.autocompleteCollection),"extraAutocompleteKeys"in $&&t(3,a=$.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,_,y,S,C,T]}class Dl extends ve{constructor(e){super(),be(this,e,Mk,$k,ge,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Ok(n){let e,t,i,s,l,o;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),Q(e,"refreshing",n[2])},m(r,a){w(r,e,a),b(e,t),l||(o=[Te(s=Be.call(null,e,n[0])),Y(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&Et(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:x,o:x,d(r){r&&k(e),l=!1,$e(o)}}}function Ek(n,e,t){const i=dt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return Kt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Jo extends ve{constructor(e){super(),be(this,e,Ek,Ok,ge,{tooltip:0,class:1})}}function Dk(n){let e,t,i,s,l;const o=n[6].default,r=Ct(o,n,n[5],null);return{c(){e=v("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Mt(r,o,a,a[5],i?$t(o,a[5],u,null):Ot(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function Ak(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class hn extends ve{constructor(e){super(),be(this,e,Ak,Dk,ge,{class:1,name:2,sort:0,disable:3})}}function Ik(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Lk(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("div"),t=v("div"),i=W(n[2]),s=E(),l=v("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(l,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(l,r),a||(u=Te(Be.call(null,e,n[3])),a=!0)},p(f,c){c&4&&le(i,f[2]),c&2&&le(o,f[1])},d(f){f&&k(e),a=!1,u()}}}function Pk(n){let e;function t(l,o){return l[0]?Lk:Ik}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function Nk(n,e,t){let i,s,{date:l=""}=e;const o={get text(){return j.formatToLocalDate(l)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,l=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i,o]}class $i extends ve{constructor(e){super(),be(this,e,Nk,Pk,ge,{date:0})}}const Fk=n=>({}),sf=n=>({}),Rk=n=>({}),lf=n=>({});function qk(n){let e,t,i,s,l,o,r,a;const u=n[11].before,f=Ct(u,n,n[10],lf),c=n[11].default,d=Ct(c,n,n[10],null),h=n[11].after,g=Ct(h,n,n[10],sf);return{c(){e=v("div"),f&&f.c(),t=E(),i=v("div"),d&&d.c(),l=E(),g&&g.c(),p(i,"class",s="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(m,_){w(m,e,_),f&&f.m(e,null),b(e,t),b(e,i),d&&d.m(i,null),n[12](i),b(e,l),g&&g.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(m,[_]){f&&f.p&&(!o||_&1024)&&Mt(f,u,m,m[10],o?$t(u,m[10],_,Rk):Ot(m[10]),lf),d&&d.p&&(!o||_&1024)&&Mt(d,c,m,m[10],o?$t(c,m[10],_,null):Ot(m[10]),null),(!o||_&9&&s!==(s="scroller "+m[0]+" "+m[3]+" svelte-3a0gfs"))&&p(i,"class",s),g&&g.p&&(!o||_&1024)&&Mt(g,h,m,m[10],o?$t(h,m[10],_,Fk):Ot(m[10]),sf)},i(m){o||(A(f,m),A(d,m),A(g,m),o=!0)},o(m){I(f,m),I(d,m),I(g,m),o=!1},d(m){m&&k(e),f&&f.d(m),d&&d.d(m),n[12](null),g&&g.d(m),r=!1,$e(a)}}}function jk(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=dt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,h,g,m,_,y;function S(){f&&t(2,f.scrollTop=0,f)}function C(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),m=f.clientWidth+2,_=f.clientHeight+2,h=f.scrollWidth-m,g=f.scrollHeight-_,g>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),l("vScrollStart")),f.scrollTop+r>=g&&(t(3,c+=" v-scroll-end"),l("vScrollEnd"))):u&&l("vScrollEnd"),h>0?(t(3,c+=" h-scroll"),a>=m&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),l("hScrollStart")),f.scrollLeft+a>=h&&(t(3,c+=" h-scroll-end"),l("hScrollEnd"))):u&&l("hScrollEnd"))}function $(){d||(d=setTimeout(()=>{T(),d=null},150))}Kt(()=>($(),y=new MutationObserver($),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(M){te[M?"unshift":"push"](()=>{f=M,t(2,f)})}return n.$$set=M=>{"class"in M&&t(0,o=M.class),"vThreshold"in M&&t(4,r=M.vThreshold),"hThreshold"in M&&t(5,a=M.hThreshold),"dispatchOnNoScroll"in M&&t(6,u=M.dispatchOnNoScroll),"$$scope"in M&&t(10,s=M.$$scope)},[o,$,f,c,r,a,u,S,C,T,s,i,O]}class Go extends ve{constructor(e){super(),be(this,e,jk,qk,ge,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function of(n,e,t){const i=n.slice();return i[23]=e[t],i}function Hk(n){let e;return{c(){e=v("div"),e.innerHTML=' Method',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Vk(n){let e;return{c(){e=v("div"),e.innerHTML=` URL`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zk(n){let e;return{c(){e=v("div"),e.innerHTML=` Referer`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Bk(n){let e;return{c(){e=v("div"),e.innerHTML=` User IP`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Uk(n){let e;return{c(){e=v("div"),e.innerHTML=` Status`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Wk(n){let e;return{c(){e=v("div"),e.innerHTML=` Created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rf(n){let e;function t(l,o){return l[6]?Kk:Yk}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function Yk(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&af(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=af(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Kk(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function af(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function uf(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ff(n,e){var Me,Je,ct;let t,i,s,l=((Me=e[23].method)==null?void 0:Me.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,h,g,m,_,y,S=(e[23].referer||"N/A")+"",C,T,$,O,M,D=(e[23].userIp||"N/A")+"",L,N,P,F,R,q=e[23].status+"",B,G,X,J,U,oe,ee,se,Ee,Re,Ve=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((ct=e[23].meta)==null?void 0:ct.errorData))&&uf();J=new $i({props:{date:e[23].created}});function We(){return e[17](e[23])}function ke(...Se){return e[18](e[23],...Se)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=W(l),a=E(),u=v("td"),f=v("span"),d=W(c),g=E(),Ve&&Ve.c(),m=E(),_=v("td"),y=v("span"),C=W(S),$=E(),O=v("td"),M=v("span"),L=W(D),P=E(),F=v("td"),R=v("span"),B=W(q),G=E(),X=v("td"),z(J.$$.fragment),U=E(),oe=v("td"),oe.innerHTML='',ee=E(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",T=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(_,"class","col-type-text col-field-referer"),p(M,"class","txt txt-ellipsis"),p(M,"title",N=e[23].userIp),Q(M,"txt-hint",!e[23].userIp),p(O,"class","col-type-number col-field-userIp"),p(R,"class","label"),Q(R,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(oe,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Se,we){w(Se,t,we),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,g),Ve&&Ve.m(u,null),b(t,m),b(t,_),b(_,y),b(y,C),b(t,$),b(t,O),b(O,M),b(M,L),b(t,P),b(t,F),b(F,R),b(R,B),b(t,G),b(t,X),H(J,X,null),b(t,U),b(t,oe),b(t,ee),se=!0,Ee||(Re=[Y(t,"click",We),Y(t,"keydown",ke)],Ee=!0)},p(Se,we){var it,ne,qe;e=Se,(!se||we&8)&&l!==(l=((it=e[23].method)==null?void 0:it.toUpperCase())+"")&&le(o,l),(!se||we&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!se||we&8)&&c!==(c=e[23].url+"")&&le(d,c),(!se||we&8&&h!==(h=e[23].url))&&p(f,"title",h),(ne=e[23].meta)!=null&&ne.errorMessage||(qe=e[23].meta)!=null&&qe.errorData?Ve||(Ve=uf(),Ve.c(),Ve.m(u,null)):Ve&&(Ve.d(1),Ve=null),(!se||we&8)&&S!==(S=(e[23].referer||"N/A")+"")&&le(C,S),(!se||we&8&&T!==(T=e[23].referer))&&p(y,"title",T),(!se||we&8)&&Q(y,"txt-hint",!e[23].referer),(!se||we&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&le(L,D),(!se||we&8&&N!==(N=e[23].userIp))&&p(M,"title",N),(!se||we&8)&&Q(M,"txt-hint",!e[23].userIp),(!se||we&8)&&q!==(q=e[23].status+"")&&le(B,q),(!se||we&8)&&Q(R,"label-danger",e[23].status>=400);const Ue={};we&8&&(Ue.date=e[23].created),J.$set(Ue)},i(Se){se||(A(J.$$.fragment,Se),se=!0)},o(Se){I(J.$$.fragment,Se),se=!1},d(Se){Se&&k(t),Ve&&Ve.d(),V(J),Ee=!1,$e(Re)}}}function Jk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L=[],N=new Map,P;function F(ke){n[11](ke)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Hk]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new hn({props:R}),te.push(()=>he(s,"sort",F));function q(ke){n[12](ke)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Vk]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new hn({props:B}),te.push(()=>he(r,"sort",q));function G(ke){n[13](ke)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[zk]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new hn({props:X}),te.push(()=>he(f,"sort",G));function J(ke){n[14](ke)}let U={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Bk]},$$scope:{ctx:n}};n[1]!==void 0&&(U.sort=n[1]),h=new hn({props:U}),te.push(()=>he(h,"sort",J));function oe(ke){n[15](ke)}let ee={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Uk]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),_=new hn({props:ee}),te.push(()=>he(_,"sort",oe));function se(ke){n[16](ke)}let Ee={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Wk]},$$scope:{ctx:n}};n[1]!==void 0&&(Ee.sort=n[1]),C=new hn({props:Ee}),te.push(()=>he(C,"sort",se));let Re=pe(n[3]);const Ve=ke=>ke[23].id;for(let ke=0;kel=!1)),s.$set(Je);const ct={};Me&67108864&&(ct.$$scope={dirty:Me,ctx:ke}),!a&&Me&2&&(a=!0,ct.sort=ke[1],_e(()=>a=!1)),r.$set(ct);const Se={};Me&67108864&&(Se.$$scope={dirty:Me,ctx:ke}),!c&&Me&2&&(c=!0,Se.sort=ke[1],_e(()=>c=!1)),f.$set(Se);const we={};Me&67108864&&(we.$$scope={dirty:Me,ctx:ke}),!g&&Me&2&&(g=!0,we.sort=ke[1],_e(()=>g=!1)),h.$set(we);const Ue={};Me&67108864&&(Ue.$$scope={dirty:Me,ctx:ke}),!y&&Me&2&&(y=!0,Ue.sort=ke[1],_e(()=>y=!1)),_.$set(Ue);const it={};Me&67108864&&(it.$$scope={dirty:Me,ctx:ke}),!T&&Me&2&&(T=!0,it.sort=ke[1],_e(()=>T=!1)),C.$set(it),Me&841&&(Re=pe(ke[3]),re(),L=gt(L,Me,Ve,1,ke,Re,N,D,Rt,ff,null,of),ae(),!Re.length&&We?We.p(ke,Me):Re.length?We&&(We.d(1),We=null):(We=rf(ke),We.c(),We.m(D,null))),(!P||Me&64)&&Q(e,"table-loading",ke[6])},i(ke){if(!P){A(s.$$.fragment,ke),A(r.$$.fragment,ke),A(f.$$.fragment,ke),A(h.$$.fragment,ke),A(_.$$.fragment,ke),A(C.$$.fragment,ke);for(let Me=0;Me{if(N<=1&&m(),t(6,d=!1),t(5,f=F.page),t(4,c=F.totalItems),s("load",u.concat(F.items)),P){const R=++h;for(;F.items.length&&h==R;)t(3,u=u.concat(F.items.splice(0,10))),await j.yieldToMain()}else t(3,u=u.concat(F.items))}).catch(F=>{F!=null&&F.isAbort||(t(6,d=!1),console.warn(F),m(),ce.error(F,(F==null?void 0:F.status)!=400))})}function m(){t(3,u=[]),t(5,f=1),t(4,c=0)}function _(N){a=N,t(1,a)}function y(N){a=N,t(1,a)}function S(N){a=N,t(1,a)}function C(N){a=N,t(1,a)}function T(N){a=N,t(1,a)}function $(N){a=N,t(1,a)}const O=N=>s("select",N),M=(N,P)=>{P.code==="Enter"&&(P.preventDefault(),s("select",N))},D=()=>t(0,o=""),L=()=>g(f+1);return n.$$set=N=>{"filter"in N&&t(0,o=N.filter),"presets"in N&&t(10,r=N.presets),"sort"in N&&t(1,a=N.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(m(),g(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,g,u,c,f,d,i,s,l,r,_,y,S,C,T,$,O,M,D,L]}class Xk extends ve{constructor(e){super(),be(this,e,Zk,Gk,ge,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! * Chart.js v3.9.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors * Released under the MIT License - */function bi(){}const xk=function(){let n=0;return function(){return n++}}();function _t(n){return n===null||typeof n>"u"}function It(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function st(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Yt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Hn(n,e){return Yt(n)?n:e}function rt(n,e){return typeof n>"u"?e:n}const e2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Fb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function yt(n,e,t,i){let s,l,o;if(It(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function zi(n,e){return(pf[e]||(pf[e]=i2(e)))(n)}function i2(n){const e=s2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function s2(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Fa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Jn=n=>typeof n<"u",Bi=n=>typeof n=="function",hf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function l2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,wt=2*Ut,o2=wt+Ut,$o=Number.POSITIVE_INFINITY,r2=Ut/180,Bt=Ut/2,Ys=Ut/4,mf=Ut*2/3,Wn=Math.log10,ci=Math.sign;function gf(n){const e=Math.round(n);n=ol(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Wn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function a2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Es(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ol(n,e,t){return Math.abs(n-e)=n}function qb(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function qa(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const is=(n,e,t,i)=>qa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]qa(n,t,i=>n[i][e]>=t);function p2(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Fa(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function bf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Hb.forEach(l=>{delete n[l]}),delete n._chartjs)}function Vb(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function Bb(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,zb.call(window,()=>{s=!1,n.apply(e,l)}))}}function m2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const g2=n=>n==="start"?"left":n==="end"?"right":"center",vf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Ub(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=mn(Math.min(is(r,o.axis,u).lo,t?i:is(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=mn(Math.max(is(r,o.axis,f,!0).hi+1,t?0:is(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Wb(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Bl=n=>n===0||n===1,yf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*wt/t)),kf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*wt/t)+1,rl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Bt)+1,easeOutSine:n=>Math.sin(n*Bt),easeInOutSine:n=>-.5*(Math.cos(Ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Bl(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Bl(n)?n:yf(n,.075,.3),easeOutElastic:n=>Bl(n)?n:kf(n,.075,.3),easeInOutElastic(n){return Bl(n)?n:n<.5?.5*yf(n*2,.1125,.45):.5+.5*kf(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-rl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?rl.easeInBounce(n*2)*.5:rl.easeOutBounce(n*2-1)*.5+.5};/*! + */function bi(){}const Qk=function(){let n=0;return function(){return n++}}();function bt(n){return n===null||typeof n>"u"}function Lt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function st(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Yt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Hn(n,e){return Yt(n)?n:e}function rt(n,e){return typeof n>"u"?e:n}const xk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Nb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function kt(n,e,t,i){let s,l,o;if(Lt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function zi(n,e){return(pf[e]||(pf[e]=n2(e)))(n)}function n2(n){const e=i2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function i2(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Fa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Jn=n=>typeof n<"u",Bi=n=>typeof n=="function",hf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function s2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,wt=2*Ut,l2=wt+Ut,Mo=Number.POSITIVE_INFINITY,o2=Ut/180,Bt=Ut/2,Ks=Ut/4,mf=Ut*2/3,Wn=Math.log10,ci=Math.sign;function gf(n){const e=Math.round(n);n=rl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Wn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function r2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function rl(n,e,t){return Math.abs(n-e)=n}function Rb(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function qa(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const is=(n,e,t,i)=>qa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]qa(n,t,i=>n[i][e]>=t);function d2(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Fa(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function bf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(jb.forEach(l=>{delete n[l]}),delete n._chartjs)}function Hb(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function zb(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,Vb.call(window,()=>{s=!1,n.apply(e,l)}))}}function h2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const m2=n=>n==="start"?"left":n==="end"?"right":"center",vf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Bb(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=mn(Math.min(is(r,o.axis,u).lo,t?i:is(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=mn(Math.max(is(r,o.axis,f,!0).hi+1,t?0:is(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Ub(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Ul=n=>n===0||n===1,yf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*wt/t)),kf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*wt/t)+1,al={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Bt)+1,easeOutSine:n=>Math.sin(n*Bt),easeInOutSine:n=>-.5*(Math.cos(Ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ul(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Ul(n)?n:yf(n,.075,.3),easeOutElastic:n=>Ul(n)?n:kf(n,.075,.3),easeInOutElastic(n){return Ul(n)?n:n<.5?.5*yf(n*2,.1125,.45):.5+.5*kf(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-al.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?al.easeInBounce(n*2)*.5:al.easeOutBounce(n*2-1)*.5+.5};/*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License - */function Dl(n){return n+.5|0}const Ri=(n,e,t)=>Math.max(Math.min(n,t),e);function tl(n){return Ri(Dl(n*2.55),0,255)}function Vi(n){return Ri(Dl(n*255),0,255)}function ki(n){return Ri(Dl(n/2.55)/100,0,1)}function wf(n){return Ri(Dl(n*100),0,100)}const jn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},na=[..."0123456789ABCDEF"],_2=n=>na[n&15],b2=n=>na[(n&240)>>4]+na[n&15],Ul=n=>(n&240)>>4===(n&15),v2=n=>Ul(n.r)&&Ul(n.g)&&Ul(n.b)&&Ul(n.a);function y2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&jn[n[1]]*17,g:255&jn[n[2]]*17,b:255&jn[n[3]]*17,a:e===5?jn[n[4]]*17:255}:(e===7||e===9)&&(t={r:jn[n[1]]<<4|jn[n[2]],g:jn[n[3]]<<4|jn[n[4]],b:jn[n[5]]<<4|jn[n[6]],a:e===9?jn[n[7]]<<4|jn[n[8]]:255})),t}const k2=(n,e)=>n<255?e(n):"";function w2(n){var e=v2(n)?_2:b2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+k2(n.a,e):void 0}const S2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Yb(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function T2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function C2(n,e,t){const i=Yb(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function $2(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=$2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ha(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Vi)}function Va(n,e,t){return Ha(Yb,n,e,t)}function M2(n,e,t){return Ha(C2,n,e,t)}function O2(n,e,t){return Ha(T2,n,e,t)}function Kb(n){return(n%360+360)%360}function E2(n){const e=S2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?tl(+e[5]):Vi(+e[5]));const s=Kb(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=M2(s,l,o):e[1]==="hsv"?i=O2(s,l,o):i=Va(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function D2(n,e){var t=ja(n);t[0]=Kb(t[0]+e),t=Va(t),n.r=t[0],n.g=t[1],n.b=t[2]}function A2(n){if(!n)return;const e=ja(n),t=e[0],i=wf(e[1]),s=wf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ki(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Sf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Tf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function I2(){const n={},e=Object.keys(Tf),t=Object.keys(Sf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Wl;function L2(n){Wl||(Wl=I2(),Wl.transparent=[0,0,0,0]);const e=Wl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const P2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function N2(n){const e=P2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?tl(o):Ri(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?tl(i):Ri(i,0,255)),s=255&(e[4]?tl(s):Ri(s,0,255)),l=255&(e[6]?tl(l):Ri(l,0,255)),{r:i,g:s,b:l,a:t}}}function F2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ki(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const mr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,_s=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function R2(n,e,t){const i=_s(ki(n.r)),s=_s(ki(n.g)),l=_s(ki(n.b));return{r:Vi(mr(i+t*(_s(ki(e.r))-i))),g:Vi(mr(s+t*(_s(ki(e.g))-s))),b:Vi(mr(l+t*(_s(ki(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Yl(n,e,t){if(n){let i=ja(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Va(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Jb(n,e){return n&&Object.assign(e||{},n)}function Cf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Vi(n[3]))):(e=Jb(n,{r:0,g:0,b:0,a:1}),e.a=Vi(e.a)),e}function q2(n){return n.charAt(0)==="r"?N2(n):E2(n)}class Mo{constructor(e){if(e instanceof Mo)return e;const t=typeof e;let i;t==="object"?i=Cf(e):t==="string"&&(i=y2(e)||L2(e)||q2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Jb(this._rgb);return e&&(e.a=ki(e.a)),e}set rgb(e){this._rgb=Cf(e)}rgbString(){return this._valid?F2(this._rgb):void 0}hexString(){return this._valid?w2(this._rgb):void 0}hslString(){return this._valid?A2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=R2(this._rgb,e._rgb,t)),this}clone(){return new Mo(this.rgb)}alpha(e){return this._rgb.a=Vi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Dl(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Yl(this._rgb,2,e),this}darken(e){return Yl(this._rgb,2,-e),this}saturate(e){return Yl(this._rgb,1,e),this}desaturate(e){return Yl(this._rgb,1,-e),this}rotate(e){return D2(this._rgb,e),this}}function Gb(n){return new Mo(n)}function Zb(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function $f(n){return Zb(n)?n:Gb(n)}function gr(n){return Zb(n)?n:Gb(n).saturate(.5).darken(.1).hexString()}const as=Object.create(null),ia=Object.create(null);function al(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>gr(i.backgroundColor),this.hoverBorderColor=(t,i)=>gr(i.borderColor),this.hoverColor=(t,i)=>gr(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return _r(this,e,t)}get(e){return al(this,e)}describe(e,t){return _r(ia,e,t)}override(e,t){return _r(as,e,t)}route(e,t,i,s){const l=al(this,e),o=al(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return st(a)?Object.assign({},u,a):rt(a,u)},set(a){this[r]=a}}})}}var at=new j2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function H2(n){return!n||_t(n.size)||_t(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Oo(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function V2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function bl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,W2(n,l),a=0;a+n||0;function Ua(n,e){const t={},i=st(e),s=i?Object.keys(e):e,l=st(n)?i?o=>rt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=Z2(l(o));return t}function Xb(n){return Ua(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ss(n){return Ua(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Gn(n){const e=Xb(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function An(n,e){n=n||{},e=e||at.font;let t=rt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=rt(n.style,e.style);i&&!(""+i).match(J2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:rt(n.family,e.family),lineHeight:G2(rt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:rt(n.weight,e.weight),string:""};return s.string=H2(s),s}function Kl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Wi(n,e){return Object.assign(Object.create(n),e)}function Wa(n,e=[""],t=n,i,s=()=>n[0]){Jn(i)||(i=t1("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Wa([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return xb(o,r,()=>lw(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return Ef(o).includes(r)},ownKeys(o){return Ef(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ds(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Qb(n,i),setContext:l=>Ds(n,l,t,i),override:l=>Ds(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return xb(l,o,()=>x2(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function Qb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Bi(t)?t:()=>t,isIndexable:Bi(i)?i:()=>i}}const Q2=(n,e)=>n?n+Fa(e):e,Ya=(n,e)=>st(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function xb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function x2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Bi(r)&&o.isScriptable(e)&&(r=ew(e,r,n,t)),It(r)&&r.length&&(r=tw(e,r,n,o.isIndexable)),Ya(e,r)&&(r=Ds(r,s,l&&l[e],o)),r}function ew(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Ya(n,e)&&(e=Ka(s._scopes,s,n,e)),e}function tw(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Jn(l.index)&&i(n))e=e[l.index%e.length];else if(st(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ka(u,s,n,f);e.push(Ds(c,l,o&&o[n],r))}}return e}function e1(n,e,t){return Bi(n)?n(e,t):n}const nw=(n,e)=>n===!0?e:typeof n=="string"?zi(e,n):void 0;function iw(n,e,t,i,s){for(const l of e){const o=nw(t,l);if(o){n.add(o);const r=e1(o._fallback,t,s);if(Jn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Jn(i)&&t!==i)return null}return!1}function Ka(n,e,t,i){const s=e._rootScopes,l=e1(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Of(r,o,t,l||t,i);return a===null||Jn(l)&&l!==t&&(a=Of(r,o,l,a,i),a===null)?!1:Wa(Array.from(r),[""],s,l,()=>sw(e,t,i))}function Of(n,e,t,i,s){for(;t;)t=iw(n,e,t,i,s);return t}function sw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return It(s)&&st(t)?t:s}function lw(n,e,t,i){let s;for(const l of e)if(s=t1(Q2(l,n),t),Jn(s))return Ya(n,s)?Ka(t,i,n,s):s}function t1(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Jn(i))return i}}function Ef(n){let e=n._keys;return e||(e=n._keys=ow(n._scopes)),e}function ow(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function n1(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function aw(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=ta(l,s),a=ta(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function uw(n,e,t){const i=n.length;let s,l,o,r,a,u=As(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")cw(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function hw(n,e){return Go(n).getPropertyValue(e)}const mw=["top","right","bottom","left"];function os(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=mw[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const gw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function _w(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(gw(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function es(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Go(t),l=s.boxSizing==="border-box",o=os(s,"padding"),r=os(s,"border","width"),{x:a,y:u,box:f}=_w(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:g}=e;return l&&(h-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function bw(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ja(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Go(l),a=os(r,"border","width"),u=os(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Ao(r.maxWidth,l,"clientWidth"),s=Ao(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||$o,maxHeight:s||$o}}const br=n=>Math.round(n*10)/10;function vw(n,e,t,i){const s=Go(n),l=os(s,"margin"),o=Ao(s.maxWidth,n,"clientWidth")||$o,r=Ao(s.maxHeight,n,"clientHeight")||$o,a=bw(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=os(s,"border","width"),d=os(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=br(Math.min(u,o,a.maxWidth)),f=br(Math.min(f,r,a.maxHeight)),u&&!f&&(f=br(u/2)),{width:u,height:f}}function Df(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const yw=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function Af(n,e){const t=hw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ts(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function kw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function ww(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=ts(n,s,t),r=ts(s,l,t),a=ts(l,e,t),u=ts(o,r,t),f=ts(r,a,t);return ts(u,f,t)}const If=new Map;function Sw(n,e){e=e||{};const t=n+JSON.stringify(e);let i=If.get(t);return i||(i=new Intl.NumberFormat(n,e),If.set(t,i)),i}function Al(n,e,t){return Sw(e,t).format(n)}const Tw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Cw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function vr(n,e,t){return n?Tw(e,t):Cw()}function $w(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Mw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function l1(n){return n==="angle"?{between:gl,compare:f2,normalize:Dn}:{between:_l,compare:(e,t)=>e-t,normalize:e=>e}}function Lf({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function Ow(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=l1(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;da(s,C,y)&&r(s,C)!==0,$=()=>r(l,y)===0||a(l,C,y),O=()=>m||T(),M=()=>!m||$();for(let D=f,L=f;D<=c;++D)S=e[D%o],!S.skip&&(y=u(S[i]),y!==C&&(m=a(y,s,l),_===null&&O()&&(_=r(y,s)===0?D:L),_!==null&&M()&&(g.push(Lf({start:_,end:D,loop:d,count:o,style:h})),_=null),L=D,C=y));return _!==null&&g.push(Lf({start:_,end:c,loop:d,count:o,style:h})),g}function r1(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function Dw(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function Aw(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=Ew(t,s,l,i);if(i===!0)return Pf(n,[{start:o,end:r,loop:l}],t,e);const a=rMath.max(Math.min(n,t),e);function nl(n){return Ri(Al(n*2.55),0,255)}function Vi(n){return Ri(Al(n*255),0,255)}function ki(n){return Ri(Al(n/2.55)/100,0,1)}function wf(n){return Ri(Al(n*100),0,100)}const jn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},na=[..."0123456789ABCDEF"],g2=n=>na[n&15],_2=n=>na[(n&240)>>4]+na[n&15],Wl=n=>(n&240)>>4===(n&15),b2=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function v2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&jn[n[1]]*17,g:255&jn[n[2]]*17,b:255&jn[n[3]]*17,a:e===5?jn[n[4]]*17:255}:(e===7||e===9)&&(t={r:jn[n[1]]<<4|jn[n[2]],g:jn[n[3]]<<4|jn[n[4]],b:jn[n[5]]<<4|jn[n[6]],a:e===9?jn[n[7]]<<4|jn[n[8]]:255})),t}const y2=(n,e)=>n<255?e(n):"";function k2(n){var e=b2(n)?g2:_2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+y2(n.a,e):void 0}const w2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Wb(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function S2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function T2(n,e,t){const i=Wb(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function C2(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=C2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ha(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Vi)}function Va(n,e,t){return Ha(Wb,n,e,t)}function $2(n,e,t){return Ha(T2,n,e,t)}function M2(n,e,t){return Ha(S2,n,e,t)}function Yb(n){return(n%360+360)%360}function O2(n){const e=w2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?nl(+e[5]):Vi(+e[5]));const s=Yb(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=$2(s,l,o):e[1]==="hsv"?i=M2(s,l,o):i=Va(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function E2(n,e){var t=ja(n);t[0]=Yb(t[0]+e),t=Va(t),n.r=t[0],n.g=t[1],n.b=t[2]}function D2(n){if(!n)return;const e=ja(n),t=e[0],i=wf(e[1]),s=wf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ki(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Sf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Tf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function A2(){const n={},e=Object.keys(Tf),t=Object.keys(Sf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Yl;function I2(n){Yl||(Yl=A2(),Yl.transparent=[0,0,0,0]);const e=Yl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const L2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function P2(n){const e=L2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?nl(o):Ri(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?nl(i):Ri(i,0,255)),s=255&(e[4]?nl(s):Ri(s,0,255)),l=255&(e[6]?nl(l):Ri(l,0,255)),{r:i,g:s,b:l,a:t}}}function N2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ki(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const gr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,_s=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function F2(n,e,t){const i=_s(ki(n.r)),s=_s(ki(n.g)),l=_s(ki(n.b));return{r:Vi(gr(i+t*(_s(ki(e.r))-i))),g:Vi(gr(s+t*(_s(ki(e.g))-s))),b:Vi(gr(l+t*(_s(ki(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Kl(n,e,t){if(n){let i=ja(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Va(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Kb(n,e){return n&&Object.assign(e||{},n)}function Cf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Vi(n[3]))):(e=Kb(n,{r:0,g:0,b:0,a:1}),e.a=Vi(e.a)),e}function R2(n){return n.charAt(0)==="r"?P2(n):O2(n)}class Oo{constructor(e){if(e instanceof Oo)return e;const t=typeof e;let i;t==="object"?i=Cf(e):t==="string"&&(i=v2(e)||I2(e)||R2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Kb(this._rgb);return e&&(e.a=ki(e.a)),e}set rgb(e){this._rgb=Cf(e)}rgbString(){return this._valid?N2(this._rgb):void 0}hexString(){return this._valid?k2(this._rgb):void 0}hslString(){return this._valid?D2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=F2(this._rgb,e._rgb,t)),this}clone(){return new Oo(this.rgb)}alpha(e){return this._rgb.a=Vi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Al(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Kl(this._rgb,2,e),this}darken(e){return Kl(this._rgb,2,-e),this}saturate(e){return Kl(this._rgb,1,e),this}desaturate(e){return Kl(this._rgb,1,-e),this}rotate(e){return E2(this._rgb,e),this}}function Jb(n){return new Oo(n)}function Gb(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function $f(n){return Gb(n)?n:Jb(n)}function _r(n){return Gb(n)?n:Jb(n).saturate(.5).darken(.1).hexString()}const as=Object.create(null),ia=Object.create(null);function ul(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>_r(i.backgroundColor),this.hoverBorderColor=(t,i)=>_r(i.borderColor),this.hoverColor=(t,i)=>_r(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return br(this,e,t)}get(e){return ul(this,e)}describe(e,t){return br(ia,e,t)}override(e,t){return br(as,e,t)}route(e,t,i,s){const l=ul(this,e),o=ul(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return st(a)?Object.assign({},u,a):rt(a,u)},set(a){this[r]=a}}})}}var at=new q2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function j2(n){return!n||bt(n.size)||bt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Eo(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function H2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function vl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,U2(n,l),a=0;a+n||0;function Ua(n,e){const t={},i=st(e),s=i?Object.keys(e):e,l=st(n)?i?o=>rt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=G2(l(o));return t}function Zb(n){return Ua(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ts(n){return Ua(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Gn(n){const e=Zb(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function An(n,e){n=n||{},e=e||at.font;let t=rt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=rt(n.style,e.style);i&&!(""+i).match(K2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:rt(n.family,e.family),lineHeight:J2(rt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:rt(n.weight,e.weight),string:""};return s.string=j2(s),s}function Jl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Wi(n,e){return Object.assign(Object.create(n),e)}function Wa(n,e=[""],t=n,i,s=()=>n[0]){Jn(i)||(i=e1("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Wa([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return Qb(o,r,()=>sw(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return Ef(o).includes(r)},ownKeys(o){return Ef(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function As(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Xb(n,i),setContext:l=>As(n,l,t,i),override:l=>As(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return Qb(l,o,()=>Q2(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function Xb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Bi(t)?t:()=>t,isIndexable:Bi(i)?i:()=>i}}const X2=(n,e)=>n?n+Fa(e):e,Ya=(n,e)=>st(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Qb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function Q2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Bi(r)&&o.isScriptable(e)&&(r=x2(e,r,n,t)),Lt(r)&&r.length&&(r=ew(e,r,n,o.isIndexable)),Ya(e,r)&&(r=As(r,s,l&&l[e],o)),r}function x2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Ya(n,e)&&(e=Ka(s._scopes,s,n,e)),e}function ew(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Jn(l.index)&&i(n))e=e[l.index%e.length];else if(st(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ka(u,s,n,f);e.push(As(c,l,o&&o[n],r))}}return e}function xb(n,e,t){return Bi(n)?n(e,t):n}const tw=(n,e)=>n===!0?e:typeof n=="string"?zi(e,n):void 0;function nw(n,e,t,i,s){for(const l of e){const o=tw(t,l);if(o){n.add(o);const r=xb(o._fallback,t,s);if(Jn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Jn(i)&&t!==i)return null}return!1}function Ka(n,e,t,i){const s=e._rootScopes,l=xb(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Of(r,o,t,l||t,i);return a===null||Jn(l)&&l!==t&&(a=Of(r,o,l,a,i),a===null)?!1:Wa(Array.from(r),[""],s,l,()=>iw(e,t,i))}function Of(n,e,t,i,s){for(;t;)t=nw(n,e,t,i,s);return t}function iw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Lt(s)&&st(t)?t:s}function sw(n,e,t,i){let s;for(const l of e)if(s=e1(X2(l,n),t),Jn(s))return Ya(n,s)?Ka(t,i,n,s):s}function e1(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Jn(i))return i}}function Ef(n){let e=n._keys;return e||(e=n._keys=lw(n._scopes)),e}function lw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function t1(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function rw(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=ta(l,s),a=ta(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function aw(n,e,t){const i=n.length;let s,l,o,r,a,u=Is(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")fw(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function pw(n,e){return Zo(n).getPropertyValue(e)}const hw=["top","right","bottom","left"];function os(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=hw[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const mw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function gw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(mw(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function es(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Zo(t),l=s.boxSizing==="border-box",o=os(s,"padding"),r=os(s,"border","width"),{x:a,y:u,box:f}=gw(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:g}=e;return l&&(h-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function _w(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ja(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Zo(l),a=os(r,"border","width"),u=os(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Io(r.maxWidth,l,"clientWidth"),s=Io(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||Mo,maxHeight:s||Mo}}const vr=n=>Math.round(n*10)/10;function bw(n,e,t,i){const s=Zo(n),l=os(s,"margin"),o=Io(s.maxWidth,n,"clientWidth")||Mo,r=Io(s.maxHeight,n,"clientHeight")||Mo,a=_w(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=os(s,"border","width"),d=os(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=vr(Math.min(u,o,a.maxWidth)),f=vr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=vr(u/2)),{width:u,height:f}}function Df(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const vw=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function Af(n,e){const t=pw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ts(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function yw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function kw(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=ts(n,s,t),r=ts(s,l,t),a=ts(l,e,t),u=ts(o,r,t),f=ts(r,a,t);return ts(u,f,t)}const If=new Map;function ww(n,e){e=e||{};const t=n+JSON.stringify(e);let i=If.get(t);return i||(i=new Intl.NumberFormat(n,e),If.set(t,i)),i}function Il(n,e,t){return ww(e,t).format(n)}const Sw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Tw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function yr(n,e,t){return n?Sw(e,t):Tw()}function Cw(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function $w(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function s1(n){return n==="angle"?{between:_l,compare:u2,normalize:Dn}:{between:bl,compare:(e,t)=>e-t,normalize:e=>e}}function Lf({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function Mw(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=s1(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;da(s,C,y)&&r(s,C)!==0,$=()=>r(l,y)===0||a(l,C,y),O=()=>m||T(),M=()=>!m||$();for(let D=f,L=f;D<=c;++D)S=e[D%o],!S.skip&&(y=u(S[i]),y!==C&&(m=a(y,s,l),_===null&&O()&&(_=r(y,s)===0?D:L),_!==null&&M()&&(g.push(Lf({start:_,end:D,loop:d,count:o,style:h})),_=null),L=D,C=y));return _!==null&&g.push(Lf({start:_,end:c,loop:d,count:o,style:h})),g}function o1(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function Ew(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function Dw(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=Ow(t,s,l,i);if(i===!0)return Pf(n,[{start:o,end:r,loop:l}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=zb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var vi=new Pw;const Ff="transparent",Nw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=$f(n||Ff),s=i.valid&&$f(e||Ff);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Fw{constructor(e,t,i,s){const l=t[i];s=Kl([e.to,s,l,e.from]);const o=Kl([e.from,l,s]);this._active=!0,this._fn=e.fn||Nw[e.type||typeof o],this._easing=rl[e.easing]||rl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Kl([e.to,t,s,e.from]),this._from=Kl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});at.set("animations",{colors:{type:"color",properties:qw},numbers:{type:"number",properties:Rw}});at.describe("animations",{_fallback:"animation"});at.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class a1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!st(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!st(s))return;const l={};for(const o of jw)l[o]=s[o];(It(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Vw(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Hw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new Fw(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return vi.add(this._chart,i),!0}}function Hw(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function Vf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=Ww(l,o,i),c=e.length;let d;for(let h=0;ht[i].axis===e).shift()}function Jw(n,e){return Wi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Gw(n,e,t){return Wi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ks(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const kr=n=>n==="reset"||n==="none",zf=(n,e)=>e?n:Object.assign({},n),Zw=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:u1(t,!0),values:null};class li{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=jf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Ks(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,h,g)=>c==="x"?d:c==="r"?g:h,l=t.xAxisID=rt(i.xAxisID,yr(e,"x")),o=t.yAxisID=rt(i.yAxisID,yr(e,"y")),r=t.rAxisID=rt(i.rAxisID,yr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&bf(this._data,this),e._stacked&&Ks(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(st(t))this._data=Uw(t);else if(i!==t){if(i){bf(i,this);const s=this._cachedMeta;Ks(s),s._parsed=[]}t&&Object.isExtensible(t)&&h2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=jf(t.vScale,t),t.stack!==i.stack&&(s=!0,Ks(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Vf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{It(s[e])?d=this.parseArrayData(i,s,e,t):st(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const h=()=>c[r]===null||u&&c[r]m||c=0;--d)if(!g()){this.updateRangeFromParsed(u,e,h,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),m=u.resolveNamedOptions(d,h,g,c);return m.$shared&&(m.$shared=a,l[o]=Object.freeze(zf(m,a))),m}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new a1(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||kr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){kr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!kr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function Qw(n){const e=n.iScale,t=Xw(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Jn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function f1(n,e,t,i){return It(n)?t3(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Bf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function i3(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(_t(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;dgl(C,r,a,!0)?1:Math.max(T,T*t,$,$*t),g=(C,T,$)=>gl(C,r,a,!0)?-1:Math.min(T,T*t,$,$*t),m=h(0,u,c),_=h(Bt,f,d),y=g(Ut,u,c),S=g(Ut+Bt,f,d);i=(m-y)/2,s=(_-S)/2,l=-(m+y)/2,o=-(_+S)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Il extends li{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(st(i[e])){const{key:a="value"}=this._parsing;l=u=>+zi(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?wt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Al(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Il.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return It(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Zo extends li{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=Ub(t,s,o);this._drawStart=r,this._drawCount=a,Wb(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:g,segment:m}=this.options,_=Es(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let S=t>0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs($[d]-S[d])>_,m&&(O.parsed=$,O.raw=u.data[C]),c&&(O.options=f||this.resolveDataElementOptions(C,T.active?"active":s)),y||this.updateElement(T,C,O,s),S=$}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Zo.id="line";Zo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Zo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Xa extends li{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Al(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return n1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*Ut;let h=d,g;const m=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?ni(this.resolveDataElementOptions(e,t).angle||i):0}}Xa.id="polarArea";Xa.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Xa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class c1 extends Il{}c1.id="pie";c1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Qa extends li{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return n1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};Oi.defaults={};Oi.defaultRoutes=void 0;const d1={values(n){return It(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=a3(n,t)}const o=Wn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Al(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Wn(n)));return i===1||i===2||i===5?d1.numeric.call(this,n,e,t):""}};function a3(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Xo={formatters:d1};at.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Xo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});at.route("scale.ticks","color","","color");at.route("scale.grid","color","","borderColor");at.route("scale.grid","borderColor","","borderColor");at.route("scale.title","color","","color");at.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});at.describe("scales",{_fallback:"scale"});at.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function u3(n,e){const t=n.options.ticks,i=t.maxTicksLimit||f3(n),s=t.major.enabled?d3(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return p3(e,a,s,l/i),a;const u=c3(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Gl(e,a,u,_t(d)?0:o-d,o),f=0,c=l-1;fs)return a}return Math.max(s,1)}function d3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Yf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Kf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function _3(n,e){yt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Hn(t,Hn(i,t)),max:Hn(i,Hn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Vt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=X2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,h=mn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Js(e.grid)-t.padding-Jf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Ra(Math.min(Math.asin(mn((f.highest.height+6)/r,-1,1)),Math.asin(mn(a/u,-1,1))-Math.asin(mn(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Vt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Vt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Jf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Js(l)+a):(e.height=this.maxHeight,e.width=Js(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),h=i.padding*2,g=ni(this.labelRotation),m=Math.cos(g),_=Math.sin(g);if(r){const y=i.mirror?0:_*c.width+m*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:m*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(u,f,_,m)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Vt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[M]||0,height:o[M]||0});return{first:O(0),last:O(t-1),widest:O(T),highest:O($),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return c2(this._alignToPixels?Zi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Js(l),d=[],h=l.setContext(this.getContext()),g=h.drawBorder?h.borderWidth:0,m=g/2,_=function(B){return Zi(i,B,g)};let y,S,C,T,$,O,M,D,L,N,P,F;if(o==="top")y=_(this.bottom),O=this.bottom-c,D=y-m,N=_(e.top)+m,F=e.bottom;else if(o==="bottom")y=_(this.top),N=e.top,F=_(e.bottom)-m,O=y+m,D=this.top+c;else if(o==="left")y=_(this.right),$=this.right-c,M=y-m,L=_(e.left)+m,P=e.right;else if(o==="right")y=_(this.left),L=e.left,P=_(e.right)-m,$=y+m,M=this.left+c;else if(t==="x"){if(o==="center")y=_((e.top+e.bottom)/2+.5);else if(st(o)){const B=Object.keys(o)[0],G=o[B];y=_(this.chart.scales[B].getPixelForValue(G))}N=e.top,F=e.bottom,O=y+m,D=O+c}else if(t==="y"){if(o==="center")y=_((e.left+e.right)/2);else if(st(o)){const B=Object.keys(o)[0],G=o[B];y=_(this.chart.scales[B].getPixelForValue(G))}$=y-m,M=$-c,L=e.left,P=e.right}const R=rt(s.ticks.maxTicksLimit,f),q=Math.max(1,Math.ceil(f/R));for(S=0;Sl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");at.route(l,s,a,r)})}function T3(n){return"id"in n&&"defaults"in n}class C3{constructor(){this.controllers=new Zl(li,"datasets",!0),this.elements=new Zl(Oi,"elements"),this.plugins=new Zl(Object,"plugins"),this.scales=new Zl(ds,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):yt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Fa(e);Vt(i["before"+s],[],i),t[e](i),Vt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let T=t;T0&&Math.abs(O[h]-C[h])>y,_&&(M.parsed=O,M.raw=u.data[T]),d&&(M.options=c||this.resolveDataElementOptions(T,$.active?"active":s)),S||this.updateElement($,T,M,s),C=O}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}xa.id="scatter";xa.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};xa.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Xi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class la{constructor(e){this.options=e||{}}init(e){}formats(){return Xi()}parse(e,t){return Xi()}format(e,t){return Xi()}add(e,t,i){return Xi()}diff(e,t,i){return Xi()}startOf(e,t,i){return Xi()}endOf(e,t){return Xi()}}la.override=function(n){Object.assign(la.prototype,n)};var p1={_date:la};function $3(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?d2:is;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Ll(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var D3={evaluateInteractionItems:Ll,modes:{index(n,e,t,i){const s=es(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?Sr(n,s,l,i,o):Tr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=es(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?Sr(n,s,l,i,o):Tr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Zf(n,e){return n.filter(t=>h1.indexOf(t.pos)===-1&&t.box.axis===e)}function Zs(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function A3(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Zs(Gs(e,"left"),!0),s=Zs(Gs(e,"right")),l=Zs(Gs(e,"top"),!0),o=Zs(Gs(e,"bottom")),r=Zf(e,"x"),a=Zf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Gs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Xf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function m1(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function N3(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!st(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&m1(o,l.getPadding());const r=Math.max(0,e.outerWidth-Xf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Xf(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function F3(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function R3(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function nl(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof m.beforeLayout=="function"&&m.beforeLayout()});const f=a.reduce((m,_)=>_.box.options&&_.box.options.display===!1?m:m+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);m1(d,Gn(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),g=L3(a.concat(u),c);nl(r.fullSize,h,c,g),nl(a,h,c,g),nl(u,h,c,g)&&nl(a,h,c,g),F3(h),Qf(r.leftAndTop,h,c,g),h.x+=h.w,h.y+=h.h,Qf(r.rightAndBottom,h,c,g),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},yt(r.chartArea,m=>{const _=m.box;Object.assign(_,n.chartArea),_.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class g1{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class q3 extends g1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const fo="$chartjs",j3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xf=n=>n===null||n==="";function H3(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[fo]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",xf(s)){const l=Af(n,"width");l!==void 0&&(n.width=l)}if(xf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Af(n,"height");l!==void 0&&(n.height=l)}return n}const _1=yw?{passive:!0}:!1;function V3(n,e,t){n.addEventListener(e,t,_1)}function z3(n,e,t){n.canvas.removeEventListener(e,t,_1)}function B3(n,e){const t=j3[n.type]||n.type,{x:i,y:s}=es(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Io(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function U3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Io(r.addedNodes,i),o=o&&!Io(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function W3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Io(r.removedNodes,i),o=o&&!Io(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const vl=new Map;let ec=0;function b1(){const n=window.devicePixelRatio;n!==ec&&(ec=n,vl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function Y3(n,e){vl.size||window.addEventListener("resize",b1),vl.set(n,e)}function K3(n){vl.delete(n),vl.size||window.removeEventListener("resize",b1)}function J3(n,e,t){const i=n.canvas,s=i&&Ja(i);if(!s)return;const l=Bb((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),Y3(n,l),o}function Cr(n,e,t){t&&t.disconnect(),e==="resize"&&K3(n)}function G3(n,e,t){const i=n.canvas,s=Bb(l=>{n.ctx!==null&&t(B3(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return V3(i,e,s),s}class Z3 extends g1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(H3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[fo])return!1;const i=t[fo].initial;["height","width"].forEach(l=>{const o=i[l];_t(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[fo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:U3,detach:W3,resize:J3}[t]||G3;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:Cr,detach:Cr,resize:Cr}[t]||z3)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return vw(e,t,i,s)}isAttached(e){const t=Ja(e);return!!(t&&t.isConnected)}}function X3(n){return!s1()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?q3:Z3}class Q3{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(Vt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){_t(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=rt(i.options&&i.options.plugins,{}),l=x3(i);return s===!1&&!t?[]:tS(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function x3(n){const e={},t=[],i=Object.keys(fi.plugins.items);for(let l=0;l{const a=i[r];if(!st(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=ra(r,a),f=sS(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=ll(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||oa(a,e),c=(as[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=iS(d,u),g=r[h+"AxisID"]||l[h]||h;o[g]=o[g]||Object.create(null),ll(o[g],[{axis:h},i[g],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];ll(a,[at.scales[a.type],at.scale])}),o}function v1(n){const e=n.options||(n.options={});e.plugins=rt(e.plugins,{}),e.scales=oS(n,e)}function y1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function rS(n){return n=n||{},n.data=y1(n.data),v1(n),n}const tc=new Map,k1=new Set;function xl(n,e){let t=tc.get(n);return t||(t=e(),tc.set(n,t),k1.add(t)),t}const Xs=(n,e,t)=>{const i=zi(e,t);i!==void 0&&n.add(i)};class aS{constructor(e){this._config=rS(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=y1(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),v1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return xl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return xl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return xl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return xl(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Xs(a,e,c))),f.forEach(c=>Xs(a,s,c)),f.forEach(c=>Xs(a,as[l]||{},c)),f.forEach(c=>Xs(a,at,c)),f.forEach(c=>Xs(a,ia,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),k1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,as[t]||{},at.datasets[t]||{},{type:t},at,ia]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=nc(this._resolverCache,e,s);let a=o;if(fS(o,t)){l.$shared=!1,i=Bi(i)?i():i;const u=this.createResolver(e,i,r);a=Ds(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=nc(this._resolverCache,e,i);return st(t)?Ds(l,t,void 0,s):l}}function nc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Wa(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const uS=n=>st(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Bi(n[t]),!1);function fS(n,e){const{isScriptable:t,isIndexable:i}=Qb(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Bi(r)||uS(r))||o&&It(r))return!0}return!1}var cS="3.9.1";const dS=["top","bottom","left","right","chartArea"];function ic(n,e){return n==="top"||n==="bottom"||dS.indexOf(n)===-1&&e==="x"}function sc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function lc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Vt(t&&t.onComplete,[n],e)}function pS(n){const e=n.chart,t=e.options.animation;Vt(t&&t.onProgress,[n],e)}function w1(n){return s1()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Lo={},S1=n=>{const e=w1(n);return Object.values(Lo).filter(t=>t.canvas===e).pop()};function hS(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function mS(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Po{constructor(e,t){const i=this.config=new aS(t),s=w1(e),l=S1(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||X3(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=xk(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Q3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=m2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Lo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}vi.listen(this,"complete",lc),vi.listen(this,"progress",pS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return _t(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Df(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Mf(this.canvas,this.ctx),this}stop(){return vi.stop(this),this}resize(e,t){vi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Df(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Vt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};yt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ra(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),yt(l,o=>{const r=o.options,a=r.id,u=ra(a,r),f=rt(r.type,o.dtype);(r.position===void 0||ic(r.position,u)!==ic(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=fi.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),yt(s,(o,r)=>{o||delete i[r]}),yt(i,o=>{Ql.configure(this,o,o.options),Ql.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(sc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){yt(this.scales,e=>{Ql.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!hf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;hS(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ql.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],yt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&za(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Ba(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return bl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=D3.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Wi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Jn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),vi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};yt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){yt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},yt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!To(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=l2(e),u=mS(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Vt(l.onHover,[e,r,this],this),a&&Vt(l.onClick,[e,r,this],this));const f=!To(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const oc=()=>yt(Po.instances,n=>n._plugins.invalidate()),Li=!0;Object.defineProperties(Po,{defaults:{enumerable:Li,value:at},instances:{enumerable:Li,value:Lo},overrides:{enumerable:Li,value:as},registry:{enumerable:Li,value:fi},version:{enumerable:Li,value:cS},getChart:{enumerable:Li,value:S1},register:{enumerable:Li,value:(...n)=>{fi.add(...n),oc()}},unregister:{enumerable:Li,value:(...n)=>{fi.remove(...n),oc()}}});function T1(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+Bt,i-Bt),n.closePath(),n.clip()}function gS(n){return Ua(n,["outerStart","outerEnd","innerStart","innerEnd"])}function _S(n,e,t,i){const s=gS(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return mn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:mn(s.innerStart,0,o),innerEnd:mn(s.innerEnd,0,o)}}function bs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function aa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const g=s-a;if(i){const B=f>0?f-i:0,G=c>0?c-i:0,X=(B+G)/2,J=X!==0?g*X/(X+i):g;h=(g-J)/2}const m=Math.max(.001,g*c-t/Ut)/c,_=(g-m)/2,y=a+_+h,S=s-_-h,{outerStart:C,outerEnd:T,innerStart:$,innerEnd:O}=_S(e,d,c,S-y),M=c-C,D=c-T,L=y+C/M,N=S-T/D,P=d+$,F=d+O,R=y+$/P,q=S-O/F;if(n.beginPath(),l){if(n.arc(o,r,c,L,N),T>0){const X=bs(D,N,o,r);n.arc(X.x,X.y,T,N,S+Bt)}const B=bs(F,S,o,r);if(n.lineTo(B.x,B.y),O>0){const X=bs(F,q,o,r);n.arc(X.x,X.y,O,S+Bt,q+Math.PI)}if(n.arc(o,r,d,S-O/d,y+$/d,!0),$>0){const X=bs(P,R,o,r);n.arc(X.x,X.y,$,R+Math.PI,y-Bt)}const G=bs(M,y,o,r);if(n.lineTo(G.x,G.y),C>0){const X=bs(M,L,o,r);n.arc(X.x,X.y,C,y-Bt,L)}}else{n.moveTo(o,r);const B=Math.cos(L)*c+o,G=Math.sin(L)*c+r;n.lineTo(B,G);const X=Math.cos(N)*c+o,J=Math.sin(N)*c+r;n.lineTo(X,J)}n.closePath()}function bS(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){aa(n,e,t,i,o+wt,s);for(let u=0;u=wt||gl(l,r,a),m=_l(o,u+d,f+d);return g&&m}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Ut&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=bS(e,this,r,l,o);yS(e,this,r,l,a,o),e.restore()}}eu.id="arc";eu.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};eu.defaultRoutes={backgroundColor:"backgroundColor"};function C1(n,e,t=e){n.lineCap=rt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(rt(t.borderDash,e.borderDash)),n.lineDashOffset=rt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=rt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=rt(t.borderWidth,e.borderWidth),n.strokeStyle=rt(t.borderColor,e.borderColor)}function kS(n,e,t){n.lineTo(t.x,t.y)}function wS(n){return n.stepped?B2:n.tension||n.cubicInterpolationMode==="monotone"?U2:kS}function $1(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%l,C=()=>{m!==_&&(n.lineTo(f,_),n.lineTo(f,m),n.lineTo(f,y))};for(a&&(h=s[S(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[S(d)],h.skip)continue;const T=h.x,$=h.y,O=T|0;O===g?($_&&(_=$),f=(c*f+T)/++c):(C(),n.lineTo(T,$),g=O,c=0,m=_=$),y=$}C()}function ua(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?TS:SS}function CS(n){return n.stepped?kw:n.tension||n.cubicInterpolationMode==="monotone"?ww:ts}function $S(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),C1(n,e.options),n.stroke(s)}function MS(n,e,t,i){const{segments:s,options:l}=e,o=ua(e);for(const r of s)C1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const OS=typeof Path2D=="function";function ES(n,e,t,i){OS&&!e.options.segment?$S(n,e,t,i):MS(n,e,t,i)}class Yi extends Oi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;pw(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Aw(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=r1(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=CS(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function rc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=nu(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function nu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function ac(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function O1(n,e){let t=[],i=!1;return It(n)?(i=!0,t=n):t=FS(n,e),t.length?new Yi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function uc(n){return n&&n.fill!==!1}function RS(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Yt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function qS(n,e,t){const i=zS(n);if(st(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Yt(s)&&Math.floor(s)===s?jS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function jS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function HS(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:st(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function VS(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:st(n)?i=n.value:i=e.getBaseValue(),i}function zS(n){const e=n.options,t=e.fill;let i=rt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function BS(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=US(e,t);r.push(O1({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&Or(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;uc(l)&&Or(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!uc(i)||t.drawTime!=="beforeDatasetDraw"||Or(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ul={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;er({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Vb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var vi=new Lw;const Ff="transparent",Pw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=$f(n||Ff),s=i.valid&&$f(e||Ff);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Nw{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||Pw[e.type||typeof o],this._easing=al[e.easing]||al.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});at.set("animations",{colors:{type:"color",properties:Rw},numbers:{type:"number",properties:Fw}});at.describe("animations",{_fallback:"animation"});at.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class r1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!st(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!st(s))return;const l={};for(const o of qw)l[o]=s[o];(Lt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Hw(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&jw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new Nw(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return vi.add(this._chart,i),!0}}function jw(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function Vf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=Uw(l,o,i),c=e.length;let d;for(let h=0;ht[i].axis===e).shift()}function Kw(n,e){return Wi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Jw(n,e,t){return Wi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Js(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const wr=n=>n==="reset"||n==="none",zf=(n,e)=>e?n:Object.assign({},n),Gw=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:a1(t,!0),values:null};class li{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=jf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Js(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,h,g)=>c==="x"?d:c==="r"?g:h,l=t.xAxisID=rt(i.xAxisID,kr(e,"x")),o=t.yAxisID=rt(i.yAxisID,kr(e,"y")),r=t.rAxisID=rt(i.rAxisID,kr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&bf(this._data,this),e._stacked&&Js(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(st(t))this._data=Bw(t);else if(i!==t){if(i){bf(i,this);const s=this._cachedMeta;Js(s),s._parsed=[]}t&&Object.isExtensible(t)&&p2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=jf(t.vScale,t),t.stack!==i.stack&&(s=!0,Js(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Vf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{Lt(s[e])?d=this.parseArrayData(i,s,e,t):st(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const h=()=>c[r]===null||u&&c[r]m||c=0;--d)if(!g()){this.updateRangeFromParsed(u,e,h,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),m=u.resolveNamedOptions(d,h,g,c);return m.$shared&&(m.$shared=a,l[o]=Object.freeze(zf(m,a))),m}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new r1(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||wr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){wr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!wr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function Xw(n){const e=n.iScale,t=Zw(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Jn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function u1(n,e,t,i){return Lt(n)?e3(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Bf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function n3(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(bt(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;d_l(C,r,a,!0)?1:Math.max(T,T*t,$,$*t),g=(C,T,$)=>_l(C,r,a,!0)?-1:Math.min(T,T*t,$,$*t),m=h(0,u,c),_=h(Bt,f,d),y=g(Ut,u,c),S=g(Ut+Bt,f,d);i=(m-y)/2,s=(_-S)/2,l=-(m+y)/2,o=-(_+S)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Ll extends li{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(st(i[e])){const{key:a="value"}=this._parsing;l=u=>+zi(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?wt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Ll.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return Lt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Xo extends li{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=Bb(t,s,o);this._drawStart=r,this._drawCount=a,Ub(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:g,segment:m}=this.options,_=Ds(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let S=t>0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs($[d]-S[d])>_,m&&(O.parsed=$,O.raw=u.data[C]),c&&(O.options=f||this.resolveDataElementOptions(C,T.active?"active":s)),y||this.updateElement(T,C,O,s),S=$}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Xo.id="line";Xo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Xo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Xa extends li{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return t1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*Ut;let h=d,g;const m=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?ni(this.resolveDataElementOptions(e,t).angle||i):0}}Xa.id="polarArea";Xa.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Xa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class f1 extends Ll{}f1.id="pie";f1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Qa extends li{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return t1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};Oi.defaults={};Oi.defaultRoutes=void 0;const c1={values(n){return Lt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=r3(n,t)}const o=Wn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Il(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Wn(n)));return i===1||i===2||i===5?c1.numeric.call(this,n,e,t):""}};function r3(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Qo={formatters:c1};at.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Qo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});at.route("scale.ticks","color","","color");at.route("scale.grid","color","","borderColor");at.route("scale.grid","borderColor","","borderColor");at.route("scale.title","color","","color");at.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});at.describe("scales",{_fallback:"scale"});at.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function a3(n,e){const t=n.options.ticks,i=t.maxTicksLimit||u3(n),s=t.major.enabled?c3(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return d3(e,a,s,l/i),a;const u=f3(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Zl(e,a,u,bt(d)?0:o-d,o),f=0,c=l-1;fs)return a}return Math.max(s,1)}function c3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Yf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Kf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function g3(n,e){kt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Hn(t,Hn(i,t)),max:Hn(i,Hn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Vt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Z2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,h=mn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Gs(e.grid)-t.padding-Jf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Ra(Math.min(Math.asin(mn((f.highest.height+6)/r,-1,1)),Math.asin(mn(a/u,-1,1))-Math.asin(mn(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Vt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Vt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Jf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Gs(l)+a):(e.height=this.maxHeight,e.width=Gs(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),h=i.padding*2,g=ni(this.labelRotation),m=Math.cos(g),_=Math.sin(g);if(r){const y=i.mirror?0:_*c.width+m*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:m*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(u,f,_,m)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Vt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[M]||0,height:o[M]||0});return{first:O(0),last:O(t-1),widest:O(T),highest:O($),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return f2(this._alignToPixels?Zi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Gs(l),d=[],h=l.setContext(this.getContext()),g=h.drawBorder?h.borderWidth:0,m=g/2,_=function(B){return Zi(i,B,g)};let y,S,C,T,$,O,M,D,L,N,P,F;if(o==="top")y=_(this.bottom),O=this.bottom-c,D=y-m,N=_(e.top)+m,F=e.bottom;else if(o==="bottom")y=_(this.top),N=e.top,F=_(e.bottom)-m,O=y+m,D=this.top+c;else if(o==="left")y=_(this.right),$=this.right-c,M=y-m,L=_(e.left)+m,P=e.right;else if(o==="right")y=_(this.left),L=e.left,P=_(e.right)-m,$=y+m,M=this.left+c;else if(t==="x"){if(o==="center")y=_((e.top+e.bottom)/2+.5);else if(st(o)){const B=Object.keys(o)[0],G=o[B];y=_(this.chart.scales[B].getPixelForValue(G))}N=e.top,F=e.bottom,O=y+m,D=O+c}else if(t==="y"){if(o==="center")y=_((e.left+e.right)/2);else if(st(o)){const B=Object.keys(o)[0],G=o[B];y=_(this.chart.scales[B].getPixelForValue(G))}$=y-m,M=$-c,L=e.left,P=e.right}const R=rt(s.ticks.maxTicksLimit,f),q=Math.max(1,Math.ceil(f/R));for(S=0;Sl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");at.route(l,s,a,r)})}function S3(n){return"id"in n&&"defaults"in n}class T3{constructor(){this.controllers=new Xl(li,"datasets",!0),this.elements=new Xl(Oi,"elements"),this.plugins=new Xl(Object,"plugins"),this.scales=new Xl(ds,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):kt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Fa(e);Vt(i["before"+s],[],i),t[e](i),Vt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let T=t;T0&&Math.abs(O[h]-C[h])>y,_&&(M.parsed=O,M.raw=u.data[T]),d&&(M.options=c||this.resolveDataElementOptions(T,$.active?"active":s)),S||this.updateElement($,T,M,s),C=O}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}xa.id="scatter";xa.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};xa.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Xi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class la{constructor(e){this.options=e||{}}init(e){}formats(){return Xi()}parse(e,t){return Xi()}format(e,t){return Xi()}add(e,t,i){return Xi()}diff(e,t,i){return Xi()}startOf(e,t,i){return Xi()}endOf(e,t){return Xi()}}la.override=function(n){Object.assign(la.prototype,n)};var d1={_date:la};function C3(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?c2:is;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Pl(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var E3={evaluateInteractionItems:Pl,modes:{index(n,e,t,i){const s=es(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?Tr(n,s,l,i,o):Cr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=es(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?Tr(n,s,l,i,o):Cr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Zf(n,e){return n.filter(t=>p1.indexOf(t.pos)===-1&&t.box.axis===e)}function Xs(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function D3(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Xs(Zs(e,"left"),!0),s=Xs(Zs(e,"right")),l=Xs(Zs(e,"top"),!0),o=Xs(Zs(e,"bottom")),r=Zf(e,"x"),a=Zf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Zs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Xf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function h1(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function P3(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!st(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&h1(o,l.getPadding());const r=Math.max(0,e.outerWidth-Xf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Xf(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function N3(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function F3(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function il(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof m.beforeLayout=="function"&&m.beforeLayout()});const f=a.reduce((m,_)=>_.box.options&&_.box.options.display===!1?m:m+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);h1(d,Gn(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),g=I3(a.concat(u),c);il(r.fullSize,h,c,g),il(a,h,c,g),il(u,h,c,g)&&il(a,h,c,g),N3(h),Qf(r.leftAndTop,h,c,g),h.x+=h.w,h.y+=h.h,Qf(r.rightAndBottom,h,c,g),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},kt(r.chartArea,m=>{const _=m.box;Object.assign(_,n.chartArea),_.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class m1{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class R3 extends m1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",q3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xf=n=>n===null||n==="";function j3(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[co]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",xf(s)){const l=Af(n,"width");l!==void 0&&(n.width=l)}if(xf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Af(n,"height");l!==void 0&&(n.height=l)}return n}const g1=vw?{passive:!0}:!1;function H3(n,e,t){n.addEventListener(e,t,g1)}function V3(n,e,t){n.canvas.removeEventListener(e,t,g1)}function z3(n,e){const t=q3[n.type]||n.type,{x:i,y:s}=es(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Lo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function B3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Lo(r.addedNodes,i),o=o&&!Lo(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function U3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Lo(r.removedNodes,i),o=o&&!Lo(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const yl=new Map;let ec=0;function _1(){const n=window.devicePixelRatio;n!==ec&&(ec=n,yl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function W3(n,e){yl.size||window.addEventListener("resize",_1),yl.set(n,e)}function Y3(n){yl.delete(n),yl.size||window.removeEventListener("resize",_1)}function K3(n,e,t){const i=n.canvas,s=i&&Ja(i);if(!s)return;const l=zb((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),W3(n,l),o}function $r(n,e,t){t&&t.disconnect(),e==="resize"&&Y3(n)}function J3(n,e,t){const i=n.canvas,s=zb(l=>{n.ctx!==null&&t(z3(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return H3(i,e,s),s}class G3 extends m1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(j3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(l=>{const o=i[l];bt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:B3,detach:U3,resize:K3}[t]||J3;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:$r,detach:$r,resize:$r}[t]||V3)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return bw(e,t,i,s)}isAttached(e){const t=Ja(e);return!!(t&&t.isConnected)}}function Z3(n){return!i1()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?R3:G3}class X3{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(Vt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){bt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=rt(i.options&&i.options.plugins,{}),l=Q3(i);return s===!1&&!t?[]:eS(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function Q3(n){const e={},t=[],i=Object.keys(fi.plugins.items);for(let l=0;l{const a=i[r];if(!st(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=ra(r,a),f=iS(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=ol(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||oa(a,e),c=(as[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=nS(d,u),g=r[h+"AxisID"]||l[h]||h;o[g]=o[g]||Object.create(null),ol(o[g],[{axis:h},i[g],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];ol(a,[at.scales[a.type],at.scale])}),o}function b1(n){const e=n.options||(n.options={});e.plugins=rt(e.plugins,{}),e.scales=lS(n,e)}function v1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function oS(n){return n=n||{},n.data=v1(n.data),b1(n),n}const tc=new Map,y1=new Set;function eo(n,e){let t=tc.get(n);return t||(t=e(),tc.set(n,t),y1.add(t)),t}const Qs=(n,e,t)=>{const i=zi(e,t);i!==void 0&&n.add(i)};class rS{constructor(e){this._config=oS(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=v1(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),b1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return eo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return eo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return eo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return eo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Qs(a,e,c))),f.forEach(c=>Qs(a,s,c)),f.forEach(c=>Qs(a,as[l]||{},c)),f.forEach(c=>Qs(a,at,c)),f.forEach(c=>Qs(a,ia,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),y1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,as[t]||{},at.datasets[t]||{},{type:t},at,ia]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=nc(this._resolverCache,e,s);let a=o;if(uS(o,t)){l.$shared=!1,i=Bi(i)?i():i;const u=this.createResolver(e,i,r);a=As(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=nc(this._resolverCache,e,i);return st(t)?As(l,t,void 0,s):l}}function nc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Wa(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const aS=n=>st(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Bi(n[t]),!1);function uS(n,e){const{isScriptable:t,isIndexable:i}=Xb(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Bi(r)||aS(r))||o&&Lt(r))return!0}return!1}var fS="3.9.1";const cS=["top","bottom","left","right","chartArea"];function ic(n,e){return n==="top"||n==="bottom"||cS.indexOf(n)===-1&&e==="x"}function sc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function lc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Vt(t&&t.onComplete,[n],e)}function dS(n){const e=n.chart,t=e.options.animation;Vt(t&&t.onProgress,[n],e)}function k1(n){return i1()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Po={},w1=n=>{const e=k1(n);return Object.values(Po).filter(t=>t.canvas===e).pop()};function pS(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function hS(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class No{constructor(e,t){const i=this.config=new rS(t),s=k1(e),l=w1(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Z3(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=Qk(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new X3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=h2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Po[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}vi.listen(this,"complete",lc),vi.listen(this,"progress",dS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return bt(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Df(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Mf(this.canvas,this.ctx),this}stop(){return vi.stop(this),this}resize(e,t){vi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Df(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Vt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};kt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ra(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),kt(l,o=>{const r=o.options,a=r.id,u=ra(a,r),f=rt(r.type,o.dtype);(r.position===void 0||ic(r.position,u)!==ic(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=fi.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),kt(s,(o,r)=>{o||delete i[r]}),kt(i,o=>{xl.configure(this,o,o.options),xl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(sc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){kt(this.scales,e=>{xl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!hf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;pS(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],kt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&za(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Ba(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return vl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=E3.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Wi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Jn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),vi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};kt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){kt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},kt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!Co(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=s2(e),u=hS(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Vt(l.onHover,[e,r,this],this),a&&Vt(l.onClick,[e,r,this],this));const f=!Co(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const oc=()=>kt(No.instances,n=>n._plugins.invalidate()),Li=!0;Object.defineProperties(No,{defaults:{enumerable:Li,value:at},instances:{enumerable:Li,value:Po},overrides:{enumerable:Li,value:as},registry:{enumerable:Li,value:fi},version:{enumerable:Li,value:fS},getChart:{enumerable:Li,value:w1},register:{enumerable:Li,value:(...n)=>{fi.add(...n),oc()}},unregister:{enumerable:Li,value:(...n)=>{fi.remove(...n),oc()}}});function S1(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+Bt,i-Bt),n.closePath(),n.clip()}function mS(n){return Ua(n,["outerStart","outerEnd","innerStart","innerEnd"])}function gS(n,e,t,i){const s=mS(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return mn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:mn(s.innerStart,0,o),innerEnd:mn(s.innerEnd,0,o)}}function bs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function aa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const g=s-a;if(i){const B=f>0?f-i:0,G=c>0?c-i:0,X=(B+G)/2,J=X!==0?g*X/(X+i):g;h=(g-J)/2}const m=Math.max(.001,g*c-t/Ut)/c,_=(g-m)/2,y=a+_+h,S=s-_-h,{outerStart:C,outerEnd:T,innerStart:$,innerEnd:O}=gS(e,d,c,S-y),M=c-C,D=c-T,L=y+C/M,N=S-T/D,P=d+$,F=d+O,R=y+$/P,q=S-O/F;if(n.beginPath(),l){if(n.arc(o,r,c,L,N),T>0){const X=bs(D,N,o,r);n.arc(X.x,X.y,T,N,S+Bt)}const B=bs(F,S,o,r);if(n.lineTo(B.x,B.y),O>0){const X=bs(F,q,o,r);n.arc(X.x,X.y,O,S+Bt,q+Math.PI)}if(n.arc(o,r,d,S-O/d,y+$/d,!0),$>0){const X=bs(P,R,o,r);n.arc(X.x,X.y,$,R+Math.PI,y-Bt)}const G=bs(M,y,o,r);if(n.lineTo(G.x,G.y),C>0){const X=bs(M,L,o,r);n.arc(X.x,X.y,C,y-Bt,L)}}else{n.moveTo(o,r);const B=Math.cos(L)*c+o,G=Math.sin(L)*c+r;n.lineTo(B,G);const X=Math.cos(N)*c+o,J=Math.sin(N)*c+r;n.lineTo(X,J)}n.closePath()}function _S(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){aa(n,e,t,i,o+wt,s);for(let u=0;u=wt||_l(l,r,a),m=bl(o,u+d,f+d);return g&&m}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Ut&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=_S(e,this,r,l,o);vS(e,this,r,l,a,o),e.restore()}}eu.id="arc";eu.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};eu.defaultRoutes={backgroundColor:"backgroundColor"};function T1(n,e,t=e){n.lineCap=rt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(rt(t.borderDash,e.borderDash)),n.lineDashOffset=rt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=rt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=rt(t.borderWidth,e.borderWidth),n.strokeStyle=rt(t.borderColor,e.borderColor)}function yS(n,e,t){n.lineTo(t.x,t.y)}function kS(n){return n.stepped?z2:n.tension||n.cubicInterpolationMode==="monotone"?B2:yS}function C1(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%l,C=()=>{m!==_&&(n.lineTo(f,_),n.lineTo(f,m),n.lineTo(f,y))};for(a&&(h=s[S(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[S(d)],h.skip)continue;const T=h.x,$=h.y,O=T|0;O===g?($_&&(_=$),f=(c*f+T)/++c):(C(),n.lineTo(T,$),g=O,c=0,m=_=$),y=$}C()}function ua(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?SS:wS}function TS(n){return n.stepped?yw:n.tension||n.cubicInterpolationMode==="monotone"?kw:ts}function CS(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),T1(n,e.options),n.stroke(s)}function $S(n,e,t,i){const{segments:s,options:l}=e,o=ua(e);for(const r of s)T1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const MS=typeof Path2D=="function";function OS(n,e,t,i){MS&&!e.options.segment?CS(n,e,t,i):$S(n,e,t,i)}class Yi extends Oi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;dw(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Dw(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=o1(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=TS(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function rc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=nu(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function nu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function ac(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function M1(n,e){let t=[],i=!1;return Lt(n)?(i=!0,t=n):t=NS(n,e),t.length?new Yi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function uc(n){return n&&n.fill!==!1}function FS(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Yt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function RS(n,e,t){const i=VS(n);if(st(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Yt(s)&&Math.floor(s)===s?qS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function qS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function jS(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:st(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function HS(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:st(n)?i=n.value:i=e.getBaseValue(),i}function VS(n){const e=n.options,t=e.fill;let i=rt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function zS(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=BS(e,t);r.push(M1({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&Er(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;uc(l)&&Er(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!uc(i)||t.drawTime!=="beforeDatasetDraw"||Er(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const fl={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` -`):n}function t4(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function pc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=An(e.bodyFont),u=An(e.titleFont),f=An(e.footerFont),c=l.length,d=s.length,h=i.length,g=Gn(e.padding);let m=g.height,_=0,y=i.reduce((T,$)=>T+$.before.length+$.lines.length+$.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(m+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;m+=h*T+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(m+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,yt(n.title,C),t.font=a.string,yt(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,yt(i,T=>{yt(T.before,C),yt(T.lines,C),yt(T.after,C)}),S=0,t.font=f.string,yt(n.footer,C),t.restore(),_+=g.width,{width:_,height:m}}function n4(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function i4(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function s4(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),i4(u,n,e,t)&&(u="center"),u}function hc(n,e,t){const i=t.yAlign||e.yAlign||n4(n,t);return{xAlign:t.xAlign||e.xAlign||s4(n,e,t,i),yAlign:i}}function l4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function o4(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function mc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=Ss(o);let g=l4(e,r);const m=o4(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:mn(g,0,i.width-e.width),y:mn(m,0,i.height-e.height)}}function eo(n,e,t){const i=Gn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function gc(n){return ai([],yi(n))}function r4(n,e,t){return Wi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function _c(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends Oi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new a1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=r4(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ai(r,yi(s)),r=ai(r,yi(l)),r=ai(r,yi(o)),r}getBeforeBody(e,t){return gc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return yt(e,l=>{const o={before:[],lines:[],after:[]},r=_c(i,l);ai(o.before,yi(r.beforeLabel.call(this,l))),ai(o.lines,r.label.call(this,l)),ai(o.after,yi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return gc(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=ai(r,yi(s)),r=ai(r,yi(l)),r=ai(r,yi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),yt(r,f=>{const c=_c(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=ul[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=pc(this,i),u=Object.assign({},r,a),f=hc(this.chart,i,u),c=mc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=Ss(r),{x:d,y:h}=e,{width:g,height:m}=t;let _,y,S,C,T,$;return l==="center"?(T=h+m/2,s==="left"?(_=d,y=_-o,C=T+o,$=T-o):(_=d+g,y=_+o,C=T-o,$=T+o),S=_):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+g-Math.max(u,c)-o:y=this.caretX,l==="top"?(C=h,T=C-o,_=y-o,S=y+o):(C=h+m,T=C+o,_=y+o,S=y-o),$=C),{x1:_,x2:y,x3:S,y1:C,y2:T,y3:$}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=vr(i.rtl,this.x,this.width);for(e.x=eo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=An(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aC!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Do(e,{x:_,y:m,w:u,h:a,radius:S}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Do(e,{x:y,y:m+1,w:u-2,h:a-2,radius:S}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(_,m,u,a),e.strokeRect(_,m,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,m+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=An(i.bodyFont);let d=c.lineHeight,h=0;const g=vr(i.rtl,this.x,this.width),m=function(D){t.fillText(D,g.x(e.x+h),e.y+d/2),e.y+=d+l},_=g.textAlign(o);let y,S,C,T,$,O,M;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=eo(this,_,i),t.fillStyle=i.bodyColor,yt(this.beforeBody,m),h=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,O=s.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=ul[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=pc(this,e),a=Object.assign({},o,this._size),u=hc(t,e,a),f=mc(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Gn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),$w(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),Mw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!To(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!To(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=ul[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ca.positioners=ul;var a4={id:"tooltip",_element:ca,positioners:ul,afterInit(n,e,t){t&&(n.tooltip=new ca({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:bi,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const u4=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function f4(n,e,t,i){const s=n.indexOf(e);if(s===-1)return u4(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const c4=(n,e)=>n===null?null:mn(Math.round(n),0,e);class da extends ds{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(_t(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:f4(i,e,rt(t,e),this._addedLabels),c4(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}da.id="category";da.defaults={ticks:{callback:da.prototype.getLabelForValue}};function d4(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,g=f-1,{min:m,max:_}=e,y=!_t(o),S=!_t(r),C=!_t(u),T=(_-m)/(c+1);let $=gf((_-m)/g/h)*h,O,M,D,L;if($<1e-14&&!y&&!S)return[{value:m},{value:_}];L=Math.ceil(_/$)-Math.floor(m/$),L>g&&($=gf(L*$/g/h)*h),_t(a)||(O=Math.pow(10,a),$=Math.ceil($*O)/O),s==="ticks"?(M=Math.floor(m/$)*$,D=Math.ceil(_/$)*$):(M=m,D=_),y&&S&&l&&u2((r-o)/l,$/1e3)?(L=Math.round(Math.min((r-o)/$,f)),$=(r-o)/L,M=o,D=r):C?(M=y?o:M,D=S?r:D,L=u-1,$=(D-M)/L):(L=(D-M)/$,ol(L,Math.round(L),$/1e3)?L=Math.round(L):L=Math.ceil(L));const N=Math.max(_f($),_f(M));O=Math.pow(10,_t(a)?N:a),M=Math.round(M*O)/O,D=Math.round(D*O)/O;let P=0;for(y&&(d&&M!==o?(t.push({value:o}),Ms=t?s:a,r=a=>l=i?l:a;if(e){const a=ci(s),u=ci(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=d4(s,l);return e.bounds==="ticks"&&qb(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Al(e,this.chart.options.locale,this.options.ticks.format)}}class iu extends No{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Yt(e)?e:0,this.max=Yt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=ni(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}iu.id="linear";iu.defaults={ticks:{callback:Xo.formatters.numeric}};function vc(n){return n/Math.pow(10,Math.floor(Wn(n)))===1}function p4(n,e){const t=Math.floor(Wn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Hn(n.min,Math.pow(10,Math.floor(Wn(e.min)))),o=Math.floor(Wn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:vc(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Yt(e)?Math.max(0,e):null,this.max=Yt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(Wn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=p4(t,this);return e.bounds==="ticks"&&qb(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Al(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Wn(e),this._valueRange=Wn(this.max)-Wn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Wn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}D1.id="logarithmic";D1.defaults={ticks:{callback:Xo.formatters.logarithmic,major:{enabled:!0}}};function pa(n){const e=n.ticks;if(e.display&&n.display){const t=Gn(e.backdropPadding);return rt(e.font&&e.font.size,at.font.size)+t.height}return 0}function h4(n,e,t){return t=It(t)?t:[t],{w:V2(n,e.string,t),h:t.length*e.lineHeight}}function yc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function m4(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?Ut/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function _4(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=pa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Ut/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function k4(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=An(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:g}=l;if(!_t(g)){const m=Ss(l.borderRadius),_=Gn(l.backdropPadding);t.fillStyle=g;const y=f-_.left,S=c-_.top,C=d-f+_.width,T=h-c+_.height;Object.values(m).some($=>$!==0)?(t.beginPath(),Do(t,{x:y,y:S,w:C,h:T,radius:m}),t.fill()):t.fillRect(y,S,C,T)}Eo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function A1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,wt);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=Vt(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?m4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=wt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Dn(e*t+ni(i))}getDistanceFromCenterForValue(e){if(_t(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(_t(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));w4(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=An(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Gn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Eo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}xo.id="radialLinear";xo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Xo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};xo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};xo.descriptors={angleLines:{_fallback:"grid"}};const er={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},kn=Object.keys(er);function T4(n,e){return n-e}function kc(n,e){if(_t(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Yt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Es(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function wc(n,e,t,i){const s=kn.length;for(let l=kn.indexOf(n);l=kn.indexOf(t);l--){const o=kn[l];if(er[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return kn[t?kn.indexOf(t):0]}function $4(n){for(let e=kn.indexOf(n)+1,t=kn.length;e=e?t[i]:t[s];n[l]=!0}}function M4(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Tc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=mn(t,0,o),i=mn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||wc(l.minUnit,t,i,this._getLabelCapacity(t)),r=rt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Es(a)||a===!0,f={};let c=t,d,h;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,h=0;dm-_).map(m=>+m)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,h=this._adapter.format(e,s||(d?f:u)),g=l.ticks.callback;return g?Vt(g,[h,t,i],this):h}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=is(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=is(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class I1 extends Pl{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=to(t,this.min),this._tableRange=to(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;oT+$.before.length+$.lines.length+$.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(m+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;m+=h*T+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(m+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,kt(n.title,C),t.font=a.string,kt(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,kt(i,T=>{kt(T.before,C),kt(T.lines,C),kt(T.after,C)}),S=0,t.font=f.string,kt(n.footer,C),t.restore(),_+=g.width,{width:_,height:m}}function t4(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function n4(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function i4(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),n4(u,n,e,t)&&(u="center"),u}function hc(n,e,t){const i=t.yAlign||e.yAlign||t4(n,t);return{xAlign:t.xAlign||e.xAlign||i4(n,e,t,i),yAlign:i}}function s4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function l4(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function mc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=Ts(o);let g=s4(e,r);const m=l4(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:mn(g,0,i.width-e.width),y:mn(m,0,i.height-e.height)}}function to(n,e,t){const i=Gn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function gc(n){return ai([],yi(n))}function o4(n,e,t){return Wi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function _c(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends Oi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new r1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=o4(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ai(r,yi(s)),r=ai(r,yi(l)),r=ai(r,yi(o)),r}getBeforeBody(e,t){return gc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return kt(e,l=>{const o={before:[],lines:[],after:[]},r=_c(i,l);ai(o.before,yi(r.beforeLabel.call(this,l))),ai(o.lines,r.label.call(this,l)),ai(o.after,yi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return gc(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=ai(r,yi(s)),r=ai(r,yi(l)),r=ai(r,yi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),kt(r,f=>{const c=_c(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=fl[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=pc(this,i),u=Object.assign({},r,a),f=hc(this.chart,i,u),c=mc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=Ts(r),{x:d,y:h}=e,{width:g,height:m}=t;let _,y,S,C,T,$;return l==="center"?(T=h+m/2,s==="left"?(_=d,y=_-o,C=T+o,$=T-o):(_=d+g,y=_+o,C=T-o,$=T+o),S=_):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+g-Math.max(u,c)-o:y=this.caretX,l==="top"?(C=h,T=C-o,_=y-o,S=y+o):(C=h+m,T=C+o,_=y+o,S=y-o),$=C),{x1:_,x2:y,x3:S,y1:C,y2:T,y3:$}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=yr(i.rtl,this.x,this.width);for(e.x=to(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=An(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aC!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Ao(e,{x:_,y:m,w:u,h:a,radius:S}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Ao(e,{x:y,y:m+1,w:u-2,h:a-2,radius:S}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(_,m,u,a),e.strokeRect(_,m,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,m+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=An(i.bodyFont);let d=c.lineHeight,h=0;const g=yr(i.rtl,this.x,this.width),m=function(D){t.fillText(D,g.x(e.x+h),e.y+d/2),e.y+=d+l},_=g.textAlign(o);let y,S,C,T,$,O,M;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=to(this,_,i),t.fillStyle=i.bodyColor,kt(this.beforeBody,m),h=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,O=s.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=fl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=pc(this,e),a=Object.assign({},o,this._size),u=hc(t,e,a),f=mc(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Gn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),Cw(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),$w(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!Co(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!Co(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=fl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ca.positioners=fl;var r4={id:"tooltip",_element:ca,positioners:fl,afterInit(n,e,t){t&&(n.tooltip=new ca({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:bi,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const a4=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function u4(n,e,t,i){const s=n.indexOf(e);if(s===-1)return a4(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const f4=(n,e)=>n===null?null:mn(Math.round(n),0,e);class da extends ds{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(bt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:u4(i,e,rt(t,e),this._addedLabels),f4(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}da.id="category";da.defaults={ticks:{callback:da.prototype.getLabelForValue}};function c4(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,g=f-1,{min:m,max:_}=e,y=!bt(o),S=!bt(r),C=!bt(u),T=(_-m)/(c+1);let $=gf((_-m)/g/h)*h,O,M,D,L;if($<1e-14&&!y&&!S)return[{value:m},{value:_}];L=Math.ceil(_/$)-Math.floor(m/$),L>g&&($=gf(L*$/g/h)*h),bt(a)||(O=Math.pow(10,a),$=Math.ceil($*O)/O),s==="ticks"?(M=Math.floor(m/$)*$,D=Math.ceil(_/$)*$):(M=m,D=_),y&&S&&l&&a2((r-o)/l,$/1e3)?(L=Math.round(Math.min((r-o)/$,f)),$=(r-o)/L,M=o,D=r):C?(M=y?o:M,D=S?r:D,L=u-1,$=(D-M)/L):(L=(D-M)/$,rl(L,Math.round(L),$/1e3)?L=Math.round(L):L=Math.ceil(L));const N=Math.max(_f($),_f(M));O=Math.pow(10,bt(a)?N:a),M=Math.round(M*O)/O,D=Math.round(D*O)/O;let P=0;for(y&&(d&&M!==o?(t.push({value:o}),Ms=t?s:a,r=a=>l=i?l:a;if(e){const a=ci(s),u=ci(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=c4(s,l);return e.bounds==="ticks"&&Rb(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Il(e,this.chart.options.locale,this.options.ticks.format)}}class iu extends Fo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Yt(e)?e:0,this.max=Yt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=ni(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}iu.id="linear";iu.defaults={ticks:{callback:Qo.formatters.numeric}};function vc(n){return n/Math.pow(10,Math.floor(Wn(n)))===1}function d4(n,e){const t=Math.floor(Wn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Hn(n.min,Math.pow(10,Math.floor(Wn(e.min)))),o=Math.floor(Wn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:vc(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Yt(e)?Math.max(0,e):null,this.max=Yt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(Wn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=d4(t,this);return e.bounds==="ticks"&&Rb(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Il(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Wn(e),this._valueRange=Wn(this.max)-Wn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Wn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}E1.id="logarithmic";E1.defaults={ticks:{callback:Qo.formatters.logarithmic,major:{enabled:!0}}};function pa(n){const e=n.ticks;if(e.display&&n.display){const t=Gn(e.backdropPadding);return rt(e.font&&e.font.size,at.font.size)+t.height}return 0}function p4(n,e,t){return t=Lt(t)?t:[t],{w:H2(n,e.string,t),h:t.length*e.lineHeight}}function yc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function h4(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?Ut/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function g4(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=pa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Ut/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function y4(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=An(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:g}=l;if(!bt(g)){const m=Ts(l.borderRadius),_=Gn(l.backdropPadding);t.fillStyle=g;const y=f-_.left,S=c-_.top,C=d-f+_.width,T=h-c+_.height;Object.values(m).some($=>$!==0)?(t.beginPath(),Ao(t,{x:y,y:S,w:C,h:T,radius:m}),t.fill()):t.fillRect(y,S,C,T)}Do(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function D1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,wt);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=Vt(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?h4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=wt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Dn(e*t+ni(i))}getDistanceFromCenterForValue(e){if(bt(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(bt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));k4(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=An(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Gn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Do(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}er.id="radialLinear";er.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Qo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};er.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};er.descriptors={angleLines:{_fallback:"grid"}};const tr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},kn=Object.keys(tr);function S4(n,e){return n-e}function kc(n,e){if(bt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Yt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ds(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function wc(n,e,t,i){const s=kn.length;for(let l=kn.indexOf(n);l=kn.indexOf(t);l--){const o=kn[l];if(tr[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return kn[t?kn.indexOf(t):0]}function C4(n){for(let e=kn.indexOf(n)+1,t=kn.length;e=e?t[i]:t[s];n[l]=!0}}function $4(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Tc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=mn(t,0,o),i=mn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||wc(l.minUnit,t,i,this._getLabelCapacity(t)),r=rt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ds(a)||a===!0,f={};let c=t,d,h;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,h=0;dm-_).map(m=>+m)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,h=this._adapter.format(e,s||(d?f:u)),g=l.ticks.callback;return g?Vt(g,[h,t,i],this):h}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=is(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=is(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class A1 extends Nl{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=no(t,this.min),this._tableRange=no(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o{i&&(t||(t=He(e,Qt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,Qt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function E4(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&(k(e),k(t),k(s))}}}function D4(n){let e;return{c(){e=U("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function A4(n){let e,t,i,s,l,o=n[2]&&Cc();function r(f,c){return f[2]?D4:E4}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=E(),i=v("canvas"),s=E(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Vr(i,"height","250px"),Vr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=Cc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){I(o)},d(f){f&&(k(e),k(s),k(l)),o&&o.d(),n[8](null),u.d()}}}function I4(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),de.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),de.error(h,(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Kt(()=>(Po.register(Yi,Qo,Zo,iu,Pl,e4,a4),t(6,o=new Po(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){te[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class L4 extends be{constructor(e){super(),_e(this,e,I4,A4,ge,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var $c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function P4(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var L1={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + */const M4={datetime:Ye.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ye.TIME_WITH_SECONDS,minute:Ye.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};d1._date.override({_id:"luxon",_create:function(n){return Ye.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return M4},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Ye.fromFormat(n,e,t):n=Ye.fromISO(n,t):n instanceof Date?n=Ye.fromJSDate(n,t):i==="object"&&!(n instanceof Ye)&&(n=Ye.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Cc(n){let e,t,i;return{c(){e=v("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,Qt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function O4(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=W(n[1]),t=E(),s=W(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&(k(e),k(t),k(s))}}}function E4(n){let e;return{c(){e=W("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function D4(n){let e,t,i,s,l,o=n[2]&&Cc();function r(f,c){return f[2]?E4:O4}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=E(),i=v("canvas"),s=E(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Vr(i,"height","250px"),Vr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=Cc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){I(o)},d(f){f&&(k(e),k(s),k(l)),o&&o.d(),n[8](null),u.d()}}}function A4(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),ce.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ce.error(h,(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Kt(()=>(No.register(Yi,xo,Xo,iu,Nl,xS,r4),t(6,o=new No(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){te[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class I4 extends ve{constructor(e){super(),be(this,e,A4,D4,ge,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var $c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function L4(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var I1={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT * @author Lea Verou * @namespace * @public - */var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(C){return C instanceof a?new a(C.type,S(C.content),C.alias):Array.isArray(C)?C.map(S):C.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch($){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec($.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var T in C)if(C[T].src==S)return C[T]}return null}},isActive:function(S,C,T){for(var $="no-"+C;S;){var O=S.classList;if(O.contains(C))return!0;if(O.contains($))return!1;S=S.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,C){var T=r.util.clone(r.languages[S]);for(var $ in C)T[$]=C[$];return T},insertBefore:function(S,C,T,$){$=$||r.languages;var O=$[S],M={};for(var D in O)if(O.hasOwnProperty(D)){if(D==C)for(var L in T)T.hasOwnProperty(L)&&(M[L]=T[L]);T.hasOwnProperty(D)||(M[D]=O[D])}var N=$[S];return $[S]=M,r.languages.DFS(r.languages,function(P,F){F===N&&P!=S&&(this[P]=M)}),M},DFS:function S(C,T,$,O){O=O||{};var M=r.util.objId;for(var D in C)if(C.hasOwnProperty(D)){T.call(C,D,C[D],$||D);var L=C[D],N=r.util.type(L);N==="Object"&&!O[M(L)]?(O[M(L)]=!0,S(L,T,null,O)):N==="Array"&&!O[M(L)]&&(O[M(L)]=!0,S(L,T,D,O))}}},plugins:{},highlightAll:function(S,C){r.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,T){var $={callback:T,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",$),$.elements=Array.prototype.slice.apply($.container.querySelectorAll($.selector)),r.hooks.run("before-all-elements-highlight",$);for(var O=0,M;M=$.elements[O++];)r.highlightElement(M,C===!0,$.callback)},highlightElement:function(S,C,T){var $=r.util.getLanguage(S),O=r.languages[$];r.util.setLanguage(S,$);var M=S.parentElement;M&&M.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(M,$);var D=S.textContent,L={element:S,language:$,grammar:O,code:D};function N(F){L.highlightedCode=F,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),T&&T.call(L.element)}if(r.hooks.run("before-sanity-check",L),M=L.element.parentElement,M&&M.nodeName.toLowerCase()==="pre"&&!M.hasAttribute("tabindex")&&M.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),T&&T.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){N(r.util.encode(L.code));return}if(C&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(F){N(F.data)},P.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else N(r.highlight(L.code,L.grammar,L.language))},highlight:function(S,C,T){var $={code:S,grammar:C,language:T};if(r.hooks.run("before-tokenize",$),!$.grammar)throw new Error('The language "'+$.language+'" has no grammar.');return $.tokens=r.tokenize($.code,$.grammar),r.hooks.run("after-tokenize",$),a.stringify(r.util.encode($.tokens),$.language)},tokenize:function(S,C){var T=C.rest;if(T){for(var $ in T)C[$]=T[$];delete C.rest}var O=new c;return d(O,O.head,S),f(S,O,C,O.head,0),g(O)},hooks:{all:{},add:function(S,C){var T=r.hooks.all;T[S]=T[S]||[],T[S].push(C)},run:function(S,C){var T=r.hooks.all[S];if(!(!T||!T.length))for(var $=0,O;O=T[$++];)O(C)}},Token:a};i.Prism=r;function a(S,C,T,$){this.type=S,this.content=C,this.alias=T,this.length=($||"").length|0}a.stringify=function S(C,T){if(typeof C=="string")return C;if(Array.isArray(C)){var $="";return C.forEach(function(N){$+=S(N,T)}),$}var O={type:C.type,content:S(C.content,T),tag:"span",classes:["token",C.type],attributes:{},language:T},M=C.alias;M&&(Array.isArray(M)?Array.prototype.push.apply(O.classes,M):O.classes.push(M)),r.hooks.run("wrap",O);var D="";for(var L in O.attributes)D+=" "+L+'="'+(O.attributes[L]||"").replace(/"/g,""")+'"';return"<"+O.tag+' class="'+O.classes.join(" ")+'"'+D+">"+O.content+""};function u(S,C,T,$){S.lastIndex=C;var O=S.exec(T);if(O&&$&&O[1]){var M=O[1].length;O.index+=M,O[0]=O[0].slice(M)}return O}function f(S,C,T,$,O,M){for(var D in T)if(!(!T.hasOwnProperty(D)||!T[D])){var L=T[D];L=Array.isArray(L)?L:[L];for(var N=0;N=M.reach);W+=J.value.length,J=J.next){var oe=J.value;if(C.length>S.length)return;if(!(oe instanceof a)){var ee=1,se;if(q){if(se=u(X,W,S,R),!se||se.index>=S.length)break;var We=se.index,Ee=se.index+se[0].length,Re=W;for(Re+=J.value.length;We>=Re;)J=J.next,Re+=J.value.length;if(Re-=J.value.length,W=Re,J.value instanceof a)continue;for(var Ve=J;Ve!==C.tail&&(ReM.reach&&(M.reach=ct);var Se=J.prev;Me&&(Se=d(C,Se,Me),W+=Me.length),h(C,Se,ee);var we=new a(D,F?r.tokenize(ke,F):ke,B,ke);if(J=d(C,Se,we),Je&&d(C,J,Je),ee>1){var Ue={cause:D+","+N,reach:ct};f(S,C,T,J.prev,W,Ue),M&&Ue.reach>M.reach&&(M.reach=Ue.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},C={value:null,prev:S,next:null};S.next=C,this.head=S,this.tail=C,this.length=0}function d(S,C,T){var $=C.next,O={value:T,prev:C,next:$};return C.next=O,$.prev=O,S.length++,O}function h(S,C,T){for(var $=C.next,O=0;O/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(m,_){return"✖ Error "+m+" while fetching file: "+_},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(m,_,y){var S=new XMLHttpRequest;S.open("GET",m,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?_(S.responseText):S.status>=400?y(s(S.status,S.statusText)):y(l))},S.send(null)}function h(m){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(_){var y=Number(_[1]),S=_[2],C=_[3];return S?C?[y,Number(C)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(m){m.selector+=", "+c}),t.hooks.add("before-sanity-check",function(m){var _=m.element;if(_.matches(c)){m.code="",_.setAttribute(r,a);var y=_.appendChild(document.createElement("CODE"));y.textContent=i;var S=_.getAttribute("data-src"),C=m.language;if(C==="none"){var T=(/\.(\w+)$/.exec(S)||[,"none"])[1];C=o[T]||T}t.util.setLanguage(y,C),t.util.setLanguage(_,C);var $=t.plugins.autoloader;$&&$.loadLanguages(C),d(S,function(O){_.setAttribute(r,u);var M=h(_.getAttribute("data-range"));if(M){var D=O.split(/\r\n?|\n/g),L=M[0],N=M[1]==null?D.length:M[1];L<0&&(L+=D.length),L=Math.max(0,Math.min(L-1,D.length)),N<0&&(N+=D.length),N=Math.max(0,Math.min(N,D.length)),O=D.slice(L,N).join(` -`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(L+1))}y.textContent=O,t.highlightElement(y)},function(O){_.setAttribute(r,f),y.textContent=O})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),S=0,C;C=y[S++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(L1);var N4=L1.exports;const Qs=P4(N4);var F4={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch($){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec($.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var T in C)if(C[T].src==S)return C[T]}return null}},isActive:function(S,C,T){for(var $="no-"+C;S;){var O=S.classList;if(O.contains(C))return!0;if(O.contains($))return!1;S=S.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,C){var T=r.util.clone(r.languages[S]);for(var $ in C)T[$]=C[$];return T},insertBefore:function(S,C,T,$){$=$||r.languages;var O=$[S],M={};for(var D in O)if(O.hasOwnProperty(D)){if(D==C)for(var L in T)T.hasOwnProperty(L)&&(M[L]=T[L]);T.hasOwnProperty(D)||(M[D]=O[D])}var N=$[S];return $[S]=M,r.languages.DFS(r.languages,function(P,F){F===N&&P!=S&&(this[P]=M)}),M},DFS:function S(C,T,$,O){O=O||{};var M=r.util.objId;for(var D in C)if(C.hasOwnProperty(D)){T.call(C,D,C[D],$||D);var L=C[D],N=r.util.type(L);N==="Object"&&!O[M(L)]?(O[M(L)]=!0,S(L,T,null,O)):N==="Array"&&!O[M(L)]&&(O[M(L)]=!0,S(L,T,D,O))}}},plugins:{},highlightAll:function(S,C){r.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,T){var $={callback:T,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",$),$.elements=Array.prototype.slice.apply($.container.querySelectorAll($.selector)),r.hooks.run("before-all-elements-highlight",$);for(var O=0,M;M=$.elements[O++];)r.highlightElement(M,C===!0,$.callback)},highlightElement:function(S,C,T){var $=r.util.getLanguage(S),O=r.languages[$];r.util.setLanguage(S,$);var M=S.parentElement;M&&M.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(M,$);var D=S.textContent,L={element:S,language:$,grammar:O,code:D};function N(F){L.highlightedCode=F,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),T&&T.call(L.element)}if(r.hooks.run("before-sanity-check",L),M=L.element.parentElement,M&&M.nodeName.toLowerCase()==="pre"&&!M.hasAttribute("tabindex")&&M.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),T&&T.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){N(r.util.encode(L.code));return}if(C&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(F){N(F.data)},P.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else N(r.highlight(L.code,L.grammar,L.language))},highlight:function(S,C,T){var $={code:S,grammar:C,language:T};if(r.hooks.run("before-tokenize",$),!$.grammar)throw new Error('The language "'+$.language+'" has no grammar.');return $.tokens=r.tokenize($.code,$.grammar),r.hooks.run("after-tokenize",$),a.stringify(r.util.encode($.tokens),$.language)},tokenize:function(S,C){var T=C.rest;if(T){for(var $ in T)C[$]=T[$];delete C.rest}var O=new c;return d(O,O.head,S),f(S,O,C,O.head,0),g(O)},hooks:{all:{},add:function(S,C){var T=r.hooks.all;T[S]=T[S]||[],T[S].push(C)},run:function(S,C){var T=r.hooks.all[S];if(!(!T||!T.length))for(var $=0,O;O=T[$++];)O(C)}},Token:a};i.Prism=r;function a(S,C,T,$){this.type=S,this.content=C,this.alias=T,this.length=($||"").length|0}a.stringify=function S(C,T){if(typeof C=="string")return C;if(Array.isArray(C)){var $="";return C.forEach(function(N){$+=S(N,T)}),$}var O={type:C.type,content:S(C.content,T),tag:"span",classes:["token",C.type],attributes:{},language:T},M=C.alias;M&&(Array.isArray(M)?Array.prototype.push.apply(O.classes,M):O.classes.push(M)),r.hooks.run("wrap",O);var D="";for(var L in O.attributes)D+=" "+L+'="'+(O.attributes[L]||"").replace(/"/g,""")+'"';return"<"+O.tag+' class="'+O.classes.join(" ")+'"'+D+">"+O.content+""};function u(S,C,T,$){S.lastIndex=C;var O=S.exec(T);if(O&&$&&O[1]){var M=O[1].length;O.index+=M,O[0]=O[0].slice(M)}return O}function f(S,C,T,$,O,M){for(var D in T)if(!(!T.hasOwnProperty(D)||!T[D])){var L=T[D];L=Array.isArray(L)?L:[L];for(var N=0;N=M.reach);U+=J.value.length,J=J.next){var oe=J.value;if(C.length>S.length)return;if(!(oe instanceof a)){var ee=1,se;if(q){if(se=u(X,U,S,R),!se||se.index>=S.length)break;var We=se.index,Ee=se.index+se[0].length,Re=U;for(Re+=J.value.length;We>=Re;)J=J.next,Re+=J.value.length;if(Re-=J.value.length,U=Re,J.value instanceof a)continue;for(var Ve=J;Ve!==C.tail&&(ReM.reach&&(M.reach=ct);var Se=J.prev;Me&&(Se=d(C,Se,Me),U+=Me.length),h(C,Se,ee);var we=new a(D,F?r.tokenize(ke,F):ke,B,ke);if(J=d(C,Se,we),Je&&d(C,J,Je),ee>1){var Ue={cause:D+","+N,reach:ct};f(S,C,T,J.prev,U,Ue),M&&Ue.reach>M.reach&&(M.reach=Ue.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},C={value:null,prev:S,next:null};S.next=C,this.head=S,this.tail=C,this.length=0}function d(S,C,T){var $=C.next,O={value:T,prev:C,next:$};return C.next=O,$.prev=O,S.length++,O}function h(S,C,T){for(var $=C.next,O=0;O/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(m,_){return"✖ Error "+m+" while fetching file: "+_},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(m,_,y){var S=new XMLHttpRequest;S.open("GET",m,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?_(S.responseText):S.status>=400?y(s(S.status,S.statusText)):y(l))},S.send(null)}function h(m){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(_){var y=Number(_[1]),S=_[2],C=_[3];return S?C?[y,Number(C)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(m){m.selector+=", "+c}),t.hooks.add("before-sanity-check",function(m){var _=m.element;if(_.matches(c)){m.code="",_.setAttribute(r,a);var y=_.appendChild(document.createElement("CODE"));y.textContent=i;var S=_.getAttribute("data-src"),C=m.language;if(C==="none"){var T=(/\.(\w+)$/.exec(S)||[,"none"])[1];C=o[T]||T}t.util.setLanguage(y,C),t.util.setLanguage(_,C);var $=t.plugins.autoloader;$&&$.loadLanguages(C),d(S,function(O){_.setAttribute(r,u);var M=h(_.getAttribute("data-range"));if(M){var D=O.split(/\r\n?|\n/g),L=M[0],N=M[1]==null?D.length:M[1];L<0&&(L+=D.length),L=Math.max(0,Math.min(L-1,D.length)),N<0&&(N+=D.length),N=Math.max(0,Math.min(N,D.length)),O=D.slice(L,N).join(` +`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(L+1))}y.textContent=O,t.highlightElement(y)},function(O){_.setAttribute(r,f),y.textContent=O})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),S=0,C;C=y[S++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(I1);var P4=I1.exports;const xs=L4(P4);var N4={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;ar&&(f[d]=` `+f[d],c=h)}a[u]=f.join("")}return a.join(` -`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",g="",m=!1,_=0;_>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function R4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function q4(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Qs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Qs.highlight(a,Qs.languages[l]||Qs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Qs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class P1 extends be{constructor(e){super(),_e(this,e,q4,R4,ge,{class:0,content:2,language:3})}}const j4=n=>({}),Mc=n=>({}),H4=n=>({}),Oc=n=>({});function Ec(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C=n[4]&&!n[2]&&Dc(n);const T=n[19].header,$=Ct(T,n,n[18],Oc);let O=n[4]&&n[2]&&Ac(n);const M=n[19].default,D=Ct(M,n,n[18],null),L=n[19].footer,N=Ct(L,n,n[18],Mc);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),C&&C.c(),r=E(),$&&$.c(),a=E(),O&&O.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),N&&N.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(P,F){w(P,e,F),b(e,t),b(e,s),b(e,l),b(l,o),C&&C.m(o,null),b(o,r),$&&$.m(o,null),b(o,a),O&&O.m(o,null),b(l,u),b(l,f),D&&D.m(f,null),n[21](f),b(l,c),b(l,d),N&&N.m(d,null),_=!0,y||(S=[Y(t,"click",Ze(n[20])),Y(f,"scroll",n[22])],y=!0)},p(P,F){n=P,n[4]&&!n[2]?C?(C.p(n,F),F[0]&20&&A(C,1)):(C=Dc(n),C.c(),A(C,1),C.m(o,r)):C&&(re(),I(C,1,1,()=>{C=null}),ae()),$&&$.p&&(!_||F[0]&262144)&&Mt($,T,n,n[18],_?$t(T,n[18],F,H4):Ot(n[18]),Oc),n[4]&&n[2]?O?O.p(n,F):(O=Ac(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),D&&D.p&&(!_||F[0]&262144)&&Mt(D,M,n,n[18],_?$t(M,n[18],F,null):Ot(n[18]),null),N&&N.p&&(!_||F[0]&262144)&&Mt(N,L,n,n[18],_?$t(L,n[18],F,j4):Ot(n[18]),Mc),(!_||F[0]&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),(!_||F[0]&262)&&Q(l,"popup",n[2]),(!_||F[0]&4)&&Q(e,"padded",n[2]),(!_||F[0]&1)&&Q(e,"active",n[0])},i(P){_||(P&&xe(()=>{_&&(i||(i=He(t,hl,{duration:Ni,opacity:0},!0)),i.run(1))}),A(C),A($,P),A(D,P),A(N,P),P&&xe(()=>{_&&(m&&m.end(1),g=$_(l,mi,n[2]?{duration:Ni,y:-10}:{duration:Ni,x:50}),g.start())}),_=!0)},o(P){P&&(i||(i=He(t,hl,{duration:Ni,opacity:0},!1)),i.run(0)),I(C),I($,P),I(D,P),I(N,P),g&&g.invalidate(),P&&(m=ya(l,mi,n[2]?{duration:Ni,y:10}:{duration:Ni,x:50})),_=!1},d(P){P&&k(e),P&&i&&i.end(),C&&C.d(),$&&$.d(P),O&&O.d(),D&&D.d(P),n[21](null),N&&N.d(P),P&&m&&m.end(),y=!1,$e(S)}}}function Dc(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",Ze(n[5])),s=!0)},p(o,r){n=o},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,hl,{duration:Ni},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,hl,{duration:Ni},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Ac(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function V4(n){let e,t,i,s,l=n[0]&&Ec(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Ec(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){I(l),t=!1},d(o){o&&k(e),l&&l.d(),n[23](null),i=!1,$e(s)}}}let Qi,Er=[];function N1(){return Qi=Qi||document.querySelector(".overlays"),Qi||(Qi=document.createElement("div"),Qi.classList.add("overlays"),document.body.appendChild(Qi)),Qi}let Ni=150;function Ic(){return 1e3+N1().querySelectorAll(".overlay-panel-container.active").length}function z4(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const h=dt(),g="op_"+j.randomString(10);let m,_,y,S,C="",T=o;function $(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(W){t(17,T=W),W?(y=document.activeElement,h("show"),m==null||m.focus()):(clearTimeout(S),h("hide"),y==null||y.focus()),await sn(),L()}function L(){m&&(o?t(6,m.style.zIndex=Ic(),m):t(6,m.style="",m))}function N(){j.pushUnique(Er,g),document.body.classList.add("overlay-active")}function P(){j.removeByValue(Er,g),Er.length||document.body.classList.remove("overlay-active")}function F(W){o&&f&&W.code=="Escape"&&!j.isInput(W.target)&&m&&m.style.zIndex==Ic()&&(W.preventDefault(),O())}function R(W){o&&q(_)}function q(W,oe){oe&&t(8,C=""),W&&(S||(S=setTimeout(()=>{if(clearTimeout(S),S=null,!W)return;if(W.scrollHeight-W.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}W.scrollTop==0?t(8,C+=" scroll-top-reached"):W.scrollTop+W.offsetHeight==W.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Kt(()=>(N1().appendChild(m),()=>{var W;clearTimeout(S),P(),(W=m==null?void 0:m.classList)==null||W.add("hidden"),setTimeout(()=>{m==null||m.remove()},0)}));const B=()=>a?O():!0;function G(W){te[W?"unshift":"push"](()=>{_=W,t(7,_)})}const X=W=>q(W.target);function J(W){te[W?"unshift":"push"](()=>{m=W,t(6,m)})}return n.$$set=W=>{"class"in W&&t(1,l=W.class),"active"in W&&t(0,o=W.active),"popup"in W&&t(2,r=W.popup),"overlayClose"in W&&t(3,a=W.overlayClose),"btnClose"in W&&t(4,u=W.btnClose),"escClose"in W&&t(12,f=W.escClose),"beforeOpen"in W&&t(13,c=W.beforeOpen),"beforeHide"in W&&t(14,d=W.beforeHide),"$$scope"in W&&t(18,s=W.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&D(o),n.$$.dirty[0]&128&&q(_,!0),n.$$.dirty[0]&64&&m&&L(),n.$$.dirty[0]&1&&(o?N():P())},[o,l,r,a,u,O,m,_,C,F,R,q,f,c,d,$,M,T,s,i,B,G,X,J]}class on extends be{constructor(e){super(),_e(this,e,z4,V4,ge,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function B4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function U4(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=U(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function W4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Y4(n){let e,t,i;return t=new P1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function K4(n){var Pe;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,g,m=n[2].status+"",_,y,S,C,T,$,O=((Pe=n[2].method)==null?void 0:Pe.toUpperCase())+"",M,D,L,N,P,F,R=n[2].auth+"",q,B,G,X,J,W,oe=n[2].url+"",ee,se,Ee,Re,Ve,We,ke,Me,Je,ct,Se,we=n[2].remoteIp+"",Ue,it,ne,qe,Ce,pt,qt=n[2].userIp+"",fn,nn,rn,Nn,_i,Fn,Ie=n[2].userAgent+"",Tt,oi,cn,Xn,Ai,Cn,Qn,en,et,ue,De,Xe,Jt,nt,Dt,At;function Rn(Ne,Ae){return Ne[2].referer?U4:B4}let K=Rn(n),Z=K(n);const ie=[Y4,W4],fe=[];function Oe(Ne,Ae){return Ae&4&&(Qn=null),Qn==null&&(Qn=!j.isEmpty(Ne[2].meta)),Qn?0:1}return en=Oe(n,-1),et=fe[en]=ie[en](n),Dt=new $i({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=E(),o=v("td"),a=U(r),u=E(),f=v("tr"),c=v("td"),c.textContent="Status",d=E(),h=v("td"),g=v("span"),_=U(m),y=E(),S=v("tr"),C=v("td"),C.textContent="Method",T=E(),$=v("td"),M=U(O),D=E(),L=v("tr"),N=v("td"),N.textContent="Auth",P=E(),F=v("td"),q=U(R),B=E(),G=v("tr"),X=v("td"),X.textContent="URL",J=E(),W=v("td"),ee=U(oe),se=E(),Ee=v("tr"),Re=v("td"),Re.textContent="Referer",Ve=E(),We=v("td"),Z.c(),ke=E(),Me=v("tr"),Je=v("td"),Je.textContent="Remote IP",ct=E(),Se=v("td"),Ue=U(we),it=E(),ne=v("tr"),qe=v("td"),qe.textContent="User IP",Ce=E(),pt=v("td"),fn=U(qt),nn=E(),rn=v("tr"),Nn=v("td"),Nn.textContent="UserAgent",_i=E(),Fn=v("td"),Tt=U(Ie),oi=E(),cn=v("tr"),Xn=v("td"),Xn.textContent="Meta",Ai=E(),Cn=v("td"),et.c(),ue=E(),De=v("tr"),Xe=v("td"),Xe.textContent="Created",Jt=E(),nt=v("td"),z(Dt.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(g,"class","label"),Q(g,"label-danger",n[2].status>=400),p(C,"class","min-width txt-hint txt-bold"),p(N,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(Re,"class","min-width txt-hint txt-bold"),p(Je,"class","min-width txt-hint txt-bold"),p(qe,"class","min-width txt-hint txt-bold"),p(Nn,"class","min-width txt-hint txt-bold"),p(Xn,"class","min-width txt-hint txt-bold"),p(Xe,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Ne,Ae){w(Ne,e,Ae),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,a),b(t,u),b(t,f),b(f,c),b(f,d),b(f,h),b(h,g),b(g,_),b(t,y),b(t,S),b(S,C),b(S,T),b(S,$),b($,M),b(t,D),b(t,L),b(L,N),b(L,P),b(L,F),b(F,q),b(t,B),b(t,G),b(G,X),b(G,J),b(G,W),b(W,ee),b(t,se),b(t,Ee),b(Ee,Re),b(Ee,Ve),b(Ee,We),Z.m(We,null),b(t,ke),b(t,Me),b(Me,Je),b(Me,ct),b(Me,Se),b(Se,Ue),b(t,it),b(t,ne),b(ne,qe),b(ne,Ce),b(ne,pt),b(pt,fn),b(t,nn),b(t,rn),b(rn,Nn),b(rn,_i),b(rn,Fn),b(Fn,Tt),b(t,oi),b(t,cn),b(cn,Xn),b(cn,Ai),b(cn,Cn),fe[en].m(Cn,null),b(t,ue),b(t,De),b(De,Xe),b(De,Jt),b(De,nt),H(Dt,nt,null),At=!0},p(Ne,Ae){var Ke;(!At||Ae&4)&&r!==(r=Ne[2].id+"")&&le(a,r),(!At||Ae&4)&&m!==(m=Ne[2].status+"")&&le(_,m),(!At||Ae&4)&&Q(g,"label-danger",Ne[2].status>=400),(!At||Ae&4)&&O!==(O=((Ke=Ne[2].method)==null?void 0:Ke.toUpperCase())+"")&&le(M,O),(!At||Ae&4)&&R!==(R=Ne[2].auth+"")&&le(q,R),(!At||Ae&4)&&oe!==(oe=Ne[2].url+"")&&le(ee,oe),K===(K=Rn(Ne))&&Z?Z.p(Ne,Ae):(Z.d(1),Z=K(Ne),Z&&(Z.c(),Z.m(We,null))),(!At||Ae&4)&&we!==(we=Ne[2].remoteIp+"")&&le(Ue,we),(!At||Ae&4)&&qt!==(qt=Ne[2].userIp+"")&&le(fn,qt),(!At||Ae&4)&&Ie!==(Ie=Ne[2].userAgent+"")&&le(Tt,Ie);let Qe=en;en=Oe(Ne,Ae),en===Qe?fe[en].p(Ne,Ae):(re(),I(fe[Qe],1,1,()=>{fe[Qe]=null}),ae(),et=fe[en],et?et.p(Ne,Ae):(et=fe[en]=ie[en](Ne),et.c()),A(et,1),et.m(Cn,null));const ze={};Ae&4&&(ze.date=Ne[2].created),Dt.$set(ze)},i(Ne){At||(A(et),A(Dt.$$.fragment,Ne),At=!0)},o(Ne){I(et),I(Dt.$$.fragment,Ne),At=!1},d(Ne){Ne&&k(e),Z.d(),fe[en].d(),V(Dt)}}}function J4(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function G4(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Z4(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[G4],header:[J4],default:[K4]},$$scope:{ctx:n}};return e=new on({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[5](null),V(e,s)}}}function X4(n,e,t){let i,s={};function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){te[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Fe.call(this,n,c)}function f(c){Fe.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class Q4 extends be{constructor(e){super(),_e(this,e,X4,Z4,ge,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function x4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Lc(n){let e,t;return e=new L4({props:{filter:n[4],presets:n[5]}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Pc(n){let e,t;return e=new Qk({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function eT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S=n[3],C,T=n[3],$,O;r=new Ko({}),r.$on("refresh",n[9]),d=new me({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[x4,({uniqueId:L})=>({14:L}),({uniqueId:L})=>L?16384:0]},$$scope:{ctx:n}}}),g=new El({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),g.$on("submit",n[11]);let M=Lc(n),D=Pc(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=U(n[6]),o=E(),z(r.$$.fragment),a=E(),u=v("div"),f=E(),c=v("div"),z(d.$$.fragment),h=E(),z(g.$$.fragment),m=E(),_=v("div"),y=E(),M.c(),C=E(),D.c(),$=ye(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(_,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(L,N){w(L,e,N),b(e,t),b(t,i),b(i,s),b(s,l),b(t,o),H(r,t,null),b(t,a),b(t,u),b(t,f),b(t,c),H(d,c,null),b(e,h),H(g,e,null),b(e,m),b(e,_),b(e,y),M.m(e,null),w(L,C,N),D.m(L,N),w(L,$,N),O=!0},p(L,N){(!O||N&64)&&le(l,L[6]);const P={};N&49154&&(P.$$scope={dirty:N,ctx:L}),d.$set(P);const F={};N&1&&(F.value=L[0]),g.$set(F),N&8&&ge(S,S=L[3])?(re(),I(M,1,1,x),ae(),M=Lc(L),M.c(),A(M,1),M.m(e,null)):M.p(L,N),N&8&&ge(T,T=L[3])?(re(),I(D,1,1,x),ae(),D=Pc(L),D.c(),A(D,1),D.m($.parentNode,$)):D.p(L,N)},i(L){O||(A(r.$$.fragment,L),A(d.$$.fragment,L),A(g.$$.fragment,L),A(M),A(D),O=!0)},o(L){I(r.$$.fragment,L),I(d.$$.fragment,L),I(g.$$.fragment,L),I(M),I(D),O=!1},d(L){L&&(k(e),k(C),k($)),V(r),V(d),V(g),M.d(L),D.d(L)}}}function tT(n){let e,t,i,s;e=new Tn({props:{$$slots:{default:[eT]},$$scope:{ctx:n}}});let l={};return i=new Q4({props:l}),n[13](i),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),s=!1},d(o){o&&k(t),V(e,o),n[13](null),V(i,o)}}}const Nc="includeAdminLogs";function nT(n,e,t){var y;let i,s,l;Ge(n,Nt,S=>t(6,l=S));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];an(Nt,l="Request logs",l);let r,a="",u=((y=window.localStorage)==null?void 0:y.getItem(Nc))<<0,f=1;function c(){t(3,f++,f)}const d=()=>c();function h(){u=this.checked,t(1,u)}const g=S=>t(0,a=S.detail),m=S=>r==null?void 0:r.show(S==null?void 0:S.detail);function _(S){te[S?"unshift":"push"](()=>{r=S,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(Nc,u<<0),n.$$.dirty&1&&t(4,s=j.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,c,d,h,g,m,_]}class iT extends be{constructor(e){super(),_e(this,e,nT,tT,ge,{})}}function sT(n){let e,t,i;return{c(){e=v("span"),p(e,"class","dragline svelte-1g2t3dj"),Q(e,"dragging",n[1])},m(s,l){w(s,e,l),n[4](e),t||(i=[Y(e,"mousedown",n[5]),Y(e,"touchstart",n[2])],t=!0)},p(s,[l]){l&2&&Q(e,"dragging",s[1])},i:x,o:x,d(s){s&&k(e),n[4](null),t=!1,$e(i)}}}function lT(n,e,t){const i=dt();let{tolerance:s=0}=e,l,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-l.offsetLeft,u=_.clientY-l.offsetTop,document.addEventListener("touchmove",h),document.addEventListener("mousemove",h),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),l.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:l})),document.removeEventListener("touchmove",h),document.removeEventListener("mousemove",h),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function h(_){let y=_.clientX-o,S=_.clientY-r,C=_.clientX-a,T=_.clientY-u;!f&&Math.abs(C-l.offsetLeft){l=_,t(0,l)})}const m=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,s=_.tolerance)},[l,f,c,s,g,m]}class oT extends be{constructor(e){super(),_e(this,e,lT,sT,ge,{tolerance:3})}}const su=Ln({});function _n(n,e,t){su.set({text:n,yesCallback:e,noCallback:t})}function F1(){su.set({})}function Fc(n){let e,t,i;const s=n[17].default,l=Ct(s,n,n[16],null);return{c(){e=v("div"),l&&l.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&Mt(l,s,o,o[16],i?$t(s,o[16],r,null):Ot(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&Q(e,"active",o[0])},i(o){i||(A(l,o),o&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=He(e,mi,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function rT(n){let e,t,i,s,l=n[0]&&Fc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[Y(window,"mousedown",n[5]),Y(window,"click",n[6]),Y(window,"keydown",n[4]),Y(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Fc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){I(l),t=!1},d(o){o&&k(e),l&&l.d(),n[19](null),i=!1,$e(s)}}}function aT(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,h,g,m=!1;const _=dt();function y(){t(0,o=!1),m=!1,clearTimeout(g)}function S(){t(0,o=!0),clearTimeout(g),g=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function C(){o?y():S()}function T(B){return!c||B.classList.contains(u)||(h==null?void 0:h.contains(B))&&!c.contains(B)||c.contains(B)&&B.closest&&B.closest("."+u)}function $(B){(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function O(B){(B.code==="Enter"||B.code==="Space")&&(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function M(B){o&&r&&B.code==="Escape"&&(B.preventDefault(),y())}function D(B){o&&!(c!=null&&c.contains(B.target))?m=!0:m&&(m=!1)}function L(B){var G;o&&m&&!(c!=null&&c.contains(B.target))&&!(h!=null&&h.contains(B.target))&&!((G=B.target)!=null&&G.closest(".flatpickr-calendar"))&&y()}function N(B){D(B),L(B)}function P(B){F(),c==null||c.addEventListener("click",$),t(15,h=B||(c==null?void 0:c.parentNode)),h==null||h.addEventListener("click",$),h==null||h.addEventListener("keydown",O)}function F(){clearTimeout(g),c==null||c.removeEventListener("click",$),h==null||h.removeEventListener("click",$),h==null||h.removeEventListener("keydown",O)}Kt(()=>(P(),()=>F()));function R(B){te[B?"unshift":"push"](()=>{d=B,t(3,d)})}function q(B){te[B?"unshift":"push"](()=>{c=B,t(2,c)})}return n.$$set=B=>{"trigger"in B&&t(8,l=B.trigger),"active"in B&&t(0,o=B.active),"escClose"in B&&t(9,r=B.escClose),"autoScroll"in B&&t(10,a=B.autoScroll),"closableClass"in B&&t(11,u=B.closableClass),"class"in B&&t(1,f=B.class),"$$scope"in B&&t(16,s=B.$$scope)},n.$$.update=()=>{var B,G;n.$$.dirty&260&&c&&P(l),n.$$.dirty&32769&&(o?((B=h==null?void 0:h.classList)==null||B.add("active"),_("show")):((G=h==null?void 0:h.classList)==null||G.remove("active"),_("hide")))},[o,f,c,d,M,D,L,N,l,r,a,u,y,S,C,h,s,i,R,q]}class Pn extends be{constructor(e){super(),_e(this,e,aT,rT,ge,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Rc(n,e,t){const i=n.slice();return i[27]=e[t],i}function uT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("input"),s=E(),l=v("label"),o=U("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),b(l,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function fT(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=Lt(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}o?(e=Lt(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],ve(()=>t=!1)),e.$set(c)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function cT(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function dT(n){let e,t,i,s;const l=[cT,fT],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function qc(n){let e,t,i,s=pe(n[10]),l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[dT,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&qc(n);return{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),r&&r.c(),l=ye()},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=qc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s),k(l)),V(e,a),V(i,a),r&&r.d(a)}}}function hT(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=v("h4"),i=U(t),s=U(" index")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&le(i,t)},d(l){l&&k(e)}}}function Hc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Te(Be.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function mT(n){let e,t,i,s,l,o,r=n[5]!=""&&Hc(n);return{c(){r&&r.c(),e=E(),t=v("button"),t.innerHTML='Cancel',i=E(),s=v("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),Q(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[Y(t,"click",n[17]),Y(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Hc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(s,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(s)),r&&r.d(a),l=!1,$e(o)}}}function gT(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[mT],header:[hT],default:[pT]},$$scope:{ctx:n}};for(let l=0;lJ.name==B);X?j.removeByValue(G.columns,X):j.pushUnique(G.columns,{name:B}),t(2,d=j.buildIndex(G))}Kt(async()=>{t(8,m=!0);try{t(7,g=(await ut(()=>import("./CodeEditor-19c882f6.js"),["./CodeEditor-19c882f6.js","./index-808c8630.js"],import.meta.url)).default)}catch(B){console.warn(B)}t(8,m=!1)});const O=()=>C(),M=()=>y(),D=()=>T(),L=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=j.buildIndex(s))};function N(B){d=B,t(2,d)}const P=B=>$(B);function F(B){te[B?"unshift":"push"](()=>{f=B,t(4,f)})}function R(B){Fe.call(this,n,B)}function q(B){Fe.call(this,n,B)}return n.$$set=B=>{e=je(je({},e),xt(B)),t(14,r=tt(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,G,X;n.$$.dirty[0]&1&&t(10,i=(((G=(B=u==null?void 0:u.schema)==null?void 0:B.filter(J=>!J.toDelete))==null?void 0:G.map(J=>J.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((X=s.columns)==null?void 0:X.map(J=>J.name))||[])},[u,y,d,s,f,c,h,g,m,l,i,C,T,$,r,_,O,M,D,L,N,P,F,R,q]}class bT extends be{constructor(e){super(),_e(this,e,_T,gT,ge,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Vc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=j.parseIndex(i[10]);return i[11]=s,i}function zc(n){let e;return{c(){e=v("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bc(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(Uc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&zc();function c(){return n[4](n[10],n[13])}return{c(){var h,g;e=v("button"),f&&f.c(),t=E(),i=v("span"),l=U(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((g=(h=n[2].indexes)==null?void 0:h[n[13]])!=null&&g.message?"label-danger":"")+" svelte-167lbwu")},m(h,g){var m,_;w(h,e,g),f&&f.m(e,null),b(e,t),b(e,i),b(i,l),a||(u=[Te(r=Be.call(null,e,((_=(m=n[2].indexes)==null?void 0:m[n[13]])==null?void 0:_.message)||"")),Y(e,"click",c)],a=!0)},p(h,g){var m,_,y,S,C;n=h,n[11].unique?f||(f=zc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),g&1&&s!==(s=((m=n[11].columns)==null?void 0:m.map(Uc).join(", "))+"")&&le(l,s),g&4&&o!==(o="label link-primary "+((y=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Et(r.update)&&g&4&&r.update.call(null,((C=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:C.message)||"")},d(h){h&&k(e),f&&f.d(),a=!1,$e(u)}}}function vT(n){var T,$,O;let e,t,i=((($=(T=n[0])==null?void 0:T.indexes)==null?void 0:$.length)||0)+"",s,l,o,r,a,u,f,c,d,h,g,m,_=pe(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let M=0;M<_.length;M+=1)y[M]=Bc(Vc(n,_,M));function S(M){n[7](M)}let C={};return n[0]!==void 0&&(C.collection=n[0]),c=new bT({props:C}),n[6](c),te.push(()=>he(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=v("div"),t=U("Unique constraints and indexes ("),s=U(i),l=U(")"),o=E(),r=v("div");for(let M=0;M+ New index',f=E(),z(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(M,D){w(M,e,D),b(e,t),b(e,s),b(e,l),w(M,o,D),w(M,r,D);for(let L=0;Ld=!1)),c.$set(L)},i(M){h||(A(c.$$.fragment,M),h=!0)},o(M){I(c.$$.fragment,M),h=!1},d(M){M&&(k(e),k(o),k(r),k(f)),bt(y,M),n[6](null),V(c,M),g=!1,m()}}}const Uc=n=>n.name;function yT(n,e,t){let i;Ge(n,Mi,h=>t(2,i=h));let{collection:s}=e,l;function o(h,g){for(let m=0;ml==null?void 0:l.show(h,g),a=()=>l==null?void 0:l.show();function u(h){te[h?"unshift":"push"](()=>{l=h,t(1,l)})}function f(h){s=h,t(0,s)}const c=h=>{for(let g=0;g{o(h.detail.old,h.detail.new)};return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},[s,l,i,o,r,a,u,f,c,d]}class kT extends be{constructor(e){super(),_e(this,e,yT,vT,ge,{collection:0})}}function Wc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Yc(n){let e,t,i,s,l,o,r;function a(){return n[4](n[6])}function u(...f){return n[5](n[6],...f)}return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent=`${n[6].label}`,l=E(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),o||(r=[Y(e,"click",Sn(a)),Y(e,"keydown",Sn(u))],o=!0)},p(f,c){n=f},d(f){f&&k(e),o=!1,$e(r)}}}function wT(n){let e,t=pe(n[2]),i=[];for(let s=0;s{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class CT extends be{constructor(e){super(),_e(this,e,TT,ST,ge,{class:0})}}const $T=n=>({interactive:n&64,hasErrors:n&32}),Kc=n=>({interactive:n[6],hasErrors:n[5]}),MT=n=>({interactive:n&64,hasErrors:n&32}),Jc=n=>({interactive:n[6],hasErrors:n[5]}),OT=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]});function Zc(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xc(n){let e,t,i;return{c(){e=v("div"),t=v("span"),i=U(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(s,l){w(s,e,l),b(e,t),b(t,i)},p(s,l){l&16&&le(i,s[4])},d(s){s&&k(e)}}}function ET(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[0].required&&Xc(n);return{c(){h&&h.c(),e=E(),t=v("div"),i=v("i"),l=E(),o=v("input"),p(i,"class",s=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),Q(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,p(o,"placeholder","Field name"),o.value=f=n[0].name},m(g,m){h&&h.m(g,m),w(g,e,m),w(g,t,m),b(t,i),w(g,l,m),w(g,o,m),n[14](o),n[0].id||o.focus(),c||(d=Y(o,"input",n[15]),c=!0)},p(g,m){g[0].required?h?h.p(g,m):(h=Xc(g),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null),m&1&&s!==(s=j.getFieldTypeIcon(g[0].type))&&p(i,"class",s),m&64&&Q(t,"txt-disabled",!g[6]),m&64&&r!==(r=!g[6])&&(o.disabled=r),m&1&&a!==(a=g[0].id&&g[0].system)&&(o.readOnly=a),m&1&&u!==(u=!g[0].id)&&(o.autofocus=u),m&1&&f!==(f=g[0].name)&&o.value!==f&&(o.value=f)},d(g){g&&(k(e),k(t),k(l),k(o)),h&&h.d(g),n[14](null),c=!1,d()}}}function DT(n){let e;return{c(){e=v("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function AT(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),Q(e,"btn-hint",!n[3]&&!n[5]),Q(e,"btn-danger",n[5])},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[11]),s=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&40&&Q(e,"btn-hint",!o[3]&&!o[5]),r&40&&Q(e,"btn-danger",o[5])},d(o){o&&k(e),s=!1,l()}}}function IT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(s,l){w(s,e,l),t||(i=[Te(Be.call(null,e,"Restore")),Y(e,"click",n[9])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function Qc(n){let e,t,i,s,l,o,r,a,u,f,c;const d=n[13].options,h=Ct(d,n,n[18],Jc);l=new me({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[LT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[PT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}});const g=n[13].optionsFooter,m=Ct(g,n,n[18],Kc);let _=!n[0].toDelete&&xc(n);return{c(){e=v("div"),t=v("div"),h&&h.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),z(r.$$.fragment),a=E(),m&&m.c(),u=E(),_&&_.c(),p(t,"class","hidden-empty m-b-sm"),p(s,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),b(e,t),h&&h.m(t,null),b(e,i),b(e,s),H(l,s,null),b(s,o),H(r,s,null),b(s,a),m&&m.m(s,null),b(s,u),_&&_.m(s,null),c=!0},p(y,S){h&&h.p&&(!c||S&262240)&&Mt(h,d,y,y[18],c?$t(d,y[18],S,MT):Ot(y[18]),Jc);const C={};S&17039377&&(C.$$scope={dirty:S,ctx:y}),l.$set(C);const T={};S&17039361&&(T.$$scope={dirty:S,ctx:y}),r.$set(T),m&&m.p&&(!c||S&262240)&&Mt(m,g,y,y[18],c?$t(g,y[18],S,$T):Ot(y[18]),Kc),y[0].toDelete?_&&(re(),I(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&1&&A(_,1)):(_=xc(y),_.c(),A(_,1),_.m(s,null))},i(y){c||(A(h,y),A(l.$$.fragment,y),A(r.$$.fragment,y),A(m,y),A(_),y&&xe(()=>{c&&(f||(f=He(e,lt,{duration:150},!0)),f.run(1))}),c=!0)},o(y){I(h,y),I(l.$$.fragment,y),I(r.$$.fragment,y),I(m,y),I(_),y&&(f||(f=He(e,lt,{duration:150},!1)),f.run(0)),c=!1},d(y){y&&k(e),h&&h.d(y),V(l),V(r),m&&m.d(y),_&&_.d(),y&&f&&f.end()}}}function LT(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),o=U(n[4]),r=E(),a=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[24])},m(h,g){w(h,e,g),e.checked=n[0].required,w(h,i,g),w(h,s,g),b(s,l),b(l,o),b(s,r),b(s,a),c||(d=[Y(e,"change",n[16]),Te(u=Be.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(h,g){g&16777216&&t!==(t=h[24])&&p(e,"id",t),g&1&&(e.checked=h[0].required),g&16&&le(o,h[4]),u&&Et(u.update)&&g&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(h[0])}.`}),g&16777216&&f!==(f=h[24])&&p(s,"for",f)},d(h){h&&(k(e),k(i),k(s)),c=!1,$e(d)}}}function PT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Presentable",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[24])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[17]),Te(Be.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],u=!0)},p(c,d){d&16777216&&t!==(t=c[24])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&16777216&&a!==(a=c[24])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function xc(n){let e,t,i,s,l,o,r,a,u;return a=new Pn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[NT]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=E(),s=v("div"),l=v("button"),o=v("i"),r=E(),z(a.$$.fragment),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(s,l),b(l,o),b(l,r),H(a,l,null),u=!0},p(f,c){const d={};c&262144&&(d.$$scope={dirty:c,ctx:f}),a.$set(d)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){I(a.$$.fragment,f),u=!1},d(f){f&&k(e),V(a)}}}function NT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function FT(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Zc();s=new me({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[ET]},$$scope:{ctx:n}}});const c=n[13].default,d=Ct(c,n,n[18],Gc),h=d||DT();function g(S,C){if(S[0].toDelete)return IT;if(S[6])return AT}let m=g(n),_=m&&m(n),y=n[6]&&n[3]&&Qc(n);return{c(){e=v("div"),t=v("div"),f&&f.c(),i=E(),z(s.$$.fragment),l=E(),h&&h.c(),o=E(),_&&_.c(),r=E(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[6]&&n[3]),Q(e,"deleted",n[0].toDelete)},m(S,C){w(S,e,C),b(e,t),f&&f.m(t,null),b(t,i),H(s,t,null),b(t,l),h&&h.m(t,null),b(t,o),_&&_.m(t,null),b(e,r),y&&y.m(e,null),u=!0},p(S,[C]){S[6]?f||(f=Zc(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};C&64&&(T.class="form-field required m-0 "+(S[6]?"":"disabled")),C&2&&(T.name="schema."+S[1]+".name"),C&262229&&(T.$$scope={dirty:C,ctx:S}),s.$set(T),d&&d.p&&(!u||C&262240)&&Mt(d,c,S,S[18],u?$t(c,S[18],C,OT):Ot(S[18]),Gc),m===(m=g(S))&&_?_.p(S,C):(_&&_.d(1),_=m&&m(S),_&&(_.c(),_.m(t,null))),S[6]&&S[3]?y?(y.p(S,C),C&72&&A(y,1)):(y=Qc(S),y.c(),A(y,1),y.m(e,null)):y&&(re(),I(y,1,1,()=>{y=null}),ae()),(!u||C&1)&&Q(e,"required",S[0].required),(!u||C&72)&&Q(e,"expanded",S[6]&&S[3]),(!u||C&1)&&Q(e,"deleted",S[0].toDelete)},i(S){u||(A(s.$$.fragment,S),A(h,S),A(y),S&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){I(s.$$.fragment,S),I(h,S),I(y),S&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),V(s),h&&h.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Dr=[];function RT(n,e,t){let i,s,l,o;Ge(n,Mi,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+j.randomString(8),f=dt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:h=j.initSchemaField()}=e,g,m=!1;function _(){h.id?t(0,h.toDelete=!0,h):f("remove")}function y(){t(0,h.toDelete=!1,h),ln({})}function S(P){return j.slugify(P)}function C(){t(3,m=!0),O()}function T(){t(3,m=!1)}function $(){m?T():C()}function O(){for(let P of Dr)P.id!=u&&P.collapse()}Kt(()=>(Dr.push({id:u,collapse:T}),h.onMountSelect&&(t(0,h.onMountSelect=!1,h),g==null||g.select()),()=>{j.removeByKey(Dr,"id",u)}));function M(P){te[P?"unshift":"push"](()=>{g=P,t(2,g)})}const D=P=>{const F=h.name;t(0,h.name=S(P.target.value),h),P.target.value=h.name,f("rename",{oldName:F,newName:h.name})};function L(){h.required=this.checked,t(0,h)}function N(){h.presentable=this.checked,t(0,h)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,h=P.field),"$$scope"in P&&t(18,a=P.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&h.toDelete&&h.originalName&&h.name!==h.originalName&&t(0,h.name=h.originalName,h),n.$$.dirty&1&&!h.originalName&&h.name&&t(0,h.originalName=h.name,h),n.$$.dirty&1&&typeof h.toDelete>"u"&&t(0,h.toDelete=!1,h),n.$$.dirty&1&&h.required&&t(0,h.nullable=!1,h),n.$$.dirty&1&&t(6,i=!h.toDelete&&!(h.id&&h.system)),n.$$.dirty&4098&&t(5,s=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,l=c[h==null?void 0:h.type]||"Nonempty")},[h,d,g,m,l,s,i,f,_,y,S,$,o,r,M,D,L,N,a]}class gi extends be{constructor(e){super(),_e(this,e,RT,FT,ge,{key:1,field:0})}}function qT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].options.min),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&vt(l.value)!==u[0].options.min&&ce(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function jT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ce(l,n[0].options.max),a||(u=Y(l,"input",n[4]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(l,"min",r),c&1&&vt(l.value)!==f[0].options.max&&ce(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function HT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Regex pattern"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","text"),p(l,"id",o=n[9]),p(l,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].options.pattern),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0].options.pattern&&ce(l,u[0].options.pattern)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function VT(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[qT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[jT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[HT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),p(t,"class","col-sm-3"),p(l,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),f=!0},p(c,d){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&1537&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const m={};d&2&&(m.name="schema."+c[1]+".options.pattern"),d&1537&&(m.$$scope={dirty:d,ctx:c}),u.$set(m)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(o.$$.fragment,c),I(u.$$.fragment,c),f=!1},d(c){c&&k(e),V(i),V(o),V(u)}}}function zT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[VT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function BT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=vt(this.value),t(0,l)}function a(){l.options.max=vt(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(h){l=h,t(0,l)}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(2,s=tt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d]}class UT extends be{constructor(e){super(),_e(this,e,BT,zT,ge,{field:0,key:1})}}function WT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].options.min),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&vt(l.value)!==u[0].options.min&&ce(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function YT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"min",r=n[0].options.min)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ce(l,n[0].options.max),a||(u=Y(l,"input",n[5]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min)&&p(l,"min",r),c&1&&vt(l.value)!==f[0].options.max&&ce(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function KT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[WT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[YT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function JT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="No decimals",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[3]),Te(Be.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&512&&a!==(a=c[9])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function GT(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[JT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.noDecimal"),s&1537&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ZT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{optionsFooter:[GT],options:[KT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function XT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.noDecimal=this.checked,t(0,l)}function a(){l.options.min=vt(this.value),t(0,l)}function u(){l.options.max=vt(this.value),t(0,l)}function f(h){l=h,t(0,l)}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(2,s=tt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d]}class QT extends be{constructor(e){super(),_e(this,e,XT,ZT,ge,{field:0,key:1})}}function xT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function eC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=je(je({},e),xt(f)),t(2,s=tt(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class tC extends be{constructor(e){super(),_e(this,e,eC,xT,ge,{field:0,key:1})}}function nC(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),xt(c)),t(5,l=tt(e,s)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,u,i,l,f]}class qs extends be{constructor(e){super(),_e(this,e,iC,nC,ge,{value:0,separator:1,readonly:2,disabled:3})}}function sC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[3](_)}let m={id:n[8],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(m.value=n[0].options.exceptDomains),r=new qs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(Be.call(null,s,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]),y&1&&(S.disabled=!j.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptDomains,ve(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function lC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[4](_)}let m={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(m.value=n[0].options.onlyDomains),r=new qs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(Be.call(null,s,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyDomains,ve(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function oC(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[sC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[lC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function rC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[oC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function aC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(2,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class R1 extends be{constructor(e){super(),_e(this,e,aC,rC,ge,{field:0,key:1})}}function uC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function fC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=je(je({},e),xt(f)),t(2,s=tt(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class cC extends be{constructor(e){super(),_e(this,e,fC,uC,ge,{field:0,key:1})}}function dC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Strip urls domain",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[3]),Te(Be.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&256&&a!==(a=c[8])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function pC(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[dC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.convertUrls"),s&769&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function hC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[4](r)}let o={$$slots:{optionsFooter:[pC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[5]),e.$on("remove",n[6]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function mC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){t(0,l.options={convertUrls:!1},l)}function a(){l.options.convertUrls=this.checked,t(0,l)}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(2,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(l.options)&&r()},[l,o,s,a,u,f,c]}class gC extends be{constructor(e){super(),_e(this,e,mC,hC,ge,{field:0,key:1})}}var Ar=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Ts={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},yl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},vn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Vn=function(n){return n===!0?1:0};function ed(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Ir=function(n){return n instanceof Array?n:[n]};function gn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function mt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function no(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function q1(n,e){if(e(n))return n;if(n.parentNode)return q1(n.parentNode,e)}function io(n,e){var t=mt("div","numInputWrapper"),i=mt("input","numInput "+n),s=mt("span","arrowUp"),l=mt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function Mn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Lr=function(){},Fo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},_C={D:Lr,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Vn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Lr,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Lr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},ns={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},fl={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[fl.w(n,e,t)]},F:function(n,e,t){return Fo(fl.n(n,e,t)-1,!1,e)},G:function(n,e,t){return vn(fl.h(n,e,t))},H:function(n){return vn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Vn(n.getHours()>11)]},M:function(n,e){return Fo(n.getMonth(),!0,e)},S:function(n){return vn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return vn(n.getFullYear(),4)},d:function(n){return vn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return vn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return vn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},j1=function(n){var e=n.config,t=e===void 0?Ts:e,i=n.l10n,s=i===void 0?yl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,h){return fl[c]&&h[d-1]!=="\\"?fl[c](r,f,t):c!=="\\"?c:""}).join("")}},ha=function(n){var e=n.config,t=e===void 0?Ts:e,i=n.l10n,s=i===void 0?yl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||Ts).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,m=[],_=0,y=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ie=Nr(t.config);Z.setHours(ie.hours,ie.minutes,ie.seconds,Z.getMilliseconds()),t.selectedDates=[Z],t.latestSelectedDateObj=Z}K!==void 0&&K.type!=="blur"&&Rn(K);var fe=t._input.value;c(),Dt(),t._input.value!==fe&&t._debouncedChange()}function u(K,Z){return K%12+12*Vn(Z===t.l10n.amPM[1])}function f(K){switch(K%24){case 0:case 12:return 12;default:return K%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var K=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,Z=(parseInt(t.minuteElement.value,10)||0)%60,ie=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(K=u(K,t.amPM.textContent));var fe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&On(t.latestSelectedDateObj,t.config.minDate,!0)===0,Oe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&On(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Pe=Pr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ne=Pr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ae=Pr(K,Z,ie);if(Ae>Ne&&Ae=12)]),t.secondElement!==void 0&&(t.secondElement.value=vn(ie)))}function g(K){var Z=Mn(K),ie=parseInt(Z.value)+(K.delta||0);(ie/1e3>1||K.key==="Enter"&&!/[^\d]/.test(ie.toString()))&&ke(ie)}function m(K,Z,ie,fe){if(Z instanceof Array)return Z.forEach(function(Oe){return m(K,Oe,ie,fe)});if(K instanceof Array)return K.forEach(function(Oe){return m(Oe,Z,ie,fe)});K.addEventListener(Z,ie,fe),t._handlers.push({remove:function(){return K.removeEventListener(Z,ie,fe)}})}function _(){et("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ie){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ie+"]"),function(fe){return m(fe,"click",t[ie])})}),t.isMobile){Qn();return}var K=ed(Ue,50);if(t._debouncedChange=ed(_,kC),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(t.daysContainer,"mouseover",function(ie){t.config.mode==="range"&&we(Mn(ie))}),m(t._input,"keydown",Se),t.calendarContainer!==void 0&&m(t.calendarContainer,"keydown",Se),!t.config.inline&&!t.config.static&&m(window,"resize",K),window.ontouchstart!==void 0?m(window.document,"touchstart",We):m(window.document,"mousedown",We),m(window.document,"focus",We,{capture:!0}),t.config.clickOpens===!0&&(m(t._input,"focus",t.open),m(t._input,"click",t.open)),t.daysContainer!==void 0&&(m(t.monthNav,"click",At),m(t.monthNav,["keyup","increment"],g),m(t.daysContainer,"click",_i)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var Z=function(ie){return Mn(ie).select()};m(t.timeContainer,["increment"],a),m(t.timeContainer,"blur",a,{capture:!0}),m(t.timeContainer,"click",C),m([t.hourElement,t.minuteElement],["focus","click"],Z),t.secondElement!==void 0&&m(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&m(t.amPM,"click",function(ie){a(ie)})}t.config.allowInput&&m(t._input,"blur",ct)}function S(K,Z){var ie=K!==void 0?t.parseDate(K):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(K);var Oe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Oe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Pe=mt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Pe,t.element),Pe.appendChild(t.element),t.altInput&&Pe.appendChild(t.altInput),Pe.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(K,Z,ie,fe){var Oe=Me(Z,!0),Pe=mt("span",K,Z.getDate().toString());return Pe.dateObj=Z,Pe.$i=fe,Pe.setAttribute("aria-label",t.formatDate(Z,t.config.ariaDateFormat)),K.indexOf("hidden")===-1&&On(Z,t.now)===0&&(t.todayDateElem=Pe,Pe.classList.add("today"),Pe.setAttribute("aria-current","date")),Oe?(Pe.tabIndex=-1,De(Z)&&(Pe.classList.add("selected"),t.selectedDateElem=Pe,t.config.mode==="range"&&(gn(Pe,"startRange",t.selectedDates[0]&&On(Z,t.selectedDates[0],!0)===0),gn(Pe,"endRange",t.selectedDates[1]&&On(Z,t.selectedDates[1],!0)===0),K==="nextMonthDay"&&Pe.classList.add("inRange")))):Pe.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Xe(Z)&&!De(Z)&&Pe.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&K!=="prevMonthDay"&&fe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(Z)+""),et("onDayCreate",Pe),Pe}function M(K){K.focus(),t.config.mode==="range"&&we(K)}function D(K){for(var Z=K>0?0:t.config.showMonths-1,ie=K>0?t.config.showMonths:-1,fe=Z;fe!=ie;fe+=K)for(var Oe=t.daysContainer.children[fe],Pe=K>0?0:Oe.children.length-1,Ne=K>0?Oe.children.length:-1,Ae=Pe;Ae!=Ne;Ae+=K){var Qe=Oe.children[Ae];if(Qe.className.indexOf("hidden")===-1&&Me(Qe.dateObj))return Qe}}function L(K,Z){for(var ie=K.className.indexOf("Month")===-1?K.dateObj.getMonth():t.currentMonth,fe=Z>0?t.config.showMonths:-1,Oe=Z>0?1:-1,Pe=ie-t.currentMonth;Pe!=fe;Pe+=Oe)for(var Ne=t.daysContainer.children[Pe],Ae=ie-t.currentMonth===Pe?K.$i+Z:Z<0?Ne.children.length-1:0,Qe=Ne.children.length,ze=Ae;ze>=0&&ze0?Qe:-1);ze+=Oe){var Ke=Ne.children[ze];if(Ke.className.indexOf("hidden")===-1&&Me(Ke.dateObj)&&Math.abs(K.$i-ze)>=Math.abs(Z))return M(Ke)}t.changeMonth(Oe),N(D(Oe),0)}function N(K,Z){var ie=l(),fe=Je(ie||document.body),Oe=K!==void 0?K:fe?ie:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:D(Z>0?1:-1);Oe===void 0?t._input.focus():fe?L(Oe,Z):M(Oe)}function P(K,Z){for(var ie=(new Date(K,Z,1).getDay()-t.l10n.firstDayOfWeek+7)%7,fe=t.utils.getDaysInMonth((Z-1+12)%12,K),Oe=t.utils.getDaysInMonth(Z,K),Pe=window.document.createDocumentFragment(),Ne=t.config.showMonths>1,Ae=Ne?"prevMonthDay hidden":"prevMonthDay",Qe=Ne?"nextMonthDay hidden":"nextMonthDay",ze=fe+1-ie,Ke=0;ze<=fe;ze++,Ke++)Pe.appendChild(O("flatpickr-day "+Ae,new Date(K,Z-1,ze),ze,Ke));for(ze=1;ze<=Oe;ze++,Ke++)Pe.appendChild(O("flatpickr-day",new Date(K,Z,ze),ze,Ke));for(var St=Oe+1;St<=42-ie&&(t.config.showMonths===1||Ke%7!==0);St++,Ke++)Pe.appendChild(O("flatpickr-day "+Qe,new Date(K,Z+1,St%Oe),St,Ke));var ri=mt("div","dayContainer");return ri.appendChild(Pe),ri}function F(){if(t.daysContainer!==void 0){no(t.daysContainer),t.weekNumbers&&no(t.weekNumbers);for(var K=document.createDocumentFragment(),Z=0;Z1||t.config.monthSelectorType!=="dropdown")){var K=function(fe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&fet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var Z=0;Z<12;Z++)if(K(Z)){var ie=mt("option","flatpickr-monthDropdown-month");ie.value=new Date(t.currentYear,Z).getMonth().toString(),ie.textContent=Fo(Z,t.config.shorthandCurrentMonth,t.l10n),ie.tabIndex=-1,t.currentMonth===Z&&(ie.selected=!0),t.monthsDropdownContainer.appendChild(ie)}}}function q(){var K=mt("div","flatpickr-month"),Z=window.document.createDocumentFragment(),ie;t.config.showMonths>1||t.config.monthSelectorType==="static"?ie=mt("span","cur-month"):(t.monthsDropdownContainer=mt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),m(t.monthsDropdownContainer,"change",function(Ne){var Ae=Mn(Ne),Qe=parseInt(Ae.value,10);t.changeMonth(Qe-t.currentMonth),et("onMonthChange")}),R(),ie=t.monthsDropdownContainer);var fe=io("cur-year",{tabindex:"-1"}),Oe=fe.getElementsByTagName("input")[0];Oe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Oe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Oe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Oe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Pe=mt("div","flatpickr-current-month");return Pe.appendChild(ie),Pe.appendChild(fe),Z.appendChild(Pe),K.appendChild(Z),{container:K,yearElement:Oe,monthElement:ie}}function B(){no(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var K=t.config.showMonths;K--;){var Z=q();t.yearElements.push(Z.yearElement),t.monthElements.push(Z.monthElement),t.monthNav.appendChild(Z.container)}t.monthNav.appendChild(t.nextMonthNav)}function G(){return t.monthNav=mt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=mt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=mt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(K){t.__hidePrevMonthArrow!==K&&(gn(t.prevMonthNav,"flatpickr-disabled",K),t.__hidePrevMonthArrow=K)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(K){t.__hideNextMonthArrow!==K&&(gn(t.nextMonthNav,"flatpickr-disabled",K),t.__hideNextMonthArrow=K)}}),t.currentYearElement=t.yearElements[0],Jt(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var K=Nr(t.config);t.timeContainer=mt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var Z=mt("span","flatpickr-time-separator",":"),ie=io("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ie.getElementsByTagName("input")[0];var fe=io("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=fe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?K.hours:f(K.hours)),t.minuteElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():K.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ie),t.timeContainer.appendChild(Z),t.timeContainer.appendChild(fe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Oe=io("flatpickr-second");t.secondElement=Oe.getElementsByTagName("input")[0],t.secondElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():K.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(mt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Oe)}return t.config.time_24hr||(t.amPM=mt("span","flatpickr-am-pm",t.l10n.amPM[Vn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function J(){t.weekdayContainer?no(t.weekdayContainer):t.weekdayContainer=mt("div","flatpickr-weekdays");for(var K=t.config.showMonths;K--;){var Z=mt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(Z)}return W(),t.weekdayContainer}function W(){if(t.weekdayContainer){var K=t.l10n.firstDayOfWeek,Z=td(t.l10n.weekdays.shorthand);K>0&&K>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function F4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function R4(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),xs.highlight(a,xs.languages[l]||xs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class L1 extends ve{constructor(e){super(),be(this,e,R4,F4,ge,{class:0,content:2,language:3})}}const q4=n=>({}),Mc=n=>({}),j4=n=>({}),Oc=n=>({});function Ec(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C=n[4]&&!n[2]&&Dc(n);const T=n[19].header,$=Ct(T,n,n[18],Oc);let O=n[4]&&n[2]&&Ac(n);const M=n[19].default,D=Ct(M,n,n[18],null),L=n[19].footer,N=Ct(L,n,n[18],Mc);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),C&&C.c(),r=E(),$&&$.c(),a=E(),O&&O.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),N&&N.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(P,F){w(P,e,F),b(e,t),b(e,s),b(e,l),b(l,o),C&&C.m(o,null),b(o,r),$&&$.m(o,null),b(o,a),O&&O.m(o,null),b(l,u),b(l,f),D&&D.m(f,null),n[21](f),b(l,c),b(l,d),N&&N.m(d,null),_=!0,y||(S=[Y(t,"click",Ze(n[20])),Y(f,"scroll",n[22])],y=!0)},p(P,F){n=P,n[4]&&!n[2]?C?(C.p(n,F),F[0]&20&&A(C,1)):(C=Dc(n),C.c(),A(C,1),C.m(o,r)):C&&(re(),I(C,1,1,()=>{C=null}),ae()),$&&$.p&&(!_||F[0]&262144)&&Mt($,T,n,n[18],_?$t(T,n[18],F,j4):Ot(n[18]),Oc),n[4]&&n[2]?O?O.p(n,F):(O=Ac(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),D&&D.p&&(!_||F[0]&262144)&&Mt(D,M,n,n[18],_?$t(M,n[18],F,null):Ot(n[18]),null),N&&N.p&&(!_||F[0]&262144)&&Mt(N,L,n,n[18],_?$t(L,n[18],F,q4):Ot(n[18]),Mc),(!_||F[0]&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),(!_||F[0]&262)&&Q(l,"popup",n[2]),(!_||F[0]&4)&&Q(e,"padded",n[2]),(!_||F[0]&1)&&Q(e,"active",n[0])},i(P){_||(P&&xe(()=>{_&&(i||(i=He(t,ml,{duration:Ni,opacity:0},!0)),i.run(1))}),A(C),A($,P),A(D,P),A(N,P),P&&xe(()=>{_&&(m&&m.end(1),g=C_(l,mi,n[2]?{duration:Ni,y:-10}:{duration:Ni,x:50}),g.start())}),_=!0)},o(P){P&&(i||(i=He(t,ml,{duration:Ni,opacity:0},!1)),i.run(0)),I(C),I($,P),I(D,P),I(N,P),g&&g.invalidate(),P&&(m=ya(l,mi,n[2]?{duration:Ni,y:10}:{duration:Ni,x:50})),_=!1},d(P){P&&k(e),P&&i&&i.end(),C&&C.d(),$&&$.d(P),O&&O.d(),D&&D.d(P),n[21](null),N&&N.d(P),P&&m&&m.end(),y=!1,$e(S)}}}function Dc(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",Ze(n[5])),s=!0)},p(o,r){n=o},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,ml,{duration:Ni},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,ml,{duration:Ni},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Ac(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function H4(n){let e,t,i,s,l=n[0]&&Ec(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Ec(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){I(l),t=!1},d(o){o&&k(e),l&&l.d(),n[23](null),i=!1,$e(s)}}}let Qi,Dr=[];function P1(){return Qi=Qi||document.querySelector(".overlays"),Qi||(Qi=document.createElement("div"),Qi.classList.add("overlays"),document.body.appendChild(Qi)),Qi}let Ni=150;function Ic(){return 1e3+P1().querySelectorAll(".overlay-panel-container.active").length}function V4(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const h=dt(),g="op_"+j.randomString(10);let m,_,y,S,C="",T=o;function $(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(U){t(17,T=U),U?(y=document.activeElement,h("show"),m==null||m.focus()):(clearTimeout(S),h("hide"),y==null||y.focus()),await sn(),L()}function L(){m&&(o?t(6,m.style.zIndex=Ic(),m):t(6,m.style="",m))}function N(){j.pushUnique(Dr,g),document.body.classList.add("overlay-active")}function P(){j.removeByValue(Dr,g),Dr.length||document.body.classList.remove("overlay-active")}function F(U){o&&f&&U.code=="Escape"&&!j.isInput(U.target)&&m&&m.style.zIndex==Ic()&&(U.preventDefault(),O())}function R(U){o&&q(_)}function q(U,oe){oe&&t(8,C=""),U&&(S||(S=setTimeout(()=>{if(clearTimeout(S),S=null,!U)return;if(U.scrollHeight-U.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}U.scrollTop==0?t(8,C+=" scroll-top-reached"):U.scrollTop+U.offsetHeight==U.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Kt(()=>(P1().appendChild(m),()=>{var U;clearTimeout(S),P(),(U=m==null?void 0:m.classList)==null||U.add("hidden"),setTimeout(()=>{m==null||m.remove()},0)}));const B=()=>a?O():!0;function G(U){te[U?"unshift":"push"](()=>{_=U,t(7,_)})}const X=U=>q(U.target);function J(U){te[U?"unshift":"push"](()=>{m=U,t(6,m)})}return n.$$set=U=>{"class"in U&&t(1,l=U.class),"active"in U&&t(0,o=U.active),"popup"in U&&t(2,r=U.popup),"overlayClose"in U&&t(3,a=U.overlayClose),"btnClose"in U&&t(4,u=U.btnClose),"escClose"in U&&t(12,f=U.escClose),"beforeOpen"in U&&t(13,c=U.beforeOpen),"beforeHide"in U&&t(14,d=U.beforeHide),"$$scope"in U&&t(18,s=U.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&D(o),n.$$.dirty[0]&128&&q(_,!0),n.$$.dirty[0]&64&&m&&L(),n.$$.dirty[0]&1&&(o?N():P())},[o,l,r,a,u,O,m,_,C,F,R,q,f,c,d,$,M,T,s,i,B,G,X,J]}class on extends ve{constructor(e){super(),be(this,e,V4,H4,ge,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function z4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function B4(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=W(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function U4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function W4(n){let e,t,i;return t=new L1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function Y4(n){var Pe;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,g,m=n[2].status+"",_,y,S,C,T,$,O=((Pe=n[2].method)==null?void 0:Pe.toUpperCase())+"",M,D,L,N,P,F,R=n[2].auth+"",q,B,G,X,J,U,oe=n[2].url+"",ee,se,Ee,Re,Ve,We,ke,Me,Je,ct,Se,we=n[2].remoteIp+"",Ue,it,ne,qe,Ce,pt,qt=n[2].userIp+"",fn,nn,rn,Nn,_i,Fn,Ie=n[2].userAgent+"",Tt,oi,cn,Xn,Ai,Cn,Qn,en,et,ue,De,Xe,Jt,nt,At,It;function Rn(Ne,Ae){return Ne[2].referer?B4:z4}let K=Rn(n),Z=K(n);const ie=[W4,U4],fe=[];function Oe(Ne,Ae){return Ae&4&&(Qn=null),Qn==null&&(Qn=!j.isEmpty(Ne[2].meta)),Qn?0:1}return en=Oe(n,-1),et=fe[en]=ie[en](n),At=new $i({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=E(),o=v("td"),a=W(r),u=E(),f=v("tr"),c=v("td"),c.textContent="Status",d=E(),h=v("td"),g=v("span"),_=W(m),y=E(),S=v("tr"),C=v("td"),C.textContent="Method",T=E(),$=v("td"),M=W(O),D=E(),L=v("tr"),N=v("td"),N.textContent="Auth",P=E(),F=v("td"),q=W(R),B=E(),G=v("tr"),X=v("td"),X.textContent="URL",J=E(),U=v("td"),ee=W(oe),se=E(),Ee=v("tr"),Re=v("td"),Re.textContent="Referer",Ve=E(),We=v("td"),Z.c(),ke=E(),Me=v("tr"),Je=v("td"),Je.textContent="Remote IP",ct=E(),Se=v("td"),Ue=W(we),it=E(),ne=v("tr"),qe=v("td"),qe.textContent="User IP",Ce=E(),pt=v("td"),fn=W(qt),nn=E(),rn=v("tr"),Nn=v("td"),Nn.textContent="UserAgent",_i=E(),Fn=v("td"),Tt=W(Ie),oi=E(),cn=v("tr"),Xn=v("td"),Xn.textContent="Meta",Ai=E(),Cn=v("td"),et.c(),ue=E(),De=v("tr"),Xe=v("td"),Xe.textContent="Created",Jt=E(),nt=v("td"),z(At.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(g,"class","label"),Q(g,"label-danger",n[2].status>=400),p(C,"class","min-width txt-hint txt-bold"),p(N,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(Re,"class","min-width txt-hint txt-bold"),p(Je,"class","min-width txt-hint txt-bold"),p(qe,"class","min-width txt-hint txt-bold"),p(Nn,"class","min-width txt-hint txt-bold"),p(Xn,"class","min-width txt-hint txt-bold"),p(Xe,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Ne,Ae){w(Ne,e,Ae),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,a),b(t,u),b(t,f),b(f,c),b(f,d),b(f,h),b(h,g),b(g,_),b(t,y),b(t,S),b(S,C),b(S,T),b(S,$),b($,M),b(t,D),b(t,L),b(L,N),b(L,P),b(L,F),b(F,q),b(t,B),b(t,G),b(G,X),b(G,J),b(G,U),b(U,ee),b(t,se),b(t,Ee),b(Ee,Re),b(Ee,Ve),b(Ee,We),Z.m(We,null),b(t,ke),b(t,Me),b(Me,Je),b(Me,ct),b(Me,Se),b(Se,Ue),b(t,it),b(t,ne),b(ne,qe),b(ne,Ce),b(ne,pt),b(pt,fn),b(t,nn),b(t,rn),b(rn,Nn),b(rn,_i),b(rn,Fn),b(Fn,Tt),b(t,oi),b(t,cn),b(cn,Xn),b(cn,Ai),b(cn,Cn),fe[en].m(Cn,null),b(t,ue),b(t,De),b(De,Xe),b(De,Jt),b(De,nt),H(At,nt,null),It=!0},p(Ne,Ae){var Ke;(!It||Ae&4)&&r!==(r=Ne[2].id+"")&&le(a,r),(!It||Ae&4)&&m!==(m=Ne[2].status+"")&&le(_,m),(!It||Ae&4)&&Q(g,"label-danger",Ne[2].status>=400),(!It||Ae&4)&&O!==(O=((Ke=Ne[2].method)==null?void 0:Ke.toUpperCase())+"")&&le(M,O),(!It||Ae&4)&&R!==(R=Ne[2].auth+"")&&le(q,R),(!It||Ae&4)&&oe!==(oe=Ne[2].url+"")&&le(ee,oe),K===(K=Rn(Ne))&&Z?Z.p(Ne,Ae):(Z.d(1),Z=K(Ne),Z&&(Z.c(),Z.m(We,null))),(!It||Ae&4)&&we!==(we=Ne[2].remoteIp+"")&&le(Ue,we),(!It||Ae&4)&&qt!==(qt=Ne[2].userIp+"")&&le(fn,qt),(!It||Ae&4)&&Ie!==(Ie=Ne[2].userAgent+"")&&le(Tt,Ie);let Qe=en;en=Oe(Ne,Ae),en===Qe?fe[en].p(Ne,Ae):(re(),I(fe[Qe],1,1,()=>{fe[Qe]=null}),ae(),et=fe[en],et?et.p(Ne,Ae):(et=fe[en]=ie[en](Ne),et.c()),A(et,1),et.m(Cn,null));const ze={};Ae&4&&(ze.date=Ne[2].created),At.$set(ze)},i(Ne){It||(A(et),A(At.$$.fragment,Ne),It=!0)},o(Ne){I(et),I(At.$$.fragment,Ne),It=!1},d(Ne){Ne&&k(e),Z.d(),fe[en].d(),V(At)}}}function K4(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function J4(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function G4(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[J4],header:[K4],default:[Y4]},$$scope:{ctx:n}};return e=new on({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[5](null),V(e,s)}}}function Z4(n,e,t){let i,s={};function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){te[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Fe.call(this,n,c)}function f(c){Fe.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class X4 extends ve{constructor(e){super(),be(this,e,Z4,G4,ge,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function Q4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Lc(n){let e,t;return e=new I4({props:{filter:n[4],presets:n[5]}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Pc(n){let e,t;return e=new Xk({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function x4(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S=n[3],C,T=n[3],$,O;r=new Jo({}),r.$on("refresh",n[9]),d=new me({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[Q4,({uniqueId:L})=>({14:L}),({uniqueId:L})=>L?16384:0]},$$scope:{ctx:n}}}),g=new Dl({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),g.$on("submit",n[11]);let M=Lc(n),D=Pc(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=W(n[6]),o=E(),z(r.$$.fragment),a=E(),u=v("div"),f=E(),c=v("div"),z(d.$$.fragment),h=E(),z(g.$$.fragment),m=E(),_=v("div"),y=E(),M.c(),C=E(),D.c(),$=ye(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(_,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(L,N){w(L,e,N),b(e,t),b(t,i),b(i,s),b(s,l),b(t,o),H(r,t,null),b(t,a),b(t,u),b(t,f),b(t,c),H(d,c,null),b(e,h),H(g,e,null),b(e,m),b(e,_),b(e,y),M.m(e,null),w(L,C,N),D.m(L,N),w(L,$,N),O=!0},p(L,N){(!O||N&64)&&le(l,L[6]);const P={};N&49154&&(P.$$scope={dirty:N,ctx:L}),d.$set(P);const F={};N&1&&(F.value=L[0]),g.$set(F),N&8&&ge(S,S=L[3])?(re(),I(M,1,1,x),ae(),M=Lc(L),M.c(),A(M,1),M.m(e,null)):M.p(L,N),N&8&&ge(T,T=L[3])?(re(),I(D,1,1,x),ae(),D=Pc(L),D.c(),A(D,1),D.m($.parentNode,$)):D.p(L,N)},i(L){O||(A(r.$$.fragment,L),A(d.$$.fragment,L),A(g.$$.fragment,L),A(M),A(D),O=!0)},o(L){I(r.$$.fragment,L),I(d.$$.fragment,L),I(g.$$.fragment,L),I(M),I(D),O=!1},d(L){L&&(k(e),k(C),k($)),V(r),V(d),V(g),M.d(L),D.d(L)}}}function eT(n){let e,t,i,s;e=new Tn({props:{$$slots:{default:[x4]},$$scope:{ctx:n}}});let l={};return i=new X4({props:l}),n[13](i),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),s=!1},d(o){o&&k(t),V(e,o),n[13](null),V(i,o)}}}const Nc="includeAdminLogs";function tT(n,e,t){var y;let i,s,l;Ge(n,Nt,S=>t(6,l=S));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];an(Nt,l="Request logs",l);let r,a="",u=((y=window.localStorage)==null?void 0:y.getItem(Nc))<<0,f=1;function c(){t(3,f++,f)}const d=()=>c();function h(){u=this.checked,t(1,u)}const g=S=>t(0,a=S.detail),m=S=>r==null?void 0:r.show(S==null?void 0:S.detail);function _(S){te[S?"unshift":"push"](()=>{r=S,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(Nc,u<<0),n.$$.dirty&1&&t(4,s=j.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,c,d,h,g,m,_]}class nT extends ve{constructor(e){super(),be(this,e,tT,eT,ge,{})}}function iT(n){let e,t,i;return{c(){e=v("span"),p(e,"class","dragline svelte-1g2t3dj"),Q(e,"dragging",n[1])},m(s,l){w(s,e,l),n[4](e),t||(i=[Y(e,"mousedown",n[5]),Y(e,"touchstart",n[2])],t=!0)},p(s,[l]){l&2&&Q(e,"dragging",s[1])},i:x,o:x,d(s){s&&k(e),n[4](null),t=!1,$e(i)}}}function sT(n,e,t){const i=dt();let{tolerance:s=0}=e,l,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-l.offsetLeft,u=_.clientY-l.offsetTop,document.addEventListener("touchmove",h),document.addEventListener("mousemove",h),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),l.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:l})),document.removeEventListener("touchmove",h),document.removeEventListener("mousemove",h),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function h(_){let y=_.clientX-o,S=_.clientY-r,C=_.clientX-a,T=_.clientY-u;!f&&Math.abs(C-l.offsetLeft){l=_,t(0,l)})}const m=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,s=_.tolerance)},[l,f,c,s,g,m]}class lT extends ve{constructor(e){super(),be(this,e,sT,iT,ge,{tolerance:3})}}const su=Ln({});function _n(n,e,t){su.set({text:n,yesCallback:e,noCallback:t})}function N1(){su.set({})}function Fc(n){let e,t,i;const s=n[17].default,l=Ct(s,n,n[16],null);return{c(){e=v("div"),l&&l.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&Mt(l,s,o,o[16],i?$t(s,o[16],r,null):Ot(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&Q(e,"active",o[0])},i(o){i||(A(l,o),o&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=He(e,mi,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function oT(n){let e,t,i,s,l=n[0]&&Fc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[Y(window,"mousedown",n[5]),Y(window,"click",n[6]),Y(window,"keydown",n[4]),Y(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Fc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){I(l),t=!1},d(o){o&&k(e),l&&l.d(),n[19](null),i=!1,$e(s)}}}function rT(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,h,g,m=!1;const _=dt();function y(){t(0,o=!1),m=!1,clearTimeout(g)}function S(){t(0,o=!0),clearTimeout(g),g=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function C(){o?y():S()}function T(B){return!c||B.classList.contains(u)||(h==null?void 0:h.contains(B))&&!c.contains(B)||c.contains(B)&&B.closest&&B.closest("."+u)}function $(B){(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function O(B){(B.code==="Enter"||B.code==="Space")&&(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function M(B){o&&r&&B.code==="Escape"&&(B.preventDefault(),y())}function D(B){o&&!(c!=null&&c.contains(B.target))?m=!0:m&&(m=!1)}function L(B){var G;o&&m&&!(c!=null&&c.contains(B.target))&&!(h!=null&&h.contains(B.target))&&!((G=B.target)!=null&&G.closest(".flatpickr-calendar"))&&y()}function N(B){D(B),L(B)}function P(B){F(),c==null||c.addEventListener("click",$),t(15,h=B||(c==null?void 0:c.parentNode)),h==null||h.addEventListener("click",$),h==null||h.addEventListener("keydown",O)}function F(){clearTimeout(g),c==null||c.removeEventListener("click",$),h==null||h.removeEventListener("click",$),h==null||h.removeEventListener("keydown",O)}Kt(()=>(P(),()=>F()));function R(B){te[B?"unshift":"push"](()=>{d=B,t(3,d)})}function q(B){te[B?"unshift":"push"](()=>{c=B,t(2,c)})}return n.$$set=B=>{"trigger"in B&&t(8,l=B.trigger),"active"in B&&t(0,o=B.active),"escClose"in B&&t(9,r=B.escClose),"autoScroll"in B&&t(10,a=B.autoScroll),"closableClass"in B&&t(11,u=B.closableClass),"class"in B&&t(1,f=B.class),"$$scope"in B&&t(16,s=B.$$scope)},n.$$.update=()=>{var B,G;n.$$.dirty&260&&c&&P(l),n.$$.dirty&32769&&(o?((B=h==null?void 0:h.classList)==null||B.add("active"),_("show")):((G=h==null?void 0:h.classList)==null||G.remove("active"),_("hide")))},[o,f,c,d,M,D,L,N,l,r,a,u,y,S,C,h,s,i,R,q]}class Pn extends ve{constructor(e){super(),be(this,e,rT,oT,ge,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Rc(n,e,t){const i=n.slice();return i[27]=e[t],i}function aT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("input"),s=E(),l=v("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),b(l,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function uT(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=Pt(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}o?(e=Pt(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],_e(()=>t=!1)),e.$set(c)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function fT(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function cT(n){let e,t,i,s;const l=[fT,uT],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function qc(n){let e,t,i,s=pe(n[10]),l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[cT,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&qc(n);return{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),r&&r.c(),l=ye()},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=qc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s),k(l)),V(e,a),V(i,a),r&&r.d(a)}}}function pT(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=v("h4"),i=W(t),s=W(" index")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&le(i,t)},d(l){l&&k(e)}}}function Hc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Te(Be.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function hT(n){let e,t,i,s,l,o,r=n[5]!=""&&Hc(n);return{c(){r&&r.c(),e=E(),t=v("button"),t.innerHTML='Cancel',i=E(),s=v("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),Q(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[Y(t,"click",n[17]),Y(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Hc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(s,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(s)),r&&r.d(a),l=!1,$e(o)}}}function mT(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[hT],header:[pT],default:[dT]},$$scope:{ctx:n}};for(let l=0;lJ.name==B);X?j.removeByValue(G.columns,X):j.pushUnique(G.columns,{name:B}),t(2,d=j.buildIndex(G))}Kt(async()=>{t(8,m=!0);try{t(7,g=(await ut(()=>import("./CodeEditor-4c129c80.js"),["./CodeEditor-4c129c80.js","./index-808c8630.js"],import.meta.url)).default)}catch(B){console.warn(B)}t(8,m=!1)});const O=()=>C(),M=()=>y(),D=()=>T(),L=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=j.buildIndex(s))};function N(B){d=B,t(2,d)}const P=B=>$(B);function F(B){te[B?"unshift":"push"](()=>{f=B,t(4,f)})}function R(B){Fe.call(this,n,B)}function q(B){Fe.call(this,n,B)}return n.$$set=B=>{e=je(je({},e),xt(B)),t(14,r=tt(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,G,X;n.$$.dirty[0]&1&&t(10,i=(((G=(B=u==null?void 0:u.schema)==null?void 0:B.filter(J=>!J.toDelete))==null?void 0:G.map(J=>J.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((X=s.columns)==null?void 0:X.map(J=>J.name))||[])},[u,y,d,s,f,c,h,g,m,l,i,C,T,$,r,_,O,M,D,L,N,P,F,R,q]}class _T extends ve{constructor(e){super(),be(this,e,gT,mT,ge,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Vc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=j.parseIndex(i[10]);return i[11]=s,i}function zc(n){let e;return{c(){e=v("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bc(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(Uc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&zc();function c(){return n[4](n[10],n[13])}return{c(){var h,g;e=v("button"),f&&f.c(),t=E(),i=v("span"),l=W(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((g=(h=n[2].indexes)==null?void 0:h[n[13]])!=null&&g.message?"label-danger":"")+" svelte-167lbwu")},m(h,g){var m,_;w(h,e,g),f&&f.m(e,null),b(e,t),b(e,i),b(i,l),a||(u=[Te(r=Be.call(null,e,((_=(m=n[2].indexes)==null?void 0:m[n[13]])==null?void 0:_.message)||"")),Y(e,"click",c)],a=!0)},p(h,g){var m,_,y,S,C;n=h,n[11].unique?f||(f=zc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),g&1&&s!==(s=((m=n[11].columns)==null?void 0:m.map(Uc).join(", "))+"")&&le(l,s),g&4&&o!==(o="label link-primary "+((y=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Et(r.update)&&g&4&&r.update.call(null,((C=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:C.message)||"")},d(h){h&&k(e),f&&f.d(),a=!1,$e(u)}}}function bT(n){var T,$,O;let e,t,i=((($=(T=n[0])==null?void 0:T.indexes)==null?void 0:$.length)||0)+"",s,l,o,r,a,u,f,c,d,h,g,m,_=pe(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let M=0;M<_.length;M+=1)y[M]=Bc(Vc(n,_,M));function S(M){n[7](M)}let C={};return n[0]!==void 0&&(C.collection=n[0]),c=new _T({props:C}),n[6](c),te.push(()=>he(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=v("div"),t=W("Unique constraints and indexes ("),s=W(i),l=W(")"),o=E(),r=v("div");for(let M=0;M+ New index',f=E(),z(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(M,D){w(M,e,D),b(e,t),b(e,s),b(e,l),w(M,o,D),w(M,r,D);for(let L=0;Ld=!1)),c.$set(L)},i(M){h||(A(c.$$.fragment,M),h=!0)},o(M){I(c.$$.fragment,M),h=!1},d(M){M&&(k(e),k(o),k(r),k(f)),vt(y,M),n[6](null),V(c,M),g=!1,m()}}}const Uc=n=>n.name;function vT(n,e,t){let i;Ge(n,Mi,h=>t(2,i=h));let{collection:s}=e,l;function o(h,g){for(let m=0;ml==null?void 0:l.show(h,g),a=()=>l==null?void 0:l.show();function u(h){te[h?"unshift":"push"](()=>{l=h,t(1,l)})}function f(h){s=h,t(0,s)}const c=h=>{for(let g=0;g{o(h.detail.old,h.detail.new)};return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},[s,l,i,o,r,a,u,f,c,d]}class yT extends ve{constructor(e){super(),be(this,e,vT,bT,ge,{collection:0})}}function Wc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Yc(n){let e,t,i,s,l,o,r;function a(){return n[4](n[6])}function u(...f){return n[5](n[6],...f)}return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent=`${n[6].label}`,l=E(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),o||(r=[Y(e,"click",Sn(a)),Y(e,"keydown",Sn(u))],o=!0)},p(f,c){n=f},d(f){f&&k(e),o=!1,$e(r)}}}function kT(n){let e,t=pe(n[2]),i=[];for(let s=0;s{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class TT extends ve{constructor(e){super(),be(this,e,ST,wT,ge,{class:0})}}const CT=n=>({interactive:n&64,hasErrors:n&32}),Kc=n=>({interactive:n[6],hasErrors:n[5]}),$T=n=>({interactive:n&64,hasErrors:n&32}),Jc=n=>({interactive:n[6],hasErrors:n[5]}),MT=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]});function Zc(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xc(n){let e,t,i;return{c(){e=v("div"),t=v("span"),i=W(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(s,l){w(s,e,l),b(e,t),b(t,i)},p(s,l){l&16&&le(i,s[4])},d(s){s&&k(e)}}}function OT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[0].required&&Xc(n);return{c(){h&&h.c(),e=E(),t=v("div"),i=v("i"),l=E(),o=v("input"),p(i,"class",s=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),Q(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,p(o,"placeholder","Field name"),o.value=f=n[0].name},m(g,m){h&&h.m(g,m),w(g,e,m),w(g,t,m),b(t,i),w(g,l,m),w(g,o,m),n[14](o),n[0].id||o.focus(),c||(d=Y(o,"input",n[15]),c=!0)},p(g,m){g[0].required?h?h.p(g,m):(h=Xc(g),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null),m&1&&s!==(s=j.getFieldTypeIcon(g[0].type))&&p(i,"class",s),m&64&&Q(t,"txt-disabled",!g[6]),m&64&&r!==(r=!g[6])&&(o.disabled=r),m&1&&a!==(a=g[0].id&&g[0].system)&&(o.readOnly=a),m&1&&u!==(u=!g[0].id)&&(o.autofocus=u),m&1&&f!==(f=g[0].name)&&o.value!==f&&(o.value=f)},d(g){g&&(k(e),k(t),k(l),k(o)),h&&h.d(g),n[14](null),c=!1,d()}}}function ET(n){let e;return{c(){e=v("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function DT(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),Q(e,"btn-hint",!n[3]&&!n[5]),Q(e,"btn-danger",n[5])},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[11]),s=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&40&&Q(e,"btn-hint",!o[3]&&!o[5]),r&40&&Q(e,"btn-danger",o[5])},d(o){o&&k(e),s=!1,l()}}}function AT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(s,l){w(s,e,l),t||(i=[Te(Be.call(null,e,"Restore")),Y(e,"click",n[9])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function Qc(n){let e,t,i,s,l,o,r,a,u,f,c;const d=n[13].options,h=Ct(d,n,n[18],Jc);l=new me({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[IT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[LT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}});const g=n[13].optionsFooter,m=Ct(g,n,n[18],Kc);let _=!n[0].toDelete&&xc(n);return{c(){e=v("div"),t=v("div"),h&&h.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),z(r.$$.fragment),a=E(),m&&m.c(),u=E(),_&&_.c(),p(t,"class","hidden-empty m-b-sm"),p(s,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),b(e,t),h&&h.m(t,null),b(e,i),b(e,s),H(l,s,null),b(s,o),H(r,s,null),b(s,a),m&&m.m(s,null),b(s,u),_&&_.m(s,null),c=!0},p(y,S){h&&h.p&&(!c||S&262240)&&Mt(h,d,y,y[18],c?$t(d,y[18],S,$T):Ot(y[18]),Jc);const C={};S&17039377&&(C.$$scope={dirty:S,ctx:y}),l.$set(C);const T={};S&17039361&&(T.$$scope={dirty:S,ctx:y}),r.$set(T),m&&m.p&&(!c||S&262240)&&Mt(m,g,y,y[18],c?$t(g,y[18],S,CT):Ot(y[18]),Kc),y[0].toDelete?_&&(re(),I(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&1&&A(_,1)):(_=xc(y),_.c(),A(_,1),_.m(s,null))},i(y){c||(A(h,y),A(l.$$.fragment,y),A(r.$$.fragment,y),A(m,y),A(_),y&&xe(()=>{c&&(f||(f=He(e,lt,{duration:150},!0)),f.run(1))}),c=!0)},o(y){I(h,y),I(l.$$.fragment,y),I(r.$$.fragment,y),I(m,y),I(_),y&&(f||(f=He(e,lt,{duration:150},!1)),f.run(0)),c=!1},d(y){y&&k(e),h&&h.d(y),V(l),V(r),m&&m.d(y),_&&_.d(),y&&f&&f.end()}}}function IT(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),o=W(n[4]),r=E(),a=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[24])},m(h,g){w(h,e,g),e.checked=n[0].required,w(h,i,g),w(h,s,g),b(s,l),b(l,o),b(s,r),b(s,a),c||(d=[Y(e,"change",n[16]),Te(u=Be.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(h,g){g&16777216&&t!==(t=h[24])&&p(e,"id",t),g&1&&(e.checked=h[0].required),g&16&&le(o,h[4]),u&&Et(u.update)&&g&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(h[0])}.`}),g&16777216&&f!==(f=h[24])&&p(s,"for",f)},d(h){h&&(k(e),k(i),k(s)),c=!1,$e(d)}}}function LT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Presentable",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[24])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[17]),Te(Be.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],u=!0)},p(c,d){d&16777216&&t!==(t=c[24])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&16777216&&a!==(a=c[24])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function xc(n){let e,t,i,s,l,o,r,a,u;return a=new Pn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[PT]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=E(),s=v("div"),l=v("button"),o=v("i"),r=E(),z(a.$$.fragment),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(s,l),b(l,o),b(l,r),H(a,l,null),u=!0},p(f,c){const d={};c&262144&&(d.$$scope={dirty:c,ctx:f}),a.$set(d)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){I(a.$$.fragment,f),u=!1},d(f){f&&k(e),V(a)}}}function PT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function NT(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Zc();s=new me({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[OT]},$$scope:{ctx:n}}});const c=n[13].default,d=Ct(c,n,n[18],Gc),h=d||ET();function g(S,C){if(S[0].toDelete)return AT;if(S[6])return DT}let m=g(n),_=m&&m(n),y=n[6]&&n[3]&&Qc(n);return{c(){e=v("div"),t=v("div"),f&&f.c(),i=E(),z(s.$$.fragment),l=E(),h&&h.c(),o=E(),_&&_.c(),r=E(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[6]&&n[3]),Q(e,"deleted",n[0].toDelete)},m(S,C){w(S,e,C),b(e,t),f&&f.m(t,null),b(t,i),H(s,t,null),b(t,l),h&&h.m(t,null),b(t,o),_&&_.m(t,null),b(e,r),y&&y.m(e,null),u=!0},p(S,[C]){S[6]?f||(f=Zc(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};C&64&&(T.class="form-field required m-0 "+(S[6]?"":"disabled")),C&2&&(T.name="schema."+S[1]+".name"),C&262229&&(T.$$scope={dirty:C,ctx:S}),s.$set(T),d&&d.p&&(!u||C&262240)&&Mt(d,c,S,S[18],u?$t(c,S[18],C,MT):Ot(S[18]),Gc),m===(m=g(S))&&_?_.p(S,C):(_&&_.d(1),_=m&&m(S),_&&(_.c(),_.m(t,null))),S[6]&&S[3]?y?(y.p(S,C),C&72&&A(y,1)):(y=Qc(S),y.c(),A(y,1),y.m(e,null)):y&&(re(),I(y,1,1,()=>{y=null}),ae()),(!u||C&1)&&Q(e,"required",S[0].required),(!u||C&72)&&Q(e,"expanded",S[6]&&S[3]),(!u||C&1)&&Q(e,"deleted",S[0].toDelete)},i(S){u||(A(s.$$.fragment,S),A(h,S),A(y),S&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){I(s.$$.fragment,S),I(h,S),I(y),S&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),V(s),h&&h.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Ar=[];function FT(n,e,t){let i,s,l,o;Ge(n,Mi,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+j.randomString(8),f=dt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:h=j.initSchemaField()}=e,g,m=!1;function _(){h.id?t(0,h.toDelete=!0,h):f("remove")}function y(){t(0,h.toDelete=!1,h),ln({})}function S(P){return j.slugify(P)}function C(){t(3,m=!0),O()}function T(){t(3,m=!1)}function $(){m?T():C()}function O(){for(let P of Ar)P.id!=u&&P.collapse()}Kt(()=>(Ar.push({id:u,collapse:T}),h.onMountSelect&&(t(0,h.onMountSelect=!1,h),g==null||g.select()),()=>{j.removeByKey(Ar,"id",u)}));function M(P){te[P?"unshift":"push"](()=>{g=P,t(2,g)})}const D=P=>{const F=h.name;t(0,h.name=S(P.target.value),h),P.target.value=h.name,f("rename",{oldName:F,newName:h.name})};function L(){h.required=this.checked,t(0,h)}function N(){h.presentable=this.checked,t(0,h)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,h=P.field),"$$scope"in P&&t(18,a=P.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&h.toDelete&&h.originalName&&h.name!==h.originalName&&t(0,h.name=h.originalName,h),n.$$.dirty&1&&!h.originalName&&h.name&&t(0,h.originalName=h.name,h),n.$$.dirty&1&&typeof h.toDelete>"u"&&t(0,h.toDelete=!1,h),n.$$.dirty&1&&h.required&&t(0,h.nullable=!1,h),n.$$.dirty&1&&t(6,i=!h.toDelete&&!(h.id&&h.system)),n.$$.dirty&4098&&t(5,s=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,l=c[h==null?void 0:h.type]||"Nonempty")},[h,d,g,m,l,s,i,f,_,y,S,$,o,r,M,D,L,N,a]}class gi extends ve{constructor(e){super(),be(this,e,FT,NT,ge,{key:1,field:0})}}function RT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Min length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.min),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.min&&de(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function qT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=W("Max length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),de(l,n[0].options.max),a||(u=Y(l,"input",n[4]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(l,"min",r),c&1&&yt(l.value)!==f[0].options.max&&de(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function jT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Regex pattern"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","text"),p(l,"id",o=n[9]),p(l,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.pattern),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0].options.pattern&&de(l,u[0].options.pattern)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function HT(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[RT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[qT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[jT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),p(t,"class","col-sm-3"),p(l,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),f=!0},p(c,d){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&1537&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const m={};d&2&&(m.name="schema."+c[1]+".options.pattern"),d&1537&&(m.$$scope={dirty:d,ctx:c}),u.$set(m)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(o.$$.fragment,c),I(u.$$.fragment,c),f=!1},d(c){c&&k(e),V(i),V(o),V(u)}}}function VT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[HT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function zT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=yt(this.value),t(0,l)}function a(){l.options.max=yt(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(h){l=h,t(0,l)}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(2,s=tt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d]}class BT extends ve{constructor(e){super(),be(this,e,zT,VT,ge,{field:0,key:1})}}function UT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Min"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.min),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.min&&de(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function WT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=W("Max"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"min",r=n[0].options.min)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),de(l,n[0].options.max),a||(u=Y(l,"input",n[5]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min)&&p(l,"min",r),c&1&&yt(l.value)!==f[0].options.max&&de(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function YT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[UT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[WT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function KT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="No decimals",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[3]),Te(Be.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&512&&a!==(a=c[9])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function JT(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[KT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.noDecimal"),s&1537&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function GT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{optionsFooter:[JT],options:[YT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function ZT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.noDecimal=this.checked,t(0,l)}function a(){l.options.min=yt(this.value),t(0,l)}function u(){l.options.max=yt(this.value),t(0,l)}function f(h){l=h,t(0,l)}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(2,s=tt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d]}class XT extends ve{constructor(e){super(),be(this,e,ZT,GT,ge,{field:0,key:1})}}function QT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function xT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=je(je({},e),xt(f)),t(2,s=tt(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class eC extends ve{constructor(e){super(),be(this,e,xT,QT,ge,{field:0,key:1})}}function tC(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),xt(c)),t(5,l=tt(e,s)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,u,i,l,f]}class js extends ve{constructor(e){super(),be(this,e,nC,tC,ge,{value:0,separator:1,readonly:2,disabled:3})}}function iC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[3](_)}let m={id:n[8],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(m.value=n[0].options.exceptDomains),r=new js({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(Be.call(null,s,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]),y&1&&(S.disabled=!j.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptDomains,_e(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function sC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[4](_)}let m={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(m.value=n[0].options.onlyDomains),r=new js({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(Be.call(null,s,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyDomains,_e(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function lC(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[iC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[sC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function oC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[lC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function rC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(2,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class F1 extends ve{constructor(e){super(),be(this,e,rC,oC,ge,{field:0,key:1})}}function aC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function uC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=je(je({},e),xt(f)),t(2,s=tt(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class fC extends ve{constructor(e){super(),be(this,e,uC,aC,ge,{field:0,key:1})}}function cC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Strip urls domain",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[3]),Te(Be.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&256&&a!==(a=c[8])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function dC(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[cC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.convertUrls"),s&769&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function pC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[4](r)}let o={$$slots:{optionsFooter:[dC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[5]),e.$on("remove",n[6]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function hC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){t(0,l.options={convertUrls:!1},l)}function a(){l.options.convertUrls=this.checked,t(0,l)}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(2,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(l.options)&&r()},[l,o,s,a,u,f,c]}class mC extends ve{constructor(e){super(),be(this,e,hC,pC,ge,{field:0,key:1})}}var Ir=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Cs={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},kl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},vn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Vn=function(n){return n===!0?1:0};function ed(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Lr=function(n){return n instanceof Array?n:[n]};function gn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function mt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function io(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function R1(n,e){if(e(n))return n;if(n.parentNode)return R1(n.parentNode,e)}function so(n,e){var t=mt("div","numInputWrapper"),i=mt("input","numInput "+n),s=mt("span","arrowUp"),l=mt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function Mn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Pr=function(){},Ro=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},gC={D:Pr,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Vn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Pr,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Pr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},ns={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},cl={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[cl.w(n,e,t)]},F:function(n,e,t){return Ro(cl.n(n,e,t)-1,!1,e)},G:function(n,e,t){return vn(cl.h(n,e,t))},H:function(n){return vn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Vn(n.getHours()>11)]},M:function(n,e){return Ro(n.getMonth(),!0,e)},S:function(n){return vn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return vn(n.getFullYear(),4)},d:function(n){return vn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return vn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return vn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},q1=function(n){var e=n.config,t=e===void 0?Cs:e,i=n.l10n,s=i===void 0?kl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,h){return cl[c]&&h[d-1]!=="\\"?cl[c](r,f,t):c!=="\\"?c:""}).join("")}},ha=function(n){var e=n.config,t=e===void 0?Cs:e,i=n.l10n,s=i===void 0?kl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||Cs).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,m=[],_=0,y=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ie=Fr(t.config);Z.setHours(ie.hours,ie.minutes,ie.seconds,Z.getMilliseconds()),t.selectedDates=[Z],t.latestSelectedDateObj=Z}K!==void 0&&K.type!=="blur"&&Rn(K);var fe=t._input.value;c(),At(),t._input.value!==fe&&t._debouncedChange()}function u(K,Z){return K%12+12*Vn(Z===t.l10n.amPM[1])}function f(K){switch(K%24){case 0:case 12:return 12;default:return K%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var K=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,Z=(parseInt(t.minuteElement.value,10)||0)%60,ie=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(K=u(K,t.amPM.textContent));var fe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&On(t.latestSelectedDateObj,t.config.minDate,!0)===0,Oe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&On(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Pe=Nr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ne=Nr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ae=Nr(K,Z,ie);if(Ae>Ne&&Ae=12)]),t.secondElement!==void 0&&(t.secondElement.value=vn(ie)))}function g(K){var Z=Mn(K),ie=parseInt(Z.value)+(K.delta||0);(ie/1e3>1||K.key==="Enter"&&!/[^\d]/.test(ie.toString()))&&ke(ie)}function m(K,Z,ie,fe){if(Z instanceof Array)return Z.forEach(function(Oe){return m(K,Oe,ie,fe)});if(K instanceof Array)return K.forEach(function(Oe){return m(Oe,Z,ie,fe)});K.addEventListener(Z,ie,fe),t._handlers.push({remove:function(){return K.removeEventListener(Z,ie,fe)}})}function _(){et("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ie){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ie+"]"),function(fe){return m(fe,"click",t[ie])})}),t.isMobile){Qn();return}var K=ed(Ue,50);if(t._debouncedChange=ed(_,yC),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(t.daysContainer,"mouseover",function(ie){t.config.mode==="range"&&we(Mn(ie))}),m(t._input,"keydown",Se),t.calendarContainer!==void 0&&m(t.calendarContainer,"keydown",Se),!t.config.inline&&!t.config.static&&m(window,"resize",K),window.ontouchstart!==void 0?m(window.document,"touchstart",We):m(window.document,"mousedown",We),m(window.document,"focus",We,{capture:!0}),t.config.clickOpens===!0&&(m(t._input,"focus",t.open),m(t._input,"click",t.open)),t.daysContainer!==void 0&&(m(t.monthNav,"click",It),m(t.monthNav,["keyup","increment"],g),m(t.daysContainer,"click",_i)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var Z=function(ie){return Mn(ie).select()};m(t.timeContainer,["increment"],a),m(t.timeContainer,"blur",a,{capture:!0}),m(t.timeContainer,"click",C),m([t.hourElement,t.minuteElement],["focus","click"],Z),t.secondElement!==void 0&&m(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&m(t.amPM,"click",function(ie){a(ie)})}t.config.allowInput&&m(t._input,"blur",ct)}function S(K,Z){var ie=K!==void 0?t.parseDate(K):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(K);var Oe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Oe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Pe=mt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Pe,t.element),Pe.appendChild(t.element),t.altInput&&Pe.appendChild(t.altInput),Pe.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(K,Z,ie,fe){var Oe=Me(Z,!0),Pe=mt("span",K,Z.getDate().toString());return Pe.dateObj=Z,Pe.$i=fe,Pe.setAttribute("aria-label",t.formatDate(Z,t.config.ariaDateFormat)),K.indexOf("hidden")===-1&&On(Z,t.now)===0&&(t.todayDateElem=Pe,Pe.classList.add("today"),Pe.setAttribute("aria-current","date")),Oe?(Pe.tabIndex=-1,De(Z)&&(Pe.classList.add("selected"),t.selectedDateElem=Pe,t.config.mode==="range"&&(gn(Pe,"startRange",t.selectedDates[0]&&On(Z,t.selectedDates[0],!0)===0),gn(Pe,"endRange",t.selectedDates[1]&&On(Z,t.selectedDates[1],!0)===0),K==="nextMonthDay"&&Pe.classList.add("inRange")))):Pe.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Xe(Z)&&!De(Z)&&Pe.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&K!=="prevMonthDay"&&fe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(Z)+""),et("onDayCreate",Pe),Pe}function M(K){K.focus(),t.config.mode==="range"&&we(K)}function D(K){for(var Z=K>0?0:t.config.showMonths-1,ie=K>0?t.config.showMonths:-1,fe=Z;fe!=ie;fe+=K)for(var Oe=t.daysContainer.children[fe],Pe=K>0?0:Oe.children.length-1,Ne=K>0?Oe.children.length:-1,Ae=Pe;Ae!=Ne;Ae+=K){var Qe=Oe.children[Ae];if(Qe.className.indexOf("hidden")===-1&&Me(Qe.dateObj))return Qe}}function L(K,Z){for(var ie=K.className.indexOf("Month")===-1?K.dateObj.getMonth():t.currentMonth,fe=Z>0?t.config.showMonths:-1,Oe=Z>0?1:-1,Pe=ie-t.currentMonth;Pe!=fe;Pe+=Oe)for(var Ne=t.daysContainer.children[Pe],Ae=ie-t.currentMonth===Pe?K.$i+Z:Z<0?Ne.children.length-1:0,Qe=Ne.children.length,ze=Ae;ze>=0&&ze0?Qe:-1);ze+=Oe){var Ke=Ne.children[ze];if(Ke.className.indexOf("hidden")===-1&&Me(Ke.dateObj)&&Math.abs(K.$i-ze)>=Math.abs(Z))return M(Ke)}t.changeMonth(Oe),N(D(Oe),0)}function N(K,Z){var ie=l(),fe=Je(ie||document.body),Oe=K!==void 0?K:fe?ie:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:D(Z>0?1:-1);Oe===void 0?t._input.focus():fe?L(Oe,Z):M(Oe)}function P(K,Z){for(var ie=(new Date(K,Z,1).getDay()-t.l10n.firstDayOfWeek+7)%7,fe=t.utils.getDaysInMonth((Z-1+12)%12,K),Oe=t.utils.getDaysInMonth(Z,K),Pe=window.document.createDocumentFragment(),Ne=t.config.showMonths>1,Ae=Ne?"prevMonthDay hidden":"prevMonthDay",Qe=Ne?"nextMonthDay hidden":"nextMonthDay",ze=fe+1-ie,Ke=0;ze<=fe;ze++,Ke++)Pe.appendChild(O("flatpickr-day "+Ae,new Date(K,Z-1,ze),ze,Ke));for(ze=1;ze<=Oe;ze++,Ke++)Pe.appendChild(O("flatpickr-day",new Date(K,Z,ze),ze,Ke));for(var St=Oe+1;St<=42-ie&&(t.config.showMonths===1||Ke%7!==0);St++,Ke++)Pe.appendChild(O("flatpickr-day "+Qe,new Date(K,Z+1,St%Oe),St,Ke));var ri=mt("div","dayContainer");return ri.appendChild(Pe),ri}function F(){if(t.daysContainer!==void 0){io(t.daysContainer),t.weekNumbers&&io(t.weekNumbers);for(var K=document.createDocumentFragment(),Z=0;Z1||t.config.monthSelectorType!=="dropdown")){var K=function(fe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&fet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var Z=0;Z<12;Z++)if(K(Z)){var ie=mt("option","flatpickr-monthDropdown-month");ie.value=new Date(t.currentYear,Z).getMonth().toString(),ie.textContent=Ro(Z,t.config.shorthandCurrentMonth,t.l10n),ie.tabIndex=-1,t.currentMonth===Z&&(ie.selected=!0),t.monthsDropdownContainer.appendChild(ie)}}}function q(){var K=mt("div","flatpickr-month"),Z=window.document.createDocumentFragment(),ie;t.config.showMonths>1||t.config.monthSelectorType==="static"?ie=mt("span","cur-month"):(t.monthsDropdownContainer=mt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),m(t.monthsDropdownContainer,"change",function(Ne){var Ae=Mn(Ne),Qe=parseInt(Ae.value,10);t.changeMonth(Qe-t.currentMonth),et("onMonthChange")}),R(),ie=t.monthsDropdownContainer);var fe=so("cur-year",{tabindex:"-1"}),Oe=fe.getElementsByTagName("input")[0];Oe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Oe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Oe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Oe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Pe=mt("div","flatpickr-current-month");return Pe.appendChild(ie),Pe.appendChild(fe),Z.appendChild(Pe),K.appendChild(Z),{container:K,yearElement:Oe,monthElement:ie}}function B(){io(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var K=t.config.showMonths;K--;){var Z=q();t.yearElements.push(Z.yearElement),t.monthElements.push(Z.monthElement),t.monthNav.appendChild(Z.container)}t.monthNav.appendChild(t.nextMonthNav)}function G(){return t.monthNav=mt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=mt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=mt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(K){t.__hidePrevMonthArrow!==K&&(gn(t.prevMonthNav,"flatpickr-disabled",K),t.__hidePrevMonthArrow=K)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(K){t.__hideNextMonthArrow!==K&&(gn(t.nextMonthNav,"flatpickr-disabled",K),t.__hideNextMonthArrow=K)}}),t.currentYearElement=t.yearElements[0],Jt(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var K=Fr(t.config);t.timeContainer=mt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var Z=mt("span","flatpickr-time-separator",":"),ie=so("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ie.getElementsByTagName("input")[0];var fe=so("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=fe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?K.hours:f(K.hours)),t.minuteElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():K.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ie),t.timeContainer.appendChild(Z),t.timeContainer.appendChild(fe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Oe=so("flatpickr-second");t.secondElement=Oe.getElementsByTagName("input")[0],t.secondElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():K.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(mt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Oe)}return t.config.time_24hr||(t.amPM=mt("span","flatpickr-am-pm",t.l10n.amPM[Vn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function J(){t.weekdayContainer?io(t.weekdayContainer):t.weekdayContainer=mt("div","flatpickr-weekdays");for(var K=t.config.showMonths;K--;){var Z=mt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(Z)}return U(),t.weekdayContainer}function U(){if(t.weekdayContainer){var K=t.l10n.firstDayOfWeek,Z=td(t.l10n.weekdays.shorthand);K>0&&K `+Z.join("")+` - `}}function oe(){t.calendarContainer.classList.add("hasWeeks");var K=mt("div","flatpickr-weekwrapper");K.appendChild(mt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Z=mt("div","flatpickr-weeks");return K.appendChild(Z),{weekWrapper:K,weekNumbers:Z}}function ee(K,Z){Z===void 0&&(Z=!0);var ie=Z?K:K-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,et("onYearChange"),R()),F(),et("onMonthChange"),Jt())}function se(K,Z){if(K===void 0&&(K=!0),Z===void 0&&(Z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Nr(t.config),fe=ie.hours,Oe=ie.minutes,Pe=ie.seconds;h(fe,Oe,Pe)}t.redraw(),K&&et("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),et("onClose")}function Re(){t.config!==void 0&&et("onDestroy");for(var K=t._handlers.length;K--;)t._handlers[K].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var Z=t.calendarContainer.parentNode;if(Z.lastChild&&Z.removeChild(Z.lastChild),Z.parentNode){for(;Z.firstChild;)Z.parentNode.insertBefore(Z.firstChild,Z);Z.parentNode.removeChild(Z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function Ve(K){return t.calendarContainer.contains(K)}function We(K){if(t.isOpen&&!t.config.inline){var Z=Mn(K),ie=Ve(Z),fe=Z===t.input||Z===t.altInput||t.element.contains(Z)||K.path&&K.path.indexOf&&(~K.path.indexOf(t.input)||~K.path.indexOf(t.altInput)),Oe=!fe&&!ie&&!Ve(K.relatedTarget),Pe=!t.config.ignoredFocusElements.some(function(Ne){return Ne.contains(Z)});Oe&&Pe&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ke(K){if(!(!K||t.config.minDate&&Kt.config.maxDate.getFullYear())){var Z=K,ie=t.currentYear!==Z;t.currentYear=Z||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),et("onYearChange"),R())}}function Me(K,Z){var ie;Z===void 0&&(Z=!0);var fe=t.parseDate(K,void 0,Z);if(t.config.minDate&&fe&&On(fe,t.config.minDate,Z!==void 0?Z:!t.minDateHasTime)<0||t.config.maxDate&&fe&&On(fe,t.config.maxDate,Z!==void 0?Z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(fe===void 0)return!1;for(var Oe=!!t.config.enable,Pe=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,Ne=0,Ae=void 0;Ne=Ae.from.getTime()&&fe.getTime()<=Ae.to.getTime())return Oe}return!Oe}function Je(K){return t.daysContainer!==void 0?K.className.indexOf("hidden")===-1&&K.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(K):!1}function ct(K){var Z=K.target===t._input,ie=t._input.value.trimEnd()!==nt();Z&&ie&&!(K.relatedTarget&&Ve(K.relatedTarget))&&t.setDate(t._input.value,!0,K.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Se(K){var Z=Mn(K),ie=t.config.wrap?n.contains(Z):Z===t._input,fe=t.config.allowInput,Oe=t.isOpen&&(!fe||!ie),Pe=t.config.inline&&ie&&!fe;if(K.keyCode===13&&ie){if(fe)return t.setDate(t._input.value,!0,Z===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),Z.blur();t.open()}else if(Ve(Z)||Oe||Pe){var Ne=!!t.timeContainer&&t.timeContainer.contains(Z);switch(K.keyCode){case 13:Ne?(K.preventDefault(),a(),Nn()):_i(K);break;case 27:K.preventDefault(),Nn();break;case 8:case 46:ie&&!t.config.allowInput&&(K.preventDefault(),t.clear());break;case 37:case 39:if(!Ne&&!ie){K.preventDefault();var Ae=l();if(t.daysContainer!==void 0&&(fe===!1||Ae&&Je(Ae))){var Qe=K.keyCode===39?1:-1;K.ctrlKey?(K.stopPropagation(),ee(Qe),N(D(1),0)):N(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:K.preventDefault();var ze=K.keyCode===40?1:-1;t.daysContainer&&Z.$i!==void 0||Z===t.input||Z===t.altInput?K.ctrlKey?(K.stopPropagation(),ke(t.currentYear-ze),N(D(1),0)):Ne||N(void 0,ze*7):Z===t.currentYearElement?ke(t.currentYear-ze):t.config.enableTime&&(!Ne&&t.hourElement&&t.hourElement.focus(),a(K),t._debouncedChange());break;case 9:if(Ne){var Ke=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function($n){return $n}),St=Ke.indexOf(Z);if(St!==-1){var ri=Ke[St+(K.shiftKey?-1:1)];K.preventDefault(),(ri||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(Z)&&K.shiftKey&&(K.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&Z===t.amPM)switch(K.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Dt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Dt();break}(ie||Ve(Z))&&et("onKeyDown",K)}function we(K,Z){if(Z===void 0&&(Z="flatpickr-day"),!(t.selectedDates.length!==1||K&&(!K.classList.contains(Z)||K.classList.contains("flatpickr-disabled")))){for(var ie=K?K.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),fe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Oe=Math.min(ie,t.selectedDates[0].getTime()),Pe=Math.max(ie,t.selectedDates[0].getTime()),Ne=!1,Ae=0,Qe=0,ze=Oe;zeOe&&zeAe)?Ae=ze:ze>fe&&(!Qe||ze ."+Z));Ke.forEach(function(St){var ri=St.dateObj,$n=ri.getTime(),Hs=Ae>0&&$n0&&$n>Qe;if(Hs){St.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ps){St.classList.remove(ps)});return}else if(Ne&&!Hs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ps){St.classList.remove(ps)}),K!==void 0&&(K.classList.add(ie<=t.selectedDates[0].getTime()?"startRange":"endRange"),feie&&$n===fe&&St.classList.add("endRange"),$n>=Ae&&(Qe===0||$n<=Qe)&&bC($n,fe,ie)&&St.classList.add("inRange"))})}}function Ue(){t.isOpen&&!t.config.static&&!t.config.inline&&qt()}function it(K,Z){if(Z===void 0&&(Z=t._positionElement),t.isMobile===!0){if(K){K.preventDefault();var ie=Mn(K);ie&&ie.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),et("onOpen");return}else if(t._input.disabled||t.config.inline)return;var fe=t.isOpen;t.isOpen=!0,fe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),et("onOpen"),qt(Z)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(K===void 0||!t.timeContainer.contains(K.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ne(K){return function(Z){var ie=t.config["_"+K+"Date"]=t.parseDate(Z,t.config.dateFormat),fe=t.config["_"+(K==="min"?"max":"min")+"Date"];ie!==void 0&&(t[K==="min"?"minDateHasTime":"maxDateHasTime"]=ie.getHours()>0||ie.getMinutes()>0||ie.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Oe){return Me(Oe)}),!t.selectedDates.length&&K==="min"&&d(ie),Dt()),t.daysContainer&&(rn(),ie!==void 0?t.currentYearElement[K]=ie.getFullYear().toString():t.currentYearElement.removeAttribute(K),t.currentYearElement.disabled=!!fe&&ie!==void 0&&fe.getFullYear()===ie.getFullYear())}}function qe(){var K=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Z=pn(pn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ie={};t.config.parseDate=Z.parseDate,t.config.formatDate=Z.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ke){t.config._enable=cn(Ke)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ke){t.config._disable=cn(Ke)}});var fe=Z.mode==="time";if(!Z.dateFormat&&(Z.enableTime||fe)){var Oe=Xt.defaultConfig.dateFormat||Ts.dateFormat;ie.dateFormat=Z.noCalendar||fe?"H:i"+(Z.enableSeconds?":S":""):Oe+" H:i"+(Z.enableSeconds?":S":"")}if(Z.altInput&&(Z.enableTime||fe)&&!Z.altFormat){var Pe=Xt.defaultConfig.altFormat||Ts.altFormat;ie.altFormat=Z.noCalendar||fe?"h:i"+(Z.enableSeconds?":S K":" K"):Pe+(" h:i"+(Z.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ne("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ne("max")});var Ne=function(Ke){return function(St){t.config[Ke==="min"?"_minTime":"_maxTime"]=t.parseDate(St,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ne("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ne("max")}),Z.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ie,Z);for(var Ae=0;Ae-1?t.config[ze]=Ir(Qe[ze]).map(o).concat(t.config[ze]):typeof Z[ze]>"u"&&(t.config[ze]=Qe[ze])}Z.altInputClass||(t.config.altInputClass=Ce().className+" "+t.config.altInputClass),et("onParseConfig")}function Ce(){return t.config.wrap?n.querySelector("[data-input]"):n}function pt(){typeof t.config.locale!="object"&&typeof Xt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=pn(pn({},Xt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Xt.l10ns[t.config.locale]:void 0),ns.D="("+t.l10n.weekdays.shorthand.join("|")+")",ns.l="("+t.l10n.weekdays.longhand.join("|")+")",ns.M="("+t.l10n.months.shorthand.join("|")+")",ns.F="("+t.l10n.months.longhand.join("|")+")",ns.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var K=pn(pn({},e),JSON.parse(JSON.stringify(n.dataset||{})));K.time_24hr===void 0&&Xt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=j1(t),t.parseDate=ha({config:t.config,l10n:t.l10n})}function qt(K){if(typeof t.config.position=="function")return void t.config.position(t,K);if(t.calendarContainer!==void 0){et("onPreCalendarPosition");var Z=K||t._positionElement,ie=Array.prototype.reduce.call(t.calendarContainer.children,function(n0,i0){return n0+i0.offsetHeight},0),fe=t.calendarContainer.offsetWidth,Oe=t.config.position.split(" "),Pe=Oe[0],Ne=Oe.length>1?Oe[1]:null,Ae=Z.getBoundingClientRect(),Qe=window.innerHeight-Ae.bottom,ze=Pe==="above"||Pe!=="below"&&Qeie,Ke=window.pageYOffset+Ae.top+(ze?-ie-2:Z.offsetHeight+2);if(gn(t.calendarContainer,"arrowTop",!ze),gn(t.calendarContainer,"arrowBottom",ze),!t.config.inline){var St=window.pageXOffset+Ae.left,ri=!1,$n=!1;Ne==="center"?(St-=(fe-Ae.width)/2,ri=!0):Ne==="right"&&(St-=fe-Ae.width,$n=!0),gn(t.calendarContainer,"arrowLeft",!ri&&!$n),gn(t.calendarContainer,"arrowCenter",ri),gn(t.calendarContainer,"arrowRight",$n);var Hs=window.document.body.offsetWidth-(window.pageXOffset+Ae.right),ps=St+fe>window.document.body.offsetWidth,G1=Hs+fe>window.document.body.offsetWidth;if(gn(t.calendarContainer,"rightMost",ps),!t.config.static)if(t.calendarContainer.style.top=Ke+"px",!ps)t.calendarContainer.style.left=St+"px",t.calendarContainer.style.right="auto";else if(!G1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Hs+"px";else{var nr=fn();if(nr===void 0)return;var Z1=window.document.body.offsetWidth,X1=Math.max(0,Z1/2-fe/2),Q1=".flatpickr-calendar.centerMost:before",x1=".flatpickr-calendar.centerMost:after",e0=nr.cssRules.length,t0="{left:"+Ae.left+"px;right:auto;}";gn(t.calendarContainer,"rightMost",!1),gn(t.calendarContainer,"centerMost",!0),nr.insertRule(Q1+","+x1+t0,e0),t.calendarContainer.style.left=X1+"px",t.calendarContainer.style.right="auto"}}}}function fn(){for(var K=null,Z=0;Zt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=fe,t.config.mode==="single")t.selectedDates=[Oe];else if(t.config.mode==="multiple"){var Ne=De(Oe);Ne?t.selectedDates.splice(parseInt(Ne),1):t.selectedDates.push(Oe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Oe,t.selectedDates.push(Oe),On(Oe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ke,St){return Ke.getTime()-St.getTime()}));if(c(),Pe){var Ae=t.currentYear!==Oe.getFullYear();t.currentYear=Oe.getFullYear(),t.currentMonth=Oe.getMonth(),Ae&&(et("onYearChange"),R()),et("onMonthChange")}if(Jt(),F(),Dt(),!Pe&&t.config.mode!=="range"&&t.config.showMonths===1?M(fe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,ze=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||ze)&&Nn()}_()}}var Fn={locale:[pt,W],showMonths:[B,r,J],minDate:[S],maxDate:[S],positionElement:[Cn],clickOpens:[function(){t.config.clickOpens===!0?(m(t._input,"focus",t.open),m(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ie(K,Z){if(K!==null&&typeof K=="object"){Object.assign(t.config,K);for(var ie in K)Fn[ie]!==void 0&&Fn[ie].forEach(function(fe){return fe()})}else t.config[K]=Z,Fn[K]!==void 0?Fn[K].forEach(function(fe){return fe()}):Ar.indexOf(K)>-1&&(t.config[K]=Ir(Z));t.redraw(),Dt(!0)}function Tt(K,Z){var ie=[];if(K instanceof Array)ie=K.map(function(fe){return t.parseDate(fe,Z)});else if(K instanceof Date||typeof K=="number")ie=[t.parseDate(K,Z)];else if(typeof K=="string")switch(t.config.mode){case"single":case"time":ie=[t.parseDate(K,Z)];break;case"multiple":ie=K.split(t.config.conjunction).map(function(fe){return t.parseDate(fe,Z)});break;case"range":ie=K.split(t.l10n.rangeSeparator).map(function(fe){return t.parseDate(fe,Z)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(K)));t.selectedDates=t.config.allowInvalidPreload?ie:ie.filter(function(fe){return fe instanceof Date&&Me(fe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(fe,Oe){return fe.getTime()-Oe.getTime()})}function oi(K,Z,ie){if(Z===void 0&&(Z=!1),ie===void 0&&(ie=t.config.dateFormat),K!==0&&!K||K instanceof Array&&K.length===0)return t.clear(Z);Tt(K,ie),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,Z),d(),t.selectedDates.length===0&&t.clear(!1),Dt(Z),Z&&et("onChange")}function cn(K){return K.slice().map(function(Z){return typeof Z=="string"||typeof Z=="number"||Z instanceof Date?t.parseDate(Z,void 0,!0):Z&&typeof Z=="object"&&Z.from&&Z.to?{from:t.parseDate(Z.from,void 0),to:t.parseDate(Z.to,void 0)}:Z}).filter(function(Z){return Z})}function Xn(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var K=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);K&&Tt(K,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Ai(){if(t.input=Ce(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=mt(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Cn()}function Cn(){t._positionElement=t.config.positionElement||t._input}function Qn(){var K=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=mt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=K,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=K==="datetime-local"?"Y-m-d\\TH:i:S":K==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}m(t.mobileInput,"change",function(Z){t.setDate(Mn(Z).value,!1,t.mobileFormatStr),et("onChange"),et("onClose")})}function en(K){if(t.isOpen===!0)return t.close();t.open(K)}function et(K,Z){if(t.config!==void 0){var ie=t.config[K];if(ie!==void 0&&ie.length>0)for(var fe=0;ie[fe]&&fe=0&&On(K,t.selectedDates[1])<=0}function Jt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(K,Z){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+Z),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[Z].textContent=Fo(ie.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ie.getMonth().toString(),K.value=ie.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function nt(K){var Z=K||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ie){return t.formatDate(ie,Z)}).filter(function(ie,fe,Oe){return t.config.mode!=="range"||t.config.enableTime||Oe.indexOf(ie)===fe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Dt(K){K===void 0&&(K=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=nt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=nt(t.config.altFormat)),K!==!1&&et("onValueUpdate")}function At(K){var Z=Mn(K),ie=t.prevMonthNav.contains(Z),fe=t.nextMonthNav.contains(Z);ie||fe?ee(ie?-1:1):t.yearElements.indexOf(Z)>=0?Z.select():Z.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):Z.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Rn(K){K.preventDefault();var Z=K.type==="keydown",ie=Mn(K),fe=ie;t.amPM!==void 0&&ie===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]);var Oe=parseFloat(fe.getAttribute("min")),Pe=parseFloat(fe.getAttribute("max")),Ne=parseFloat(fe.getAttribute("step")),Ae=parseInt(fe.value,10),Qe=K.delta||(Z?K.which===38?1:-1:0),ze=Ae+Ne*Qe;if(typeof fe.value<"u"&&fe.value.length===2){var Ke=fe===t.hourElement,St=fe===t.minuteElement;zePe&&(ze=fe===t.hourElement?ze-Pe-Vn(!t.amPM):Oe,St&&T(void 0,1,t.hourElement)),t.amPM&&Ke&&(Ne===1?ze+Ae===23:Math.abs(ze-Ae)>Ne)&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]),fe.value=vn(ze)}}return s(),t}function Cs(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function $C(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=tt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,h=!1,{input:g=void 0,flatpickr:m=void 0}=e;Kt(()=>{const T=f??g,$=y(d);return $.onReady.push((O,M,D)=>{a===void 0&&S(O,M,D),sn().then(()=>{t(8,h=!0)})}),t(3,m=Xt(T,Object.assign($,f?{wrap:!0}:{}))),()=>{m.destroy()}});const _=dt();function y(T={}){T=Object.assign({},T);for(const $ of r){const O=(M,D,L)=>{_(CC($),[M,D,L])};$ in T?(Array.isArray(T[$])||(T[$]=[T[$]]),T[$].push(O)):T[$]=[O]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,$,O){const M=nd(O,T);!id(a,M)&&(a||M)&&t(2,a=M),t(4,u=$)}function C(T){te[T?"unshift":"push"](()=>{g=T,t(0,g)})}return n.$$set=T=>{e=je(je({},e),xt(T)),t(1,s=tt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,g=T.input),"flatpickr"in T&&t(3,m=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&m&&h&&(id(a,nd(m,m.selectedDates))||m.setDate(a,!0,c)),n.$$.dirty&392&&m&&h)for(const[T,$]of Object.entries(y(d)))m.set(T,$)},[g,s,a,m,u,f,c,d,h,o,l,C]}class lu extends be{constructor(e){super(),_e(this,e,$C,TC,ge,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function MC(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),l=new lu({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=v("label"),t=U("Min date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),H(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};h&32768&&(g.id=d[15]),!o&&h&4&&(o=!0,g.value=d[2],ve(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=d[0].options.min,ve(()=>r=!1)),l.$set(g)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){I(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),V(l,d)}}}function OC(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),l=new lu({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=v("label"),t=U("Max date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),H(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};h&32768&&(g.id=d[15]),!o&&h&8&&(o=!0,g.value=d[3],ve(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=d[0].options.max,ve(()=>r=!1)),l.$set(g)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){I(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),V(l,d)}}}function EC(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[MC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[OC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&98309&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&98313&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function DC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[EC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?kt(s,[a&2&&{key:r[1]},a&32&&Pt(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function AC(n,e,t){var C,T;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e,r=(C=l==null?void 0:l.options)==null?void 0:C.min,a=(T=l==null?void 0:l.options)==null?void 0:T.max;function u($,O){$.detail&&$.detail.length==3&&t(0,l.options[O]=$.detail[1],l)}function f($){r=$,t(2,r),t(0,l)}function c($){n.$$.not_equal(l.options.min,$)&&(l.options.min=$,t(0,l))}const d=$=>u($,"min");function h($){a=$,t(3,a),t(0,l)}function g($){n.$$.not_equal(l.options.max,$)&&(l.options.max=$,t(0,l))}const m=$=>u($,"max");function _($){l=$,t(0,l)}function y($){Fe.call(this,n,$)}function S($){Fe.call(this,n,$)}return n.$$set=$=>{e=je(je({},e),xt($)),t(5,s=tt(e,i)),"field"in $&&t(0,l=$.field),"key"in $&&t(1,o=$.key)},n.$$.update=()=>{var $,O,M,D;n.$$.dirty&5&&r!=(($=l==null?void 0:l.options)==null?void 0:$.min)&&t(2,r=(O=l==null?void 0:l.options)==null?void 0:O.min),n.$$.dirty&9&&a!=((M=l==null?void 0:l.options)==null?void 0:M.max)&&t(3,a=(D=l==null?void 0:l.options)==null?void 0:D.max)},[l,o,r,a,u,s,f,c,d,h,g,m,_,y,S]}class IC extends be{constructor(e){super(),_e(this,e,AC,DC,ge,{field:0,key:1})}}const LC=n=>({}),sd=n=>({});function ld(n,e,t){const i=n.slice();return i[48]=e[t],i}const PC=n=>({}),od=n=>({});function rd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function ad(n){let e,t,i;return{c(){e=v("div"),t=U(n[2]),i=E(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),b(e,t),b(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&96&&Q(e,"link-hint",!s[5]&&!s[6])},d(s){s&&k(e)}}}function NC(n){let e,t=n[48]+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&1&&t!==(t=s[48]+"")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function FC(n){let e,t,i;const s=[{item:n[48]},n[11]];var l=n[10];function o(r,a){let u={};if(a!==void 0&&a[0]&2049)u=kt(s,[a[0]&1&&{item:r[48]},a[0]&2048&&Pt(r[11])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Lt(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&2049?kt(s,[a[0]&1&&{item:r[48]},a[0]&2048&&Pt(r[11])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function ud(n){let e,t,i;function s(){return n[36](n[48])}return{c(){e=v("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Te(Be.call(null,e,"Clear")),Y(e,"click",Sn(Ze(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function fd(n){let e,t,i,s,l,o;const r=[FC,NC],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&ud(n);return{c(){e=v("div"),i.c(),s=E(),f&&f.c(),l=E(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),b(e,s),f&&f.m(e,null),b(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(re(),I(a[h],1,1,()=>{a[h]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[8]?f?f.p(c,d):(f=ud(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){I(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function cd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[jC]},$$scope:{ctx:n}};return e=new Pn({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(s[7]?"dropdown-upside":"")),l[0]&1048576&&(o.trigger=s[20]),l[0]&6451722|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[41](null),V(e,s)}}}function dd(n){let e,t,i,s,l,o,r,a,u=n[17].length&&pd(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='',s=E(),l=v("input"),o=E(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(t,s),b(t,l),ce(l,n[17]),b(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[38]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&131072&&l.value!==f[17]&&ce(l,f[17]),f[17].length?u?u.p(f,c):(u=pd(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function pd(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",Sn(Ze(n[23]))),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function hd(n){let e,t=n[1]&&md(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=md(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function md(n){let e,t;return{c(){e=v("div"),t=U(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&k(e)}}}function RC(n){let e=n[48]+"",t;return{c(){t=U(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&4194304&&e!==(e=i[48]+"")&&le(t,e)},i:x,o:x,d(i){i&&k(t)}}}function qC(n){let e,t,i;const s=[{item:n[48]},n[13]];var l=n[12];function o(r,a){let u={};if(a!==void 0&&a[0]&4202496)u=kt(s,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Pt(r[13])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Lt(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&4202496?kt(s,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Pt(r[13])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function gd(n){let e,t,i,s,l,o,r;const a=[qC,RC],u=[];function f(h,g){return h[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[39](n[48],...h)}function d(...h){return n[40](n[48],...h)}return{c(){e=v("div"),i.c(),s=E(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[9]),Q(e,"selected",n[21](n[48]))},m(h,g){w(h,e,g),u[t].m(e,null),b(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(h,g){n=h;let m=t;t=f(n),t===m?u[t].p(n,g):(re(),I(u[m],1,1,()=>{u[m]=null}),ae(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||g[0]&512)&&Q(e,"closable",n[9]),(!l||g[0]&6291456)&&Q(e,"selected",n[21](n[48]))},i(h){l||(A(i),l=!0)},o(h){I(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,$e(r)}}}function jC(n){let e,t,i,s,l,o=n[14]&&dd(n);const r=n[35].beforeOptions,a=Ct(r,n,n[44],od);let u=pe(n[22]),f=[];for(let m=0;mI(f[m],1,1,()=>{f[m]=null});let d=null;u.length||(d=hd(n));const h=n[35].afterOptions,g=Ct(h,n,n[44],sd);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=v("div");for(let m=0;mI(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=ad(n));let c=!n[5]&&!n[6]&&cd(n);return{c(){e=v("div"),t=v("div");for(let d=0;d{c=null}),ae()),(!o||h[0]&32768&&l!==(l="select "+d[15]))&&p(e,"class",l),(!o||h[0]&32896)&&Q(e,"upside",d[7]),(!o||h[0]&32784)&&Q(e,"multiple",d[4]),(!o||h[0]&32800)&&Q(e,"disabled",d[5]),(!o||h[0]&32832)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let h=0;hCe(pt,qe))||[]}function Ee(ne,qe){ne.preventDefault(),y&&d?G(qe):B(qe)}function Re(ne,qe){(ne.code==="Enter"||ne.code==="Space")&&(Ee(ne,qe),S&&W())}function Ve(){ee(),setTimeout(()=>{const ne=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ne&&(ne.focus(),ne.scrollIntoView({block:"nearest"}))},0)}function We(ne){ne.stopPropagation(),!g&&!h&&(N==null||N.toggle())}Kt(()=>{const ne=document.querySelectorAll(`label[for="${r}"]`);for(const qe of ne)qe.addEventListener("click",We);return()=>{for(const qe of ne)qe.removeEventListener("click",We)}});const ke=ne=>q(ne);function Me(ne){te[ne?"unshift":"push"](()=>{R=ne,t(20,R)})}function Je(){P=this.value,t(17,P)}const ct=(ne,qe)=>Ee(qe,ne),Se=(ne,qe)=>Re(qe,ne);function we(ne){te[ne?"unshift":"push"](()=>{N=ne,t(18,N)})}function Ue(ne){Fe.call(this,n,ne)}function it(ne){te[ne?"unshift":"push"](()=>{F=ne,t(19,F)})}return n.$$set=ne=>{"id"in ne&&t(27,r=ne.id),"noOptionsText"in ne&&t(1,a=ne.noOptionsText),"selectPlaceholder"in ne&&t(2,u=ne.selectPlaceholder),"searchPlaceholder"in ne&&t(3,f=ne.searchPlaceholder),"items"in ne&&t(28,c=ne.items),"multiple"in ne&&t(4,d=ne.multiple),"disabled"in ne&&t(5,h=ne.disabled),"readonly"in ne&&t(6,g=ne.readonly),"upside"in ne&&t(7,m=ne.upside),"selected"in ne&&t(0,_=ne.selected),"toggle"in ne&&t(8,y=ne.toggle),"closable"in ne&&t(9,S=ne.closable),"labelComponent"in ne&&t(10,C=ne.labelComponent),"labelComponentProps"in ne&&t(11,T=ne.labelComponentProps),"optionComponent"in ne&&t(12,$=ne.optionComponent),"optionComponentProps"in ne&&t(13,O=ne.optionComponentProps),"searchable"in ne&&t(14,M=ne.searchable),"searchFunc"in ne&&t(29,D=ne.searchFunc),"class"in ne&&t(15,L=ne.class),"$$scope"in ne&&t(44,o=ne.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(oe(),ee()),n.$$.dirty[0]&268566528&&t(22,i=se(c,P)),n.$$.dirty[0]&1&&t(21,s=function(ne){const qe=j.toArray(_);return j.inArray(qe,ne)})},[_,a,u,f,d,h,g,m,y,S,C,T,$,O,M,L,q,P,N,F,R,s,i,ee,Ee,Re,Ve,r,c,D,B,G,X,J,W,l,ke,Me,Je,ct,Se,we,Ue,it,o]}class H1 extends be{constructor(e){super(),_e(this,e,zC,HC,ge,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function _d(n){let e,t;return{c(){e=v("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function BC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&_d(n);return{c(){l&&l.c(),e=E(),t=v("span"),s=U(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),b(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=_d(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&le(s,i)},i:x,o:x,d(o){o&&(k(e),k(t)),l&&l.d(o)}}}function UC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class bd extends be{constructor(e){super(),_e(this,e,UC,BC,ge,{item:0})}}const WC=n=>({}),vd=n=>({});function YC(n){let e;const t=n[8].afterOptions,i=Ct(t,n,n[12],vd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Mt(i,t,s,s[12],e?$t(t,s[12],l,WC):Ot(s[12]),vd)},i(s){e||(A(i,s),e=!0)},o(s){I(i,s),e=!1},d(s){i&&i.d(s)}}}function KC(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[YC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&62?kt(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Pt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function JC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=tt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=bd}=e,{optionComponent:c=bd}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(C){C=j.toArray(C,!0);let T=[];for(let $ of C){const O=j.findByKey(r,d,$);O&&T.push(O)}C.length&&!T.length||t(0,u=a?T:T[0])}async function m(C){let T=j.toArray(C,!0).map($=>$[d]);r.length&&t(6,h=a?T:T[0])}function _(C){u=C,t(0,u)}function y(C){Fe.call(this,n,C)}function S(C){Fe.call(this,n,C)}return n.$$set=C=>{e=je(je({},e),xt(C)),t(5,s=tt(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,c=C.optionComponent),"selectionKey"in C&&t(7,d=C.selectionKey),"keyOfSelected"in C&&t(6,h=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&m(u)},[u,r,a,f,c,s,h,d,l,_,y,S,o]}class Ei extends be{constructor(e){super(),_e(this,e,JC,KC,ge,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function GC(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[13],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[14]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new qs({props:a}),te.push(()=>he(t,"value",r)),{c(){e=v("div"),z(t.$$.fragment)},m(u,f){w(u,e,f),H(t,e,null),s=!0,l||(o=Te(Be.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&16384&&(c.readonly=!u[14]),!i&&f&1&&(i=!0,c.value=u[0].options.values,ve(()=>i=!1)),t.$set(c)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){I(t.$$.fragment,u),s=!1},d(u){u&&k(e),V(t),l=!1,o()}}}function ZC(n){let e,t,i;function s(o){n[8](o)}let l={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8192&&(a.id=o[13]),r&16384&&(a.readonly=!o[14]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function XC(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[GC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[ZC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16384&&(h.class="form-field required "+(c[14]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.values"),d&57345&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&16384&&(g.class="form-field form-field-single-multiple-select "+(c[14]?"":"readonly")),d&57348&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),V(i,c),V(r,c)}}}function yd(n){let e,t;return e=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[QC,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&40961&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[13]),p(l,"id",o=n[13]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&vt(l.value)!==u[0].options.maxSelect&&ce(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function xC(n){let e,t,i=!n[2]&&yd(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,l){s[2]?i&&(re(),I(i,1,1,()=>{i=null}),ae()):i?(i.p(s,l),l&4&&A(i,1)):(i=yd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function e$(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[xC],default:[XC,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&18?kt(s,[a&2&&{key:r[1]},a&16&&Pt(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function t$(n,e,t){var y;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((y=l.options)==null?void 0:y.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function c(){l.options.maxSelect=vt(this.value),t(0,l),t(5,u),t(2,a)}function d(S){n.$$.not_equal(l.options.values,S)&&(l.options.values=S,t(0,l),t(5,u),t(2,a))}function h(S){a=S,t(2,a)}function g(S){l=S,t(0,l),t(5,u),t(2,a)}function m(S){Fe.call(this,n,S)}function _(S){Fe.call(this,n,S)}return n.$$set=S=>{e=je(je({},e),xt(S)),t(4,s=tt(e,i)),"field"in S&&t(0,l=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,C;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((C=(S=l.options)==null?void 0:S.values)==null?void 0:C.length)||2,l)),n.$$.dirty&1&&j.isEmpty(l.options)&&f()},[l,o,a,r,s,u,c,d,h,g,m,_]}class n$ extends be{constructor(e){super(),_e(this,e,t$,e$,ge,{field:0,key:1})}}function i$(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function s$(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M='"{"a":1,"b":2}"',D,L,N,P,F,R,q,B,G,X,J,W,oe;return{c(){e=v("div"),t=v("div"),i=v("div"),s=U("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=U(` and - `),r=v("code"),r.textContent="multipart/form-data",a=U(` - requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=U(` field + `}}function oe(){t.calendarContainer.classList.add("hasWeeks");var K=mt("div","flatpickr-weekwrapper");K.appendChild(mt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Z=mt("div","flatpickr-weeks");return K.appendChild(Z),{weekWrapper:K,weekNumbers:Z}}function ee(K,Z){Z===void 0&&(Z=!0);var ie=Z?K:K-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,et("onYearChange"),R()),F(),et("onMonthChange"),Jt())}function se(K,Z){if(K===void 0&&(K=!0),Z===void 0&&(Z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Fr(t.config),fe=ie.hours,Oe=ie.minutes,Pe=ie.seconds;h(fe,Oe,Pe)}t.redraw(),K&&et("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),et("onClose")}function Re(){t.config!==void 0&&et("onDestroy");for(var K=t._handlers.length;K--;)t._handlers[K].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var Z=t.calendarContainer.parentNode;if(Z.lastChild&&Z.removeChild(Z.lastChild),Z.parentNode){for(;Z.firstChild;)Z.parentNode.insertBefore(Z.firstChild,Z);Z.parentNode.removeChild(Z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function Ve(K){return t.calendarContainer.contains(K)}function We(K){if(t.isOpen&&!t.config.inline){var Z=Mn(K),ie=Ve(Z),fe=Z===t.input||Z===t.altInput||t.element.contains(Z)||K.path&&K.path.indexOf&&(~K.path.indexOf(t.input)||~K.path.indexOf(t.altInput)),Oe=!fe&&!ie&&!Ve(K.relatedTarget),Pe=!t.config.ignoredFocusElements.some(function(Ne){return Ne.contains(Z)});Oe&&Pe&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ke(K){if(!(!K||t.config.minDate&&Kt.config.maxDate.getFullYear())){var Z=K,ie=t.currentYear!==Z;t.currentYear=Z||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),et("onYearChange"),R())}}function Me(K,Z){var ie;Z===void 0&&(Z=!0);var fe=t.parseDate(K,void 0,Z);if(t.config.minDate&&fe&&On(fe,t.config.minDate,Z!==void 0?Z:!t.minDateHasTime)<0||t.config.maxDate&&fe&&On(fe,t.config.maxDate,Z!==void 0?Z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(fe===void 0)return!1;for(var Oe=!!t.config.enable,Pe=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,Ne=0,Ae=void 0;Ne=Ae.from.getTime()&&fe.getTime()<=Ae.to.getTime())return Oe}return!Oe}function Je(K){return t.daysContainer!==void 0?K.className.indexOf("hidden")===-1&&K.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(K):!1}function ct(K){var Z=K.target===t._input,ie=t._input.value.trimEnd()!==nt();Z&&ie&&!(K.relatedTarget&&Ve(K.relatedTarget))&&t.setDate(t._input.value,!0,K.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Se(K){var Z=Mn(K),ie=t.config.wrap?n.contains(Z):Z===t._input,fe=t.config.allowInput,Oe=t.isOpen&&(!fe||!ie),Pe=t.config.inline&&ie&&!fe;if(K.keyCode===13&&ie){if(fe)return t.setDate(t._input.value,!0,Z===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),Z.blur();t.open()}else if(Ve(Z)||Oe||Pe){var Ne=!!t.timeContainer&&t.timeContainer.contains(Z);switch(K.keyCode){case 13:Ne?(K.preventDefault(),a(),Nn()):_i(K);break;case 27:K.preventDefault(),Nn();break;case 8:case 46:ie&&!t.config.allowInput&&(K.preventDefault(),t.clear());break;case 37:case 39:if(!Ne&&!ie){K.preventDefault();var Ae=l();if(t.daysContainer!==void 0&&(fe===!1||Ae&&Je(Ae))){var Qe=K.keyCode===39?1:-1;K.ctrlKey?(K.stopPropagation(),ee(Qe),N(D(1),0)):N(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:K.preventDefault();var ze=K.keyCode===40?1:-1;t.daysContainer&&Z.$i!==void 0||Z===t.input||Z===t.altInput?K.ctrlKey?(K.stopPropagation(),ke(t.currentYear-ze),N(D(1),0)):Ne||N(void 0,ze*7):Z===t.currentYearElement?ke(t.currentYear-ze):t.config.enableTime&&(!Ne&&t.hourElement&&t.hourElement.focus(),a(K),t._debouncedChange());break;case 9:if(Ne){var Ke=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function($n){return $n}),St=Ke.indexOf(Z);if(St!==-1){var ri=Ke[St+(K.shiftKey?-1:1)];K.preventDefault(),(ri||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(Z)&&K.shiftKey&&(K.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&Z===t.amPM)switch(K.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),At();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),At();break}(ie||Ve(Z))&&et("onKeyDown",K)}function we(K,Z){if(Z===void 0&&(Z="flatpickr-day"),!(t.selectedDates.length!==1||K&&(!K.classList.contains(Z)||K.classList.contains("flatpickr-disabled")))){for(var ie=K?K.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),fe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Oe=Math.min(ie,t.selectedDates[0].getTime()),Pe=Math.max(ie,t.selectedDates[0].getTime()),Ne=!1,Ae=0,Qe=0,ze=Oe;zeOe&&zeAe)?Ae=ze:ze>fe&&(!Qe||ze ."+Z));Ke.forEach(function(St){var ri=St.dateObj,$n=ri.getTime(),Vs=Ae>0&&$n0&&$n>Qe;if(Vs){St.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ps){St.classList.remove(ps)});return}else if(Ne&&!Vs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ps){St.classList.remove(ps)}),K!==void 0&&(K.classList.add(ie<=t.selectedDates[0].getTime()?"startRange":"endRange"),feie&&$n===fe&&St.classList.add("endRange"),$n>=Ae&&(Qe===0||$n<=Qe)&&_C($n,fe,ie)&&St.classList.add("inRange"))})}}function Ue(){t.isOpen&&!t.config.static&&!t.config.inline&&qt()}function it(K,Z){if(Z===void 0&&(Z=t._positionElement),t.isMobile===!0){if(K){K.preventDefault();var ie=Mn(K);ie&&ie.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),et("onOpen");return}else if(t._input.disabled||t.config.inline)return;var fe=t.isOpen;t.isOpen=!0,fe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),et("onOpen"),qt(Z)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(K===void 0||!t.timeContainer.contains(K.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ne(K){return function(Z){var ie=t.config["_"+K+"Date"]=t.parseDate(Z,t.config.dateFormat),fe=t.config["_"+(K==="min"?"max":"min")+"Date"];ie!==void 0&&(t[K==="min"?"minDateHasTime":"maxDateHasTime"]=ie.getHours()>0||ie.getMinutes()>0||ie.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Oe){return Me(Oe)}),!t.selectedDates.length&&K==="min"&&d(ie),At()),t.daysContainer&&(rn(),ie!==void 0?t.currentYearElement[K]=ie.getFullYear().toString():t.currentYearElement.removeAttribute(K),t.currentYearElement.disabled=!!fe&&ie!==void 0&&fe.getFullYear()===ie.getFullYear())}}function qe(){var K=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Z=pn(pn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ie={};t.config.parseDate=Z.parseDate,t.config.formatDate=Z.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ke){t.config._enable=cn(Ke)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ke){t.config._disable=cn(Ke)}});var fe=Z.mode==="time";if(!Z.dateFormat&&(Z.enableTime||fe)){var Oe=Xt.defaultConfig.dateFormat||Cs.dateFormat;ie.dateFormat=Z.noCalendar||fe?"H:i"+(Z.enableSeconds?":S":""):Oe+" H:i"+(Z.enableSeconds?":S":"")}if(Z.altInput&&(Z.enableTime||fe)&&!Z.altFormat){var Pe=Xt.defaultConfig.altFormat||Cs.altFormat;ie.altFormat=Z.noCalendar||fe?"h:i"+(Z.enableSeconds?":S K":" K"):Pe+(" h:i"+(Z.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ne("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ne("max")});var Ne=function(Ke){return function(St){t.config[Ke==="min"?"_minTime":"_maxTime"]=t.parseDate(St,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ne("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ne("max")}),Z.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ie,Z);for(var Ae=0;Ae-1?t.config[ze]=Lr(Qe[ze]).map(o).concat(t.config[ze]):typeof Z[ze]>"u"&&(t.config[ze]=Qe[ze])}Z.altInputClass||(t.config.altInputClass=Ce().className+" "+t.config.altInputClass),et("onParseConfig")}function Ce(){return t.config.wrap?n.querySelector("[data-input]"):n}function pt(){typeof t.config.locale!="object"&&typeof Xt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=pn(pn({},Xt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Xt.l10ns[t.config.locale]:void 0),ns.D="("+t.l10n.weekdays.shorthand.join("|")+")",ns.l="("+t.l10n.weekdays.longhand.join("|")+")",ns.M="("+t.l10n.months.shorthand.join("|")+")",ns.F="("+t.l10n.months.longhand.join("|")+")",ns.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var K=pn(pn({},e),JSON.parse(JSON.stringify(n.dataset||{})));K.time_24hr===void 0&&Xt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=q1(t),t.parseDate=ha({config:t.config,l10n:t.l10n})}function qt(K){if(typeof t.config.position=="function")return void t.config.position(t,K);if(t.calendarContainer!==void 0){et("onPreCalendarPosition");var Z=K||t._positionElement,ie=Array.prototype.reduce.call(t.calendarContainer.children,function(t0,n0){return t0+n0.offsetHeight},0),fe=t.calendarContainer.offsetWidth,Oe=t.config.position.split(" "),Pe=Oe[0],Ne=Oe.length>1?Oe[1]:null,Ae=Z.getBoundingClientRect(),Qe=window.innerHeight-Ae.bottom,ze=Pe==="above"||Pe!=="below"&&Qeie,Ke=window.pageYOffset+Ae.top+(ze?-ie-2:Z.offsetHeight+2);if(gn(t.calendarContainer,"arrowTop",!ze),gn(t.calendarContainer,"arrowBottom",ze),!t.config.inline){var St=window.pageXOffset+Ae.left,ri=!1,$n=!1;Ne==="center"?(St-=(fe-Ae.width)/2,ri=!0):Ne==="right"&&(St-=fe-Ae.width,$n=!0),gn(t.calendarContainer,"arrowLeft",!ri&&!$n),gn(t.calendarContainer,"arrowCenter",ri),gn(t.calendarContainer,"arrowRight",$n);var Vs=window.document.body.offsetWidth-(window.pageXOffset+Ae.right),ps=St+fe>window.document.body.offsetWidth,J1=Vs+fe>window.document.body.offsetWidth;if(gn(t.calendarContainer,"rightMost",ps),!t.config.static)if(t.calendarContainer.style.top=Ke+"px",!ps)t.calendarContainer.style.left=St+"px",t.calendarContainer.style.right="auto";else if(!J1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Vs+"px";else{var ir=fn();if(ir===void 0)return;var G1=window.document.body.offsetWidth,Z1=Math.max(0,G1/2-fe/2),X1=".flatpickr-calendar.centerMost:before",Q1=".flatpickr-calendar.centerMost:after",x1=ir.cssRules.length,e0="{left:"+Ae.left+"px;right:auto;}";gn(t.calendarContainer,"rightMost",!1),gn(t.calendarContainer,"centerMost",!0),ir.insertRule(X1+","+Q1+e0,x1),t.calendarContainer.style.left=Z1+"px",t.calendarContainer.style.right="auto"}}}}function fn(){for(var K=null,Z=0;Zt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=fe,t.config.mode==="single")t.selectedDates=[Oe];else if(t.config.mode==="multiple"){var Ne=De(Oe);Ne?t.selectedDates.splice(parseInt(Ne),1):t.selectedDates.push(Oe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Oe,t.selectedDates.push(Oe),On(Oe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ke,St){return Ke.getTime()-St.getTime()}));if(c(),Pe){var Ae=t.currentYear!==Oe.getFullYear();t.currentYear=Oe.getFullYear(),t.currentMonth=Oe.getMonth(),Ae&&(et("onYearChange"),R()),et("onMonthChange")}if(Jt(),F(),At(),!Pe&&t.config.mode!=="range"&&t.config.showMonths===1?M(fe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,ze=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||ze)&&Nn()}_()}}var Fn={locale:[pt,U],showMonths:[B,r,J],minDate:[S],maxDate:[S],positionElement:[Cn],clickOpens:[function(){t.config.clickOpens===!0?(m(t._input,"focus",t.open),m(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ie(K,Z){if(K!==null&&typeof K=="object"){Object.assign(t.config,K);for(var ie in K)Fn[ie]!==void 0&&Fn[ie].forEach(function(fe){return fe()})}else t.config[K]=Z,Fn[K]!==void 0?Fn[K].forEach(function(fe){return fe()}):Ir.indexOf(K)>-1&&(t.config[K]=Lr(Z));t.redraw(),At(!0)}function Tt(K,Z){var ie=[];if(K instanceof Array)ie=K.map(function(fe){return t.parseDate(fe,Z)});else if(K instanceof Date||typeof K=="number")ie=[t.parseDate(K,Z)];else if(typeof K=="string")switch(t.config.mode){case"single":case"time":ie=[t.parseDate(K,Z)];break;case"multiple":ie=K.split(t.config.conjunction).map(function(fe){return t.parseDate(fe,Z)});break;case"range":ie=K.split(t.l10n.rangeSeparator).map(function(fe){return t.parseDate(fe,Z)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(K)));t.selectedDates=t.config.allowInvalidPreload?ie:ie.filter(function(fe){return fe instanceof Date&&Me(fe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(fe,Oe){return fe.getTime()-Oe.getTime()})}function oi(K,Z,ie){if(Z===void 0&&(Z=!1),ie===void 0&&(ie=t.config.dateFormat),K!==0&&!K||K instanceof Array&&K.length===0)return t.clear(Z);Tt(K,ie),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,Z),d(),t.selectedDates.length===0&&t.clear(!1),At(Z),Z&&et("onChange")}function cn(K){return K.slice().map(function(Z){return typeof Z=="string"||typeof Z=="number"||Z instanceof Date?t.parseDate(Z,void 0,!0):Z&&typeof Z=="object"&&Z.from&&Z.to?{from:t.parseDate(Z.from,void 0),to:t.parseDate(Z.to,void 0)}:Z}).filter(function(Z){return Z})}function Xn(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var K=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);K&&Tt(K,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Ai(){if(t.input=Ce(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=mt(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Cn()}function Cn(){t._positionElement=t.config.positionElement||t._input}function Qn(){var K=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=mt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=K,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=K==="datetime-local"?"Y-m-d\\TH:i:S":K==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}m(t.mobileInput,"change",function(Z){t.setDate(Mn(Z).value,!1,t.mobileFormatStr),et("onChange"),et("onClose")})}function en(K){if(t.isOpen===!0)return t.close();t.open(K)}function et(K,Z){if(t.config!==void 0){var ie=t.config[K];if(ie!==void 0&&ie.length>0)for(var fe=0;ie[fe]&&fe=0&&On(K,t.selectedDates[1])<=0}function Jt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(K,Z){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+Z),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[Z].textContent=Ro(ie.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ie.getMonth().toString(),K.value=ie.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function nt(K){var Z=K||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ie){return t.formatDate(ie,Z)}).filter(function(ie,fe,Oe){return t.config.mode!=="range"||t.config.enableTime||Oe.indexOf(ie)===fe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function At(K){K===void 0&&(K=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=nt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=nt(t.config.altFormat)),K!==!1&&et("onValueUpdate")}function It(K){var Z=Mn(K),ie=t.prevMonthNav.contains(Z),fe=t.nextMonthNav.contains(Z);ie||fe?ee(ie?-1:1):t.yearElements.indexOf(Z)>=0?Z.select():Z.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):Z.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Rn(K){K.preventDefault();var Z=K.type==="keydown",ie=Mn(K),fe=ie;t.amPM!==void 0&&ie===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]);var Oe=parseFloat(fe.getAttribute("min")),Pe=parseFloat(fe.getAttribute("max")),Ne=parseFloat(fe.getAttribute("step")),Ae=parseInt(fe.value,10),Qe=K.delta||(Z?K.which===38?1:-1:0),ze=Ae+Ne*Qe;if(typeof fe.value<"u"&&fe.value.length===2){var Ke=fe===t.hourElement,St=fe===t.minuteElement;zePe&&(ze=fe===t.hourElement?ze-Pe-Vn(!t.amPM):Oe,St&&T(void 0,1,t.hourElement)),t.amPM&&Ke&&(Ne===1?ze+Ae===23:Math.abs(ze-Ae)>Ne)&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]),fe.value=vn(ze)}}return s(),t}function $s(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function CC(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=tt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,h=!1,{input:g=void 0,flatpickr:m=void 0}=e;Kt(()=>{const T=f??g,$=y(d);return $.onReady.push((O,M,D)=>{a===void 0&&S(O,M,D),sn().then(()=>{t(8,h=!0)})}),t(3,m=Xt(T,Object.assign($,f?{wrap:!0}:{}))),()=>{m.destroy()}});const _=dt();function y(T={}){T=Object.assign({},T);for(const $ of r){const O=(M,D,L)=>{_(TC($),[M,D,L])};$ in T?(Array.isArray(T[$])||(T[$]=[T[$]]),T[$].push(O)):T[$]=[O]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,$,O){const M=nd(O,T);!id(a,M)&&(a||M)&&t(2,a=M),t(4,u=$)}function C(T){te[T?"unshift":"push"](()=>{g=T,t(0,g)})}return n.$$set=T=>{e=je(je({},e),xt(T)),t(1,s=tt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,g=T.input),"flatpickr"in T&&t(3,m=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&m&&h&&(id(a,nd(m,m.selectedDates))||m.setDate(a,!0,c)),n.$$.dirty&392&&m&&h)for(const[T,$]of Object.entries(y(d)))m.set(T,$)},[g,s,a,m,u,f,c,d,h,o,l,C]}class lu extends ve{constructor(e){super(),be(this,e,CC,SC,ge,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function $C(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),l=new lu({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=v("label"),t=W("Min date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),H(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};h&32768&&(g.id=d[15]),!o&&h&4&&(o=!0,g.value=d[2],_e(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=d[0].options.min,_e(()=>r=!1)),l.$set(g)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){I(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),V(l,d)}}}function MC(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),l=new lu({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=v("label"),t=W("Max date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),H(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};h&32768&&(g.id=d[15]),!o&&h&8&&(o=!0,g.value=d[3],_e(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=d[0].options.max,_e(()=>r=!1)),l.$set(g)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){I(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),V(l,d)}}}function OC(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[$C,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[MC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&98309&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&98313&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function EC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[OC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?_t(s,[a&2&&{key:r[1]},a&32&&Dt(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function DC(n,e,t){var C,T;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e,r=(C=l==null?void 0:l.options)==null?void 0:C.min,a=(T=l==null?void 0:l.options)==null?void 0:T.max;function u($,O){$.detail&&$.detail.length==3&&t(0,l.options[O]=$.detail[1],l)}function f($){r=$,t(2,r),t(0,l)}function c($){n.$$.not_equal(l.options.min,$)&&(l.options.min=$,t(0,l))}const d=$=>u($,"min");function h($){a=$,t(3,a),t(0,l)}function g($){n.$$.not_equal(l.options.max,$)&&(l.options.max=$,t(0,l))}const m=$=>u($,"max");function _($){l=$,t(0,l)}function y($){Fe.call(this,n,$)}function S($){Fe.call(this,n,$)}return n.$$set=$=>{e=je(je({},e),xt($)),t(5,s=tt(e,i)),"field"in $&&t(0,l=$.field),"key"in $&&t(1,o=$.key)},n.$$.update=()=>{var $,O,M,D;n.$$.dirty&5&&r!=(($=l==null?void 0:l.options)==null?void 0:$.min)&&t(2,r=(O=l==null?void 0:l.options)==null?void 0:O.min),n.$$.dirty&9&&a!=((M=l==null?void 0:l.options)==null?void 0:M.max)&&t(3,a=(D=l==null?void 0:l.options)==null?void 0:D.max)},[l,o,r,a,u,s,f,c,d,h,g,m,_,y,S]}class AC extends ve{constructor(e){super(),be(this,e,DC,EC,ge,{field:0,key:1})}}const IC=n=>({}),sd=n=>({});function ld(n,e,t){const i=n.slice();return i[48]=e[t],i}const LC=n=>({}),od=n=>({});function rd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function ad(n){let e,t,i;return{c(){e=v("div"),t=W(n[2]),i=E(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),b(e,t),b(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&96&&Q(e,"link-hint",!s[5]&&!s[6])},d(s){s&&k(e)}}}function PC(n){let e,t=n[48]+"",i;return{c(){e=v("span"),i=W(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&1&&t!==(t=s[48]+"")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function NC(n){let e,t,i;const s=[{item:n[48]},n[11]];var l=n[10];function o(r,a){let u={};if(a!==void 0&&a[0]&2049)u=_t(s,[a[0]&1&&{item:r[48]},a[0]&2048&&Dt(r[11])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Pt(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&2049?_t(s,[a[0]&1&&{item:r[48]},a[0]&2048&&Dt(r[11])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function ud(n){let e,t,i;function s(){return n[36](n[48])}return{c(){e=v("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Te(Be.call(null,e,"Clear")),Y(e,"click",Sn(Ze(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function fd(n){let e,t,i,s,l,o;const r=[NC,PC],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&ud(n);return{c(){e=v("div"),i.c(),s=E(),f&&f.c(),l=E(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),b(e,s),f&&f.m(e,null),b(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(re(),I(a[h],1,1,()=>{a[h]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[8]?f?f.p(c,d):(f=ud(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){I(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function cd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[qC]},$$scope:{ctx:n}};return e=new Pn({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(s[7]?"dropdown-upside":"")),l[0]&1048576&&(o.trigger=s[20]),l[0]&6451722|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[41](null),V(e,s)}}}function dd(n){let e,t,i,s,l,o,r,a,u=n[17].length&&pd(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='',s=E(),l=v("input"),o=E(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(t,s),b(t,l),de(l,n[17]),b(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[38]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&131072&&l.value!==f[17]&&de(l,f[17]),f[17].length?u?u.p(f,c):(u=pd(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function pd(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",Sn(Ze(n[23]))),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function hd(n){let e,t=n[1]&&md(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=md(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function md(n){let e,t;return{c(){e=v("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&k(e)}}}function FC(n){let e=n[48]+"",t;return{c(){t=W(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&4194304&&e!==(e=i[48]+"")&&le(t,e)},i:x,o:x,d(i){i&&k(t)}}}function RC(n){let e,t,i;const s=[{item:n[48]},n[13]];var l=n[12];function o(r,a){let u={};if(a!==void 0&&a[0]&4202496)u=_t(s,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Dt(r[13])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Pt(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&4202496?_t(s,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Dt(r[13])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function gd(n){let e,t,i,s,l,o,r;const a=[RC,FC],u=[];function f(h,g){return h[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[39](n[48],...h)}function d(...h){return n[40](n[48],...h)}return{c(){e=v("div"),i.c(),s=E(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[9]),Q(e,"selected",n[21](n[48]))},m(h,g){w(h,e,g),u[t].m(e,null),b(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(h,g){n=h;let m=t;t=f(n),t===m?u[t].p(n,g):(re(),I(u[m],1,1,()=>{u[m]=null}),ae(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||g[0]&512)&&Q(e,"closable",n[9]),(!l||g[0]&6291456)&&Q(e,"selected",n[21](n[48]))},i(h){l||(A(i),l=!0)},o(h){I(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,$e(r)}}}function qC(n){let e,t,i,s,l,o=n[14]&&dd(n);const r=n[35].beforeOptions,a=Ct(r,n,n[44],od);let u=pe(n[22]),f=[];for(let m=0;mI(f[m],1,1,()=>{f[m]=null});let d=null;u.length||(d=hd(n));const h=n[35].afterOptions,g=Ct(h,n,n[44],sd);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=v("div");for(let m=0;mI(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=ad(n));let c=!n[5]&&!n[6]&&cd(n);return{c(){e=v("div"),t=v("div");for(let d=0;d{c=null}),ae()),(!o||h[0]&32768&&l!==(l="select "+d[15]))&&p(e,"class",l),(!o||h[0]&32896)&&Q(e,"upside",d[7]),(!o||h[0]&32784)&&Q(e,"multiple",d[4]),(!o||h[0]&32800)&&Q(e,"disabled",d[5]),(!o||h[0]&32832)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let h=0;hCe(pt,qe))||[]}function Ee(ne,qe){ne.preventDefault(),y&&d?G(qe):B(qe)}function Re(ne,qe){(ne.code==="Enter"||ne.code==="Space")&&(Ee(ne,qe),S&&U())}function Ve(){ee(),setTimeout(()=>{const ne=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ne&&(ne.focus(),ne.scrollIntoView({block:"nearest"}))},0)}function We(ne){ne.stopPropagation(),!g&&!h&&(N==null||N.toggle())}Kt(()=>{const ne=document.querySelectorAll(`label[for="${r}"]`);for(const qe of ne)qe.addEventListener("click",We);return()=>{for(const qe of ne)qe.removeEventListener("click",We)}});const ke=ne=>q(ne);function Me(ne){te[ne?"unshift":"push"](()=>{R=ne,t(20,R)})}function Je(){P=this.value,t(17,P)}const ct=(ne,qe)=>Ee(qe,ne),Se=(ne,qe)=>Re(qe,ne);function we(ne){te[ne?"unshift":"push"](()=>{N=ne,t(18,N)})}function Ue(ne){Fe.call(this,n,ne)}function it(ne){te[ne?"unshift":"push"](()=>{F=ne,t(19,F)})}return n.$$set=ne=>{"id"in ne&&t(27,r=ne.id),"noOptionsText"in ne&&t(1,a=ne.noOptionsText),"selectPlaceholder"in ne&&t(2,u=ne.selectPlaceholder),"searchPlaceholder"in ne&&t(3,f=ne.searchPlaceholder),"items"in ne&&t(28,c=ne.items),"multiple"in ne&&t(4,d=ne.multiple),"disabled"in ne&&t(5,h=ne.disabled),"readonly"in ne&&t(6,g=ne.readonly),"upside"in ne&&t(7,m=ne.upside),"selected"in ne&&t(0,_=ne.selected),"toggle"in ne&&t(8,y=ne.toggle),"closable"in ne&&t(9,S=ne.closable),"labelComponent"in ne&&t(10,C=ne.labelComponent),"labelComponentProps"in ne&&t(11,T=ne.labelComponentProps),"optionComponent"in ne&&t(12,$=ne.optionComponent),"optionComponentProps"in ne&&t(13,O=ne.optionComponentProps),"searchable"in ne&&t(14,M=ne.searchable),"searchFunc"in ne&&t(29,D=ne.searchFunc),"class"in ne&&t(15,L=ne.class),"$$scope"in ne&&t(44,o=ne.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(oe(),ee()),n.$$.dirty[0]&268566528&&t(22,i=se(c,P)),n.$$.dirty[0]&1&&t(21,s=function(ne){const qe=j.toArray(_);return j.inArray(qe,ne)})},[_,a,u,f,d,h,g,m,y,S,C,T,$,O,M,L,q,P,N,F,R,s,i,ee,Ee,Re,Ve,r,c,D,B,G,X,J,U,l,ke,Me,Je,ct,Se,we,Ue,it,o]}class j1 extends ve{constructor(e){super(),be(this,e,VC,jC,ge,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function _d(n){let e,t;return{c(){e=v("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function zC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&_d(n);return{c(){l&&l.c(),e=E(),t=v("span"),s=W(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),b(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=_d(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&le(s,i)},i:x,o:x,d(o){o&&(k(e),k(t)),l&&l.d(o)}}}function BC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class bd extends ve{constructor(e){super(),be(this,e,BC,zC,ge,{item:0})}}const UC=n=>({}),vd=n=>({});function WC(n){let e;const t=n[8].afterOptions,i=Ct(t,n,n[12],vd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Mt(i,t,s,s[12],e?$t(t,s[12],l,UC):Ot(s[12]),vd)},i(s){e||(A(i,s),e=!0)},o(s){I(i,s),e=!1},d(s){i&&i.d(s)}}}function YC(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[WC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&62?_t(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Dt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function KC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=tt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=bd}=e,{optionComponent:c=bd}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(C){C=j.toArray(C,!0);let T=[];for(let $ of C){const O=j.findByKey(r,d,$);O&&T.push(O)}C.length&&!T.length||t(0,u=a?T:T[0])}async function m(C){let T=j.toArray(C,!0).map($=>$[d]);r.length&&t(6,h=a?T:T[0])}function _(C){u=C,t(0,u)}function y(C){Fe.call(this,n,C)}function S(C){Fe.call(this,n,C)}return n.$$set=C=>{e=je(je({},e),xt(C)),t(5,s=tt(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,c=C.optionComponent),"selectionKey"in C&&t(7,d=C.selectionKey),"keyOfSelected"in C&&t(6,h=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&m(u)},[u,r,a,f,c,s,h,d,l,_,y,S,o]}class Ei extends ve{constructor(e){super(),be(this,e,KC,YC,ge,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function JC(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[13],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[14]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new js({props:a}),te.push(()=>he(t,"value",r)),{c(){e=v("div"),z(t.$$.fragment)},m(u,f){w(u,e,f),H(t,e,null),s=!0,l||(o=Te(Be.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&16384&&(c.readonly=!u[14]),!i&&f&1&&(i=!0,c.value=u[0].options.values,_e(()=>i=!1)),t.$set(c)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){I(t.$$.fragment,u),s=!1},d(u){u&&k(e),V(t),l=!1,o()}}}function GC(n){let e,t,i;function s(o){n[8](o)}let l={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8192&&(a.id=o[13]),r&16384&&(a.readonly=!o[14]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ZC(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[JC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[GC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16384&&(h.class="form-field required "+(c[14]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.values"),d&57345&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&16384&&(g.class="form-field form-field-single-multiple-select "+(c[14]?"":"readonly")),d&57348&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),V(i,c),V(r,c)}}}function yd(n){let e,t;return e=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[XC,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&40961&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function XC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Max select"),s=E(),l=v("input"),p(e,"for",i=n[13]),p(l,"id",o=n[13]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.maxSelect&&de(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function QC(n){let e,t,i=!n[2]&&yd(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,l){s[2]?i&&(re(),I(i,1,1,()=>{i=null}),ae()):i?(i.p(s,l),l&4&&A(i,1)):(i=yd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function xC(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[QC],default:[ZC,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&18?_t(s,[a&2&&{key:r[1]},a&16&&Dt(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function e$(n,e,t){var y;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((y=l.options)==null?void 0:y.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function c(){l.options.maxSelect=yt(this.value),t(0,l),t(5,u),t(2,a)}function d(S){n.$$.not_equal(l.options.values,S)&&(l.options.values=S,t(0,l),t(5,u),t(2,a))}function h(S){a=S,t(2,a)}function g(S){l=S,t(0,l),t(5,u),t(2,a)}function m(S){Fe.call(this,n,S)}function _(S){Fe.call(this,n,S)}return n.$$set=S=>{e=je(je({},e),xt(S)),t(4,s=tt(e,i)),"field"in S&&t(0,l=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,C;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((C=(S=l.options)==null?void 0:S.values)==null?void 0:C.length)||2,l)),n.$$.dirty&1&&j.isEmpty(l.options)&&f()},[l,o,a,r,s,u,c,d,h,g,m,_]}class t$ extends ve{constructor(e){super(),be(this,e,e$,xC,ge,{field:0,key:1})}}function n$(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function i$(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M='"{"a":1,"b":2}"',D,L,N,P,F,R,q,B,G,X,J,U,oe;return{c(){e=v("div"),t=v("div"),i=v("div"),s=W("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=W(` and + `),r=v("code"),r.textContent="multipart/form-data",a=W(` + requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=W(` field is a - `),c=v("strong"),c.textContent="plain string",d=U(`: - `),h=v("ul"),g=v("li"),g.innerHTML=""true" is converted to the json true",m=E(),_=v("li"),_.innerHTML=""false" is converted to the json false",y=E(),S=v("li"),S.innerHTML=""null" is converted to the json null",C=E(),T=v("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",$=E(),O=v("li"),D=U(M),L=U(" is converted to the json "),N=v("code"),N.textContent='{"a":1,"b":2}',P=E(),F=v("li"),F.textContent="numeric strings are converted to json number",R=E(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",B=E(),G=v("li"),G.textContent="any other string (empty string too) is double quoted",X=U(` + `),c=v("strong"),c.textContent="plain string",d=W(`: + `),h=v("ul"),g=v("li"),g.innerHTML=""true" is converted to the json true",m=E(),_=v("li"),_.innerHTML=""false" is converted to the json false",y=E(),S=v("li"),S.innerHTML=""null" is converted to the json null",C=E(),T=v("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",$=E(),O=v("li"),D=W(M),L=W(" is converted to the json "),N=v("code"),N.textContent='{"a":1,"b":2}',P=E(),F=v("li"),F.textContent="numeric strings are converted to json number",R=E(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",B=E(),G=v("li"),G.textContent="any other string (empty string too) is double quoted",X=W(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),J=v("code"),J.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,se){w(ee,e,se),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,h),b(h,g),b(h,m),b(h,_),b(h,y),b(h,S),b(h,C),b(h,T),b(h,$),b(h,O),b(O,D),b(O,L),b(O,N),b(h,P),b(h,F),b(h,R),b(h,q),b(h,B),b(h,G),b(i,X),b(i,J),oe=!0},i(ee){oe||(ee&&xe(()=>{oe&&(W||(W=He(e,lt,{duration:150},!0)),W.run(1))}),oe=!0)},o(ee){ee&&(W||(W=He(e,lt,{duration:150},!1)),W.run(0)),oe=!1},d(ee){ee&&k(e),ee&&W&&W.end()}}}function l$(n){let e,t,i,s,l,o,r;function a(d,h){return d[2]?s$:i$}let u=a(n),f=u(n),c=n[2]&&kd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,h){w(d,e,h),b(e,t),b(e,i),f.m(e,null),w(d,s,h),c&&c.m(d,h),w(d,l,h),o||(r=Y(e,"click",n[4]),o=!0)},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?h&4&&A(c,1):(c=kd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&(k(e),k(s),k(l)),f.d(),c&&c.d(d),o=!1,r()}}}function o$(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[l$]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&10?kt(s,[a&2&&{key:r[1]},a&8&&Pt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function r$(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(3,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class a$ extends be{constructor(e){super(),_e(this,e,r$,o$,ge,{field:0,key:1})}}function u$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=E(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:x,o:x,d(a){a&&(k(e),k(s),k(l))}}}function f$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class wd extends be{constructor(e){super(),_e(this,e,f$,u$,ge,{item:0})}}const c$=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function d$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&4194304&&(a.id=o[22]),r&8388608&&(a.readonly=!o[23]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function p$(n){let e,t,i,s,l,o;return i=new me({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[d$,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const u={};a&8388608&&(u.class="form-field form-field-single-multiple-select "+(r[23]?"":"readonly")),a&29360132&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(A(i.$$.fragment,r),o=!0)},o(r){I(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s),k(l)),V(i,r)}}}function h$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=v("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=v("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=v("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[9]),Y(i,"click",n[10]),Y(l,"click",n[11]),Y(r,"click",n[12])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function m$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C;function T(O){n[8](O)}let $={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:wd,optionComponent:wd};return n[0].options.mimeTypes!==void 0&&($.keyOfSelected=n[0].options.mimeTypes),r=new Ei({props:$}),te.push(()=>he(r,"keyOfSelected",T)),_=new Pn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[h$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",h=E(),g=v("i"),m=E(),z(_.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(d,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,M){w(O,e,M),b(e,t),b(e,i),b(e,s),w(O,o,M),H(r,O,M),w(O,u,M),w(O,f,M),b(f,c),b(c,d),b(c,h),b(c,g),b(c,m),H(_,c,null),y=!0,S||(C=Te(Be.call(null,s,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,M){(!y||M&4194304&&l!==(l=O[22]))&&p(e,"for",l);const D={};M&4194304&&(D.id=O[22]),M&8&&(D.items=O[3]),!a&&M&1&&(a=!0,D.keyOfSelected=O[0].options.mimeTypes,ve(()=>a=!1)),r.$set(D);const L={};M&16777217&&(L.$$scope={dirty:M,ctx:O}),_.$set(L)},i(O){y||(A(r.$$.fragment,O),A(_.$$.fragment,O),y=!0)},o(O){I(r.$$.fragment,O),I(_.$$.fragment,O),y=!1},d(O){O&&(k(e),k(o),k(u),k(f)),V(r,O),V(_),S=!1,C()}}}function g$(n){let e;return{c(){e=v("ul"),e.innerHTML=`
  • WxH + data inside an object, eg.`),J=v("code"),J.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,se){w(ee,e,se),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,h),b(h,g),b(h,m),b(h,_),b(h,y),b(h,S),b(h,C),b(h,T),b(h,$),b(h,O),b(O,D),b(O,L),b(O,N),b(h,P),b(h,F),b(h,R),b(h,q),b(h,B),b(h,G),b(i,X),b(i,J),oe=!0},i(ee){oe||(ee&&xe(()=>{oe&&(U||(U=He(e,lt,{duration:150},!0)),U.run(1))}),oe=!0)},o(ee){ee&&(U||(U=He(e,lt,{duration:150},!1)),U.run(0)),oe=!1},d(ee){ee&&k(e),ee&&U&&U.end()}}}function s$(n){let e,t,i,s,l,o,r;function a(d,h){return d[2]?i$:n$}let u=a(n),f=u(n),c=n[2]&&kd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,h){w(d,e,h),b(e,t),b(e,i),f.m(e,null),w(d,s,h),c&&c.m(d,h),w(d,l,h),o||(r=Y(e,"click",n[4]),o=!0)},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?h&4&&A(c,1):(c=kd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&(k(e),k(s),k(l)),f.d(),c&&c.d(d),o=!1,r()}}}function l$(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[s$]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&10?_t(s,[a&2&&{key:r[1]},a&8&&Dt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function o$(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(3,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class r$ extends ve{constructor(e){super(),be(this,e,o$,l$,ge,{field:0,key:1})}}function a$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=W(t),s=E(),l=v("small"),r=W(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:x,o:x,d(a){a&&(k(e),k(s),k(l))}}}function u$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class wd extends ve{constructor(e){super(),be(this,e,u$,a$,ge,{item:0})}}const f$=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function c$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&4194304&&(a.id=o[22]),r&8388608&&(a.readonly=!o[23]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function d$(n){let e,t,i,s,l,o;return i=new me({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[c$,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const u={};a&8388608&&(u.class="form-field form-field-single-multiple-select "+(r[23]?"":"readonly")),a&29360132&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(A(i.$$.fragment,r),o=!0)},o(r){I(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s),k(l)),V(i,r)}}}function p$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=v("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=v("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=v("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[9]),Y(i,"click",n[10]),Y(l,"click",n[11]),Y(r,"click",n[12])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function h$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C;function T(O){n[8](O)}let $={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:wd,optionComponent:wd};return n[0].options.mimeTypes!==void 0&&($.keyOfSelected=n[0].options.mimeTypes),r=new Ei({props:$}),te.push(()=>he(r,"keyOfSelected",T)),_=new Pn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[p$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",h=E(),g=v("i"),m=E(),z(_.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(d,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,M){w(O,e,M),b(e,t),b(e,i),b(e,s),w(O,o,M),H(r,O,M),w(O,u,M),w(O,f,M),b(f,c),b(c,d),b(c,h),b(c,g),b(c,m),H(_,c,null),y=!0,S||(C=Te(Be.call(null,s,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,M){(!y||M&4194304&&l!==(l=O[22]))&&p(e,"for",l);const D={};M&4194304&&(D.id=O[22]),M&8&&(D.items=O[3]),!a&&M&1&&(a=!0,D.keyOfSelected=O[0].options.mimeTypes,_e(()=>a=!1)),r.$set(D);const L={};M&16777217&&(L.$$scope={dirty:M,ctx:O}),_.$set(L)},i(O){y||(A(r.$$.fragment,O),A(_.$$.fragment,O),y=!0)},o(O){I(r.$$.fragment,O),I(_.$$.fragment,O),y=!1},d(O){O&&(k(e),k(o),k(u),k(f)),V(r,O),V(_),S=!1,C()}}}function m$(n){let e;return{c(){e=v("ul"),e.innerHTML=`
  • WxH (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt (eg. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (eg. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (eg. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;function O(D){n[13](D)}let M={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(M.value=n[0].options.thumbs),r=new qs({props:M}),te.push(()=>he(r,"value",O)),S=new Pn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[g$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),h=v("button"),g=v("span"),g.textContent="Supported formats",m=E(),_=v("i"),y=E(),z(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,L){w(D,e,L),b(e,t),b(e,i),b(e,s),w(D,o,L),H(r,D,L),w(D,u,L),w(D,f,L),b(f,c),b(f,d),b(f,h),b(h,g),b(h,m),b(h,_),b(h,y),H(S,h,null),C=!0,T||($=Te(Be.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(D,L){(!C||L&4194304&&l!==(l=D[22]))&&p(e,"for",l);const N={};L&4194304&&(N.id=D[22]),!a&&L&1&&(a=!0,N.value=D[0].options.thumbs,ve(()=>a=!1)),r.$set(N);const P={};L&16777216&&(P.$$scope={dirty:L,ctx:D}),S.$set(P)},i(D){C||(A(r.$$.fragment,D),A(S.$$.fragment,D),C=!0)},o(D){I(r.$$.fragment,D),I(S.$$.fragment,D),C=!1},d(D){D&&(k(e),k(o),k(u),k(f)),V(r,D),V(S),T=!1,$()}}}function b$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ce(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&vt(l.value)!==c[0].options.maxSize&&ce(l,c[0].options.maxSize)},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function Sd(n){let e,t,i;return t=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[v$,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function v$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&vt(l.value)!==u[0].options.maxSelect&&ce(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function y$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[m$,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[_$,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[b$,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&Sd(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),d=E(),g&&g.c(),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(m,_){w(m,e,_),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,a),b(e,u),H(f,u,null),b(e,d),g&&g.m(e,null),h=!0},p(m,_){const y={};_&2&&(y.name="schema."+m[1]+".options.mimeTypes"),_&20971529&&(y.$$scope={dirty:_,ctx:m}),i.$set(y);const S={};_&2&&(S.name="schema."+m[1]+".options.thumbs"),_&20971521&&(S.$$scope={dirty:_,ctx:m}),o.$set(S),(!h||_&4&&r!==(r=m[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const C={};_&2&&(C.name="schema."+m[1]+".options.maxSize"),_&20971521&&(C.$$scope={dirty:_,ctx:m}),f.$set(C),(!h||_&4&&c!==(c=m[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),m[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(m,_),_&4&&A(g,1)):(g=Sd(m),g.c(),A(g,1),g.m(e,null))},i(m){h||(A(i.$$.fragment,m),A(o.$$.fragment,m),A(f.$$.fragment,m),A(g),h=!0)},o(m){I(i.$$.fragment,m),I(o.$$.fragment,m),I(f.$$.fragment,m),I(g),h=!1},d(m){m&&k(e),V(i),V(o),V(f),g&&g.d()}}}function k$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Protected",r=E(),a=v("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"class","txt"),p(s,"for",o=n[22]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,s,d),b(s,l),w(c,r,d),w(c,a,d),u||(f=Y(e,"change",n[7]),u=!0)},p(c,d){d&4194304&&t!==(t=c[22])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&4194304&&o!==(o=c[22])&&p(s,"for",o)},d(c){c&&(k(e),k(i),k(s),k(r),k(a)),u=!1,f()}}}function w$(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[k$,({uniqueId:i})=>({22:i}),({uniqueId:i})=>i?4194304:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.protected"),s&20971521&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function S$(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{optionsFooter:[w$],options:[y$],default:[p$,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?kt(s,[a&2&&{key:r[1]},a&32&&Pt(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function T$(n,e,t){var N;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=c$.slice(),u=((N=l.options)==null?void 0:N.maxSelect)<=1,f=u;function c(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function d(){if(j.isEmpty(l.options.mimeTypes))return;const P=[];for(const F of l.options.mimeTypes)a.find(R=>R.mimeType===F)||P.push({mimeType:F});P.length&&t(3,a=a.concat(P))}function h(){l.options.protected=this.checked,t(0,l),t(6,f),t(2,u)}function g(P){n.$$.not_equal(l.options.mimeTypes,P)&&(l.options.mimeTypes=P,t(0,l),t(6,f),t(2,u))}const m=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},_=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},y=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},S=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function C(P){n.$$.not_equal(l.options.thumbs,P)&&(l.options.thumbs=P,t(0,l),t(6,f),t(2,u))}function T(){l.options.maxSize=vt(this.value),t(0,l),t(6,f),t(2,u)}function $(){l.options.maxSelect=vt(this.value),t(0,l),t(6,f),t(2,u)}function O(P){u=P,t(2,u)}function M(P){l=P,t(0,l),t(6,f),t(2,u)}function D(P){Fe.call(this,n,P)}function L(P){Fe.call(this,n,P)}return n.$$set=P=>{e=je(je({},e),xt(P)),t(5,s=tt(e,i)),"field"in P&&t(0,l=P.field),"key"in P&&t(1,o=P.key)},n.$$.update=()=>{var P,F;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((F=(P=l.options)==null?void 0:P.values)==null?void 0:F.length)||99,l)),n.$$.dirty&1&&(j.isEmpty(l.options)?c():d())},[l,o,u,a,r,s,f,h,g,m,_,y,S,C,T,$,O,M,D,L]}class C$ extends be{constructor(e){super(),_e(this,e,T$,S$,ge,{field:0,key:1})}}function $$(n){let e,t,i,s,l;return{c(){e=v("hr"),t=E(),i=v("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function M$(n){let e,t,i;function s(o){n[15](o)}let l={id:n[23],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[24]||n[0].id,$$slots:{afterOptions:[$$]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&16777217&&(a.readonly=!o[24]||o[0].id),r&33554440&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function O$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[23],items:n[6],readonly:!n[24]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function E$(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field required "+(n[24]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[M$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[O$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16777216&&(h.class="form-field required "+(c[24]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&58720297&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&16777216&&(g.class="form-field form-field-single-multiple-select "+(c[24]?"":"readonly")),d&58720260&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),V(i,c),V(r,c)}}}function Td(n){let e,t,i,s,l,o;return t=new me({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[D$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[A$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),i=E(),s=v("div"),z(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),H(t,e,null),w(r,i,a),w(r,s,a),H(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&41943041&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&41943041&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(s)),V(t),V(l)}}}function D$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min select"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].options.minSelect),r||(a=Y(l,"input",n[11]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&vt(l.value)!==u[0].options.minSelect&&ce(l,u[0].options.minSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function A$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].options.minSelect||2)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ce(l,n[0].options.maxSelect),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].options.minSelect||2)&&p(l,"min",r),c&1&&vt(l.value)!==f[0].options.maxSelect&&ce(l,f[0].options.maxSelect)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function I$(n){let e,t,i,s,l,o,r,a,u,f,c,d;function h(m){n[13](m)}let g={id:n[23],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(g.keyOfSelected=n[0].options.cascadeDelete),a=new Ei({props:g}),te.push(()=>he(a,"keyOfSelected",h)),{c(){e=v("label"),t=v("span"),t.textContent="Cascade delete",i=E(),s=v("i"),r=E(),z(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[23])},m(m,_){var y,S;w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,r,_),H(a,m,_),f=!0,c||(d=Te(l=Be.call(null,s,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + (eg. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function g$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;function O(D){n[13](D)}let M={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(M.value=n[0].options.thumbs),r=new js({props:M}),te.push(()=>he(r,"value",O)),S=new Pn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[m$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),h=v("button"),g=v("span"),g.textContent="Supported formats",m=E(),_=v("i"),y=E(),z(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,L){w(D,e,L),b(e,t),b(e,i),b(e,s),w(D,o,L),H(r,D,L),w(D,u,L),w(D,f,L),b(f,c),b(f,d),b(f,h),b(h,g),b(h,m),b(h,_),b(h,y),H(S,h,null),C=!0,T||($=Te(Be.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(D,L){(!C||L&4194304&&l!==(l=D[22]))&&p(e,"for",l);const N={};L&4194304&&(N.id=D[22]),!a&&L&1&&(a=!0,N.value=D[0].options.thumbs,_e(()=>a=!1)),r.$set(N);const P={};L&16777216&&(P.$$scope={dirty:L,ctx:D}),S.$set(P)},i(D){C||(A(r.$$.fragment,D),A(S.$$.fragment,D),C=!0)},o(D){I(r.$$.fragment,D),I(S.$$.fragment,D),C=!1},d(D){D&&(k(e),k(o),k(u),k(f)),V(r,D),V(S),T=!1,$()}}}function _$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=W("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),de(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&yt(l.value)!==c[0].options.maxSize&&de(l,c[0].options.maxSize)},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function Sd(n){let e,t,i;return t=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[b$,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function b$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.maxSelect&&de(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function v$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[h$,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[g$,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[_$,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&Sd(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),d=E(),g&&g.c(),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(m,_){w(m,e,_),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,a),b(e,u),H(f,u,null),b(e,d),g&&g.m(e,null),h=!0},p(m,_){const y={};_&2&&(y.name="schema."+m[1]+".options.mimeTypes"),_&20971529&&(y.$$scope={dirty:_,ctx:m}),i.$set(y);const S={};_&2&&(S.name="schema."+m[1]+".options.thumbs"),_&20971521&&(S.$$scope={dirty:_,ctx:m}),o.$set(S),(!h||_&4&&r!==(r=m[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const C={};_&2&&(C.name="schema."+m[1]+".options.maxSize"),_&20971521&&(C.$$scope={dirty:_,ctx:m}),f.$set(C),(!h||_&4&&c!==(c=m[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),m[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(m,_),_&4&&A(g,1)):(g=Sd(m),g.c(),A(g,1),g.m(e,null))},i(m){h||(A(i.$$.fragment,m),A(o.$$.fragment,m),A(f.$$.fragment,m),A(g),h=!0)},o(m){I(i.$$.fragment,m),I(o.$$.fragment,m),I(f.$$.fragment,m),I(g),h=!1},d(m){m&&k(e),V(i),V(o),V(f),g&&g.d()}}}function y$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Protected",r=E(),a=v("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"class","txt"),p(s,"for",o=n[22]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,s,d),b(s,l),w(c,r,d),w(c,a,d),u||(f=Y(e,"change",n[7]),u=!0)},p(c,d){d&4194304&&t!==(t=c[22])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&4194304&&o!==(o=c[22])&&p(s,"for",o)},d(c){c&&(k(e),k(i),k(s),k(r),k(a)),u=!1,f()}}}function k$(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[y$,({uniqueId:i})=>({22:i}),({uniqueId:i})=>i?4194304:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.protected"),s&20971521&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function w$(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{optionsFooter:[k$],options:[v$],default:[d$,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?_t(s,[a&2&&{key:r[1]},a&32&&Dt(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function S$(n,e,t){var N;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=f$.slice(),u=((N=l.options)==null?void 0:N.maxSelect)<=1,f=u;function c(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function d(){if(j.isEmpty(l.options.mimeTypes))return;const P=[];for(const F of l.options.mimeTypes)a.find(R=>R.mimeType===F)||P.push({mimeType:F});P.length&&t(3,a=a.concat(P))}function h(){l.options.protected=this.checked,t(0,l),t(6,f),t(2,u)}function g(P){n.$$.not_equal(l.options.mimeTypes,P)&&(l.options.mimeTypes=P,t(0,l),t(6,f),t(2,u))}const m=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},_=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},y=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},S=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function C(P){n.$$.not_equal(l.options.thumbs,P)&&(l.options.thumbs=P,t(0,l),t(6,f),t(2,u))}function T(){l.options.maxSize=yt(this.value),t(0,l),t(6,f),t(2,u)}function $(){l.options.maxSelect=yt(this.value),t(0,l),t(6,f),t(2,u)}function O(P){u=P,t(2,u)}function M(P){l=P,t(0,l),t(6,f),t(2,u)}function D(P){Fe.call(this,n,P)}function L(P){Fe.call(this,n,P)}return n.$$set=P=>{e=je(je({},e),xt(P)),t(5,s=tt(e,i)),"field"in P&&t(0,l=P.field),"key"in P&&t(1,o=P.key)},n.$$.update=()=>{var P,F;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((F=(P=l.options)==null?void 0:P.values)==null?void 0:F.length)||99,l)),n.$$.dirty&1&&(j.isEmpty(l.options)?c():d())},[l,o,u,a,r,s,f,h,g,m,_,y,S,C,T,$,O,M,D,L]}class T$ extends ve{constructor(e){super(),be(this,e,S$,w$,ge,{field:0,key:1})}}function C$(n){let e,t,i,s,l;return{c(){e=v("hr"),t=E(),i=v("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function $$(n){let e,t,i;function s(o){n[15](o)}let l={id:n[23],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[24]||n[0].id,$$slots:{afterOptions:[C$]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&16777217&&(a.readonly=!o[24]||o[0].id),r&33554440&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function M$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[23],items:n[6],readonly:!n[24]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function O$(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field required "+(n[24]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[$$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[M$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16777216&&(h.class="form-field required "+(c[24]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&58720297&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&16777216&&(g.class="form-field form-field-single-multiple-select "+(c[24]?"":"readonly")),d&58720260&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),V(i,c),V(r,c)}}}function Td(n){let e,t,i,s,l,o;return t=new me({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[E$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[D$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),i=E(),s=v("div"),z(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),H(t,e,null),w(r,i,a),w(r,s,a),H(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&41943041&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&41943041&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(s)),V(t),V(l)}}}function E$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Min select"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.minSelect),r||(a=Y(l,"input",n[11]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.minSelect&&de(l,u[0].options.minSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function D$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=W("Max select"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].options.minSelect||2)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),de(l,n[0].options.maxSelect),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].options.minSelect||2)&&p(l,"min",r),c&1&&yt(l.value)!==f[0].options.maxSelect&&de(l,f[0].options.maxSelect)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function A$(n){let e,t,i,s,l,o,r,a,u,f,c,d;function h(m){n[13](m)}let g={id:n[23],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(g.keyOfSelected=n[0].options.cascadeDelete),a=new Ei({props:g}),te.push(()=>he(a,"keyOfSelected",h)),{c(){e=v("label"),t=v("span"),t.textContent="Cascade delete",i=E(),s=v("i"),r=E(),z(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[23])},m(m,_){var y,S;w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,r,_),H(a,m,_),f=!0,c||(d=Te(l=Be.call(null,s,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` `),position:"top"})),c=!0)},p(m,_){var S,C;l&&Et(l.update)&&_&20&&l.update.call(null,{text:[`Whether on ${((S=m[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,m[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((C=m[4])==null?void 0:C.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!f||_&8388608&&o!==(o=m[23]))&&p(e,"for",o);const y={};_&8388608&&(y.id=m[23]),!u&&_&1&&(u=!0,y.keyOfSelected=m[0].options.cascadeDelete,ve(()=>u=!1)),a.$set(y)},i(m){f||(A(a.$$.fragment,m),f=!0)},o(m){I(a.$$.fragment,m),f=!1},d(m){m&&(k(e),k(r)),V(a,m),c=!1,d()}}}function L$(n){let e,t,i,s,l,o=!n[2]&&Td(n);return s=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[I$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),o&&o.c(),t=E(),i=v("div"),z(s.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),b(e,t),b(e,i),H(s,i,null),l=!0},p(r,a){r[2]?o&&(re(),I(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&A(o,1)):(o=Td(r),o.c(),A(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&41943061&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){l||(A(o),A(s.$$.fragment,r),l=!0)},o(r){I(o),I(s.$$.fragment,r),l=!1},d(r){r&&k(e),o&&o.d(),V(s)}}}function P$(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[L$],default:[E$,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;fhe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return s=new ou({props:u}),n[20](s),s.$on("save",n[21]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,c){H(e,f,c),w(f,i,c),H(s,f,c),l=!0},p(f,[c]){const d=c&258?kt(o,[c&2&&{key:f[1]},c&256&&Pt(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ve(()=>t=!1)),e.$set(d);const h={};s.$set(h)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),I(s.$$.fragment,f),l=!1},d(f){f&&k(i),V(e,f),n[20](null),V(s,f)}}}function N$(n,e,t){var P;let i,s;const l=["field","key"];let o=tt(e,l),r;Ge(n,Zn,F=>t(10,r=F));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,h=((P=a.options)==null?void 0:P.maxSelect)==1,g=h;function m(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,h=!0),t(9,g=h)}function _(){a.options.minSelect=vt(this.value),t(0,a),t(9,g),t(2,h)}function y(){a.options.maxSelect=vt(this.value),t(0,a),t(9,g),t(2,h)}function S(F){n.$$.not_equal(a.options.cascadeDelete,F)&&(a.options.cascadeDelete=F,t(0,a),t(9,g),t(2,h))}const C=()=>d==null?void 0:d.show();function T(F){n.$$.not_equal(a.options.collectionId,F)&&(a.options.collectionId=F,t(0,a),t(9,g),t(2,h))}function $(F){h=F,t(2,h)}function O(F){a=F,t(0,a),t(9,g),t(2,h)}function M(F){Fe.call(this,n,F)}function D(F){Fe.call(this,n,F)}function L(F){te[F?"unshift":"push"](()=>{d=F,t(3,d)})}const N=F=>{var R,q;(q=(R=F==null?void 0:F.detail)==null?void 0:R.collection)!=null&&q.id&&F.detail.collection.type!="view"&&t(0,a.options.collectionId=F.detail.collection.id,a)};return n.$$set=F=>{e=je(je({},e),xt(F)),t(8,o=tt(e,l)),"field"in F&&t(0,a=F.field),"key"in F&&t(1,u=F.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(F=>F.type!="view")),n.$$.dirty&516&&g!=h&&(t(9,g=h),h?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&m(),n.$$.dirty&1025&&t(4,s=r.find(F=>F.id==a.options.collectionId)||null)},[a,u,h,d,s,i,f,c,o,g,r,_,y,S,C,T,$,O,M,D,L,N]}class F$ extends be{constructor(e){super(),_e(this,e,N$,P$,ge,{field:0,key:1})}}const R$=n=>({dragging:n&4,dragover:n&8}),Cd=n=>({dragging:n[2],dragover:n[3]});function q$(n){let e,t,i,s,l;const o=n[10].default,r=Ct(o,n,n[9],Cd);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",Ze(n[11])),Y(e,"dragleave",Ze(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Mt(r,o,a,a[9],i?$t(o,a[9],u,R$):Ot(a[9]),Cd),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&Q(e,"dragging",a[2]),(!i||u&8)&&Q(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function j$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=dt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function h(T,$){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:$,group:a})),l("drag",T)}}function g(T,$){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const M=O.index<<0;M<$?(r.splice($+1,0,r[M]),r.splice(M,1)):(r.splice($,0,r[M]),r.splice(M+1,1)),t(6,r),l("sort",{oldIndex:M,newIndex:$,list:r})}const m=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=T=>h(T,o),C=T=>g(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,s=T.$$scope)},[o,u,c,d,h,g,r,a,f,s,i,m,_,y,S,C]}class Nl extends be{constructor(e){super(),_e(this,e,j$,q$,ge,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function $d(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function Md(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`, - `),t=v("code"),t.textContent="username",i=U(` , - `),s=v("code"),s.textContent="email",l=U(` , - `),o=v("code"),o.textContent="emailVisibility",r=U(` , - `),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r),k(a))}}}function H$(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u,f){let c={key:u[4](u[17])};return u[17]!==void 0&&(c.field=u[17]),{props:c}}return r&&(e=Lt(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&z(e.$$.fragment),i=E()},m(u,f){e&&H(e,u,f),w(u,i,f),s=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}r?(e=Lt(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(r){const c={};f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],ve(()=>t=!1)),e.$set(c)}},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&I(e.$$.fragment,u),s=!1},d(u){u&&k(i),e&&V(e,u)}}}function Od(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[H$]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Nl({props:r}),te.push(()=>he(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function V$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$,O,M=n[0].type==="auth"&&Md(),D=pe(n[0].schema);const L=F=>F[17];for(let F=0;Fhe(T,"collection",N)),{c(){e=v("div"),t=v("p"),i=U(`System fields: - `),s=v("code"),s.textContent="id",l=U(` , - `),o=v("code"),o.textContent="created",r=U(` , - `),a=v("code"),a.textContent="updated",u=E(),M&&M.c(),f=U(` - .`),c=E(),d=v("div");for(let F=0;F$=!1)),T.$set(q)},i(F){if(!O){for(let R=0;RO.name===T))}function f(T){return i.findIndex($=>$===T)}function c(T,$){var O;!((O=s==null?void 0:s.schema)!=null&&O.length)||T===$||!$||t(0,s.indexes=s.indexes.map(M=>j.replaceIndexColumn(M,T,$)),s)}function d(T,$,O,M){O[M]=T,t(0,s)}const h=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function m(T){n.$$.not_equal(s.schema,T)&&(s.schema=T,t(0,s))}const _=T=>{if(!T.detail)return;const $=T.detail.target;$.style.opacity=0,setTimeout(()=>{var O;(O=$==null?void 0:$.style)==null||O.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage($,0,0)},y=()=>{ln({})},S=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,c,d,h,g,m,_,y,S,C]}class B$ extends be{constructor(e){super(),_e(this,e,z$,V$,ge,{collection:0})}}const U$=n=>({isAdminOnly:n&512}),Ed=n=>({isAdminOnly:n[9]}),W$=n=>({isAdminOnly:n&512}),Dd=n=>({isAdminOnly:n[9]}),Y$=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]});function K$(n){let e,t;return e=new me({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[G$,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function J$(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Id(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Ld(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function G$(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,c,d,h,g,m,_,y,S;const C=n[12].beforeLabel,T=Ct(C,n,n[15],Ad),$=n[12].afterLabel,O=Ct($,n,n[15],Dd);let M=!n[9]&&Id(n);function D(q){n[14](q)}var L=n[7];function N(q,B){let G={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(G.value=q[0]),{props:G}}L&&(h=Lt(L,N(n)),n[13](h),te.push(()=>he(h,"value",D)));let P=n[9]&&Ld(n);const F=n[12].default,R=Ct(F,n,n[15],Ed);return{c(){e=v("div"),t=v("label"),T&&T.c(),i=E(),s=v("span"),l=U(n[2]),o=E(),a=U(r),u=E(),O&&O.c(),f=E(),M&&M.c(),d=E(),h&&z(h.$$.fragment),m=E(),P&&P.c(),_=E(),y=v("div"),R&&R.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,B){w(q,e,B),b(e,t),T&&T.m(t,null),b(t,i),b(t,s),b(s,l),b(s,o),b(s,a),b(t,u),O&&O.m(t,null),b(t,f),M&&M.m(t,null),b(e,d),h&&H(h,e,null),b(e,m),P&&P.m(e,null),w(q,_,B),w(q,y,B),R&&R.m(y,null),S=!0},p(q,B){if(T&&T.p&&(!S||B&33280)&&Mt(T,C,q,q[15],S?$t(C,q[15],B,Y$):Ot(q[15]),Ad),(!S||B&4)&&le(l,q[2]),(!S||B&512)&&r!==(r=q[9]?"- Admins only":"")&&le(a,r),(!S||B&512)&&Q(s,"txt-hint",q[9]),O&&O.p&&(!S||B&33280)&&Mt(O,$,q,q[15],S?$t($,q[15],B,W$):Ot(q[15]),Dd),q[9]?M&&(M.d(1),M=null):M?M.p(q,B):(M=Id(q),M.c(),M.m(t,null)),(!S||B&262144&&c!==(c=q[18]))&&p(t,"for",c),B&128&&L!==(L=q[7])){if(h){re();const G=h;I(G.$$.fragment,1,0,()=>{V(G,1)}),ae()}L?(h=Lt(L,N(q)),q[13](h),te.push(()=>he(h,"value",D)),z(h.$$.fragment),A(h.$$.fragment,1),H(h,e,m)):h=null}else if(L){const G={};B&262144&&(G.id=q[18]),B&2&&(G.baseCollection=q[1]),B&512&&(G.disabled=q[9]),B&544&&(G.placeholder=q[9]?"":q[5]),!g&&B&1&&(g=!0,G.value=q[0],ve(()=>g=!1)),h.$set(G)}q[9]?P?(P.p(q,B),B&512&&A(P,1)):(P=Ld(q),P.c(),A(P,1),P.m(e,null)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),R&&R.p&&(!S||B&33280)&&Mt(R,F,q,q[15],S?$t(F,q[15],B,U$):Ot(q[15]),Ed)},i(q){S||(A(T,q),A(O,q),h&&A(h.$$.fragment,q),A(P),A(R,q),S=!0)},o(q){I(T,q),I(O,q),h&&I(h.$$.fragment,q),I(P),I(R,q),S=!1},d(q){q&&(k(e),k(_),k(y)),T&&T.d(q),O&&O.d(q),M&&M.d(),n[13](null),h&&V(h),P&&P.d(),R&&R.d(q)}}}function Z$(n){let e,t,i,s;const l=[J$,K$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}let Pd;function X$(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,h=null,g=Pd,m=!1;_();async function _(){g||m||(t(8,m=!0),t(7,g=(await ut(()=>import("./FilterAutocompleteInput-67803140.js"),["./FilterAutocompleteInput-67803140.js","./index-808c8630.js"],import.meta.url)).default),Pd=g,t(8,m=!1))}async function y(){t(0,r=h||""),await sn(),d==null||d.focus()}async function S(){h=r,t(0,r=null)}function C($){te[$?"unshift":"push"](()=>{d=$,t(6,d)})}function T($){r=$,t(0,r)}return n.$$set=$=>{"collection"in $&&t(1,o=$.collection),"rule"in $&&t(0,r=$.rule),"label"in $&&t(2,a=$.label),"formKey"in $&&t(3,u=$.formKey),"required"in $&&t(4,f=$.required),"placeholder"in $&&t(5,c=$.placeholder),"$$scope"in $&&t(15,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,g,m,i,y,S,s,C,T,l]}class $s extends be{constructor(e){super(),_e(this,e,X$,Z$,ge,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Nd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Fd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L=pe(n[2]),N=[];for(let P=0;P@request
    filter:",c=E(),d=v("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",h=E(),g=v("hr"),m=E(),_=v("p"),_.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=E(),S=v("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",C=E(),T=v("hr"),$=E(),O=v("p"),O.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,F){w(P,e,F),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R{D&&(M||(M=He(e,lt,{duration:150},!0)),M.run(1))}),D=!0)},o(P){P&&(M||(M=He(e,lt,{duration:150},!1)),M.run(0)),D=!1},d(P){P&&k(e),bt(N,P),P&&M&&M.end()}}}function Rd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&le(i,t)},d(s){s&&k(e)}}}function qd(n){let e,t,i,s,l,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[Q$,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new $s({props:c}),te.push(()=>he(e,"rule",f));function d(_){n[7](_)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new $s({props:h}),te.push(()=>he(s,"rule",d));function g(_){n[8](_)}let m={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(m.rule=n[0].deleteRule),r=new $s({props:m}),te.push(()=>he(r,"rule",g)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(_,y){H(e,_,y),w(_,i,y),H(s,_,y),w(_,o,y),H(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),y&17408&&(S.$$scope={dirty:y,ctx:_}),!t&&y&1&&(t=!0,S.rule=_[0].createRule,ve(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=_[0]),!l&&y&1&&(l=!0,C.rule=_[0].updateRule,ve(()=>l=!1)),s.$set(C);const T={};y&1&&(T.collection=_[0]),!a&&y&1&&(a=!0,T.rule=_[0].deleteRule,ve(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(s.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),V(e,_),V(s,_),V(r,_)}}}function jd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Te(Be.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function Q$(n){let e,t=!n[10]&&jd();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=jd(),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function Hd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[x$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new $s({props:l}),te.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function x$(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. +`),position:"top"}),(!f||_&8388608&&o!==(o=m[23]))&&p(e,"for",o);const y={};_&8388608&&(y.id=m[23]),!u&&_&1&&(u=!0,y.keyOfSelected=m[0].options.cascadeDelete,_e(()=>u=!1)),a.$set(y)},i(m){f||(A(a.$$.fragment,m),f=!0)},o(m){I(a.$$.fragment,m),f=!1},d(m){m&&(k(e),k(r)),V(a,m),c=!1,d()}}}function I$(n){let e,t,i,s,l,o=!n[2]&&Td(n);return s=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[A$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),o&&o.c(),t=E(),i=v("div"),z(s.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),b(e,t),b(e,i),H(s,i,null),l=!0},p(r,a){r[2]?o&&(re(),I(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&A(o,1)):(o=Td(r),o.c(),A(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&41943061&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){l||(A(o),A(s.$$.fragment,r),l=!0)},o(r){I(o),I(s.$$.fragment,r),l=!1},d(r){r&&k(e),o&&o.d(),V(s)}}}function L$(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[I$],default:[O$,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;fhe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return s=new ou({props:u}),n[20](s),s.$on("save",n[21]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,c){H(e,f,c),w(f,i,c),H(s,f,c),l=!0},p(f,[c]){const d=c&258?_t(o,[c&2&&{key:f[1]},c&256&&Dt(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],_e(()=>t=!1)),e.$set(d);const h={};s.$set(h)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),I(s.$$.fragment,f),l=!1},d(f){f&&k(i),V(e,f),n[20](null),V(s,f)}}}function P$(n,e,t){var P;let i,s;const l=["field","key"];let o=tt(e,l),r;Ge(n,Zn,F=>t(10,r=F));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,h=((P=a.options)==null?void 0:P.maxSelect)==1,g=h;function m(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,h=!0),t(9,g=h)}function _(){a.options.minSelect=yt(this.value),t(0,a),t(9,g),t(2,h)}function y(){a.options.maxSelect=yt(this.value),t(0,a),t(9,g),t(2,h)}function S(F){n.$$.not_equal(a.options.cascadeDelete,F)&&(a.options.cascadeDelete=F,t(0,a),t(9,g),t(2,h))}const C=()=>d==null?void 0:d.show();function T(F){n.$$.not_equal(a.options.collectionId,F)&&(a.options.collectionId=F,t(0,a),t(9,g),t(2,h))}function $(F){h=F,t(2,h)}function O(F){a=F,t(0,a),t(9,g),t(2,h)}function M(F){Fe.call(this,n,F)}function D(F){Fe.call(this,n,F)}function L(F){te[F?"unshift":"push"](()=>{d=F,t(3,d)})}const N=F=>{var R,q;(q=(R=F==null?void 0:F.detail)==null?void 0:R.collection)!=null&&q.id&&F.detail.collection.type!="view"&&t(0,a.options.collectionId=F.detail.collection.id,a)};return n.$$set=F=>{e=je(je({},e),xt(F)),t(8,o=tt(e,l)),"field"in F&&t(0,a=F.field),"key"in F&&t(1,u=F.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(F=>F.type!="view")),n.$$.dirty&516&&g!=h&&(t(9,g=h),h?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&m(),n.$$.dirty&1025&&t(4,s=r.find(F=>F.id==a.options.collectionId)||null)},[a,u,h,d,s,i,f,c,o,g,r,_,y,S,C,T,$,O,M,D,L,N]}class N$ extends ve{constructor(e){super(),be(this,e,P$,L$,ge,{field:0,key:1})}}const F$=n=>({dragging:n&4,dragover:n&8}),Cd=n=>({dragging:n[2],dragover:n[3]});function R$(n){let e,t,i,s,l;const o=n[10].default,r=Ct(o,n,n[9],Cd);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",Ze(n[11])),Y(e,"dragleave",Ze(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Mt(r,o,a,a[9],i?$t(o,a[9],u,F$):Ot(a[9]),Cd),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&Q(e,"dragging",a[2]),(!i||u&8)&&Q(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function q$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=dt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function h(T,$){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:$,group:a})),l("drag",T)}}function g(T,$){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const M=O.index<<0;M<$?(r.splice($+1,0,r[M]),r.splice(M,1)):(r.splice($,0,r[M]),r.splice(M+1,1)),t(6,r),l("sort",{oldIndex:M,newIndex:$,list:r})}const m=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=T=>h(T,o),C=T=>g(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,s=T.$$scope)},[o,u,c,d,h,g,r,a,f,s,i,m,_,y,S,C]}class Fl extends ve{constructor(e){super(),be(this,e,q$,R$,ge,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function $d(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function Md(n){let e,t,i,s,l,o,r,a;return{c(){e=W(`, + `),t=v("code"),t.textContent="username",i=W(` , + `),s=v("code"),s.textContent="email",l=W(` , + `),o=v("code"),o.textContent="emailVisibility",r=W(` , + `),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r),k(a))}}}function j$(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u,f){let c={key:u[4](u[17])};return u[17]!==void 0&&(c.field=u[17]),{props:c}}return r&&(e=Pt(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&z(e.$$.fragment),i=E()},m(u,f){e&&H(e,u,f),w(u,i,f),s=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}r?(e=Pt(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(r){const c={};f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],_e(()=>t=!1)),e.$set(c)}},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&I(e.$$.fragment,u),s=!1},d(u){u&&k(i),e&&V(e,u)}}}function Od(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[j$]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Fl({props:r}),te.push(()=>he(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,_e(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function H$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$,O,M=n[0].type==="auth"&&Md(),D=pe(n[0].schema);const L=F=>F[17];for(let F=0;Fhe(T,"collection",N)),{c(){e=v("div"),t=v("p"),i=W(`System fields: + `),s=v("code"),s.textContent="id",l=W(` , + `),o=v("code"),o.textContent="created",r=W(` , + `),a=v("code"),a.textContent="updated",u=E(),M&&M.c(),f=W(` + .`),c=E(),d=v("div");for(let F=0;F$=!1)),T.$set(q)},i(F){if(!O){for(let R=0;RO.name===T))}function f(T){return i.findIndex($=>$===T)}function c(T,$){var O;!((O=s==null?void 0:s.schema)!=null&&O.length)||T===$||!$||t(0,s.indexes=s.indexes.map(M=>j.replaceIndexColumn(M,T,$)),s)}function d(T,$,O,M){O[M]=T,t(0,s)}const h=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function m(T){n.$$.not_equal(s.schema,T)&&(s.schema=T,t(0,s))}const _=T=>{if(!T.detail)return;const $=T.detail.target;$.style.opacity=0,setTimeout(()=>{var O;(O=$==null?void 0:$.style)==null||O.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage($,0,0)},y=()=>{ln({})},S=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,c,d,h,g,m,_,y,S,C]}class z$ extends ve{constructor(e){super(),be(this,e,V$,H$,ge,{collection:0})}}const B$=n=>({isAdminOnly:n&512}),Ed=n=>({isAdminOnly:n[9]}),U$=n=>({isAdminOnly:n&512}),Dd=n=>({isAdminOnly:n[9]}),W$=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]});function Y$(n){let e,t;return e=new me({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[J$,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function K$(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Id(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Ld(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function J$(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,c,d,h,g,m,_,y,S;const C=n[12].beforeLabel,T=Ct(C,n,n[15],Ad),$=n[12].afterLabel,O=Ct($,n,n[15],Dd);let M=!n[9]&&Id(n);function D(q){n[14](q)}var L=n[7];function N(q,B){let G={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(G.value=q[0]),{props:G}}L&&(h=Pt(L,N(n)),n[13](h),te.push(()=>he(h,"value",D)));let P=n[9]&&Ld(n);const F=n[12].default,R=Ct(F,n,n[15],Ed);return{c(){e=v("div"),t=v("label"),T&&T.c(),i=E(),s=v("span"),l=W(n[2]),o=E(),a=W(r),u=E(),O&&O.c(),f=E(),M&&M.c(),d=E(),h&&z(h.$$.fragment),m=E(),P&&P.c(),_=E(),y=v("div"),R&&R.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,B){w(q,e,B),b(e,t),T&&T.m(t,null),b(t,i),b(t,s),b(s,l),b(s,o),b(s,a),b(t,u),O&&O.m(t,null),b(t,f),M&&M.m(t,null),b(e,d),h&&H(h,e,null),b(e,m),P&&P.m(e,null),w(q,_,B),w(q,y,B),R&&R.m(y,null),S=!0},p(q,B){if(T&&T.p&&(!S||B&33280)&&Mt(T,C,q,q[15],S?$t(C,q[15],B,W$):Ot(q[15]),Ad),(!S||B&4)&&le(l,q[2]),(!S||B&512)&&r!==(r=q[9]?"- Admins only":"")&&le(a,r),(!S||B&512)&&Q(s,"txt-hint",q[9]),O&&O.p&&(!S||B&33280)&&Mt(O,$,q,q[15],S?$t($,q[15],B,U$):Ot(q[15]),Dd),q[9]?M&&(M.d(1),M=null):M?M.p(q,B):(M=Id(q),M.c(),M.m(t,null)),(!S||B&262144&&c!==(c=q[18]))&&p(t,"for",c),B&128&&L!==(L=q[7])){if(h){re();const G=h;I(G.$$.fragment,1,0,()=>{V(G,1)}),ae()}L?(h=Pt(L,N(q)),q[13](h),te.push(()=>he(h,"value",D)),z(h.$$.fragment),A(h.$$.fragment,1),H(h,e,m)):h=null}else if(L){const G={};B&262144&&(G.id=q[18]),B&2&&(G.baseCollection=q[1]),B&512&&(G.disabled=q[9]),B&544&&(G.placeholder=q[9]?"":q[5]),!g&&B&1&&(g=!0,G.value=q[0],_e(()=>g=!1)),h.$set(G)}q[9]?P?(P.p(q,B),B&512&&A(P,1)):(P=Ld(q),P.c(),A(P,1),P.m(e,null)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),R&&R.p&&(!S||B&33280)&&Mt(R,F,q,q[15],S?$t(F,q[15],B,B$):Ot(q[15]),Ed)},i(q){S||(A(T,q),A(O,q),h&&A(h.$$.fragment,q),A(P),A(R,q),S=!0)},o(q){I(T,q),I(O,q),h&&I(h.$$.fragment,q),I(P),I(R,q),S=!1},d(q){q&&(k(e),k(_),k(y)),T&&T.d(q),O&&O.d(q),M&&M.d(),n[13](null),h&&V(h),P&&P.d(),R&&R.d(q)}}}function G$(n){let e,t,i,s;const l=[K$,Y$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}let Pd;function Z$(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,h=null,g=Pd,m=!1;_();async function _(){g||m||(t(8,m=!0),t(7,g=(await ut(()=>import("./FilterAutocompleteInput-4cde62df.js"),["./FilterAutocompleteInput-4cde62df.js","./index-808c8630.js"],import.meta.url)).default),Pd=g,t(8,m=!1))}async function y(){t(0,r=h||""),await sn(),d==null||d.focus()}async function S(){h=r,t(0,r=null)}function C($){te[$?"unshift":"push"](()=>{d=$,t(6,d)})}function T($){r=$,t(0,r)}return n.$$set=$=>{"collection"in $&&t(1,o=$.collection),"rule"in $&&t(0,r=$.rule),"label"in $&&t(2,a=$.label),"formKey"in $&&t(3,u=$.formKey),"required"in $&&t(4,f=$.required),"placeholder"in $&&t(5,c=$.placeholder),"$$scope"in $&&t(15,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,g,m,i,y,S,s,C,T,l]}class Ms extends ve{constructor(e){super(),be(this,e,Z$,G$,ge,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Nd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Fd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L=pe(n[2]),N=[];for(let P=0;P@request filter:",c=E(),d=v("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",h=E(),g=v("hr"),m=E(),_=v("p"),_.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=E(),S=v("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",C=E(),T=v("hr"),$=E(),O=v("p"),O.innerHTML=`Example rule: +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,F){w(P,e,F),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R{D&&(M||(M=He(e,lt,{duration:150},!0)),M.run(1))}),D=!0)},o(P){P&&(M||(M=He(e,lt,{duration:150},!1)),M.run(0)),D=!1},d(P){P&&k(e),vt(N,P),P&&M&&M.end()}}}function Rd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=W(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&le(i,t)},d(s){s&&k(e)}}}function qd(n){let e,t,i,s,l,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[X$,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Ms({props:c}),te.push(()=>he(e,"rule",f));function d(_){n[7](_)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new Ms({props:h}),te.push(()=>he(s,"rule",d));function g(_){n[8](_)}let m={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(m.rule=n[0].deleteRule),r=new Ms({props:m}),te.push(()=>he(r,"rule",g)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(_,y){H(e,_,y),w(_,i,y),H(s,_,y),w(_,o,y),H(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),y&17408&&(S.$$scope={dirty:y,ctx:_}),!t&&y&1&&(t=!0,S.rule=_[0].createRule,_e(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=_[0]),!l&&y&1&&(l=!0,C.rule=_[0].updateRule,_e(()=>l=!1)),s.$set(C);const T={};y&1&&(T.collection=_[0]),!a&&y&1&&(a=!0,T.rule=_[0].deleteRule,_e(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(s.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),V(e,_),V(s,_),V(r,_)}}}function jd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Te(Be.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function X$(n){let e,t=!n[10]&&jd();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=jd(),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function Hd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[Q$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ms({props:l}),te.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Q$(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the verified - state or email, etc.`,t=E(),i=v("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&(k(e),k(t),k(i))}}}function eM(n){var F,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,g,m,_,y,S,C,T,$=n[1]&&Fd(n);function O(q){n[4](q)}let M={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(M.rule=n[0].listRule),f=new $s({props:M}),te.push(()=>he(f,"rule",O));function D(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),h=new $s({props:L}),te.push(()=>he(h,"rule",D));let N=((F=n[0])==null?void 0:F.type)!=="view"&&qd(n),P=((R=n[0])==null?void 0:R.type)==="auth"&&Hd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the + state or email, etc.`,t=E(),i=v("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&(k(e),k(t),k(i))}}}function x$(n){var F,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,g,m,_,y,S,C,T,$=n[1]&&Fd(n);function O(q){n[4](q)}let M={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(M.rule=n[0].listRule),f=new Ms({props:M}),te.push(()=>he(f,"rule",O));function D(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),h=new Ms({props:L}),te.push(()=>he(h,"rule",D));let N=((F=n[0])==null?void 0:F.type)!=="view"&&qd(n),P=((R=n[0])==null?void 0:R.type)==="auth"&&Hd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators - .`,s=E(),l=v("button"),r=U(o),a=E(),$&&$.c(),u=E(),z(f.$$.fragment),d=E(),z(h.$$.fragment),m=E(),N&&N.c(),_=E(),P&&P.c(),y=ye(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,B){w(q,e,B),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),$&&$.m(e,null),w(q,u,B),H(f,q,B),w(q,d,B),H(h,q,B),w(q,m,B),N&&N.m(q,B),w(q,_,B),P&&P.m(q,B),w(q,y,B),S=!0,C||(T=Y(l,"click",n[3]),C=!0)},p(q,[B]){var J,W;(!S||B&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&le(r,o),q[1]?$?($.p(q,B),B&2&&A($,1)):($=Fd(q),$.c(),A($,1),$.m(e,null)):$&&(re(),I($,1,1,()=>{$=null}),ae());const G={};B&1&&(G.collection=q[0]),!c&&B&1&&(c=!0,G.rule=q[0].listRule,ve(()=>c=!1)),f.$set(G);const X={};B&1&&(X.collection=q[0]),!g&&B&1&&(g=!0,X.rule=q[0].viewRule,ve(()=>g=!1)),h.$set(X),((J=q[0])==null?void 0:J.type)!=="view"?N?(N.p(q,B),B&1&&A(N,1)):(N=qd(q),N.c(),A(N,1),N.m(_.parentNode,_)):N&&(re(),I(N,1,1,()=>{N=null}),ae()),((W=q[0])==null?void 0:W.type)==="auth"?P?(P.p(q,B),B&1&&A(P,1)):(P=Hd(q),P.c(),A(P,1),P.m(y.parentNode,y)):P&&(re(),I(P,1,1,()=>{P=null}),ae())},i(q){S||(A($),A(f.$$.fragment,q),A(h.$$.fragment,q),A(N),A(P),S=!0)},o(q){I($),I(f.$$.fragment,q),I(h.$$.fragment,q),I(N),I(P),S=!1},d(q){q&&(k(e),k(u),k(d),k(m),k(_),k(y)),$&&$.d(),V(f,q),V(h,q),N&&N.d(q),P&&P.d(q),C=!1,T()}}}function tM(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function c(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function d(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class nM extends be{constructor(e){super(),_e(this,e,tM,eM,ge,{collection:0})}}function Vd(n,e,t){const i=n.slice();return i[9]=e[t],i}function iM(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=Lt(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Lt(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ve(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function sM(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function zd(n){let e,t,i=pe(n[3]),s=[];for(let l=0;l
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. + .`,s=E(),l=v("button"),r=W(o),a=E(),$&&$.c(),u=E(),z(f.$$.fragment),d=E(),z(h.$$.fragment),m=E(),N&&N.c(),_=E(),P&&P.c(),y=ye(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,B){w(q,e,B),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),$&&$.m(e,null),w(q,u,B),H(f,q,B),w(q,d,B),H(h,q,B),w(q,m,B),N&&N.m(q,B),w(q,_,B),P&&P.m(q,B),w(q,y,B),S=!0,C||(T=Y(l,"click",n[3]),C=!0)},p(q,[B]){var J,U;(!S||B&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&le(r,o),q[1]?$?($.p(q,B),B&2&&A($,1)):($=Fd(q),$.c(),A($,1),$.m(e,null)):$&&(re(),I($,1,1,()=>{$=null}),ae());const G={};B&1&&(G.collection=q[0]),!c&&B&1&&(c=!0,G.rule=q[0].listRule,_e(()=>c=!1)),f.$set(G);const X={};B&1&&(X.collection=q[0]),!g&&B&1&&(g=!0,X.rule=q[0].viewRule,_e(()=>g=!1)),h.$set(X),((J=q[0])==null?void 0:J.type)!=="view"?N?(N.p(q,B),B&1&&A(N,1)):(N=qd(q),N.c(),A(N,1),N.m(_.parentNode,_)):N&&(re(),I(N,1,1,()=>{N=null}),ae()),((U=q[0])==null?void 0:U.type)==="auth"?P?(P.p(q,B),B&1&&A(P,1)):(P=Hd(q),P.c(),A(P,1),P.m(y.parentNode,y)):P&&(re(),I(P,1,1,()=>{P=null}),ae())},i(q){S||(A($),A(f.$$.fragment,q),A(h.$$.fragment,q),A(N),A(P),S=!0)},o(q){I($),I(f.$$.fragment,q),I(h.$$.fragment,q),I(N),I(P),S=!1},d(q){q&&(k(e),k(u),k(d),k(m),k(_),k(y)),$&&$.d(),V(f,q),V(h,q),N&&N.d(q),P&&P.d(q),C=!1,T()}}}function eM(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function c(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function d(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class tM extends ve{constructor(e){super(),be(this,e,eM,x$,ge,{collection:0})}}function Vd(n,e,t){const i=n.slice();return i[9]=e[t],i}function nM(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=Pt(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Pt(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,_e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function iM(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function zd(n){let e,t,i=pe(n[3]),s=[];for(let l=0;l
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,u=E(),m&&m.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),h[l].m(_,y),w(_,r,y),w(_,a,y),w(_,u,y),m&&m.m(_,y),w(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=l;l=g(_),l===S?h[l].p(_,y):(re(),I(h[S],1,1,()=>{h[S]=null}),ae(),o=h[l],o?o.p(_,y):(o=h[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?m?m.p(_,y):(m=zd(_),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&(k(e),k(s),k(r),k(a),k(u),k(f)),h[l].d(_),m&&m.d(_)}}}function oM(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[lM,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rM(n,e,t){let i;Ge(n,Mi,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var g;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const h=j.extractColumnsFromQuery((g=s==null?void 0:s.options)==null?void 0:g.query);j.removeByValue(h,"id"),j.removeByValue(h,"created"),j.removeByValue(h,"updated");for(let m in d)for(let _ in d[m]){const y=d[m][_].message,S=h[m]||m;r.push(j.sentenize(S+": "+y))}}Kt(async()=>{t(2,o=!0);try{t(1,l=(await ut(()=>import("./CodeEditor-19c882f6.js"),["./CodeEditor-19c882f6.js","./index-808c8630.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&pi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class aM extends be{constructor(e){super(),_e(this,e,rM,oM,ge,{collection:0})}}const uM=n=>({active:n&1}),Ud=n=>({active:n[0]});function Wd(n){let e,t,i;const s=n[15].default,l=Ct(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Mt(l,s,o,o[14],i?$t(s,o[14],r,null):Ot(o[14]),null)},i(o){i||(A(l,o),o&&xe(()=>{i&&(t||(t=He(e,lt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=He(e,lt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function fM(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Ct(a,n,n[14],Ud);let f=n[0]&&Wd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",Ze(n[17])),Y(t,"drop",Ze(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",Ze(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Mt(u,a,c,c[14],l?$t(a,c[14],d,uM):Ot(c[14]),Ud),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Wd(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){I(u,c),I(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,$e(r)}}}function cM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=dt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,h=!1;function g(){return!!f}function m(){S(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():m()}function S(){if(d&&o.closest(".accordions")){const N=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of N)P.click()}}Kt(()=>()=>clearTimeout(r));function C(N){Fe.call(this,n,N)}const T=()=>c&&y(),$=N=>{u&&(t(7,h=!1),S(),l("drop",N))},O=N=>u&&l("dragstart",N),M=N=>{u&&(t(7,h=!0),l("dragenter",N))},D=N=>{u&&(t(7,h=!1),l("dragleave",N))};function L(N){te[N?"unshift":"push"](()=>{o=N,t(6,o)})}return n.$$set=N=>{"class"in N&&t(1,a=N.class),"draggable"in N&&t(2,u=N.draggable),"active"in N&&t(0,f=N.active),"interactive"in N&&t(3,c=N.interactive),"single"in N&&t(9,d=N.single),"$$scope"in N&&t(14,s=N.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,y,S,o,h,l,d,g,m,_,r,s,i,C,T,$,O,M,D,L]}class co extends be{constructor(e){super(),_e(this,e,cM,fM,ge,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function dM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function pM(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[dM,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function hM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function mM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Yd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function gM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowUsernameAuth?mM:hM}let a=r(n),u=a(n),f=n[3]&&Yd();return{c(){e=v("div"),e.innerHTML=' Username/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[3]?f?d&8&&A(f,1):(f=Yd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function _M(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Kd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[bM,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[vM,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&xe(()=>{a&&(r||(r=He(e,lt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=He(e,lt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),V(i),V(o),u&&r&&r.end()}}}function bM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[7](_)}let m={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(m.value=n[0].options.exceptEmailDomains),r=new qs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(Be.call(null,s,{text:`Email domains that are NOT allowed to sign up. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!j.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ve(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function vM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[8](_)}let m={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(m.value=n[0].options.onlyEmailDomains),r=new qs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(Be.call(null,s,{text:`Email domains that are ONLY allowed to sign up. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!j.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ve(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function yM(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[_M,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Kd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Kd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){o&&(k(t),k(i)),V(e,o),l&&l.d(o)}}}function kM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Jd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function SM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?wM:kM}let a=r(n),u=a(n),f=n[2]&&Jd();return{c(){e=v("div"),e.innerHTML=' Email/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Jd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function TM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Gd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=He(e,lt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,lt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function CM(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[TM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Gd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Gd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){o&&(k(t),k(i)),V(e,o),l&&l.d(o)}}}function $M(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function MM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function OM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowOAuth2Auth?MM:$M}let a=r(n),u=a(n),f=n[1]&&Zd();return{c(){e=v("div"),e.innerHTML=' OAuth2',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&A(f,1):(f=Zd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function EM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=E(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&vt(l.value)!==u[0].options.minPasswordLength&&ce(l,u[0].options.minPasswordLength)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function DM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Always require email",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),Te(Be.call(null,r,{text:`The constraint is applied only for new records. -Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function AM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return s=new co({props:{single:!0,$$slots:{header:[gM],default:[pM]},$$scope:{ctx:n}}}),o=new co({props:{single:!0,$$slots:{header:[SM],default:[yM]},$$scope:{ctx:n}}}),a=new co({props:{single:!0,$$slots:{header:[OM],default:[CM]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[EM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[DM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",h=E(),z(g.$$.fragment),m=E(),z(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,C){w(S,e,C),w(S,t,C),w(S,i,C),H(s,i,null),b(i,l),H(o,i,null),b(i,r),H(a,i,null),w(S,u,C),w(S,f,C),w(S,c,C),w(S,d,C),w(S,h,C),H(g,S,C),w(S,m,C),H(_,S,C),y=!0},p(S,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:S}),s.$set(T);const $={};C&8197&&($.$$scope={dirty:C,ctx:S}),o.$set($);const O={};C&8195&&(O.$$scope={dirty:C,ctx:S}),a.$set(O);const M={};C&12289&&(M.$$scope={dirty:C,ctx:S}),g.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:S}),_.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),y=!0)},o(S){I(s.$$.fragment,S),I(o.$$.fragment,S),I(a.$$.fragment,S),I(g.$$.fragment,S),I(_.$$.fragment,S),y=!1},d(S){S&&(k(e),k(t),k(i),k(u),k(f),k(c),k(d),k(h),k(m)),V(s),V(o),V(a),V(g,S),V(_,S)}}}function IM(n,e,t){let i,s,l,o;Ge(n,Mi,m=>t(4,o=m));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(m){n.$$.not_equal(r.options.exceptEmailDomains,m)&&(r.options.exceptEmailDomains=m,t(0,r))}function c(m){n.$$.not_equal(r.options.onlyEmailDomains,m)&&(r.options.onlyEmailDomains=m,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=vt(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=m=>{"collection"in m&&t(0,r=m.collection)},n.$$.update=()=>{var m,_,y,S;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!j.isEmpty((m=o==null?void 0:o.options)==null?void 0:m.allowEmailAuth)||!j.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,g]}class LM extends be{constructor(e){super(),_e(this,e,IM,AM,ge,{collection:0})}}function Xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[18]=e[t],i}function xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function ep(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function tp(n){let e,t,i,s,l=n[3]&&np(n),o=!n[4]&&ip(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=np(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=ip(r),o.c(),o.m(i,null))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(),o&&o.d()}}}function np(n){var h,g;let e,t,i,s,l=((h=n[1])==null?void 0:h.name)+"",o,r,a,u,f,c=((g=n[2])==null?void 0:g.name)+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed collection - `),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,_){w(m,e,_),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(m,_){var y,S;_&2&&l!==(l=((y=m[1])==null?void 0:y.name)+"")&&le(o,l),_&4&&c!==(c=((S=m[2])==null?void 0:S.name)+"")&&le(d,c)},d(m){m&&k(e)}}}function ip(n){let e,t,i,s=pe(n[6]),l=[];for(let f=0;f
    ',i=E(),s=v("div"),l=v("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=ye(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=ep(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=tp(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(k(e),k(r),k(a)),u&&u.d(),f&&f.d(c)}}}function NM(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function FM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Cancel',t=E(),i=v("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[Y(e,"click",n[12]),Y(i,"click",n[13])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function RM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[FM],header:[NM],default:[PM]},$$scope:{ctx:n}};return e=new on({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[14](null),V(e,s)}}}function qM(n,e,t){let i,s,l,o,r,a;const u=dt();let f,c,d;async function h($,O){t(1,c=$),t(2,d=O),await sn(),i||l.length||o.length||r.length?f==null||f.show():m()}function g(){f==null||f.hide()}function m(){g(),u("confirm")}const _=()=>g(),y=()=>m();function S($){te[$?"unshift":"push"](()=>{f=$,t(5,f)})}function C($){Fe.call(this,n,$)}function T($){Fe.call(this,n,$)}return n.$$.update=()=>{var $,O,M;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=(($=d==null?void 0:d.schema)==null?void 0:$.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>{var N,P,F;const L=(N=c==null?void 0:c.schema)==null?void 0:N.find(R=>R.id==D.id);return L?((P=L.options)==null?void 0:P.maxSelect)!=1&&((F=D.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[g,c,d,i,s,f,r,o,l,a,m,h,_,y,S,C,T]}class jM extends be{constructor(e){super(),_e(this,e,qM,RM,ge,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function rp(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function HM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new B$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function VM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new aM({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ap(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new nM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ve(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function up(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new LM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Is)},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ve(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Is)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function zM(n){let e,t,i,s,l,o,r;const a=[VM,HM],u=[];function f(h,g){return h[14]?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===kl&&ap(n),d=n[15]&&up(n);return{c(){e=v("div"),t=v("div"),s.c(),l=E(),c&&c.c(),o=E(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===ji),p(e,"class","tabs-content svelte-12y0yzb")},m(h,g){w(h,e,g),b(e,t),u[i].m(t,null),b(e,l),c&&c.m(e,null),b(e,o),d&&d.m(e,null),r=!0},p(h,g){let m=i;i=f(h),i===m?u[i].p(h,g):(re(),I(u[m],1,1,()=>{u[m]=null}),ae(),s=u[i],s?s.p(h,g):(s=u[i]=a[i](h),s.c()),A(s,1),s.m(t,null)),(!r||g[0]&8)&&Q(t,"active",h[3]===ji),h[3]===kl?c?(c.p(h,g),g[0]&8&&A(c,1)):(c=ap(h),c.c(),A(c,1),c.m(e,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),h[15]?d?(d.p(h,g),g[0]&32768&&A(d,1)):(d=up(h),d.c(),A(d,1),d.m(e,null)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(h){r||(A(s),A(c),A(d),r=!0)},o(h){I(s),I(c),I(d),r=!1},d(h){h&&k(e),u[i].d(),c&&c.d(),d&&d.d()}}}function fp(n){let e,t,i,s,l,o,r;return o=new Pn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[BM]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),i=v("button"),s=v("i"),l=E(),z(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),b(i,s),b(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[1]&4194304&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){I(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),V(o)}}}function BM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=' Duplicate',t=E(),i=v("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[26]),Y(i,"click",Sn(Ze(n[27])))],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function cp(n){let e,t,i,s;return i=new Pn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[UM]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=E(),z(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&(k(e),k(t)),V(i,l)}}}function dp(n){let e,t,i,s,l,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=v("button"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" collection"),u=E(),p(t,"class",i=ii(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[49]==n[2].type)},m(h,g){w(h,e,g),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=Y(e,"click",d),f=!0)},p(h,g){n=h,g[0]&64&&i!==(i=ii(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),g[0]&64&&o!==(o=n[50]+"")&&le(r,o),g[0]&68&&Q(e,"selected",n[49]==n[2].type)},d(h){h&&k(e),f=!1,c()}}}function UM(n){let e,t=pe(Object.entries(n[6])),i=[];for(let s=0;s{P=null}),ae()):P?(P.p(R,q),q[0]&4&&A(P,1)):(P=cp(R),P.c(),A(P,1),P.m(d,null)),(!D||q[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",T),(!D||q[0]&4&&$!==($=!!R[2].id))&&(d.disabled=$),R[2].system?F||(F=pp(),F.c(),F.m(M.parentNode,M)):F&&(F.d(1),F=null)},i(R){D||(A(P),D=!0)},o(R){I(P),D=!1},d(R){R&&(k(e),k(s),k(l),k(f),k(c),k(O),k(M)),P&&P.d(),F&&F.d(R),L=!1,N()}}}function hp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Te(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&Et(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{s&&(i||(i=He(e,Qt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=He(e,Qt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function mp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function gp(n){var a,u,f;let e,t,i,s=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&_p();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=E(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Is)},m(c,d){w(c,e,d),b(e,t),b(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[33]),l=!0)},p(c,d){var h,g,m;d[0]&32&&(s=!j.isEmpty((h=c[5])==null?void 0:h.options)&&!((m=(g=c[5])==null?void 0:g.options)!=null&&m.manageRule)),s?r?d[0]&32&&A(r,1):(r=_p(),r.c(),A(r,1),r.m(e,null)):r&&(re(),I(r,1,1,()=>{r=null}),ae()),d[0]&8&&Q(e,"active",c[3]===Is)},d(c){c&&k(e),r&&r.d(),l=!1,o()}}}function _p(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function YM(n){var B,G,X,J,W,oe,ee;let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,u,f,c,d,h,g=n[14]?"Query":"Fields",m,_,y=!j.isEmpty(n[11]),S,C,T,$,O=!j.isEmpty((B=n[5])==null?void 0:B.listRule)||!j.isEmpty((G=n[5])==null?void 0:G.viewRule)||!j.isEmpty((X=n[5])==null?void 0:X.createRule)||!j.isEmpty((J=n[5])==null?void 0:J.updateRule)||!j.isEmpty((W=n[5])==null?void 0:W.deleteRule)||!j.isEmpty((ee=(oe=n[5])==null?void 0:oe.options)==null?void 0:ee.manageRule),M,D,L,N,P=!!n[2].id&&!n[2].system&&fp(n);r=new me({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[WM,({uniqueId:se})=>({48:se}),({uniqueId:se})=>[0,se?131072:0]]},$$scope:{ctx:n}}});let F=y&&hp(n),R=O&&mp(),q=n[15]&&gp(n);return{c(){e=v("h4"),i=U(t),s=E(),P&&P.c(),l=E(),o=v("form"),z(r.$$.fragment),a=E(),u=v("input"),f=E(),c=v("div"),d=v("button"),h=v("span"),m=U(g),_=E(),F&&F.c(),S=E(),C=v("button"),T=v("span"),T.textContent="API Rules",$=E(),R&&R.c(),M=E(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[3]===ji),p(T,"class","txt"),p(C,"type","button"),p(C,"class","tab-item"),Q(C,"active",n[3]===kl),p(c,"class","tabs-header stretched")},m(se,Ee){w(se,e,Ee),b(e,i),w(se,s,Ee),P&&P.m(se,Ee),w(se,l,Ee),w(se,o,Ee),H(r,o,null),b(o,a),b(o,u),w(se,f,Ee),w(se,c,Ee),b(c,d),b(d,h),b(h,m),b(d,_),F&&F.m(d,null),b(c,S),b(c,C),b(C,T),b(C,$),R&&R.m(C,null),b(c,M),q&&q.m(c,null),D=!0,L||(N=[Y(o,"submit",Ze(n[30])),Y(d,"click",n[31]),Y(C,"click",n[32])],L=!0)},p(se,Ee){var Ve,We,ke,Me,Je,ct,Se;(!D||Ee[0]&4)&&t!==(t=se[2].id?"Edit collection":"New collection")&&le(i,t),se[2].id&&!se[2].system?P?(P.p(se,Ee),Ee[0]&4&&A(P,1)):(P=fp(se),P.c(),A(P,1),P.m(l.parentNode,l)):P&&(re(),I(P,1,1,()=>{P=null}),ae());const Re={};Ee[0]&8192&&(Re.class="form-field collection-field-name required m-b-0 "+(se[13]?"disabled":"")),Ee[0]&41028|Ee[1]&4325376&&(Re.$$scope={dirty:Ee,ctx:se}),r.$set(Re),(!D||Ee[0]&16384)&&g!==(g=se[14]?"Query":"Fields")&&le(m,g),Ee[0]&2048&&(y=!j.isEmpty(se[11])),y?F?(F.p(se,Ee),Ee[0]&2048&&A(F,1)):(F=hp(se),F.c(),A(F,1),F.m(d,null)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),(!D||Ee[0]&8)&&Q(d,"active",se[3]===ji),Ee[0]&32&&(O=!j.isEmpty((Ve=se[5])==null?void 0:Ve.listRule)||!j.isEmpty((We=se[5])==null?void 0:We.viewRule)||!j.isEmpty((ke=se[5])==null?void 0:ke.createRule)||!j.isEmpty((Me=se[5])==null?void 0:Me.updateRule)||!j.isEmpty((Je=se[5])==null?void 0:Je.deleteRule)||!j.isEmpty((Se=(ct=se[5])==null?void 0:ct.options)==null?void 0:Se.manageRule)),O?R?Ee[0]&32&&A(R,1):(R=mp(),R.c(),A(R,1),R.m(C,null)):R&&(re(),I(R,1,1,()=>{R=null}),ae()),(!D||Ee[0]&8)&&Q(C,"active",se[3]===kl),se[15]?q?q.p(se,Ee):(q=gp(se),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(se){D||(A(P),A(r.$$.fragment,se),A(F),A(R),D=!0)},o(se){I(P),I(r.$$.fragment,se),I(F),I(R),D=!1},d(se){se&&(k(e),k(s),k(l),k(o),k(f),k(c)),P&&P.d(se),V(r),F&&F.d(),R&&R.d(),q&&q.d(),L=!1,$e(N)}}}function KM(n){let e,t,i,s,l,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=[Y(e,"click",n[24]),Y(s,"click",n[25])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function JM(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[KM],header:[YM],default:[zM]},$$scope:{ctx:n}};e=new on({props:l}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new jM({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[39](null),V(e,r),n[42](null),V(i,r)}}}const ji="schema",kl="api_rules",Is="options",GM="base",bp="auth",vp="view";function Fr(n){return JSON.stringify(n)}function ZM(n,e,t){let i,s,l,o,r,a;Ge(n,Mi,ne=>t(5,a=ne));const u={};u[GM]="Base",u[vp]="View",u[bp]="Auth";const f=dt();let c,d,h=null,g=j.initCollection(),m=!1,_=!1,y=ji,S=Fr(g),C="";function T(ne){t(3,y=ne)}function $(ne){return M(ne),t(10,_=!0),T(ji),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}async function M(ne){ln({}),typeof ne<"u"?(t(22,h=ne),t(2,g=structuredClone(ne))):(t(22,h=null),t(2,g=j.initCollection())),t(2,g.schema=g.schema||[],g),t(2,g.originalName=g.name||"",g),await sn(),t(23,S=Fr(g))}function D(){g.id?d==null||d.show(h,g):L()}function L(){if(m)return;t(9,m=!0);const ne=N();let qe;g.id?qe=de.collections.update(g.id,ne):qe=de.collections.create(ne),qe.then(Ce=>{Ia(),xy(Ce),t(10,_=!1),O(),zt(g.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!g.id,collection:Ce})}).catch(Ce=>{de.error(Ce)}).finally(()=>{t(9,m=!1)})}function N(){const ne=Object.assign({},g);ne.schema=ne.schema.slice(0);for(let qe=ne.schema.length-1;qe>=0;qe--)ne.schema[qe].toDelete&&ne.schema.splice(qe,1);return ne}function P(){h!=null&&h.id&&_n(`Do you really want to delete collection "${h.name}" and all its records?`,()=>de.collections.delete(h.id).then(()=>{O(),zt(`Successfully deleted collection "${h.name}".`),f("delete",h),ek(h)}).catch(ne=>{de.error(ne)}))}function F(ne){t(2,g.type=ne,g),pi("schema")}function R(){o?_n("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ne=h?structuredClone(h):null;if(ne){if(ne.id="",ne.created="",ne.updated="",ne.name+="_duplicate",!j.isEmpty(ne.schema))for(const qe of ne.schema)qe.id="";if(!j.isEmpty(ne.indexes))for(let qe=0;qeO(),G=()=>D(),X=()=>R(),J=()=>P(),W=ne=>{t(2,g.name=j.slugify(ne.target.value),g),ne.target.value=g.name},oe=ne=>F(ne),ee=()=>{r&&D()},se=()=>T(ji),Ee=()=>T(kl),Re=()=>T(Is);function Ve(ne){g=ne,t(2,g),t(22,h)}function We(ne){g=ne,t(2,g),t(22,h)}function ke(ne){g=ne,t(2,g),t(22,h)}function Me(ne){g=ne,t(2,g),t(22,h)}const Je=()=>o&&_?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),O()}),!1):!0;function ct(ne){te[ne?"unshift":"push"](()=>{c=ne,t(7,c)})}function Se(ne){Fe.call(this,n,ne)}function we(ne){Fe.call(this,n,ne)}function Ue(ne){te[ne?"unshift":"push"](()=>{d=ne,t(8,d)})}const it=()=>L();return n.$$.update=()=>{var ne,qe;n.$$.dirty[0]&4&&g.type==="view"&&(t(2,g.createRule=null,g),t(2,g.updateRule=null,g),t(2,g.deleteRule=null,g),t(2,g.indexes=[],g)),n.$$.dirty[0]&4194308&&g.name&&(h==null?void 0:h.name)!=g.name&&g.indexes.length>0&&t(2,g.indexes=(ne=g.indexes)==null?void 0:ne.map(Ce=>j.replaceIndexTableName(Ce,g.name)),g),n.$$.dirty[0]&4&&t(15,i=g.type===bp),n.$$.dirty[0]&4&&t(14,s=g.type===vp),n.$$.dirty[0]&32&&(a.schema||(qe=a.options)!=null&&qe.query?t(11,C=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,C="")),n.$$.dirty[0]&4&&t(13,l=!!g.id&&g.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Fr(g)),n.$$.dirty[0]&20&&t(12,r=!g.id||o),n.$$.dirty[0]&12&&y===Is&&g.type!=="auth"&&T(ji)},[T,O,g,y,o,a,u,c,d,m,_,C,r,l,s,i,D,L,P,F,R,$,h,S,B,G,X,J,W,oe,ee,se,Ee,Re,Ve,We,ke,Me,Je,ct,Se,we,Ue,it]}class ou extends be{constructor(e){super(),_e(this,e,ZM,JM,ge,{changeTab:0,show:21,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function XM(n){let e;return{c(){e=v("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-6yuceu")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function QM(n){let e;return{c(){e=v("i"),p(e,"class","ri-unpin-line svelte-6yuceu")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xM(n){let e,t,i,s,l,o=n[0].name+"",r,a,u,f,c,d,h,g;function m(S,C){return S[1]?QM:XM}let _=m(n),y=_(n);return{c(){var S;e=v("a"),t=v("i"),s=E(),l=v("span"),r=U(o),a=E(),u=v("span"),y.c(),p(t,"class",i=ii(j.getCollectionTypeIcon(n[0].type))+" svelte-6yuceu"),p(l,"class","txt m-r-auto"),p(u,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-6yuceu"),p(u,"aria-label","Pin collection"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-6yuceu"),p(e,"title",d=n[0].name),Q(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,C){w(S,e,C),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),y.m(u,null),h||(g=[Te(f=Be.call(null,u,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),Y(u,"click",Sn(Ze(n[5]))),Te(dn.call(null,e))],h=!0)},p(S,[C]){var T;C&1&&i!==(i=ii(j.getCollectionTypeIcon(S[0].type))+" svelte-6yuceu")&&p(t,"class",i),C&1&&o!==(o=S[0].name+"")&&le(r,o),_!==(_=m(S))&&(y.d(1),y=_(S),y&&(y.c(),y.m(u,null))),f&&Et(f.update)&&C&2&&f.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),C&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),C&1&&d!==(d=S[0].name)&&p(e,"title",d),C&5&&Q(e,"active",((T=S[2])==null?void 0:T.id)===S[0].id)},i:x,o:x,d(S){S&&k(e),y.d(),h=!1,$e(g)}}}function e5(n,e,t){let i,s;Ge(n,hi,u=>t(2,s=u));let{collection:l}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?j.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(l);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(l.id))},[l,i,s,r,o,a]}class V1 extends be{constructor(e){super(),_e(this,e,e5,xM,ge,{collection:0,pinnedIds:4})}}function yp(n,e,t){const i=n.slice();return i[29]=e[t],i}function kp(n,e,t){const i=n.slice();return i[29]=e[t],i}function wp(n){let e,t,i=[],s=new Map,l,o,r=pe(n[9]);const a=u=>u[29].id;for(let u=0;uhe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&512&&(f.collection=e[29]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function Tp(n){let e,t=[],i=new Map,s,l,o=n[9].length&&Cp(),r=pe(n[8]);const a=u=>u[29].id;for(let u=0;uhe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[29]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function Mp(n){let e;return{c(){e=v("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Op(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",n[19]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function t5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O=n[9].length&&wp(n),M=n[8].length&&Tp(n),D=n[5].length&&!n[4].length&&Mp(),L=!n[12]&&Op(n);_=new oT({}),_.$on("dragstart",n[21]),_.$on("dragging",n[22]),_.$on("dragstop",n[23]);let N={};return S=new ou({props:N}),n[24](S),S.$on("save",n[25]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='',o=E(),r=v("input"),a=E(),u=v("hr"),f=E(),c=v("div"),O&&O.c(),d=E(),M&&M.c(),h=E(),D&&D.c(),g=E(),L&&L.c(),m=E(),z(_.$$.fragment),y=E(),z(S.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[10]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(r,"name","collections-search"),p(i,"class","form-field search"),Q(i,"active",n[10]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),Q(c,"fade",n[11]),Q(c,"sidebar-content-compact",n[4].length>20),p(e,"class","page-sidebar collection-sidebar")},m(P,F){w(P,e,F),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),ce(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c),O&&O.m(c,null),b(c,d),M&&M.m(c,null),b(c,h),D&&D.m(c,null),b(e,g),L&&L.m(e,null),n[20](e),w(P,m,F),H(_,P,F),w(P,y,F),H(S,P,F),C=!0,T||($=[Y(l,"click",n[15]),Y(r,"input",n[16])],T=!0)},p(P,F){(!C||F[0]&1024)&&Q(l,"hidden",!P[10]),F[0]&1&&r.value!==P[0]&&ce(r,P[0]),(!C||F[0]&1024)&&Q(i,"active",P[10]),P[9].length?O?(O.p(P,F),F[0]&512&&A(O,1)):(O=wp(P),O.c(),A(O,1),O.m(c,d)):O&&(re(),I(O,1,1,()=>{O=null}),ae()),P[8].length?M?(M.p(P,F),F[0]&256&&A(M,1)):(M=Tp(P),M.c(),A(M,1),M.m(c,h)):M&&(re(),I(M,1,1,()=>{M=null}),ae()),P[5].length&&!P[4].length?D||(D=Mp(),D.c(),D.m(c,null)):D&&(D.d(1),D=null),(!C||F[0]&2048)&&Q(c,"fade",P[11]),(!C||F[0]&16)&&Q(c,"sidebar-content-compact",P[4].length>20),P[12]?L&&(L.d(1),L=null):L?L.p(P,F):(L=Op(P),L.c(),L.m(e,null));const R={};S.$set(R)},i(P){C||(A(O),A(M),A(_.$$.fragment,P),A(S.$$.fragment,P),C=!0)},o(P){I(O),I(M),I(_.$$.fragment,P),I(S.$$.fragment,P),C=!1},d(P){P&&(k(e),k(m),k(y)),O&&O.d(),M&&M.d(),D&&D.d(),L&&L.d(),n[20](null),V(_,P),n[24](null),V(S,P),T=!1,$e($)}}}const Ep="@pinnedCollections";function n5(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function i5(n,e,t){let i,s,l,o,r,a,u,f,c;Ge(n,Zn,G=>t(14,a=G)),Ge(n,hi,G=>t(26,u=G)),Ge(n,ko,G=>t(11,f=G)),Ge(n,Os,G=>t(12,c=G));let d,h="",g=[],m,_,y=localStorage.getItem("adminSidebarWidth")||null;C();function S(G){an(hi,u=G,u)}function C(){t(1,g=[]);try{const G=localStorage.getItem(Ep);G&&t(1,g=JSON.parse(G)||[])}catch{}}function T(){t(1,g=g.filter(G=>!!a.find(X=>X.id==G)))}const $=()=>t(0,h="");function O(){h=this.value,t(0,h)}function M(G){g=G,t(1,g)}function D(G){g=G,t(1,g)}const L=()=>d==null?void 0:d.show();function N(G){te[G?"unshift":"push"](()=>{m=G,t(2,m),t(3,y)})}const P=()=>{t(7,_=m.offsetWidth)},F=G=>{t(3,y=_+G.detail.diffX+"px")},R=()=>{j.triggerResize()};function q(G){te[G?"unshift":"push"](()=>{d=G,t(6,d)})}const B=G=>{var X;(X=G.detail)!=null&&X.isNew&&G.detail.collection&&S(G.detail.collection)};return n.$$.update=()=>{n.$$.dirty[0]&12&&y&&m&&(t(2,m.style.width=y,m),localStorage.setItem("adminSidebarWidth",y)),n.$$.dirty[0]&16384&&a&&(T(),n5()),n.$$.dirty[0]&1&&t(5,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(10,s=h!==""),n.$$.dirty[0]&2&&g&&localStorage.setItem(Ep,JSON.stringify(g)),n.$$.dirty[0]&16417&&t(4,l=a.filter(G=>G.id==h||G.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty[0]&18&&t(9,o=l.filter(G=>g.includes(G.id))),n.$$.dirty[0]&18&&t(8,r=l.filter(G=>!g.includes(G.id)))},[h,g,m,y,l,i,d,_,r,o,s,f,c,S,a,$,O,M,D,L,N,P,F,R,q,B]}class s5 extends be{constructor(e){super(),_e(this,e,i5,t5,ge,{},null,[-1,-1])}}function Dp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Ap(n){n[18]=n[19].default}function Ip(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Lp(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Pp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Lp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),s=E(),l=v("button"),r=U(o),a=E(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(h,g){w(h,t,g),c&&c.m(h,g),w(h,s,g),w(h,l,g),b(l,r),b(l,a),u||(f=Y(l,"click",d),u=!0)},p(h,g){e=h,g&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Lp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),g&8&&o!==(o=e[15].label+"")&&le(r,o),g&40&&Q(l,"active",e[5]===e[14])},d(h){h&&(k(t),k(s),k(l)),c&&c.d(h),u=!1,f()}}}function Np(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:r5,then:o5,catch:l5,value:19,blocks:[,,,]};return pu(t=n[15].component,s),{c(){e=ye(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&pu(t,s)||w0(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];I(r)}i=!1},d(l){l&&k(e),s.block.d(l),s.token=null,s=null}}}function l5(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function o5(n){Ap(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){z(e.$$.fragment),t=E()},m(s,l){H(e,s,l),w(s,t,l),i=!0},p(s,l){Ap(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){s&&k(t),V(e,s)}}}function r5(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function Fp(n,e){let t,i,s,l=e[5]===e[14]&&Np(e);return{key:n,first:null,c(){t=ye(),l&&l.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=Np(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(l),s=!0)},o(o){I(l),s=!1},d(o){o&&(k(t),k(i)),l&&l.d(o)}}}function a5(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=m=>m[14];for(let m=0;mm[14];for(let m=0;mClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function f5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[u5],default:[a5]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function c5(n,e,t){const i={list:{label:"List/Search",component:ut(()=>import("./ListApiDocs-be91ffbc.js"),["./ListApiDocs-be91ffbc.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:ut(()=>import("./ViewApiDocs-07cf54b1.js"),["./ViewApiDocs-07cf54b1.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js"],import.meta.url)},create:{label:"Create",component:ut(()=>import("./CreateApiDocs-21fe1a54.js"),["./CreateApiDocs-21fe1a54.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js"],import.meta.url)},update:{label:"Update",component:ut(()=>import("./UpdateApiDocs-4ef0014c.js"),["./UpdateApiDocs-4ef0014c.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js"],import.meta.url)},delete:{label:"Delete",component:ut(()=>import("./DeleteApiDocs-3b1ae28b.js"),["./DeleteApiDocs-3b1ae28b.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:ut(()=>import("./RealtimeApiDocs-12687e5c.js"),["./RealtimeApiDocs-12687e5c.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:ut(()=>import("./AuthWithPasswordDocs-1f709a24.js"),["./AuthWithPasswordDocs-1f709a24.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:ut(()=>import("./AuthWithOAuth2Docs-10f54027.js"),["./AuthWithOAuth2Docs-10f54027.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js"],import.meta.url)},refresh:{label:"Auth refresh",component:ut(()=>import("./AuthRefreshDocs-b60a2fd5.js"),["./AuthRefreshDocs-b60a2fd5.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js"],import.meta.url)},"request-verification":{label:"Request verification",component:ut(()=>import("./RequestVerificationDocs-260f7b66.js"),["./RequestVerificationDocs-260f7b66.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:ut(()=>import("./ConfirmVerificationDocs-67060e24.js"),["./ConfirmVerificationDocs-67060e24.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:ut(()=>import("./RequestPasswordResetDocs-8e1c8ea3.js"),["./RequestPasswordResetDocs-8e1c8ea3.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:ut(()=>import("./ConfirmPasswordResetDocs-86e54f25.js"),["./ConfirmPasswordResetDocs-86e54f25.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:ut(()=>import("./RequestEmailChangeDocs-b6e056f4.js"),["./RequestEmailChangeDocs-b6e056f4.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:ut(()=>import("./ConfirmEmailChangeDocs-19103f76.js"),["./ConfirmEmailChangeDocs-19103f76.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:ut(()=>import("./AuthMethodsDocs-17fb0bc2.js"),["./AuthMethodsDocs-17fb0bc2.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:ut(()=>import("./ListExternalAuthsDocs-3af7454a.js"),["./ListExternalAuthsDocs-3af7454a.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-72392a2a.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:ut(()=>import("./UnlinkExternalAuthDocs-33be0955.js"),["./UnlinkExternalAuthDocs-33be0955.js","./SdkTabs-065ad731.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>f(),h=y=>c(y);function g(y){te[y?"unshift":"push"](()=>{l=y,t(4,l)})}function m(y){Fe.call(this,n,y)}function _(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,h,g,m,_]}class d5 extends be{constructor(e){super(),_e(this,e,c5,f5,ge,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function p5(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(l,o){w(l,e,o),i||(s=Te(t=Be.call(null,e,{text:n[0].join(` + MAX(balance) as maxBalance).`,u=E(),m&&m.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),h[l].m(_,y),w(_,r,y),w(_,a,y),w(_,u,y),m&&m.m(_,y),w(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=l;l=g(_),l===S?h[l].p(_,y):(re(),I(h[S],1,1,()=>{h[S]=null}),ae(),o=h[l],o?o.p(_,y):(o=h[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?m?m.p(_,y):(m=zd(_),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&(k(e),k(s),k(r),k(a),k(u),k(f)),h[l].d(_),m&&m.d(_)}}}function lM(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[sM,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function oM(n,e,t){let i;Ge(n,Mi,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var g;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const h=j.extractColumnsFromQuery((g=s==null?void 0:s.options)==null?void 0:g.query);j.removeByValue(h,"id"),j.removeByValue(h,"created"),j.removeByValue(h,"updated");for(let m in d)for(let _ in d[m]){const y=d[m][_].message,S=h[m]||m;r.push(j.sentenize(S+": "+y))}}Kt(async()=>{t(2,o=!0);try{t(1,l=(await ut(()=>import("./CodeEditor-4c129c80.js"),["./CodeEditor-4c129c80.js","./index-808c8630.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&pi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class rM extends ve{constructor(e){super(),be(this,e,oM,lM,ge,{collection:0})}}const aM=n=>({active:n&1}),Ud=n=>({active:n[0]});function Wd(n){let e,t,i;const s=n[15].default,l=Ct(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Mt(l,s,o,o[14],i?$t(s,o[14],r,null):Ot(o[14]),null)},i(o){i||(A(l,o),o&&xe(()=>{i&&(t||(t=He(e,lt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=He(e,lt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function uM(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Ct(a,n,n[14],Ud);let f=n[0]&&Wd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",Ze(n[17])),Y(t,"drop",Ze(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",Ze(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Mt(u,a,c,c[14],l?$t(a,c[14],d,aM):Ot(c[14]),Ud),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Wd(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){I(u,c),I(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,$e(r)}}}function fM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=dt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,h=!1;function g(){return!!f}function m(){S(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():m()}function S(){if(d&&o.closest(".accordions")){const N=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of N)P.click()}}Kt(()=>()=>clearTimeout(r));function C(N){Fe.call(this,n,N)}const T=()=>c&&y(),$=N=>{u&&(t(7,h=!1),S(),l("drop",N))},O=N=>u&&l("dragstart",N),M=N=>{u&&(t(7,h=!0),l("dragenter",N))},D=N=>{u&&(t(7,h=!1),l("dragleave",N))};function L(N){te[N?"unshift":"push"](()=>{o=N,t(6,o)})}return n.$$set=N=>{"class"in N&&t(1,a=N.class),"draggable"in N&&t(2,u=N.draggable),"active"in N&&t(0,f=N.active),"interactive"in N&&t(3,c=N.interactive),"single"in N&&t(9,d=N.single),"$$scope"in N&&t(14,s=N.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,y,S,o,h,l,d,g,m,_,r,s,i,C,T,$,O,M,D,L]}class po extends ve{constructor(e){super(),be(this,e,fM,uM,ge,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function cM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function dM(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[cM,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function pM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Yd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function mM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowUsernameAuth?hM:pM}let a=r(n),u=a(n),f=n[3]&&Yd();return{c(){e=v("div"),e.innerHTML=' Username/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[3]?f?d&8&&A(f,1):(f=Yd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function gM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Kd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[_M,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[bM,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&xe(()=>{a&&(r||(r=He(e,lt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=He(e,lt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),V(i),V(o),u&&r&&r.end()}}}function _M(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[7](_)}let m={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(m.value=n[0].options.exceptEmailDomains),r=new js({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(Be.call(null,s,{text:`Email domains that are NOT allowed to sign up. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!j.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,_e(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function bM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[8](_)}let m={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(m.value=n[0].options.onlyEmailDomains),r=new js({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(Be.call(null,s,{text:`Email domains that are ONLY allowed to sign up. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!j.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,_e(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function vM(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[gM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Kd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Kd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){o&&(k(t),k(i)),V(e,o),l&&l.d(o)}}}function yM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Jd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function wM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?kM:yM}let a=r(n),u=a(n),f=n[2]&&Jd();return{c(){e=v("div"),e.innerHTML=' Email/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Jd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function SM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Gd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=He(e,lt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,lt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function TM(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[SM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Gd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Gd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){o&&(k(t),k(i)),V(e,o),l&&l.d(o)}}}function CM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $M(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function MM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowOAuth2Auth?$M:CM}let a=r(n),u=a(n),f=n[1]&&Zd();return{c(){e=v("div"),e.innerHTML=' OAuth2',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&A(f,1):(f=Zd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function OM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Minimum password length"),s=E(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.minPasswordLength&&de(l,u[0].options.minPasswordLength)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function EM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Always require email",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),Te(Be.call(null,r,{text:`The constraint is applied only for new records. +Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function DM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return s=new po({props:{single:!0,$$slots:{header:[mM],default:[dM]},$$scope:{ctx:n}}}),o=new po({props:{single:!0,$$slots:{header:[wM],default:[vM]},$$scope:{ctx:n}}}),a=new po({props:{single:!0,$$slots:{header:[MM],default:[TM]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[OM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[EM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",h=E(),z(g.$$.fragment),m=E(),z(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,C){w(S,e,C),w(S,t,C),w(S,i,C),H(s,i,null),b(i,l),H(o,i,null),b(i,r),H(a,i,null),w(S,u,C),w(S,f,C),w(S,c,C),w(S,d,C),w(S,h,C),H(g,S,C),w(S,m,C),H(_,S,C),y=!0},p(S,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:S}),s.$set(T);const $={};C&8197&&($.$$scope={dirty:C,ctx:S}),o.$set($);const O={};C&8195&&(O.$$scope={dirty:C,ctx:S}),a.$set(O);const M={};C&12289&&(M.$$scope={dirty:C,ctx:S}),g.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:S}),_.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),y=!0)},o(S){I(s.$$.fragment,S),I(o.$$.fragment,S),I(a.$$.fragment,S),I(g.$$.fragment,S),I(_.$$.fragment,S),y=!1},d(S){S&&(k(e),k(t),k(i),k(u),k(f),k(c),k(d),k(h),k(m)),V(s),V(o),V(a),V(g,S),V(_,S)}}}function AM(n,e,t){let i,s,l,o;Ge(n,Mi,m=>t(4,o=m));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(m){n.$$.not_equal(r.options.exceptEmailDomains,m)&&(r.options.exceptEmailDomains=m,t(0,r))}function c(m){n.$$.not_equal(r.options.onlyEmailDomains,m)&&(r.options.onlyEmailDomains=m,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=yt(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=m=>{"collection"in m&&t(0,r=m.collection)},n.$$.update=()=>{var m,_,y,S;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!j.isEmpty((m=o==null?void 0:o.options)==null?void 0:m.allowEmailAuth)||!j.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,g]}class IM extends ve{constructor(e){super(),be(this,e,AM,DM,ge,{collection:0})}}function Xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[18]=e[t],i}function xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function ep(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function tp(n){let e,t,i,s,l=n[3]&&np(n),o=!n[4]&&ip(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=np(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=ip(r),o.c(),o.m(i,null))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(),o&&o.d()}}}function np(n){var h,g;let e,t,i,s,l=((h=n[1])==null?void 0:h.name)+"",o,r,a,u,f,c=((g=n[2])==null?void 0:g.name)+"",d;return{c(){e=v("li"),t=v("div"),i=W(`Renamed collection + `),s=v("strong"),o=W(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=W(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,_){w(m,e,_),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(m,_){var y,S;_&2&&l!==(l=((y=m[1])==null?void 0:y.name)+"")&&le(o,l),_&4&&c!==(c=((S=m[2])==null?void 0:S.name)+"")&&le(d,c)},d(m){m&&k(e)}}}function ip(n){let e,t,i,s=pe(n[6]),l=[];for(let f=0;f
    ',i=E(),s=v("div"),l=v("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=ye(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=ep(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=tp(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(k(e),k(r),k(a)),u&&u.d(),f&&f.d(c)}}}function PM(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function NM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Cancel',t=E(),i=v("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[Y(e,"click",n[12]),Y(i,"click",n[13])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function FM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[NM],header:[PM],default:[LM]},$$scope:{ctx:n}};return e=new on({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[14](null),V(e,s)}}}function RM(n,e,t){let i,s,l,o,r,a;const u=dt();let f,c,d;async function h($,O){t(1,c=$),t(2,d=O),await sn(),i||l.length||o.length||r.length?f==null||f.show():m()}function g(){f==null||f.hide()}function m(){g(),u("confirm")}const _=()=>g(),y=()=>m();function S($){te[$?"unshift":"push"](()=>{f=$,t(5,f)})}function C($){Fe.call(this,n,$)}function T($){Fe.call(this,n,$)}return n.$$.update=()=>{var $,O,M;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=(($=d==null?void 0:d.schema)==null?void 0:$.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>{var N,P,F;const L=(N=c==null?void 0:c.schema)==null?void 0:N.find(R=>R.id==D.id);return L?((P=L.options)==null?void 0:P.maxSelect)!=1&&((F=D.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[g,c,d,i,s,f,r,o,l,a,m,h,_,y,S,C,T]}class qM extends ve{constructor(e){super(),be(this,e,RM,FM,ge,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function rp(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function jM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new z$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function HM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new rM({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ap(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new tM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],_e(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function up(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new IM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Ls)},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],_e(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Ls)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function VM(n){let e,t,i,s,l,o,r;const a=[HM,jM],u=[];function f(h,g){return h[14]?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===wl&&ap(n),d=n[15]&&up(n);return{c(){e=v("div"),t=v("div"),s.c(),l=E(),c&&c.c(),o=E(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===ji),p(e,"class","tabs-content svelte-12y0yzb")},m(h,g){w(h,e,g),b(e,t),u[i].m(t,null),b(e,l),c&&c.m(e,null),b(e,o),d&&d.m(e,null),r=!0},p(h,g){let m=i;i=f(h),i===m?u[i].p(h,g):(re(),I(u[m],1,1,()=>{u[m]=null}),ae(),s=u[i],s?s.p(h,g):(s=u[i]=a[i](h),s.c()),A(s,1),s.m(t,null)),(!r||g[0]&8)&&Q(t,"active",h[3]===ji),h[3]===wl?c?(c.p(h,g),g[0]&8&&A(c,1)):(c=ap(h),c.c(),A(c,1),c.m(e,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),h[15]?d?(d.p(h,g),g[0]&32768&&A(d,1)):(d=up(h),d.c(),A(d,1),d.m(e,null)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(h){r||(A(s),A(c),A(d),r=!0)},o(h){I(s),I(c),I(d),r=!1},d(h){h&&k(e),u[i].d(),c&&c.d(),d&&d.d()}}}function fp(n){let e,t,i,s,l,o,r;return o=new Pn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[zM]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),i=v("button"),s=v("i"),l=E(),z(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),b(i,s),b(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[1]&4194304&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){I(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),V(o)}}}function zM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=' Duplicate',t=E(),i=v("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[26]),Y(i,"click",Sn(Ze(n[27])))],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function cp(n){let e,t,i,s;return i=new Pn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[BM]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=E(),z(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&(k(e),k(t)),V(i,l)}}}function dp(n){let e,t,i,s,l,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=v("button"),t=v("i"),s=E(),l=v("span"),r=W(o),a=W(" collection"),u=E(),p(t,"class",i=ii(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[49]==n[2].type)},m(h,g){w(h,e,g),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=Y(e,"click",d),f=!0)},p(h,g){n=h,g[0]&64&&i!==(i=ii(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),g[0]&64&&o!==(o=n[50]+"")&&le(r,o),g[0]&68&&Q(e,"selected",n[49]==n[2].type)},d(h){h&&k(e),f=!1,c()}}}function BM(n){let e,t=pe(Object.entries(n[6])),i=[];for(let s=0;s{P=null}),ae()):P?(P.p(R,q),q[0]&4&&A(P,1)):(P=cp(R),P.c(),A(P,1),P.m(d,null)),(!D||q[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",T),(!D||q[0]&4&&$!==($=!!R[2].id))&&(d.disabled=$),R[2].system?F||(F=pp(),F.c(),F.m(M.parentNode,M)):F&&(F.d(1),F=null)},i(R){D||(A(P),D=!0)},o(R){I(P),D=!1},d(R){R&&(k(e),k(s),k(l),k(f),k(c),k(O),k(M)),P&&P.d(),F&&F.d(R),L=!1,N()}}}function hp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Te(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&Et(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{s&&(i||(i=He(e,Qt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=He(e,Qt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function mp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function gp(n){var a,u,f;let e,t,i,s=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&_p();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=E(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Ls)},m(c,d){w(c,e,d),b(e,t),b(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[33]),l=!0)},p(c,d){var h,g,m;d[0]&32&&(s=!j.isEmpty((h=c[5])==null?void 0:h.options)&&!((m=(g=c[5])==null?void 0:g.options)!=null&&m.manageRule)),s?r?d[0]&32&&A(r,1):(r=_p(),r.c(),A(r,1),r.m(e,null)):r&&(re(),I(r,1,1,()=>{r=null}),ae()),d[0]&8&&Q(e,"active",c[3]===Ls)},d(c){c&&k(e),r&&r.d(),l=!1,o()}}}function _p(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function WM(n){var B,G,X,J,U,oe,ee;let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,u,f,c,d,h,g=n[14]?"Query":"Fields",m,_,y=!j.isEmpty(n[11]),S,C,T,$,O=!j.isEmpty((B=n[5])==null?void 0:B.listRule)||!j.isEmpty((G=n[5])==null?void 0:G.viewRule)||!j.isEmpty((X=n[5])==null?void 0:X.createRule)||!j.isEmpty((J=n[5])==null?void 0:J.updateRule)||!j.isEmpty((U=n[5])==null?void 0:U.deleteRule)||!j.isEmpty((ee=(oe=n[5])==null?void 0:oe.options)==null?void 0:ee.manageRule),M,D,L,N,P=!!n[2].id&&!n[2].system&&fp(n);r=new me({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[UM,({uniqueId:se})=>({48:se}),({uniqueId:se})=>[0,se?131072:0]]},$$scope:{ctx:n}}});let F=y&&hp(n),R=O&&mp(),q=n[15]&&gp(n);return{c(){e=v("h4"),i=W(t),s=E(),P&&P.c(),l=E(),o=v("form"),z(r.$$.fragment),a=E(),u=v("input"),f=E(),c=v("div"),d=v("button"),h=v("span"),m=W(g),_=E(),F&&F.c(),S=E(),C=v("button"),T=v("span"),T.textContent="API Rules",$=E(),R&&R.c(),M=E(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[3]===ji),p(T,"class","txt"),p(C,"type","button"),p(C,"class","tab-item"),Q(C,"active",n[3]===wl),p(c,"class","tabs-header stretched")},m(se,Ee){w(se,e,Ee),b(e,i),w(se,s,Ee),P&&P.m(se,Ee),w(se,l,Ee),w(se,o,Ee),H(r,o,null),b(o,a),b(o,u),w(se,f,Ee),w(se,c,Ee),b(c,d),b(d,h),b(h,m),b(d,_),F&&F.m(d,null),b(c,S),b(c,C),b(C,T),b(C,$),R&&R.m(C,null),b(c,M),q&&q.m(c,null),D=!0,L||(N=[Y(o,"submit",Ze(n[30])),Y(d,"click",n[31]),Y(C,"click",n[32])],L=!0)},p(se,Ee){var Ve,We,ke,Me,Je,ct,Se;(!D||Ee[0]&4)&&t!==(t=se[2].id?"Edit collection":"New collection")&&le(i,t),se[2].id&&!se[2].system?P?(P.p(se,Ee),Ee[0]&4&&A(P,1)):(P=fp(se),P.c(),A(P,1),P.m(l.parentNode,l)):P&&(re(),I(P,1,1,()=>{P=null}),ae());const Re={};Ee[0]&8192&&(Re.class="form-field collection-field-name required m-b-0 "+(se[13]?"disabled":"")),Ee[0]&41028|Ee[1]&4325376&&(Re.$$scope={dirty:Ee,ctx:se}),r.$set(Re),(!D||Ee[0]&16384)&&g!==(g=se[14]?"Query":"Fields")&&le(m,g),Ee[0]&2048&&(y=!j.isEmpty(se[11])),y?F?(F.p(se,Ee),Ee[0]&2048&&A(F,1)):(F=hp(se),F.c(),A(F,1),F.m(d,null)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),(!D||Ee[0]&8)&&Q(d,"active",se[3]===ji),Ee[0]&32&&(O=!j.isEmpty((Ve=se[5])==null?void 0:Ve.listRule)||!j.isEmpty((We=se[5])==null?void 0:We.viewRule)||!j.isEmpty((ke=se[5])==null?void 0:ke.createRule)||!j.isEmpty((Me=se[5])==null?void 0:Me.updateRule)||!j.isEmpty((Je=se[5])==null?void 0:Je.deleteRule)||!j.isEmpty((Se=(ct=se[5])==null?void 0:ct.options)==null?void 0:Se.manageRule)),O?R?Ee[0]&32&&A(R,1):(R=mp(),R.c(),A(R,1),R.m(C,null)):R&&(re(),I(R,1,1,()=>{R=null}),ae()),(!D||Ee[0]&8)&&Q(C,"active",se[3]===wl),se[15]?q?q.p(se,Ee):(q=gp(se),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(se){D||(A(P),A(r.$$.fragment,se),A(F),A(R),D=!0)},o(se){I(P),I(r.$$.fragment,se),I(F),I(R),D=!1},d(se){se&&(k(e),k(s),k(l),k(o),k(f),k(c)),P&&P.d(se),V(r),F&&F.d(),R&&R.d(),q&&q.d(),L=!1,$e(N)}}}function YM(n){let e,t,i,s,l,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=W(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=[Y(e,"click",n[24]),Y(s,"click",n[25])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function KM(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[YM],header:[WM],default:[VM]},$$scope:{ctx:n}};e=new on({props:l}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new qM({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[39](null),V(e,r),n[42](null),V(i,r)}}}const ji="schema",wl="api_rules",Ls="options",JM="base",bp="auth",vp="view";function Rr(n){return JSON.stringify(n)}function GM(n,e,t){let i,s,l,o,r,a;Ge(n,Mi,ne=>t(5,a=ne));const u={};u[JM]="Base",u[vp]="View",u[bp]="Auth";const f=dt();let c,d,h=null,g=j.initCollection(),m=!1,_=!1,y=ji,S=Rr(g),C="";function T(ne){t(3,y=ne)}function $(ne){return M(ne),t(10,_=!0),T(ji),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}async function M(ne){ln({}),typeof ne<"u"?(t(22,h=ne),t(2,g=structuredClone(ne))):(t(22,h=null),t(2,g=j.initCollection())),t(2,g.schema=g.schema||[],g),t(2,g.originalName=g.name||"",g),await sn(),t(23,S=Rr(g))}function D(){g.id?d==null||d.show(h,g):L()}function L(){if(m)return;t(9,m=!0);const ne=N();let qe;g.id?qe=ce.collections.update(g.id,ne):qe=ce.collections.create(ne),qe.then(Ce=>{Ia(),Qy(Ce),t(10,_=!1),O(),zt(g.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!g.id,collection:Ce})}).catch(Ce=>{ce.error(Ce)}).finally(()=>{t(9,m=!1)})}function N(){const ne=Object.assign({},g);ne.schema=ne.schema.slice(0);for(let qe=ne.schema.length-1;qe>=0;qe--)ne.schema[qe].toDelete&&ne.schema.splice(qe,1);return ne}function P(){h!=null&&h.id&&_n(`Do you really want to delete collection "${h.name}" and all its records?`,()=>ce.collections.delete(h.id).then(()=>{O(),zt(`Successfully deleted collection "${h.name}".`),f("delete",h),xy(h)}).catch(ne=>{ce.error(ne)}))}function F(ne){t(2,g.type=ne,g),pi("schema")}function R(){o?_n("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ne=h?structuredClone(h):null;if(ne){if(ne.id="",ne.created="",ne.updated="",ne.name+="_duplicate",!j.isEmpty(ne.schema))for(const qe of ne.schema)qe.id="";if(!j.isEmpty(ne.indexes))for(let qe=0;qeO(),G=()=>D(),X=()=>R(),J=()=>P(),U=ne=>{t(2,g.name=j.slugify(ne.target.value),g),ne.target.value=g.name},oe=ne=>F(ne),ee=()=>{r&&D()},se=()=>T(ji),Ee=()=>T(wl),Re=()=>T(Ls);function Ve(ne){g=ne,t(2,g),t(22,h)}function We(ne){g=ne,t(2,g),t(22,h)}function ke(ne){g=ne,t(2,g),t(22,h)}function Me(ne){g=ne,t(2,g),t(22,h)}const Je=()=>o&&_?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),O()}),!1):!0;function ct(ne){te[ne?"unshift":"push"](()=>{c=ne,t(7,c)})}function Se(ne){Fe.call(this,n,ne)}function we(ne){Fe.call(this,n,ne)}function Ue(ne){te[ne?"unshift":"push"](()=>{d=ne,t(8,d)})}const it=()=>L();return n.$$.update=()=>{var ne,qe;n.$$.dirty[0]&4&&g.type==="view"&&(t(2,g.createRule=null,g),t(2,g.updateRule=null,g),t(2,g.deleteRule=null,g),t(2,g.indexes=[],g)),n.$$.dirty[0]&4194308&&g.name&&(h==null?void 0:h.name)!=g.name&&g.indexes.length>0&&t(2,g.indexes=(ne=g.indexes)==null?void 0:ne.map(Ce=>j.replaceIndexTableName(Ce,g.name)),g),n.$$.dirty[0]&4&&t(15,i=g.type===bp),n.$$.dirty[0]&4&&t(14,s=g.type===vp),n.$$.dirty[0]&32&&(a.schema||(qe=a.options)!=null&&qe.query?t(11,C=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,C="")),n.$$.dirty[0]&4&&t(13,l=!!g.id&&g.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Rr(g)),n.$$.dirty[0]&20&&t(12,r=!g.id||o),n.$$.dirty[0]&12&&y===Ls&&g.type!=="auth"&&T(ji)},[T,O,g,y,o,a,u,c,d,m,_,C,r,l,s,i,D,L,P,F,R,$,h,S,B,G,X,J,U,oe,ee,se,Ee,Re,Ve,We,ke,Me,Je,ct,Se,we,Ue,it]}class ou extends ve{constructor(e){super(),be(this,e,GM,KM,ge,{changeTab:0,show:21,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function ZM(n){let e;return{c(){e=v("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-6yuceu")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function XM(n){let e;return{c(){e=v("i"),p(e,"class","ri-unpin-line svelte-6yuceu")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function QM(n){let e,t,i,s,l,o=n[0].name+"",r,a,u,f,c,d,h,g;function m(S,C){return S[1]?XM:ZM}let _=m(n),y=_(n);return{c(){var S;e=v("a"),t=v("i"),s=E(),l=v("span"),r=W(o),a=E(),u=v("span"),y.c(),p(t,"class",i=ii(j.getCollectionTypeIcon(n[0].type))+" svelte-6yuceu"),p(l,"class","txt m-r-auto"),p(u,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-6yuceu"),p(u,"aria-label","Pin collection"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-6yuceu"),p(e,"title",d=n[0].name),Q(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,C){w(S,e,C),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),y.m(u,null),h||(g=[Te(f=Be.call(null,u,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),Y(u,"click",Sn(Ze(n[5]))),Te(dn.call(null,e))],h=!0)},p(S,[C]){var T;C&1&&i!==(i=ii(j.getCollectionTypeIcon(S[0].type))+" svelte-6yuceu")&&p(t,"class",i),C&1&&o!==(o=S[0].name+"")&&le(r,o),_!==(_=m(S))&&(y.d(1),y=_(S),y&&(y.c(),y.m(u,null))),f&&Et(f.update)&&C&2&&f.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),C&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),C&1&&d!==(d=S[0].name)&&p(e,"title",d),C&5&&Q(e,"active",((T=S[2])==null?void 0:T.id)===S[0].id)},i:x,o:x,d(S){S&&k(e),y.d(),h=!1,$e(g)}}}function xM(n,e,t){let i,s;Ge(n,hi,u=>t(2,s=u));let{collection:l}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?j.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(l);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(l.id))},[l,i,s,r,o,a]}class H1 extends ve{constructor(e){super(),be(this,e,xM,QM,ge,{collection:0,pinnedIds:4})}}function yp(n,e,t){const i=n.slice();return i[29]=e[t],i}function kp(n,e,t){const i=n.slice();return i[29]=e[t],i}function wp(n){let e,t,i=[],s=new Map,l,o,r=pe(n[9]);const a=u=>u[29].id;for(let u=0;uhe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&512&&(f.collection=e[29]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],_e(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function Tp(n){let e,t=[],i=new Map,s,l,o=n[9].length&&Cp(),r=pe(n[8]);const a=u=>u[29].id;for(let u=0;uhe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[29]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],_e(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function Mp(n){let e;return{c(){e=v("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Op(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",n[19]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function e6(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O=n[9].length&&wp(n),M=n[8].length&&Tp(n),D=n[5].length&&!n[4].length&&Mp(),L=!n[12]&&Op(n);_=new lT({}),_.$on("dragstart",n[21]),_.$on("dragging",n[22]),_.$on("dragstop",n[23]);let N={};return S=new ou({props:N}),n[24](S),S.$on("save",n[25]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='',o=E(),r=v("input"),a=E(),u=v("hr"),f=E(),c=v("div"),O&&O.c(),d=E(),M&&M.c(),h=E(),D&&D.c(),g=E(),L&&L.c(),m=E(),z(_.$$.fragment),y=E(),z(S.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[10]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(r,"name","collections-search"),p(i,"class","form-field search"),Q(i,"active",n[10]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),Q(c,"fade",n[11]),Q(c,"sidebar-content-compact",n[4].length>20),p(e,"class","page-sidebar collection-sidebar")},m(P,F){w(P,e,F),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),de(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c),O&&O.m(c,null),b(c,d),M&&M.m(c,null),b(c,h),D&&D.m(c,null),b(e,g),L&&L.m(e,null),n[20](e),w(P,m,F),H(_,P,F),w(P,y,F),H(S,P,F),C=!0,T||($=[Y(l,"click",n[15]),Y(r,"input",n[16])],T=!0)},p(P,F){(!C||F[0]&1024)&&Q(l,"hidden",!P[10]),F[0]&1&&r.value!==P[0]&&de(r,P[0]),(!C||F[0]&1024)&&Q(i,"active",P[10]),P[9].length?O?(O.p(P,F),F[0]&512&&A(O,1)):(O=wp(P),O.c(),A(O,1),O.m(c,d)):O&&(re(),I(O,1,1,()=>{O=null}),ae()),P[8].length?M?(M.p(P,F),F[0]&256&&A(M,1)):(M=Tp(P),M.c(),A(M,1),M.m(c,h)):M&&(re(),I(M,1,1,()=>{M=null}),ae()),P[5].length&&!P[4].length?D||(D=Mp(),D.c(),D.m(c,null)):D&&(D.d(1),D=null),(!C||F[0]&2048)&&Q(c,"fade",P[11]),(!C||F[0]&16)&&Q(c,"sidebar-content-compact",P[4].length>20),P[12]?L&&(L.d(1),L=null):L?L.p(P,F):(L=Op(P),L.c(),L.m(e,null));const R={};S.$set(R)},i(P){C||(A(O),A(M),A(_.$$.fragment,P),A(S.$$.fragment,P),C=!0)},o(P){I(O),I(M),I(_.$$.fragment,P),I(S.$$.fragment,P),C=!1},d(P){P&&(k(e),k(m),k(y)),O&&O.d(),M&&M.d(),D&&D.d(),L&&L.d(),n[20](null),V(_,P),n[24](null),V(S,P),T=!1,$e($)}}}const Ep="@pinnedCollections";function t6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function n6(n,e,t){let i,s,l,o,r,a,u,f,c;Ge(n,Zn,G=>t(14,a=G)),Ge(n,hi,G=>t(26,u=G)),Ge(n,wo,G=>t(11,f=G)),Ge(n,Es,G=>t(12,c=G));let d,h="",g=[],m,_,y=localStorage.getItem("adminSidebarWidth")||null;C();function S(G){an(hi,u=G,u)}function C(){t(1,g=[]);try{const G=localStorage.getItem(Ep);G&&t(1,g=JSON.parse(G)||[])}catch{}}function T(){t(1,g=g.filter(G=>!!a.find(X=>X.id==G)))}const $=()=>t(0,h="");function O(){h=this.value,t(0,h)}function M(G){g=G,t(1,g)}function D(G){g=G,t(1,g)}const L=()=>d==null?void 0:d.show();function N(G){te[G?"unshift":"push"](()=>{m=G,t(2,m),t(3,y)})}const P=()=>{t(7,_=m.offsetWidth)},F=G=>{t(3,y=_+G.detail.diffX+"px")},R=()=>{j.triggerResize()};function q(G){te[G?"unshift":"push"](()=>{d=G,t(6,d)})}const B=G=>{var X;(X=G.detail)!=null&&X.isNew&&G.detail.collection&&S(G.detail.collection)};return n.$$.update=()=>{n.$$.dirty[0]&12&&y&&m&&(t(2,m.style.width=y,m),localStorage.setItem("adminSidebarWidth",y)),n.$$.dirty[0]&16384&&a&&(T(),t6()),n.$$.dirty[0]&1&&t(5,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(10,s=h!==""),n.$$.dirty[0]&2&&g&&localStorage.setItem(Ep,JSON.stringify(g)),n.$$.dirty[0]&16417&&t(4,l=a.filter(G=>G.id==h||G.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty[0]&18&&t(9,o=l.filter(G=>g.includes(G.id))),n.$$.dirty[0]&18&&t(8,r=l.filter(G=>!g.includes(G.id)))},[h,g,m,y,l,i,d,_,r,o,s,f,c,S,a,$,O,M,D,L,N,P,F,R,q,B]}class i6 extends ve{constructor(e){super(),be(this,e,n6,e6,ge,{},null,[-1,-1])}}function Dp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Ap(n){n[18]=n[19].default}function Ip(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Lp(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Pp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Lp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),s=E(),l=v("button"),r=W(o),a=E(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(h,g){w(h,t,g),c&&c.m(h,g),w(h,s,g),w(h,l,g),b(l,r),b(l,a),u||(f=Y(l,"click",d),u=!0)},p(h,g){e=h,g&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Lp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),g&8&&o!==(o=e[15].label+"")&&le(r,o),g&40&&Q(l,"active",e[5]===e[14])},d(h){h&&(k(t),k(s),k(l)),c&&c.d(h),u=!1,f()}}}function Np(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:o6,then:l6,catch:s6,value:19,blocks:[,,,]};return pu(t=n[15].component,s),{c(){e=ye(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&pu(t,s)||k0(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];I(r)}i=!1},d(l){l&&k(e),s.block.d(l),s.token=null,s=null}}}function s6(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function l6(n){Ap(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){z(e.$$.fragment),t=E()},m(s,l){H(e,s,l),w(s,t,l),i=!0},p(s,l){Ap(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){s&&k(t),V(e,s)}}}function o6(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function Fp(n,e){let t,i,s,l=e[5]===e[14]&&Np(e);return{key:n,first:null,c(){t=ye(),l&&l.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=Np(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(l),s=!0)},o(o){I(l),s=!1},d(o){o&&(k(t),k(i)),l&&l.d(o)}}}function r6(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=m=>m[14];for(let m=0;mm[14];for(let m=0;mClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function u6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[a6],default:[r6]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function f6(n,e,t){const i={list:{label:"List/Search",component:ut(()=>import("./ListApiDocs-361e5923.js"),["./ListApiDocs-361e5923.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:ut(()=>import("./ViewApiDocs-dbbbc92f.js"),["./ViewApiDocs-dbbbc92f.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js"],import.meta.url)},create:{label:"Create",component:ut(()=>import("./CreateApiDocs-60d7d195.js"),["./CreateApiDocs-60d7d195.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js"],import.meta.url)},update:{label:"Update",component:ut(()=>import("./UpdateApiDocs-8b967d6d.js"),["./UpdateApiDocs-8b967d6d.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js"],import.meta.url)},delete:{label:"Delete",component:ut(()=>import("./DeleteApiDocs-6483c004.js"),["./DeleteApiDocs-6483c004.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:ut(()=>import("./RealtimeApiDocs-a6768892.js"),["./RealtimeApiDocs-a6768892.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:ut(()=>import("./AuthWithPasswordDocs-4cae5a40.js"),["./AuthWithPasswordDocs-4cae5a40.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:ut(()=>import("./AuthWithOAuth2Docs-0ed62345.js"),["./AuthWithOAuth2Docs-0ed62345.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js"],import.meta.url)},refresh:{label:"Auth refresh",component:ut(()=>import("./AuthRefreshDocs-bf429c31.js"),["./AuthRefreshDocs-bf429c31.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js"],import.meta.url)},"request-verification":{label:"Request verification",component:ut(()=>import("./RequestVerificationDocs-1001dd67.js"),["./RequestVerificationDocs-1001dd67.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:ut(()=>import("./ConfirmVerificationDocs-6f5834ff.js"),["./ConfirmVerificationDocs-6f5834ff.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:ut(()=>import("./RequestPasswordResetDocs-6dc15257.js"),["./RequestPasswordResetDocs-6dc15257.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:ut(()=>import("./ConfirmPasswordResetDocs-1b30e67d.js"),["./ConfirmPasswordResetDocs-1b30e67d.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:ut(()=>import("./RequestEmailChangeDocs-b6287ca5.js"),["./RequestEmailChangeDocs-b6287ca5.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:ut(()=>import("./ConfirmEmailChangeDocs-036e7a03.js"),["./ConfirmEmailChangeDocs-036e7a03.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:ut(()=>import("./AuthMethodsDocs-ab7833e1.js"),["./AuthMethodsDocs-ab7833e1.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:ut(()=>import("./ListExternalAuthsDocs-c1cb832e.js"),["./ListExternalAuthsDocs-c1cb832e.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-fb32761b.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:ut(()=>import("./UnlinkExternalAuthDocs-49b32d70.js"),["./UnlinkExternalAuthDocs-49b32d70.js","./SdkTabs-f8951db6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>f(),h=y=>c(y);function g(y){te[y?"unshift":"push"](()=>{l=y,t(4,l)})}function m(y){Fe.call(this,n,y)}function _(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,h,g,m,_]}class c6 extends ve{constructor(e){super(),be(this,e,f6,u6,ge,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function d6(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(l,o){w(l,e,o),i||(s=Te(t=Be.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(l,[o]){t&&Et(t.update)&&o&1&&t.update.call(null,{text:l[0].join(` -`),position:"left"})},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}const Rp="yyyy-MM-dd HH:mm:ss.SSS";function h5(n,e,t){let{model:i}=e,s=[];function l(){t(0,s=[]),i.created&&s.push("Created: "+j.formatToLocalDate(i.created,Rp)+" Local"),i.updated&&s.push("Updated: "+j.formatToLocalDate(i.updated,Rp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&l()},[s,i]}class z1 extends be{constructor(e){super(),_e(this,e,h5,p5,ge,{model:1})}}function m5(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),s||(l=[Te(i=Be.call(null,e,n[2]?"":"Copy")),Y(e,"click",Sn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Et(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function g5(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Kt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class js extends be{constructor(e){super(),_e(this,e,g5,m5,ge,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function _5(n){let e,t,i,s,l,o,r,a,u,f;return l=new js({props:{value:n[1]}}),{c(){e=v("div"),t=v("span"),i=U(n[1]),s=E(),z(l.$$.fragment),o=E(),r=v("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),b(e,t),b(t,i),n[6](t),b(e,s),H(l,e,null),b(e,o),b(e,r),a=!0,u||(f=[Te(Be.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&le(i,c[1]);const h={};d&2&&(h.value=c[1]),l.$set(h)},i(c){a||(A(l.$$.fragment,c),a=!0)},o(c){I(l.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),V(l),u=!1,$e(f)}}}function b5(n){let e,t,i,s,l,o,r,a,u,f;function c(h){n[7](h)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[_5]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),s=new Pn({props:d}),te.push(()=>he(s,"active",c)),s.$on("show",n[4]),{c(){e=v("button"),t=v("i"),i=E(),z(s.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(h,g){w(h,e,g),b(e,t),b(e,i),H(s,e,null),a=!0,u||(f=Te(r=Be.call(null,e,n[3]?"":"Generate")),u=!0)},p(h,[g]){const m={};g&518&&(m.$$scope={dirty:g,ctx:h}),!l&&g&8&&(l=!0,m.active=h[3],ve(()=>l=!1)),s.$set(m),(!a||g&1&&o!==(o="btn btn-circle "+h[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Et(r.update)&&g&8&&r.update.call(null,h[3]?"":"Generate")},i(h){a||(A(s.$$.fragment,h),a=!0)},o(h){I(s.$$.fragment,h),a=!1},d(h){h&&k(e),V(s),u=!1,f()}}}function v5(n,e,t){const i=dt();let{class:s="btn-sm btn-hint btn-transparent"}=e,{length:l=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(l)),i("generate",o),await sn(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,s=d.class),"length"in d&&t(5,l=d.length)},[s,o,r,a,u,l,f,c]}class B1 extends be{constructor(e){super(),_e(this,e,v5,b5,ge,{class:0,length:5})}}function y5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Username",o=E(),r=v("input"),p(t,"class",j.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(h,g){w(h,e,g),b(e,t),b(e,i),b(e,s),w(h,o,g),w(h,r,g),ce(r,n[0].username),c||(d=Y(r,"input",n[5]),c=!0)},p(h,g){g&8192&&l!==(l=h[13])&&p(e,"for",l),g&4&&a!==(a=!h[2])&&p(r,"requried",a),g&4&&u!==(u=h[2]?"Leave empty to auto generate...":h[4])&&p(r,"placeholder",u),g&8192&&f!==(f=h[13])&&p(r,"id",f),g&1&&r.value!==h[0].username&&ce(r,h[0].username)},d(h){h&&(k(e),k(o),k(r)),c=!1,d()}}}function k5(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,h,g,m,_,y,S,C;return{c(){var T;e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("div"),a=v("button"),u=v("span"),f=U("Public: "),d=U(c),g=E(),m=v("input"),p(t,"class",j.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",h="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(m,"type","email"),m.autofocus=n[2],p(m,"autocomplete","off"),p(m,"id",_=n[13]),m.required=y=(T=n[1].options)==null?void 0:T.requireEmail,p(m,"class","svelte-1751a4d")},m(T,$){w(T,e,$),b(e,t),b(e,i),b(e,s),w(T,o,$),w(T,r,$),b(r,a),b(a,u),b(u,f),b(u,d),w(T,g,$),w(T,m,$),ce(m,n[0].email),n[2]&&m.focus(),S||(C=[Te(Be.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",Ze(n[6])),Y(m,"input",n[7])],S=!0)},p(T,$){var O;$&8192&&l!==(l=T[13])&&p(e,"for",l),$&1&&c!==(c=T[0].emailVisibility?"On":"Off")&&le(d,c),$&1&&h!==(h="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",h),$&4&&(m.autofocus=T[2]),$&8192&&_!==(_=T[13])&&p(m,"id",_),$&2&&y!==(y=(O=T[1].options)==null?void 0:O.requireEmail)&&(m.required=y),$&1&&m.value!==T[0].email&&ce(m,T[0].email)},d(T){T&&(k(e),k(o),k(r),k(g),k(m)),S=!1,$e(C)}}}function qp(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[w5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&24584&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function w5(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function jp(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[S5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[T5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c&24577&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!u||c&8)&&Q(t,"p-t-xs",f[3])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function S5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new B1({props:{length:15}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),ce(r,n[0].password),w(m,u,_),w(m,f,_),H(c,f,null),d=!0,h||(g=Y(r,"input",n[9]),h=!0)},p(m,_){(!d||_&8192&&l!==(l=m[13]))&&p(e,"for",l),(!d||_&8192&&a!==(a=m[13]))&&p(r,"id",a),_&1&&r.value!==m[0].password&&ce(r,m[0].password)},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){I(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),V(c),h=!1,g()}}}function T5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ce(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[10]),u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&ce(r,c[0].passwordConfirm)},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function C5(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"change",n[11]),Y(e,"change",Ze(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function $5(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new me({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[y5,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[k5,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let g=!n[2]&&qp(n),m=(n[2]||n[3])&&jp(n);return d=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[C5,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),g&&g.c(),u=E(),m&&m.c(),f=E(),c=v("div"),z(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),g&&g.m(a,null),b(a,u),m&&m.m(a,null),b(e,f),b(e,c),H(d,c,null),h=!0},p(y,[S]){var O;const C={};S&4&&(C.class="form-field "+(y[2]?"":"required")),S&24581&&(C.$$scope={dirty:S,ctx:y}),i.$set(C);const T={};S&2&&(T.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&(T.$$scope={dirty:S,ctx:y}),o.$set(T),y[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(y,S),S&4&&A(g,1)):(g=qp(y),g.c(),A(g,1),g.m(a,u)),y[2]||y[3]?m?(m.p(y,S),S&12&&A(m,1)):(m=jp(y),m.c(),A(m,1),m.m(a,null)):m&&(re(),I(m,1,1,()=>{m=null}),ae());const $={};S&24581&&($.$$scope={dirty:S,ctx:y}),d.$set($)},i(y){h||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(g),A(m),A(d.$$.fragment,y),h=!0)},o(y){I(i.$$.fragment,y),I(o.$$.fragment,y),I(g),I(m),I(d.$$.fragment,y),h=!1},d(y){y&&k(e),V(i),V(o),g&&g.d(),m&&m.d(),V(d)}}}function M5(n,e,t){let{record:i}=e,{collection:s}=e,{isNew:l=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const u=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function f(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function h(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function g(){i.verified=this.checked,t(0,i),t(3,r)}const m=_=>{l||_n("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!_.target.checked,i)})};return n.$$set=_=>{"record"in _&&t(0,i=_.record),"collection"in _&&t(1,s=_.collection),"isNew"in _&&t(2,l=_.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),pi("password"),pi("passwordConfirm")))},[i,s,l,r,o,a,u,f,c,d,h,g,m]}class O5 extends be{constructor(e){super(),_e(this,e,M5,$5,ge,{record:0,collection:1,isNew:2})}}function E5(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)&&!(h!=null&&h.isComposing)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Kt(()=>(u(),()=>clearTimeout(a)));function c(h){te[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(3,s=tt(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class A5 extends be{constructor(e){super(),_e(this,e,D5,E5,ge,{value:0,maxHeight:4})}}function I5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(m){n[2](m)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new A5({props:g}),te.push(()=>he(f,"value",h)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),z(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),H(f,m,_),d=!0},p(m,_){(!d||_&2&&i!==(i=j.getFieldTypeIcon(m[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=m[1].name+"")&&le(r,o),(!d||_&8&&a!==(a=m[3]))&&p(e,"for",a);const y={};_&8&&(y.id=m[3]),_&2&&(y.required=m[1].required),!c&&_&1&&(c=!0,y.value=m[0],ve(()=>c=!1)),f.$set(y)},i(m){d||(A(f.$$.fragment,m),d=!0)},o(m){I(f.$$.fragment,m),d=!1},d(m){m&&(k(e),k(u)),V(f,m)}}}function L5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[I5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function P5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class N5 extends be{constructor(e){super(),_e(this,e,P5,L5,ge,{field:1,value:0})}}function F5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_;return{c(){var y,S;e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",g=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),w(y,f,S),ce(f,n[0]),m||(_=Y(f,"input",n[2]),m=!0)},p(y,S){var C,T;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&le(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&h!==(h=(C=y[1].options)==null?void 0:C.min)&&p(f,"min",h),S&2&&g!==(g=(T=y[1].options)==null?void 0:T.max)&&p(f,"max",g),S&1&&vt(f.value)!==y[0]&&ce(f,y[0])},d(y){y&&(k(e),k(u),k(f)),m=!1,_()}}}function R5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[F5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function q5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=vt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class j5 extends be{constructor(e){super(),_e(this,e,q5,R5,ge,{field:1,value:0})}}function H5(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=E(),s=v("label"),o=U(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),b(s,o),a||(u=Y(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&le(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&(k(e),k(i),k(s)),a=!1,u()}}}function V5(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[H5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function z5(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class B5 extends be{constructor(e){super(),_e(this,e,z5,V5,ge,{field:1,value:0})}}function U5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),w(m,f,_),ce(f,n[0]),h||(g=Y(f,"input",n[2]),h=!0)},p(m,_){_&2&&i!==(i=j.getFieldTypeIcon(m[1].type))&&p(t,"class",i),_&2&&o!==(o=m[1].name+"")&&le(r,o),_&8&&a!==(a=m[3])&&p(e,"for",a),_&8&&c!==(c=m[3])&&p(f,"id",c),_&2&&d!==(d=m[1].required)&&(f.required=d),_&1&&f.value!==m[0]&&ce(f,m[0])},d(m){m&&(k(e),k(u),k(f)),h=!1,g()}}}function W5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[U5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Y5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class K5 extends be{constructor(e){super(),_e(this,e,Y5,W5,ge,{field:1,value:0})}}function J5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),w(m,f,_),ce(f,n[0]),h||(g=Y(f,"input",n[2]),h=!0)},p(m,_){_&2&&i!==(i=j.getFieldTypeIcon(m[1].type))&&p(t,"class",i),_&2&&o!==(o=m[1].name+"")&&le(r,o),_&8&&a!==(a=m[3])&&p(e,"for",a),_&8&&c!==(c=m[3])&&p(f,"id",c),_&2&&d!==(d=m[1].required)&&(f.required=d),_&1&&f.value!==m[0]&&ce(f,m[0])},d(m){m&&(k(e),k(u),k(f)),h=!1,g()}}}function G5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[J5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Z5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class X5 extends be{constructor(e){super(),_e(this,e,Z5,G5,ge,{field:1,value:0})}}function Hp(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),b(e,t),i||(s=[Te(Be.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:x,d(l){l&&k(e),i=!1,$e(s)}}}function Q5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_=n[0]&&!n[1].required&&Hp(n);function y(T){n[6](T)}function S(T){n[7](T)}let C={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(C.value=n[2]),n[0]!==void 0&&(C.formattedValue=n[0]),d=new lu({props:C}),te.push(()=>he(d,"value",y)),te.push(()=>he(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" (UTC)"),f=E(),_&&_.c(),c=E(),z(d.$$.fragment),p(t,"class",i=ii(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(T,$){w(T,e,$),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),w(T,f,$),_&&_.m(T,$),w(T,c,$),H(d,T,$),m=!0},p(T,$){(!m||$&2&&i!==(i=ii(j.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!m||$&2)&&o!==(o=T[1].name+"")&&le(r,o),(!m||$&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?_?_.p(T,$):(_=Hp(T),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const O={};$&256&&(O.id=T[8]),!h&&$&4&&(h=!0,O.value=T[2],ve(()=>h=!1)),!g&&$&1&&(g=!0,O.formattedValue=T[0],ve(()=>g=!1)),d.$set(O)},i(T){m||(A(d.$$.fragment,T),m=!0)},o(T){I(d.$$.fragment,T),m=!1},d(T){T&&(k(e),k(f),k(c)),_&&_.d(T),V(d,T)}}}function x5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Q5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function e6(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class t6 extends be{constructor(e){super(),_e(this,e,e6,x5,ge,{field:1,value:0})}}function Vp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=U("Select up to "),s=U(i),l=U(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&k(e)}}}function n6(n){var S,C,T,$,O,M;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function m(D){n[3](D)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((C=n[1].options)==null?void 0:C.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((O=($=n[1].options)==null?void 0:$.values)==null?void 0:O.length)>5};n[0]!==void 0&&(_.selected=n[0]),f=new H1({props:_}),te.push(()=>he(f,"selected",m));let y=((M=n[1].options)==null?void 0:M.maxSelect)>1&&Vp(n);return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),z(f.$$.fragment),d=E(),y&&y.c(),h=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,L){w(D,e,L),b(e,t),b(e,s),b(e,l),b(l,r),w(D,u,L),H(f,D,L),w(D,d,L),y&&y.m(D,L),w(D,h,L),g=!0},p(D,L){var P,F,R,q,B,G;(!g||L&2&&i!==(i=j.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!g||L&2)&&o!==(o=D[1].name+"")&&le(r,o),(!g||L&16&&a!==(a=D[4]))&&p(e,"for",a);const N={};L&16&&(N.id=D[4]),L&6&&(N.toggle=!D[1].required||D[2]),L&4&&(N.multiple=D[2]),L&7&&(N.closable=!D[2]||((P=D[0])==null?void 0:P.length)>=((F=D[1].options)==null?void 0:F.maxSelect)),L&2&&(N.items=(R=D[1].options)==null?void 0:R.values),L&2&&(N.searchable=((B=(q=D[1].options)==null?void 0:q.values)==null?void 0:B.length)>5),!c&&L&1&&(c=!0,N.selected=D[0],ve(()=>c=!1)),f.$set(N),((G=D[1].options)==null?void 0:G.maxSelect)>1?y?y.p(D,L):(y=Vp(D),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(D){g||(A(f.$$.fragment,D),g=!0)},o(D){I(f.$$.fragment,D),g=!1},d(D){D&&(k(e),k(u),k(d),k(h)),V(f,D),y&&y.d(D)}}}function i6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[n6,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function s6(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class l6 extends be{constructor(e){super(),_e(this,e,s6,i6,ge,{field:1,value:0})}}function o6(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function r6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function a6(n){let e;return{c(){e=v("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function u6(n){let e,t,i;var s=n[3];function l(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return s&&(e=Lt(s,l(n)),e.$on("change",n[5])),{c(){e&&z(e.$$.fragment),t=ye()},m(o,r){e&&H(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&s!==(s=o[3])){if(e){re();const a=e;I(a.$$.fragment,1,0,()=>{V(a,1)}),ae()}s?(e=Lt(s,l(o)),e.$on("change",o[5]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&A(e.$$.fragment,o),i=!0)},o(o){e&&I(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&V(e,o)}}}function f6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_,y,S;function C(L,N){return L[4]?r6:o6}let T=C(n),$=T(n);const O=[u6,a6],M=[];function D(L,N){return L[3]?0:1}return h=D(n),g=M[h]=O[h](n),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),a=E(),u=v("span"),$.c(),d=E(),g.c(),m=ye(),p(t,"class",i=ii(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(l,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,N){w(L,e,N),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),$.m(u,null),w(L,d,N),M[h].m(L,N),w(L,m,N),_=!0,y||(S=Te(f=Be.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,N){(!_||N&2&&i!==(i=ii(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!_||N&2)&&o!==(o=L[1].name+"")&&le(r,o),T!==(T=C(L))&&($.d(1),$=T(L),$&&($.c(),$.m(u,null))),f&&Et(f.update)&&N&16&&f.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!_||N&64&&c!==(c=L[6]))&&p(e,"for",c);let P=h;h=D(L),h===P?M[h].p(L,N):(re(),I(M[P],1,1,()=>{M[P]=null}),ae(),g=M[h],g?g.p(L,N):(g=M[h]=O[h](L),g.c()),A(g,1),g.m(m.parentNode,m))},i(L){_||(A(g),_=!0)},o(L){I(g),_=!1},d(L){L&&(k(e),k(d),k(m)),$.d(),M[h].d(L),y=!1,S()}}}function c6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[f6,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&223&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function zp(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function d6(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function p6(n,e,t){let i,{field:s}=e,{value:l=void 0}=e,o,r=zp(l);Kt(async()=>{try{t(3,o=(await ut(()=>import("./CodeEditor-19c882f6.js"),["./CodeEditor-19c882f6.js","./index-808c8630.js"],import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,l=r.trim())};return n.$$set=u=>{"field"in u&&t(1,s=u.field),"value"in u&&t(0,l=u.value)},n.$$.update=()=>{n.$$.dirty&5&&l!==(r==null?void 0:r.trim())&&(t(2,r=zp(l)),t(0,l=r)),n.$$.dirty&4&&t(4,i=d6(r))},[l,s,r,o,i,a]}class h6 extends be{constructor(e){super(),_e(this,e,p6,c6,ge,{field:1,value:0})}}function m6(n){let e,t;return{c(){e=v("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function g6(n){let e,t,i;return{c(){e=v("img"),p(e,"draggable",!1),un(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!un(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function _6(n){let e;function t(l,o){return l[2]?g6:m6}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function b6(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){j.hasImageExtension(s==null?void 0:s.name)?j.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class v6 extends be{constructor(e){super(),_e(this,e,b6,_6,ge,{file:0,size:1})}}function Bp(n){let e;function t(l,o){return l[4]==="image"?k6:y6}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function y6(n){let e,t;return{c(){e=v("object"),t=U("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&k(e)}}}function k6(n){let e,t,i;return{c(){e=v("img"),un(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!un(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function w6(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Bp(n);return{c(){i&&i.c(),t=ye()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=Bp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&k(t),i&&i.d(l)}}}function S6(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[0])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function T6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=U(n[2]),i=E(),s=v("i"),l=E(),o=v("div"),r=E(),a=v("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=Y(a,"click",n[0]),u=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(l),k(o),k(r),k(a)),u=!1,f()}}}function C6(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[T6],header:[S6],default:[w6]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[7](null),V(e,s)}}}function $6(n,e,t){let i,s,l,o,r="";function a(h){h!==""&&(t(1,r=h),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(h){te[h?"unshift":"push"](()=>{o=h,t(3,o)})}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=j.getFileType(s))},[u,r,s,o,l,a,i,f,c,d]}class M6 extends be{constructor(e){super(),_e(this,e,$6,C6,ge,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function O6(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?I6:u[3]==="video"||u[3]==="audio"?A6:D6}let r=o(n),a=r(n);return{c(){e=v("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){w(u,e,f),a.m(e,null),s||(l=Y(e,"click",Sn(n[11])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&k(e),a.d(),s=!1,l()}}}function E6(n){let e,t;return{c(){e=v("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function D6(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function A6(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function I6(n){let e,t,i,s,l;return{c(){e=v("img"),p(e,"draggable",!1),un(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),p(e,"loading","lazy")},m(o,r){w(o,e,r),s||(l=Y(e,"error",n[8]),s=!0)},p(o,r){r&32&&!un(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&k(e),s=!1,l()}}}function Up(n){let e,t,i={};return e=new M6({props:i}),n[12](e),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[12](null),V(e,s)}}}function L6(n){let e,t,i;function s(a,u){return a[2]?E6:O6}let l=s(n),o=l(n),r=n[7]&&Up(n);return{c(){o.c(),e=E(),r&&r.c(),t=ye()},m(a,u){o.m(a,u),w(a,e,u),r&&r.m(a,u),w(a,t,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&A(r,1)):(r=Up(a),r.c(),A(r,1),r.m(t.parentNode,t)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){i||(A(r),i=!0)},o(a){I(r),i=!1},d(a){a&&(k(e),k(t)),o.d(a),r&&r.d(a)}}}function P6(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;h();async function h(){t(2,d=!0);try{t(10,c=await de.getAdminFileToken(l.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function g(){t(5,u="")}const m=y=>{s&&(y.preventDefault(),a==null||a.show(f))};function _(y){te[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,l=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":de.files.getUrl(l,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":de.files.getUrl(l,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,s,g,l,c,m,_]}class ru extends be{constructor(e){super(),_e(this,e,P6,L6,ge,{record:9,filename:0,size:1})}}function Wp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Yp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const s=i[2].includes(i[34]);return i[35]=s,i}function N6(n){let e,t,i;function s(){return n[17](n[34])}return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[Te(Be.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function F6(n){let e,t,i;function s(){return n[16](n[34])}return{c(){e=v("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function R6(n){let e,t,i,s,l,o,r=n[34]+"",a,u,f,c,d,h;i=new ru({props:{record:n[3],filename:n[34]}});function g(y,S){return y[35]?F6:N6}let m=g(n),_=m(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("a"),a=U(r),c=E(),d=v("div"),_.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=de.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(l,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(y,S){w(y,e,S),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),b(o,a),b(e,c),b(e,d),_.m(d,null),h=!0},p(y,S){const C={};S[0]&8&&(C.record=y[3]),S[0]&32&&(C.filename=y[34]),i.$set(C),(!h||S[0]&36)&&Q(t,"fade",y[35]),(!h||S[0]&32)&&r!==(r=y[34]+"")&&le(a,r),(!h||S[0]&1064&&u!==(u=de.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",u),(!h||S[0]&36&&f!==(f="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),m===(m=g(y))&&_?_.p(y,S):(_.d(1),_=m(y),_&&(_.c(),_.m(d,null))),(!h||S[1]&2)&&Q(e,"dragging",y[32]),(!h||S[1]&4)&&Q(e,"dragover",y[33])},i(y){h||(A(i.$$.fragment,y),h=!0)},o(y){I(i.$$.fragment,y),h=!1},d(y){y&&k(e),V(i),_.d()}}}function Kp(n,e){let t,i,s,l;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[R6,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Nl({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function q6(n){let e,t,i,s,l,o,r,a,u=n[29].name+"",f,c,d,h,g,m,_;i=new v6({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=v("div"),t=v("figure"),z(i.$$.fragment),s=E(),l=v("div"),o=v("small"),o.textContent="New",r=E(),a=v("span"),f=U(u),d=E(),h=v("button"),h.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"title",c=n[29].name),p(h,"type","button"),p(h,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,C){w(S,e,C),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),b(l,r),b(l,a),b(a,f),b(e,d),b(e,h),g=!0,m||(_=[Te(Be.call(null,h,"Remove file")),Y(h,"click",y)],m=!0)},p(S,C){n=S;const T={};C[0]&2&&(T.file=n[29]),i.$set(T),(!g||C[0]&2)&&u!==(u=n[29].name+"")&&le(f,u),(!g||C[0]&2&&c!==(c=n[29].name))&&p(l,"title",c),(!g||C[1]&2)&&Q(e,"dragging",n[32]),(!g||C[1]&4)&&Q(e,"dragover",n[33])},i(S){g||(A(i.$$.fragment,S),g=!0)},o(S){I(i.$$.fragment,S),g=!1},d(S){S&&k(e),V(i),m=!1,$e(_)}}}function Jp(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[q6,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Nl({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function j6(n){let e,t,i,s,l,o=n[4].name+"",r,a,u,f,c=[],d=new Map,h,g=[],m=new Map,_,y,S,C,T,$,O,M,D,L,N,P,F=pe(n[5]);const R=G=>G[34]+G[3].id;for(let G=0;GG[29].name+G[31];for(let G=0;G{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&l()},[s,i]}class V1 extends ve{constructor(e){super(),be(this,e,p6,d6,ge,{model:1})}}function h6(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),s||(l=[Te(i=Be.call(null,e,n[2]?"":"Copy")),Y(e,"click",Sn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Et(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function m6(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Kt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class Hs extends ve{constructor(e){super(),be(this,e,m6,h6,ge,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function g6(n){let e,t,i,s,l,o,r,a,u,f;return l=new Hs({props:{value:n[1]}}),{c(){e=v("div"),t=v("span"),i=W(n[1]),s=E(),z(l.$$.fragment),o=E(),r=v("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),b(e,t),b(t,i),n[6](t),b(e,s),H(l,e,null),b(e,o),b(e,r),a=!0,u||(f=[Te(Be.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&le(i,c[1]);const h={};d&2&&(h.value=c[1]),l.$set(h)},i(c){a||(A(l.$$.fragment,c),a=!0)},o(c){I(l.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),V(l),u=!1,$e(f)}}}function _6(n){let e,t,i,s,l,o,r,a,u,f;function c(h){n[7](h)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[g6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),s=new Pn({props:d}),te.push(()=>he(s,"active",c)),s.$on("show",n[4]),{c(){e=v("button"),t=v("i"),i=E(),z(s.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(h,g){w(h,e,g),b(e,t),b(e,i),H(s,e,null),a=!0,u||(f=Te(r=Be.call(null,e,n[3]?"":"Generate")),u=!0)},p(h,[g]){const m={};g&518&&(m.$$scope={dirty:g,ctx:h}),!l&&g&8&&(l=!0,m.active=h[3],_e(()=>l=!1)),s.$set(m),(!a||g&1&&o!==(o="btn btn-circle "+h[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Et(r.update)&&g&8&&r.update.call(null,h[3]?"":"Generate")},i(h){a||(A(s.$$.fragment,h),a=!0)},o(h){I(s.$$.fragment,h),a=!1},d(h){h&&k(e),V(s),u=!1,f()}}}function b6(n,e,t){const i=dt();let{class:s="btn-sm btn-hint btn-transparent"}=e,{length:l=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(l)),i("generate",o),await sn(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,s=d.class),"length"in d&&t(5,l=d.length)},[s,o,r,a,u,l,f,c]}class z1 extends ve{constructor(e){super(),be(this,e,b6,_6,ge,{class:0,length:5})}}function v6(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Username",o=E(),r=v("input"),p(t,"class",j.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(h,g){w(h,e,g),b(e,t),b(e,i),b(e,s),w(h,o,g),w(h,r,g),de(r,n[0].username),c||(d=Y(r,"input",n[5]),c=!0)},p(h,g){g&8192&&l!==(l=h[13])&&p(e,"for",l),g&4&&a!==(a=!h[2])&&p(r,"requried",a),g&4&&u!==(u=h[2]?"Leave empty to auto generate...":h[4])&&p(r,"placeholder",u),g&8192&&f!==(f=h[13])&&p(r,"id",f),g&1&&r.value!==h[0].username&&de(r,h[0].username)},d(h){h&&(k(e),k(o),k(r)),c=!1,d()}}}function y6(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,h,g,m,_,y,S,C;return{c(){var T;e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("div"),a=v("button"),u=v("span"),f=W("Public: "),d=W(c),g=E(),m=v("input"),p(t,"class",j.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",h="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(m,"type","email"),m.autofocus=n[2],p(m,"autocomplete","off"),p(m,"id",_=n[13]),m.required=y=(T=n[1].options)==null?void 0:T.requireEmail,p(m,"class","svelte-1751a4d")},m(T,$){w(T,e,$),b(e,t),b(e,i),b(e,s),w(T,o,$),w(T,r,$),b(r,a),b(a,u),b(u,f),b(u,d),w(T,g,$),w(T,m,$),de(m,n[0].email),n[2]&&m.focus(),S||(C=[Te(Be.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",Ze(n[6])),Y(m,"input",n[7])],S=!0)},p(T,$){var O;$&8192&&l!==(l=T[13])&&p(e,"for",l),$&1&&c!==(c=T[0].emailVisibility?"On":"Off")&&le(d,c),$&1&&h!==(h="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",h),$&4&&(m.autofocus=T[2]),$&8192&&_!==(_=T[13])&&p(m,"id",_),$&2&&y!==(y=(O=T[1].options)==null?void 0:O.requireEmail)&&(m.required=y),$&1&&m.value!==T[0].email&&de(m,T[0].email)},d(T){T&&(k(e),k(o),k(r),k(g),k(m)),S=!1,$e(C)}}}function qp(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[k6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&24584&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function k6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function jp(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[w6,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[S6,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c&24577&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!u||c&8)&&Q(t,"p-t-xs",f[3])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function w6(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new z1({props:{length:15}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),de(r,n[0].password),w(m,u,_),w(m,f,_),H(c,f,null),d=!0,h||(g=Y(r,"input",n[9]),h=!0)},p(m,_){(!d||_&8192&&l!==(l=m[13]))&&p(e,"for",l),(!d||_&8192&&a!==(a=m[13]))&&p(r,"id",a),_&1&&r.value!==m[0].password&&de(r,m[0].password)},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){I(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),V(c),h=!1,g()}}}function S6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[10]),u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&de(r,c[0].passwordConfirm)},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function T6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"change",n[11]),Y(e,"change",Ze(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function C6(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new me({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[v6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[y6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let g=!n[2]&&qp(n),m=(n[2]||n[3])&&jp(n);return d=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[T6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),g&&g.c(),u=E(),m&&m.c(),f=E(),c=v("div"),z(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),g&&g.m(a,null),b(a,u),m&&m.m(a,null),b(e,f),b(e,c),H(d,c,null),h=!0},p(y,[S]){var O;const C={};S&4&&(C.class="form-field "+(y[2]?"":"required")),S&24581&&(C.$$scope={dirty:S,ctx:y}),i.$set(C);const T={};S&2&&(T.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&(T.$$scope={dirty:S,ctx:y}),o.$set(T),y[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(y,S),S&4&&A(g,1)):(g=qp(y),g.c(),A(g,1),g.m(a,u)),y[2]||y[3]?m?(m.p(y,S),S&12&&A(m,1)):(m=jp(y),m.c(),A(m,1),m.m(a,null)):m&&(re(),I(m,1,1,()=>{m=null}),ae());const $={};S&24581&&($.$$scope={dirty:S,ctx:y}),d.$set($)},i(y){h||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(g),A(m),A(d.$$.fragment,y),h=!0)},o(y){I(i.$$.fragment,y),I(o.$$.fragment,y),I(g),I(m),I(d.$$.fragment,y),h=!1},d(y){y&&k(e),V(i),V(o),g&&g.d(),m&&m.d(),V(d)}}}function $6(n,e,t){let{record:i}=e,{collection:s}=e,{isNew:l=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const u=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function f(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function h(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function g(){i.verified=this.checked,t(0,i),t(3,r)}const m=_=>{l||_n("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!_.target.checked,i)})};return n.$$set=_=>{"record"in _&&t(0,i=_.record),"collection"in _&&t(1,s=_.collection),"isNew"in _&&t(2,l=_.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),pi("password"),pi("passwordConfirm")))},[i,s,l,r,o,a,u,f,c,d,h,g,m]}class M6 extends ve{constructor(e){super(),be(this,e,$6,C6,ge,{record:0,collection:1,isNew:2})}}function O6(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)&&!(h!=null&&h.isComposing)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Kt(()=>(u(),()=>clearTimeout(a)));function c(h){te[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(3,s=tt(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class D6 extends ve{constructor(e){super(),be(this,e,E6,O6,ge,{value:0,maxHeight:4})}}function A6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(m){n[2](m)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new D6({props:g}),te.push(()=>he(f,"value",h)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),z(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),H(f,m,_),d=!0},p(m,_){(!d||_&2&&i!==(i=j.getFieldTypeIcon(m[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=m[1].name+"")&&le(r,o),(!d||_&8&&a!==(a=m[3]))&&p(e,"for",a);const y={};_&8&&(y.id=m[3]),_&2&&(y.required=m[1].required),!c&&_&1&&(c=!0,y.value=m[0],_e(()=>c=!1)),f.$set(y)},i(m){d||(A(f.$$.fragment,m),d=!0)},o(m){I(f.$$.fragment,m),d=!1},d(m){m&&(k(e),k(u)),V(f,m)}}}function I6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[A6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function L6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class P6 extends ve{constructor(e){super(),be(this,e,L6,I6,ge,{field:1,value:0})}}function N6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_;return{c(){var y,S;e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",g=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),w(y,f,S),de(f,n[0]),m||(_=Y(f,"input",n[2]),m=!0)},p(y,S){var C,T;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&le(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&h!==(h=(C=y[1].options)==null?void 0:C.min)&&p(f,"min",h),S&2&&g!==(g=(T=y[1].options)==null?void 0:T.max)&&p(f,"max",g),S&1&&yt(f.value)!==y[0]&&de(f,y[0])},d(y){y&&(k(e),k(u),k(f)),m=!1,_()}}}function F6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[N6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function R6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=yt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class q6 extends ve{constructor(e){super(),be(this,e,R6,F6,ge,{field:1,value:0})}}function j6(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=E(),s=v("label"),o=W(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),b(s,o),a||(u=Y(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&le(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&(k(e),k(i),k(s)),a=!1,u()}}}function H6(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function V6(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class z6 extends ve{constructor(e){super(),be(this,e,V6,H6,ge,{field:1,value:0})}}function B6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),w(m,f,_),de(f,n[0]),h||(g=Y(f,"input",n[2]),h=!0)},p(m,_){_&2&&i!==(i=j.getFieldTypeIcon(m[1].type))&&p(t,"class",i),_&2&&o!==(o=m[1].name+"")&&le(r,o),_&8&&a!==(a=m[3])&&p(e,"for",a),_&8&&c!==(c=m[3])&&p(f,"id",c),_&2&&d!==(d=m[1].required)&&(f.required=d),_&1&&f.value!==m[0]&&de(f,m[0])},d(m){m&&(k(e),k(u),k(f)),h=!1,g()}}}function U6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function W6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class Y6 extends ve{constructor(e){super(),be(this,e,W6,U6,ge,{field:1,value:0})}}function K6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),w(m,f,_),de(f,n[0]),h||(g=Y(f,"input",n[2]),h=!0)},p(m,_){_&2&&i!==(i=j.getFieldTypeIcon(m[1].type))&&p(t,"class",i),_&2&&o!==(o=m[1].name+"")&&le(r,o),_&8&&a!==(a=m[3])&&p(e,"for",a),_&8&&c!==(c=m[3])&&p(f,"id",c),_&2&&d!==(d=m[1].required)&&(f.required=d),_&1&&f.value!==m[0]&&de(f,m[0])},d(m){m&&(k(e),k(u),k(f)),h=!1,g()}}}function J6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function G6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class Z6 extends ve{constructor(e){super(),be(this,e,G6,J6,ge,{field:1,value:0})}}function Hp(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),b(e,t),i||(s=[Te(Be.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:x,d(l){l&&k(e),i=!1,$e(s)}}}function X6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_=n[0]&&!n[1].required&&Hp(n);function y(T){n[6](T)}function S(T){n[7](T)}let C={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(C.value=n[2]),n[0]!==void 0&&(C.formattedValue=n[0]),d=new lu({props:C}),te.push(()=>he(d,"value",y)),te.push(()=>he(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),a=W(" (UTC)"),f=E(),_&&_.c(),c=E(),z(d.$$.fragment),p(t,"class",i=ii(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(T,$){w(T,e,$),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),w(T,f,$),_&&_.m(T,$),w(T,c,$),H(d,T,$),m=!0},p(T,$){(!m||$&2&&i!==(i=ii(j.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!m||$&2)&&o!==(o=T[1].name+"")&&le(r,o),(!m||$&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?_?_.p(T,$):(_=Hp(T),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const O={};$&256&&(O.id=T[8]),!h&&$&4&&(h=!0,O.value=T[2],_e(()=>h=!1)),!g&&$&1&&(g=!0,O.formattedValue=T[0],_e(()=>g=!1)),d.$set(O)},i(T){m||(A(d.$$.fragment,T),m=!0)},o(T){I(d.$$.fragment,T),m=!1},d(T){T&&(k(e),k(f),k(c)),_&&_.d(T),V(d,T)}}}function Q6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X6,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function x6(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class e5 extends ve{constructor(e){super(),be(this,e,x6,Q6,ge,{field:1,value:0})}}function Vp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=W("Select up to "),s=W(i),l=W(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&k(e)}}}function t5(n){var S,C,T,$,O,M;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function m(D){n[3](D)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((C=n[1].options)==null?void 0:C.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((O=($=n[1].options)==null?void 0:$.values)==null?void 0:O.length)>5};n[0]!==void 0&&(_.selected=n[0]),f=new j1({props:_}),te.push(()=>he(f,"selected",m));let y=((M=n[1].options)==null?void 0:M.maxSelect)>1&&Vp(n);return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),z(f.$$.fragment),d=E(),y&&y.c(),h=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,L){w(D,e,L),b(e,t),b(e,s),b(e,l),b(l,r),w(D,u,L),H(f,D,L),w(D,d,L),y&&y.m(D,L),w(D,h,L),g=!0},p(D,L){var P,F,R,q,B,G;(!g||L&2&&i!==(i=j.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!g||L&2)&&o!==(o=D[1].name+"")&&le(r,o),(!g||L&16&&a!==(a=D[4]))&&p(e,"for",a);const N={};L&16&&(N.id=D[4]),L&6&&(N.toggle=!D[1].required||D[2]),L&4&&(N.multiple=D[2]),L&7&&(N.closable=!D[2]||((P=D[0])==null?void 0:P.length)>=((F=D[1].options)==null?void 0:F.maxSelect)),L&2&&(N.items=(R=D[1].options)==null?void 0:R.values),L&2&&(N.searchable=((B=(q=D[1].options)==null?void 0:q.values)==null?void 0:B.length)>5),!c&&L&1&&(c=!0,N.selected=D[0],_e(()=>c=!1)),f.$set(N),((G=D[1].options)==null?void 0:G.maxSelect)>1?y?y.p(D,L):(y=Vp(D),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(D){g||(A(f.$$.fragment,D),g=!0)},o(D){I(f.$$.fragment,D),g=!1},d(D){D&&(k(e),k(u),k(d),k(h)),V(f,D),y&&y.d(D)}}}function n5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[t5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function i5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class s5 extends ve{constructor(e){super(),be(this,e,i5,n5,ge,{field:1,value:0})}}function l5(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function o5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function r5(n){let e;return{c(){e=v("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function a5(n){let e,t,i;var s=n[3];function l(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return s&&(e=Pt(s,l(n)),e.$on("change",n[5])),{c(){e&&z(e.$$.fragment),t=ye()},m(o,r){e&&H(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&s!==(s=o[3])){if(e){re();const a=e;I(a.$$.fragment,1,0,()=>{V(a,1)}),ae()}s?(e=Pt(s,l(o)),e.$on("change",o[5]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&A(e.$$.fragment,o),i=!0)},o(o){e&&I(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&V(e,o)}}}function u5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_,y,S;function C(L,N){return L[4]?o5:l5}let T=C(n),$=T(n);const O=[a5,r5],M=[];function D(L,N){return L[3]?0:1}return h=D(n),g=M[h]=O[h](n),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),a=E(),u=v("span"),$.c(),d=E(),g.c(),m=ye(),p(t,"class",i=ii(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(l,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,N){w(L,e,N),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),$.m(u,null),w(L,d,N),M[h].m(L,N),w(L,m,N),_=!0,y||(S=Te(f=Be.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,N){(!_||N&2&&i!==(i=ii(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!_||N&2)&&o!==(o=L[1].name+"")&&le(r,o),T!==(T=C(L))&&($.d(1),$=T(L),$&&($.c(),$.m(u,null))),f&&Et(f.update)&&N&16&&f.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!_||N&64&&c!==(c=L[6]))&&p(e,"for",c);let P=h;h=D(L),h===P?M[h].p(L,N):(re(),I(M[P],1,1,()=>{M[P]=null}),ae(),g=M[h],g?g.p(L,N):(g=M[h]=O[h](L),g.c()),A(g,1),g.m(m.parentNode,m))},i(L){_||(A(g),_=!0)},o(L){I(g),_=!1},d(L){L&&(k(e),k(d),k(m)),$.d(),M[h].d(L),y=!1,S()}}}function f5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[u5,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&223&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function zp(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function c5(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function d5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e,o,r=zp(l);Kt(async()=>{try{t(3,o=(await ut(()=>import("./CodeEditor-4c129c80.js"),["./CodeEditor-4c129c80.js","./index-808c8630.js"],import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,l=r.trim())};return n.$$set=u=>{"field"in u&&t(1,s=u.field),"value"in u&&t(0,l=u.value)},n.$$.update=()=>{n.$$.dirty&5&&l!==(r==null?void 0:r.trim())&&(t(2,r=zp(l)),t(0,l=r)),n.$$.dirty&4&&t(4,i=c5(r))},[l,s,r,o,i,a]}class p5 extends ve{constructor(e){super(),be(this,e,d5,f5,ge,{field:1,value:0})}}function h5(n){let e,t;return{c(){e=v("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function m5(n){let e,t,i;return{c(){e=v("img"),p(e,"draggable",!1),un(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!un(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function g5(n){let e;function t(l,o){return l[2]?m5:h5}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function _5(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){j.hasImageExtension(s==null?void 0:s.name)?j.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class b5 extends ve{constructor(e){super(),be(this,e,_5,g5,ge,{file:0,size:1})}}function Bp(n){let e;function t(l,o){return l[4]==="image"?y5:v5}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function v5(n){let e,t;return{c(){e=v("object"),t=W("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&k(e)}}}function y5(n){let e,t,i;return{c(){e=v("img"),un(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!un(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function k5(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Bp(n);return{c(){i&&i.c(),t=ye()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=Bp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&k(t),i&&i.d(l)}}}function w5(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[0])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function S5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=W(n[2]),i=E(),s=v("i"),l=E(),o=v("div"),r=E(),a=v("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=Y(a,"click",n[0]),u=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(l),k(o),k(r),k(a)),u=!1,f()}}}function T5(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[S5],header:[w5],default:[k5]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[7](null),V(e,s)}}}function C5(n,e,t){let i,s,l,o,r="";function a(h){h!==""&&(t(1,r=h),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(h){te[h?"unshift":"push"](()=>{o=h,t(3,o)})}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=j.getFileType(s))},[u,r,s,o,l,a,i,f,c,d]}class $5 extends ve{constructor(e){super(),be(this,e,C5,T5,ge,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function M5(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?A5:u[3]==="video"||u[3]==="audio"?D5:E5}let r=o(n),a=r(n);return{c(){e=v("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){w(u,e,f),a.m(e,null),s||(l=Y(e,"click",Sn(n[11])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&k(e),a.d(),s=!1,l()}}}function O5(n){let e,t;return{c(){e=v("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function E5(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function D5(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function A5(n){let e,t,i,s,l;return{c(){e=v("img"),p(e,"draggable",!1),un(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),p(e,"loading","lazy")},m(o,r){w(o,e,r),s||(l=Y(e,"error",n[8]),s=!0)},p(o,r){r&32&&!un(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&k(e),s=!1,l()}}}function Up(n){let e,t,i={};return e=new $5({props:i}),n[12](e),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[12](null),V(e,s)}}}function I5(n){let e,t,i;function s(a,u){return a[2]?O5:M5}let l=s(n),o=l(n),r=n[7]&&Up(n);return{c(){o.c(),e=E(),r&&r.c(),t=ye()},m(a,u){o.m(a,u),w(a,e,u),r&&r.m(a,u),w(a,t,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&A(r,1)):(r=Up(a),r.c(),A(r,1),r.m(t.parentNode,t)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){i||(A(r),i=!0)},o(a){I(r),i=!1},d(a){a&&(k(e),k(t)),o.d(a),r&&r.d(a)}}}function L5(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;h();async function h(){t(2,d=!0);try{t(10,c=await ce.getAdminFileToken(l.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function g(){t(5,u="")}const m=y=>{s&&(y.preventDefault(),a==null||a.show(f))};function _(y){te[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,l=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":ce.files.getUrl(l,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":ce.files.getUrl(l,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,s,g,l,c,m,_]}class ru extends ve{constructor(e){super(),be(this,e,L5,I5,ge,{record:9,filename:0,size:1})}}function Wp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Yp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const s=i[2].includes(i[34]);return i[35]=s,i}function P5(n){let e,t,i;function s(){return n[17](n[34])}return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[Te(Be.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function N5(n){let e,t,i;function s(){return n[16](n[34])}return{c(){e=v("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function F5(n){let e,t,i,s,l,o,r=n[34]+"",a,u,f,c,d,h;i=new ru({props:{record:n[3],filename:n[34]}});function g(y,S){return y[35]?N5:P5}let m=g(n),_=m(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("a"),a=W(r),c=E(),d=v("div"),_.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=ce.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(l,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(y,S){w(y,e,S),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),b(o,a),b(e,c),b(e,d),_.m(d,null),h=!0},p(y,S){const C={};S[0]&8&&(C.record=y[3]),S[0]&32&&(C.filename=y[34]),i.$set(C),(!h||S[0]&36)&&Q(t,"fade",y[35]),(!h||S[0]&32)&&r!==(r=y[34]+"")&&le(a,r),(!h||S[0]&1064&&u!==(u=ce.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",u),(!h||S[0]&36&&f!==(f="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),m===(m=g(y))&&_?_.p(y,S):(_.d(1),_=m(y),_&&(_.c(),_.m(d,null))),(!h||S[1]&2)&&Q(e,"dragging",y[32]),(!h||S[1]&4)&&Q(e,"dragover",y[33])},i(y){h||(A(i.$$.fragment,y),h=!0)},o(y){I(i.$$.fragment,y),h=!1},d(y){y&&k(e),V(i),_.d()}}}function Kp(n,e){let t,i,s,l;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[F5,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Fl({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],_e(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function R5(n){let e,t,i,s,l,o,r,a,u=n[29].name+"",f,c,d,h,g,m,_;i=new b5({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=v("div"),t=v("figure"),z(i.$$.fragment),s=E(),l=v("div"),o=v("small"),o.textContent="New",r=E(),a=v("span"),f=W(u),d=E(),h=v("button"),h.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"title",c=n[29].name),p(h,"type","button"),p(h,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,C){w(S,e,C),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),b(l,r),b(l,a),b(a,f),b(e,d),b(e,h),g=!0,m||(_=[Te(Be.call(null,h,"Remove file")),Y(h,"click",y)],m=!0)},p(S,C){n=S;const T={};C[0]&2&&(T.file=n[29]),i.$set(T),(!g||C[0]&2)&&u!==(u=n[29].name+"")&&le(f,u),(!g||C[0]&2&&c!==(c=n[29].name))&&p(l,"title",c),(!g||C[1]&2)&&Q(e,"dragging",n[32]),(!g||C[1]&4)&&Q(e,"dragover",n[33])},i(S){g||(A(i.$$.fragment,S),g=!0)},o(S){I(i.$$.fragment,S),g=!1},d(S){S&&k(e),V(i),m=!1,$e(_)}}}function Jp(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[R5,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Fl({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],_e(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function q5(n){let e,t,i,s,l,o=n[4].name+"",r,a,u,f,c=[],d=new Map,h,g=[],m=new Map,_,y,S,C,T,$,O,M,D,L,N,P,F=pe(n[5]);const R=G=>G[34]+G[3].id;for(let G=0;GG[29].name+G[31];for(let G=0;G({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),H(t,e,null),i=!0,s||(l=[Y(e,"dragover",Ze(n[25])),Y(e,"dragleave",n[26]),Y(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=` + `,name:n[4].name,$$slots:{default:[q5,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),H(t,e,null),i=!0,s||(l=[Y(e,"dragover",Ze(n[25])),Y(e,"dragleave",n[26]),Y(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=` form-field form-field-list form-field-file `+(o[4].required?"required":"")+` `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){I(t.$$.fragment,o),i=!1},d(o){o&&k(e),V(t),s=!1,$e(l)}}}function V6(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,h=!1,g="";function m(B){j.removeByValue(f,B),t(2,f)}function _(B){j.pushUnique(f,B),t(2,f)}function y(B){j.isEmpty(u[B])||u.splice(B,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function C(B){var X,J;B.preventDefault(),t(9,h=!1);const G=((X=B.dataTransfer)==null?void 0:X.files)||[];if(!(l||!G.length)){for(const W of G){const oe=s.length+u.length-f.length;if(((J=r.options)==null?void 0:J.maxSelect)<=oe)break;u.push(W)}t(1,u)}}Kt(async()=>{t(10,g=await de.getAdminFileToken(o.collectionId))});const T=B=>m(B),$=B=>_(B);function O(B){a=B,t(0,a),t(6,i),t(4,r)}const M=B=>y(B);function D(B){u=B,t(1,u)}function L(B){te[B?"unshift":"push"](()=>{c=B,t(7,c)})}const N=()=>{for(let B of c.files)u.push(B);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function F(B){te[B?"unshift":"push"](()=>{d=B,t(8,d)})}const R=()=>{t(9,h=!0)},q=()=>{t(9,h=!1)};return n.$$set=B=>{"record"in B&&t(3,o=B.record),"field"in B&&t(4,r=B.field),"value"in B&&t(0,a=B.value),"uploadedFiles"in B&&t(1,u=B.uploadedFiles),"deletedFileNames"in B&&t(2,f=B.deletedFileNames)},n.$$.update=()=>{var B,G;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=j.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((B=r.options)==null?void 0:B.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=j.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((G=r.options)==null?void 0:G.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,h,g,l,m,_,y,C,T,$,O,M,D,L,N,P,F,R,q]}class z6 extends be{constructor(e){super(),_e(this,e,V6,H6,ge,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Gp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function B6(n,e){e=Gp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Gp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Zp(n,e,t){const i=n.slice();i[5]=e[t];const s=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=s,i}function Xp(n,e,t){const i=n.slice();return i[9]=e[t],i}function Qp(n){let e,t;return e=new ru({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&5&&(l.filename=i[9]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xp(n){let e=!j.isEmpty(n[9]),t,i,s=e&&Qp(n);return{c(){s&&s.c(),t=ye()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&5&&(e=!j.isEmpty(l[9])),e?s?(s.p(l,o),o&5&&A(s,1)):(s=Qp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(l){i||(A(s),i=!0)},o(l){I(s),i=!1},d(l){l&&k(t),s&&s.d(l)}}}function eh(n){let e,t,i=pe(n[6]),s=[];for(let o=0;oI(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oI(h[m],1,1,()=>{h[m]=null});return{c(){e=v("div"),t=v("i"),s=E();for(let m=0;mt(4,o=a));let{record:r}=e;return n.$$set=a=>{"record"in a&&t(0,r=a.record)},n.$$.update=()=>{var a,u,f,c;n.$$.dirty&17&&t(3,i=o==null?void 0:o.find(d=>d.id==(r==null?void 0:r.collectionId))),n.$$.dirty&8&&t(2,s=((u=(a=i==null?void 0:i.schema)==null?void 0:a.filter(d=>d.presentable&&d.type=="file"))==null?void 0:u.map(d=>d.name))||[]),n.$$.dirty&8&&t(1,l=((c=(f=i==null?void 0:i.schema)==null?void 0:f.filter(d=>d.presentable&&d.type!="file"))==null?void 0:c.map(d=>d.name))||[])},[r,l,s,i,o]}class tr extends be{constructor(e){super(),_e(this,e,W6,U6,ge,{record:0})}}function th(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function nh(n,e,t){const i=n.slice();i[49]=e[t];const s=i[9](i[49]);return i[6]=s,i}function ih(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function sh(n){let e,t=!n[13]&&lh(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[13]?t&&(t.d(1),t=null):t?t.p(i,s):(t=lh(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function lh(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&oh(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=oh(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function oh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[35]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Y6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function K6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rh(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),b(e,t),i||(s=[Te(Be.call(null,t,"Edit")),Y(t,"keydown",Sn(n[27])),Y(t,"click",Sn(l))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,$e(s)}}}function ah(n,e){let t,i,s,l,o,r,a,u;function f(_,y){return _[6]?K6:Y6}let c=f(e),d=c(e);l=new tr({props:{record:e[49]}});let h=!e[11]&&rh(e);function g(){return e[33](e[49])}function m(..._){return e[34](e[49],..._)}return{key:n,first:null,c(){t=v("div"),d.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),h&&h.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,y){w(_,t,y),d.m(t,null),b(t,i),b(t,s),H(l,s,null),b(t,o),h&&h.m(t,null),r=!0,a||(u=[Y(t,"click",g),Y(t,"keydown",m)],a=!0)},p(_,y){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),l.$set(S),e[11]?h&&(h.d(1),h=null):h?h.p(e,y):(h=rh(e),h.c(),h.m(t,null)),(!r||y[0]&768)&&Q(t,"selected",e[6]),(!r||y[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(A(l.$$.fragment,_),r=!0)},o(_){I(l.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),V(l),h&&h.d(),a=!1,$e(u)}}}function uh(n){let e;return{c(){e=v("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fh(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=U("("),i=U(t),s=U(" of MAX "),l=U(n[4]),o=U(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&16&&le(l,r[4])},d(r){r&&(k(e),k(i),k(s),k(l),k(o))}}}function J6(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function G6(n){let e,t,i=pe(n[6]),s=[];for(let o=0;oI(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o',l=E(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[52]),Q(e,"label-warning",n[53])},m(f,c){w(f,e,c),H(t,e,null),b(e,i),b(e,s),w(f,l,c),o=!0,r||(a=Y(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&Q(e,"label-danger",n[52]),(!o||c[1]&4194304)&&Q(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){I(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(l)),V(t),r=!1,a()}}}function ch(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[Z6,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new Nl({props:l}),te.push(()=>he(e,"list",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function X6(n){let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,h,g,m,_,y,S,C;t=new El({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&ih(n),$=pe(n[8]);const O=R=>R[49].id;for(let R=0;R<$.length;R+=1){let q=nh(n,$,R),B=O(q);r.set(B,o[R]=ah(B,q))}let M=null;$.length||(M=sh(n));let D=n[13]&&uh(),L=n[4]>1&&fh(n);const N=[G6,J6],P=[];function F(R,q){return R[6].length?0:1}return g=F(n),m=P[g]=N[g](n),{c(){e=v("div"),z(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=v("div");for(let R=0;R1?L?L.p(R,q):(L=fh(R),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let G=g;g=F(R),g===G?P[g].p(R,q):(re(),I(P[G],1,1,()=>{P[G]=null}),ae(),m=P[g],m?m.p(R,q):(m=P[g]=N[g](R),m.c()),A(m,1),m.m(_.parentNode,_))},i(R){if(!y){A(t.$$.fragment,R);for(let q=0;q<$.length;q+=1)A(o[q]);A(m),y=!0}},o(R){I(t.$$.fragment,R);for(let q=0;qCancel',t=E(),i=v("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function eO(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[x6],header:[Q6],default:[X6]},$$scope:{ctx:n}};for(let a=0;at(26,h=Ce));const g=dt(),m="picker_"+j.randomString(5);let{value:_}=e,{field:y}=e,S,C,T="",$=[],O=[],M=1,D=0,L=!1,N=!1;function P(){return t(2,T=""),t(8,$=[]),t(6,O=[]),R(),q(!0),S==null?void 0:S.show()}function F(){return S==null?void 0:S.hide()}async function R(){const Ce=j.toArray(_);if(!s||!Ce.length)return;t(24,N=!0);let pt=[];const qt=Ce.slice(),fn=[];for(;qt.length>0;){const nn=[];for(const rn of qt.splice(0,so))nn.push(`id="${rn}"`);fn.push(de.collection(s).getFullList({batch:so,filter:nn.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(fn).then(nn=>{pt=pt.concat(...nn)}),t(6,O=[]);for(const nn of Ce){const rn=j.findByKey(pt,"id",nn);rn&&O.push(rn)}T.trim()||t(8,$=j.filterDuplicatesByKey(O.concat($))),t(24,N=!1)}catch(nn){nn.isAbort||(de.error(nn),t(24,N=!1))}}async function q(Ce=!1){if(s){t(3,L=!0),Ce&&(T.trim()?t(8,$=[]):t(8,$=j.toArray(O).slice()));try{const pt=Ce?1:M+1,qt=j.getAllCollectionIdentifiers(l),fn=await de.collection(s).getList(pt,so,{filter:j.normalizeSearchFilter(T,qt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:m+"loadList"});t(8,$=j.filterDuplicatesByKey($.concat(fn.items))),M=fn.page,t(23,D=fn.items.length),t(3,L=!1)}catch(pt){pt.isAbort||(de.error(pt),t(3,L=!1))}}}function B(Ce){i==1?t(6,O=[Ce]):u&&(j.pushOrReplaceByKey(O,Ce),t(6,O))}function G(Ce){j.removeByKey(O,"id",Ce.id),t(6,O)}function X(Ce){f(Ce)?G(Ce):B(Ce)}function J(){var Ce;i!=1?t(20,_=O.map(pt=>pt.id)):t(20,_=((Ce=O==null?void 0:O[0])==null?void 0:Ce.id)||""),g("save",O),F()}function W(Ce){Fe.call(this,n,Ce)}const oe=()=>F(),ee=()=>J(),se=Ce=>t(2,T=Ce.detail),Ee=()=>C==null?void 0:C.show(),Re=Ce=>C==null?void 0:C.show(Ce),Ve=Ce=>X(Ce),We=(Ce,pt)=>{(pt.code==="Enter"||pt.code==="Space")&&(pt.preventDefault(),pt.stopPropagation(),X(Ce))},ke=()=>t(2,T=""),Me=()=>{a&&!L&&q()},Je=Ce=>G(Ce);function ct(Ce){O=Ce,t(6,O)}function Se(Ce){te[Ce?"unshift":"push"](()=>{S=Ce,t(1,S)})}function we(Ce){Fe.call(this,n,Ce)}function Ue(Ce){Fe.call(this,n,Ce)}function it(Ce){te[Ce?"unshift":"push"](()=>{C=Ce,t(7,C)})}const ne=Ce=>{j.removeByKey($,"id",Ce.detail.record.id),$.unshift(Ce.detail.record),t(8,$),B(Ce.detail.record)},qe=Ce=>{j.removeByKey($,"id",Ce.detail.id),t(8,$),G(Ce.detail)};return n.$$set=Ce=>{e=je(je({},e),xt(Ce)),t(19,d=tt(e,c)),"value"in Ce&&t(20,_=Ce.value),"field"in Ce&&t(21,y=Ce.field)},n.$$.update=()=>{var Ce,pt;n.$$.dirty[0]&2097152&&t(4,i=((Ce=y==null?void 0:y.options)==null?void 0:Ce.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(pt=y==null?void 0:y.options)==null?void 0:pt.collectionId),n.$$.dirty[0]&100663296&&t(5,l=h.find(qt=>qt.id==s)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(l==null?void 0:l.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||N),n.$$.dirty[0]&8388608&&t(12,a=D==so),n.$$.dirty[0]&80&&t(10,u=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,f=function(qt){return j.findByKey(O,"id",qt.id)})},[F,S,T,L,i,l,O,C,$,f,u,o,a,r,q,B,G,X,J,d,_,y,P,D,N,s,h,W,oe,ee,se,Ee,Re,Ve,We,ke,Me,Je,ct,Se,we,Ue,it,ne,qe]}class nO extends be{constructor(e){super(),_e(this,e,tO,eO,ge,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function dh(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function ph(n,e,t){const i=n.slice();return i[26]=e[t],i}function hh(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(l,o){w(l,e,o),i||(s=Te(t=Be.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(l,o){t&&Et(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+l[6].join(", ")})},d(l){l&&k(e),i=!1,s()}}}function mh(n){let e,t=n[5]&&gh(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=gh(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function gh(n){let e,t=pe(j.toArray(n[0]).slice(0,10)),i=[];for(let s=0;s ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function iO(n){let e,t,i,s,l,o,r,a,u,f;i=new tr({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("button"),o.innerHTML='',r=E(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[24]),Q(e,"dragover",n[25])},m(d,h){w(d,e,h),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),w(d,r,h),a=!0,u||(f=[Te(Be.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(d,h){n=d;const g={};h&16&&(g.record=n[21]),i.$set(g),(!a||h&16777216)&&Q(e,"dragging",n[24]),(!a||h&33554432)&&Q(e,"dragover",n[25])},i(d){a||(A(i.$$.fragment,d),a=!0)},o(d){I(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),V(i),u=!1,$e(f)}}}function bh(n,e){let t,i,s,l;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[iO,({dragging:a,dragover:u})=>({24:a,25:u}),({dragging:a,dragover:u})=>(a?16777216:0)|(u?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Nl({props:r}),te.push(()=>he(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[23]),u&128&&(f.disabled=!e[7]),u&587202576&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function sO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$=n[6].length&&hh(n),O=pe(n[4]);const M=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=ii(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(_,"class","list-item list-item-btn"),p(c,"class","list")},m(L,N){w(L,e,N),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),$&&$.m(e,null),w(L,f,N),w(L,c,N),b(c,d);for(let P=0;P({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new me({props:l}),n[15](e);let o={value:n[0],field:n[2]};return i=new nO({props:o}),n[16](i),i.$on("save",n[17]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&537919735&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const vh=100;function oO(n,e,t){let i,{field:s}=e,{value:l}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const M=j.toArray(l);return t(4,a=a.filter(D=>M.includes(D.id))),M.length!=a.length}async function h(){var N,P;const M=j.toArray(l);if(t(4,a=[]),t(6,c=[]),!((N=s==null?void 0:s.options)!=null&&N.collectionId)||!M.length){t(5,u=!1);return}t(5,u=!0);const D=M.slice(),L=[];for(;D.length>0;){const F=[];for(const R of D.splice(0,vh))F.push(`id="${R}"`);L.push(de.collection((P=s==null?void 0:s.options)==null?void 0:P.collectionId).getFullList(vh,{filter:F.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let F=[];await Promise.all(L).then(R=>{F=F.concat(...R)});for(const R of M){const q=j.findByKey(F,"id",R);q?a.push(q):c.push(R)}t(4,a),m()}catch(F){de.error(F)}t(5,u=!1)}function g(M){j.removeByKey(a,"id",M.id),t(4,a),m()}function m(){var M;i?t(0,l=a.map(D=>D.id)):t(0,l=((M=a[0])==null?void 0:M.id)||"")}Ls(()=>{clearTimeout(f)});const _=M=>g(M);function y(M){a=M,t(4,a)}const S=()=>{m()},C=()=>o==null?void 0:o.show();function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){te[M?"unshift":"push"](()=>{o=M,t(1,o)})}const O=M=>{var D;t(4,a=M.detail||[]),t(0,l=i?a.map(L=>L.id):((D=a[0])==null?void 0:D.id)||"")};return n.$$set=M=>{"field"in M&&t(2,s=M.field),"value"in M&&t(0,l=M.value),"picker"in M&&t(1,o=M.picker)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(7,i=((M=s.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof l<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(h,0)))},[l,o,s,r,a,u,c,i,g,m,f,_,y,S,C,T,$,O]}class rO extends be{constructor(e){super(),_e(this,e,oO,lO,ge,{field:2,value:0,picker:1})}}const aO=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],uO=(n,e)=>{aO.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function fO(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),Vr(e,"visibility","hidden")},m(t,i){w(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[18](null)}}}function cO(n){let e;return{c(){e=v("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[17](null)}}}function dO(n){let e;function t(l,o){return l[1]?cO:fO}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),p(e,"class",n[2])},m(l,o){w(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:x,o:x,d(l){l&&k(e),s.d(),n[19](null)}}}const U1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),pO=()=>{let n={listeners:[],scriptId:U1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let hO=pO();function mO(n,e,t){var i;let{id:s=U1("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:h=""}=e,{cssClass:g="tinymce-wrapper"}=e,m,_,y,S=d,C=o;const T=dt(),$=()=>{const P=(()=>typeof window<"u"?window:global)();return P&&P.tinymce?P.tinymce:null},O=()=>{const N=Object.assign(Object.assign({},f),{target:_,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:P=>{t(14,y=P),P.on("init",()=>{P.setContent(d),P.on(c,()=>{t(15,S=P.getContent()),S!==d&&(t(5,d=S),t(6,h=P.getContent({format:"text"})))})}),uO(P,T),typeof f.setup=="function"&&f.setup(P)}});t(4,_.style.visibility="",_),$().init(N)};Kt(()=>{if($()!==null)O();else{const N=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;hO.load(m.ownerDocument,N,()=>{O()})}}),Ls(()=>{var N;y&&((N=$())===null||N===void 0||N.remove(y))});function M(N){te[N?"unshift":"push"](()=>{_=N,t(4,_)})}function D(N){te[N?"unshift":"push"](()=>{_=N,t(4,_)})}function L(N){te[N?"unshift":"push"](()=>{m=N,t(3,m)})}return n.$$set=N=>{"id"in N&&t(0,s=N.id),"inline"in N&&t(1,l=N.inline),"disabled"in N&&t(7,o=N.disabled),"apiKey"in N&&t(8,r=N.apiKey),"channel"in N&&t(9,a=N.channel),"scriptSrc"in N&&t(10,u=N.scriptSrc),"conf"in N&&t(11,f=N.conf),"modelEvents"in N&&t(12,c=N.modelEvents),"value"in N&&t(5,d=N.value),"text"in N&&t(6,h=N.text),"cssClass"in N&&t(2,g=N.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(y&&S!==d&&(y.setContent(d),t(6,h=y.getContent({format:"text"}))),y&&o!==C&&(t(16,C=o),typeof(t(13,i=y.mode)===null||i===void 0?void 0:i.set)=="function"?y.mode.set(o?"readonly":"design"):y.setMode(o?"readonly":"design")))},[s,l,g,m,_,d,h,o,r,a,u,f,c,i,y,S,C,M,D,L]}class au extends be{constructor(e){super(),_e(this,e,mO,dO,ge,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function yh(n,e,t){const i=n.slice();i[44]=e[t];const s=i[19](i[44]);return i[45]=s,i}function kh(n,e,t){const i=n.slice();return i[48]=e[t],i}function wh(n,e,t){const i=n.slice();return i[51]=e[t],i}function gO(n){let e,t,i=[],s=new Map,l,o,r,a,u,f,c,d,h,g,m,_=pe(n[7]);const y=S=>S[51].id;for(let S=0;S<_.length;S+=1){let C=wh(n,_,S),T=y(C);s.set(T,i[S]=Sh(T,C))}return a=new El({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Jo({props:{class:"files-list",vThreshold:100,$$slots:{default:[wO]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=v("div"),t=v("aside");for(let S=0;SNew record',c=E(),z(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,C){w(S,e,C),b(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Sh(n,e){let t,i=e[51].name+"",s,l,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=v("button"),s=U(i),l=E(),p(t,"type","button"),p(t,"class","sidebar-item"),Q(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),b(t,s),b(t,l),o||(r=Y(t,"click",Ze(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&le(s,i),f[0]&384&&Q(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&k(t),o=!1,r()}}}function bO(n){var l;let e,t,i,s=((l=n[4])==null?void 0:l.length)&&Th(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?s?s.p(o,r):(s=Th(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function vO(n){let e=[],t=new Map,i,s=pe(n[5]);const l=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[17])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function yO(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function kO(n){let e,t,i;return{c(){e=v("img"),p(e,"loading","lazy"),un(e.src,t=de.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(s,l){w(s,e,l)},p(s,l){l[0]&32&&!un(e.src,t=de.files.getUrl(s[44],s[48],{thumb:"100x100"}))&&p(e,"src",t),l[0]&32&&i!==(i=s[48])&&p(e,"alt",i)},d(s){s&&k(e)}}}function Ch(n){let e,t,i,s,l,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(f[48])),t?kO:yO}let a=r(n,[-1,-1]),u=a(n);return{c(){e=v("button"),u.c(),i=E(),p(e,"type","button"),p(e,"class","thumb handle"),Q(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),b(e,i),l||(o=[Te(s=Be.call(null,e,n[48]+` + `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){I(t.$$.fragment,o),i=!1},d(o){o&&k(e),V(t),s=!1,$e(l)}}}function H5(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,h=!1,g="";function m(B){j.removeByValue(f,B),t(2,f)}function _(B){j.pushUnique(f,B),t(2,f)}function y(B){j.isEmpty(u[B])||u.splice(B,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function C(B){var X,J;B.preventDefault(),t(9,h=!1);const G=((X=B.dataTransfer)==null?void 0:X.files)||[];if(!(l||!G.length)){for(const U of G){const oe=s.length+u.length-f.length;if(((J=r.options)==null?void 0:J.maxSelect)<=oe)break;u.push(U)}t(1,u)}}Kt(async()=>{t(10,g=await ce.getAdminFileToken(o.collectionId))});const T=B=>m(B),$=B=>_(B);function O(B){a=B,t(0,a),t(6,i),t(4,r)}const M=B=>y(B);function D(B){u=B,t(1,u)}function L(B){te[B?"unshift":"push"](()=>{c=B,t(7,c)})}const N=()=>{for(let B of c.files)u.push(B);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function F(B){te[B?"unshift":"push"](()=>{d=B,t(8,d)})}const R=()=>{t(9,h=!0)},q=()=>{t(9,h=!1)};return n.$$set=B=>{"record"in B&&t(3,o=B.record),"field"in B&&t(4,r=B.field),"value"in B&&t(0,a=B.value),"uploadedFiles"in B&&t(1,u=B.uploadedFiles),"deletedFileNames"in B&&t(2,f=B.deletedFileNames)},n.$$.update=()=>{var B,G;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=j.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((B=r.options)==null?void 0:B.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=j.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((G=r.options)==null?void 0:G.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,h,g,l,m,_,y,C,T,$,O,M,D,L,N,P,F,R,q]}class V5 extends ve{constructor(e){super(),be(this,e,H5,j5,ge,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Gp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function z5(n,e){e=Gp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Gp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Zp(n,e,t){const i=n.slice();i[5]=e[t];const s=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=s,i}function Xp(n,e,t){const i=n.slice();return i[9]=e[t],i}function Qp(n){let e,t;return e=new ru({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&5&&(l.filename=i[9]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xp(n){let e=!j.isEmpty(n[9]),t,i,s=e&&Qp(n);return{c(){s&&s.c(),t=ye()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&5&&(e=!j.isEmpty(l[9])),e?s?(s.p(l,o),o&5&&A(s,1)):(s=Qp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(l){i||(A(s),i=!0)},o(l){I(s),i=!1},d(l){l&&k(t),s&&s.d(l)}}}function eh(n){let e,t,i=pe(n[6]),s=[];for(let o=0;oI(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oI(h[m],1,1,()=>{h[m]=null});return{c(){e=v("div"),t=v("i"),s=E();for(let m=0;mt(4,o=a));let{record:r}=e;return n.$$set=a=>{"record"in a&&t(0,r=a.record)},n.$$.update=()=>{var a,u,f,c;n.$$.dirty&17&&t(3,i=o==null?void 0:o.find(d=>d.id==(r==null?void 0:r.collectionId))),n.$$.dirty&8&&t(2,s=((u=(a=i==null?void 0:i.schema)==null?void 0:a.filter(d=>d.presentable&&d.type=="file"))==null?void 0:u.map(d=>d.name))||[]),n.$$.dirty&8&&t(1,l=((c=(f=i==null?void 0:i.schema)==null?void 0:f.filter(d=>d.presentable&&d.type!="file"))==null?void 0:c.map(d=>d.name))||[])},[r,l,s,i,o]}class nr extends ve{constructor(e){super(),be(this,e,U5,B5,ge,{record:0})}}function th(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function nh(n,e,t){const i=n.slice();i[49]=e[t];const s=i[9](i[49]);return i[6]=s,i}function ih(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function sh(n){let e,t=!n[13]&&lh(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[13]?t&&(t.d(1),t=null):t?t.p(i,s):(t=lh(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function lh(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&oh(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=oh(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function oh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[35]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function W5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Y5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rh(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),b(e,t),i||(s=[Te(Be.call(null,t,"Edit")),Y(t,"keydown",Sn(n[27])),Y(t,"click",Sn(l))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,$e(s)}}}function ah(n,e){let t,i,s,l,o,r,a,u;function f(_,y){return _[6]?Y5:W5}let c=f(e),d=c(e);l=new nr({props:{record:e[49]}});let h=!e[11]&&rh(e);function g(){return e[33](e[49])}function m(..._){return e[34](e[49],..._)}return{key:n,first:null,c(){t=v("div"),d.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),h&&h.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,y){w(_,t,y),d.m(t,null),b(t,i),b(t,s),H(l,s,null),b(t,o),h&&h.m(t,null),r=!0,a||(u=[Y(t,"click",g),Y(t,"keydown",m)],a=!0)},p(_,y){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),l.$set(S),e[11]?h&&(h.d(1),h=null):h?h.p(e,y):(h=rh(e),h.c(),h.m(t,null)),(!r||y[0]&768)&&Q(t,"selected",e[6]),(!r||y[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(A(l.$$.fragment,_),r=!0)},o(_){I(l.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),V(l),h&&h.d(),a=!1,$e(u)}}}function uh(n){let e;return{c(){e=v("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fh(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=W("("),i=W(t),s=W(" of MAX "),l=W(n[4]),o=W(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&16&&le(l,r[4])},d(r){r&&(k(e),k(i),k(s),k(l),k(o))}}}function K5(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function J5(n){let e,t,i=pe(n[6]),s=[];for(let o=0;oI(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o',l=E(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[52]),Q(e,"label-warning",n[53])},m(f,c){w(f,e,c),H(t,e,null),b(e,i),b(e,s),w(f,l,c),o=!0,r||(a=Y(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&Q(e,"label-danger",n[52]),(!o||c[1]&4194304)&&Q(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){I(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(l)),V(t),r=!1,a()}}}function ch(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[G5,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new Fl({props:l}),te.push(()=>he(e,"list",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Z5(n){let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,h,g,m,_,y,S,C;t=new Dl({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&ih(n),$=pe(n[8]);const O=R=>R[49].id;for(let R=0;R<$.length;R+=1){let q=nh(n,$,R),B=O(q);r.set(B,o[R]=ah(B,q))}let M=null;$.length||(M=sh(n));let D=n[13]&&uh(),L=n[4]>1&&fh(n);const N=[J5,K5],P=[];function F(R,q){return R[6].length?0:1}return g=F(n),m=P[g]=N[g](n),{c(){e=v("div"),z(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=v("div");for(let R=0;R1?L?L.p(R,q):(L=fh(R),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let G=g;g=F(R),g===G?P[g].p(R,q):(re(),I(P[G],1,1,()=>{P[G]=null}),ae(),m=P[g],m?m.p(R,q):(m=P[g]=N[g](R),m.c()),A(m,1),m.m(_.parentNode,_))},i(R){if(!y){A(t.$$.fragment,R);for(let q=0;q<$.length;q+=1)A(o[q]);A(m),y=!0}},o(R){I(t.$$.fragment,R);for(let q=0;qCancel',t=E(),i=v("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function x5(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[Q5],header:[X5],default:[Z5]},$$scope:{ctx:n}};for(let a=0;at(26,h=Ce));const g=dt(),m="picker_"+j.randomString(5);let{value:_}=e,{field:y}=e,S,C,T="",$=[],O=[],M=1,D=0,L=!1,N=!1;function P(){return t(2,T=""),t(8,$=[]),t(6,O=[]),R(),q(!0),S==null?void 0:S.show()}function F(){return S==null?void 0:S.hide()}async function R(){const Ce=j.toArray(_);if(!s||!Ce.length)return;t(24,N=!0);let pt=[];const qt=Ce.slice(),fn=[];for(;qt.length>0;){const nn=[];for(const rn of qt.splice(0,lo))nn.push(`id="${rn}"`);fn.push(ce.collection(s).getFullList({batch:lo,filter:nn.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(fn).then(nn=>{pt=pt.concat(...nn)}),t(6,O=[]);for(const nn of Ce){const rn=j.findByKey(pt,"id",nn);rn&&O.push(rn)}T.trim()||t(8,$=j.filterDuplicatesByKey(O.concat($))),t(24,N=!1)}catch(nn){nn.isAbort||(ce.error(nn),t(24,N=!1))}}async function q(Ce=!1){if(s){t(3,L=!0),Ce&&(T.trim()?t(8,$=[]):t(8,$=j.toArray(O).slice()));try{const pt=Ce?1:M+1,qt=j.getAllCollectionIdentifiers(l),fn=await ce.collection(s).getList(pt,lo,{filter:j.normalizeSearchFilter(T,qt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:m+"loadList"});t(8,$=j.filterDuplicatesByKey($.concat(fn.items))),M=fn.page,t(23,D=fn.items.length),t(3,L=!1)}catch(pt){pt.isAbort||(ce.error(pt),t(3,L=!1))}}}function B(Ce){i==1?t(6,O=[Ce]):u&&(j.pushOrReplaceByKey(O,Ce),t(6,O))}function G(Ce){j.removeByKey(O,"id",Ce.id),t(6,O)}function X(Ce){f(Ce)?G(Ce):B(Ce)}function J(){var Ce;i!=1?t(20,_=O.map(pt=>pt.id)):t(20,_=((Ce=O==null?void 0:O[0])==null?void 0:Ce.id)||""),g("save",O),F()}function U(Ce){Fe.call(this,n,Ce)}const oe=()=>F(),ee=()=>J(),se=Ce=>t(2,T=Ce.detail),Ee=()=>C==null?void 0:C.show(),Re=Ce=>C==null?void 0:C.show(Ce),Ve=Ce=>X(Ce),We=(Ce,pt)=>{(pt.code==="Enter"||pt.code==="Space")&&(pt.preventDefault(),pt.stopPropagation(),X(Ce))},ke=()=>t(2,T=""),Me=()=>{a&&!L&&q()},Je=Ce=>G(Ce);function ct(Ce){O=Ce,t(6,O)}function Se(Ce){te[Ce?"unshift":"push"](()=>{S=Ce,t(1,S)})}function we(Ce){Fe.call(this,n,Ce)}function Ue(Ce){Fe.call(this,n,Ce)}function it(Ce){te[Ce?"unshift":"push"](()=>{C=Ce,t(7,C)})}const ne=Ce=>{j.removeByKey($,"id",Ce.detail.record.id),$.unshift(Ce.detail.record),t(8,$),B(Ce.detail.record)},qe=Ce=>{j.removeByKey($,"id",Ce.detail.id),t(8,$),G(Ce.detail)};return n.$$set=Ce=>{e=je(je({},e),xt(Ce)),t(19,d=tt(e,c)),"value"in Ce&&t(20,_=Ce.value),"field"in Ce&&t(21,y=Ce.field)},n.$$.update=()=>{var Ce,pt;n.$$.dirty[0]&2097152&&t(4,i=((Ce=y==null?void 0:y.options)==null?void 0:Ce.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(pt=y==null?void 0:y.options)==null?void 0:pt.collectionId),n.$$.dirty[0]&100663296&&t(5,l=h.find(qt=>qt.id==s)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(l==null?void 0:l.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||N),n.$$.dirty[0]&8388608&&t(12,a=D==lo),n.$$.dirty[0]&80&&t(10,u=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,f=function(qt){return j.findByKey(O,"id",qt.id)})},[F,S,T,L,i,l,O,C,$,f,u,o,a,r,q,B,G,X,J,d,_,y,P,D,N,s,h,U,oe,ee,se,Ee,Re,Ve,We,ke,Me,Je,ct,Se,we,Ue,it,ne,qe]}class tO extends ve{constructor(e){super(),be(this,e,eO,x5,ge,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function dh(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function ph(n,e,t){const i=n.slice();return i[26]=e[t],i}function hh(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(l,o){w(l,e,o),i||(s=Te(t=Be.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(l,o){t&&Et(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+l[6].join(", ")})},d(l){l&&k(e),i=!1,s()}}}function mh(n){let e,t=n[5]&&gh(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=gh(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function gh(n){let e,t=pe(j.toArray(n[0]).slice(0,10)),i=[];for(let s=0;s ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function nO(n){let e,t,i,s,l,o,r,a,u,f;i=new nr({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("button"),o.innerHTML='',r=E(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[24]),Q(e,"dragover",n[25])},m(d,h){w(d,e,h),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),w(d,r,h),a=!0,u||(f=[Te(Be.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(d,h){n=d;const g={};h&16&&(g.record=n[21]),i.$set(g),(!a||h&16777216)&&Q(e,"dragging",n[24]),(!a||h&33554432)&&Q(e,"dragover",n[25])},i(d){a||(A(i.$$.fragment,d),a=!0)},o(d){I(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),V(i),u=!1,$e(f)}}}function bh(n,e){let t,i,s,l;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[nO,({dragging:a,dragover:u})=>({24:a,25:u}),({dragging:a,dragover:u})=>(a?16777216:0)|(u?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Fl({props:r}),te.push(()=>he(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[23]),u&128&&(f.disabled=!e[7]),u&587202576&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],_e(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function iO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$=n[6].length&&hh(n),O=pe(n[4]);const M=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=ii(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(_,"class","list-item list-item-btn"),p(c,"class","list")},m(L,N){w(L,e,N),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),$&&$.m(e,null),w(L,f,N),w(L,c,N),b(c,d);for(let P=0;P({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new me({props:l}),n[15](e);let o={value:n[0],field:n[2]};return i=new tO({props:o}),n[16](i),i.$on("save",n[17]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&537919735&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const vh=100;function lO(n,e,t){let i,{field:s}=e,{value:l}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const M=j.toArray(l);return t(4,a=a.filter(D=>M.includes(D.id))),M.length!=a.length}async function h(){var N,P;const M=j.toArray(l);if(t(4,a=[]),t(6,c=[]),!((N=s==null?void 0:s.options)!=null&&N.collectionId)||!M.length){t(5,u=!1);return}t(5,u=!0);const D=M.slice(),L=[];for(;D.length>0;){const F=[];for(const R of D.splice(0,vh))F.push(`id="${R}"`);L.push(ce.collection((P=s==null?void 0:s.options)==null?void 0:P.collectionId).getFullList(vh,{filter:F.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let F=[];await Promise.all(L).then(R=>{F=F.concat(...R)});for(const R of M){const q=j.findByKey(F,"id",R);q?a.push(q):c.push(R)}t(4,a),m()}catch(F){ce.error(F)}t(5,u=!1)}function g(M){j.removeByKey(a,"id",M.id),t(4,a),m()}function m(){var M;i?t(0,l=a.map(D=>D.id)):t(0,l=((M=a[0])==null?void 0:M.id)||"")}Ps(()=>{clearTimeout(f)});const _=M=>g(M);function y(M){a=M,t(4,a)}const S=()=>{m()},C=()=>o==null?void 0:o.show();function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){te[M?"unshift":"push"](()=>{o=M,t(1,o)})}const O=M=>{var D;t(4,a=M.detail||[]),t(0,l=i?a.map(L=>L.id):((D=a[0])==null?void 0:D.id)||"")};return n.$$set=M=>{"field"in M&&t(2,s=M.field),"value"in M&&t(0,l=M.value),"picker"in M&&t(1,o=M.picker)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(7,i=((M=s.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof l<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(h,0)))},[l,o,s,r,a,u,c,i,g,m,f,_,y,S,C,T,$,O]}class oO extends ve{constructor(e){super(),be(this,e,lO,sO,ge,{field:2,value:0,picker:1})}}const rO=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],aO=(n,e)=>{rO.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function uO(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),Vr(e,"visibility","hidden")},m(t,i){w(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[18](null)}}}function fO(n){let e;return{c(){e=v("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[17](null)}}}function cO(n){let e;function t(l,o){return l[1]?fO:uO}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),p(e,"class",n[2])},m(l,o){w(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:x,o:x,d(l){l&&k(e),s.d(),n[19](null)}}}const B1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),dO=()=>{let n={listeners:[],scriptId:B1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let pO=dO();function hO(n,e,t){var i;let{id:s=B1("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:h=""}=e,{cssClass:g="tinymce-wrapper"}=e,m,_,y,S=d,C=o;const T=dt(),$=()=>{const P=(()=>typeof window<"u"?window:global)();return P&&P.tinymce?P.tinymce:null},O=()=>{const N=Object.assign(Object.assign({},f),{target:_,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:P=>{t(14,y=P),P.on("init",()=>{P.setContent(d),P.on(c,()=>{t(15,S=P.getContent()),S!==d&&(t(5,d=S),t(6,h=P.getContent({format:"text"})))})}),aO(P,T),typeof f.setup=="function"&&f.setup(P)}});t(4,_.style.visibility="",_),$().init(N)};Kt(()=>{if($()!==null)O();else{const N=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;pO.load(m.ownerDocument,N,()=>{O()})}}),Ps(()=>{var N;y&&((N=$())===null||N===void 0||N.remove(y))});function M(N){te[N?"unshift":"push"](()=>{_=N,t(4,_)})}function D(N){te[N?"unshift":"push"](()=>{_=N,t(4,_)})}function L(N){te[N?"unshift":"push"](()=>{m=N,t(3,m)})}return n.$$set=N=>{"id"in N&&t(0,s=N.id),"inline"in N&&t(1,l=N.inline),"disabled"in N&&t(7,o=N.disabled),"apiKey"in N&&t(8,r=N.apiKey),"channel"in N&&t(9,a=N.channel),"scriptSrc"in N&&t(10,u=N.scriptSrc),"conf"in N&&t(11,f=N.conf),"modelEvents"in N&&t(12,c=N.modelEvents),"value"in N&&t(5,d=N.value),"text"in N&&t(6,h=N.text),"cssClass"in N&&t(2,g=N.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(y&&S!==d&&(y.setContent(d),t(6,h=y.getContent({format:"text"}))),y&&o!==C&&(t(16,C=o),typeof(t(13,i=y.mode)===null||i===void 0?void 0:i.set)=="function"?y.mode.set(o?"readonly":"design"):y.setMode(o?"readonly":"design")))},[s,l,g,m,_,d,h,o,r,a,u,f,c,i,y,S,C,M,D,L]}class au extends ve{constructor(e){super(),be(this,e,hO,cO,ge,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function yh(n,e,t){const i=n.slice();i[44]=e[t];const s=i[19](i[44]);return i[45]=s,i}function kh(n,e,t){const i=n.slice();return i[48]=e[t],i}function wh(n,e,t){const i=n.slice();return i[51]=e[t],i}function mO(n){let e,t,i=[],s=new Map,l,o,r,a,u,f,c,d,h,g,m,_=pe(n[7]);const y=S=>S[51].id;for(let S=0;S<_.length;S+=1){let C=wh(n,_,S),T=y(C);s.set(T,i[S]=Sh(T,C))}return a=new Dl({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Go({props:{class:"files-list",vThreshold:100,$$slots:{default:[kO]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=v("div"),t=v("aside");for(let S=0;SNew record',c=E(),z(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,C){w(S,e,C),b(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Sh(n,e){let t,i=e[51].name+"",s,l,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=v("button"),s=W(i),l=E(),p(t,"type","button"),p(t,"class","sidebar-item"),Q(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),b(t,s),b(t,l),o||(r=Y(t,"click",Ze(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&le(s,i),f[0]&384&&Q(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&k(t),o=!1,r()}}}function _O(n){var l;let e,t,i,s=((l=n[4])==null?void 0:l.length)&&Th(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?s?s.p(o,r):(s=Th(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function bO(n){let e=[],t=new Map,i,s=pe(n[5]);const l=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[17])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function vO(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function yO(n){let e,t,i;return{c(){e=v("img"),p(e,"loading","lazy"),un(e.src,t=ce.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(s,l){w(s,e,l)},p(s,l){l[0]&32&&!un(e.src,t=ce.files.getUrl(s[44],s[48],{thumb:"100x100"}))&&p(e,"src",t),l[0]&32&&i!==(i=s[48])&&p(e,"alt",i)},d(s){s&&k(e)}}}function Ch(n){let e,t,i,s,l,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(f[48])),t?yO:vO}let a=r(n,[-1,-1]),u=a(n);return{c(){e=v("button"),u.c(),i=E(),p(e,"type","button"),p(e,"class","thumb handle"),Q(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),b(e,i),l||(o=[Te(s=Be.call(null,e,n[48]+` (record: `+n[44].id+")")),Y(e,"click",Ze(function(){Et(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],l=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),s&&Et(s.update)&&c[0]&32&&s.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&Q(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&k(e),u.d(),l=!1,$e(o)}}}function $h(n,e){let t,i,s=pe(e[45]),l=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wO(n){let e,t;function i(r,a){if(r[15])return vO;if(!r[6])return bO}let s=i(n),l=s&&s(n),o=n[6]&&Mh();return{c(){l&&l.c(),e=E(),o&&o.c(),t=ye()},m(r,a){l&&l.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){s===(s=i(r))&&l?l.p(r,a):(l&&l.d(1),l=s&&s(r),l&&(l.c(),l.m(e.parentNode,e))),r[6]?o||(o=Mh(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(k(e),k(t)),l&&l.d(r),o&&o.d(r)}}}function SO(n){let e,t,i,s;const l=[_O,gO],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function TO(n){let e,t;return{c(){e=v("h4"),t=U(n[0])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&1&&le(t,i[0])},d(i){i&&k(e)}}}function Oh(n){let e,t;return e=new me({props:{class:"form-field file-picker-size-select",$$slots:{default:[CO,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&8402944|s[1]&8388608&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function CO(n){let e,t,i;function s(o){n[28](o)}let l={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(l.keyOfSelected=n[12]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $O(n){var g;let e,t,i,s=j.hasImageExtension((g=n[9])==null?void 0:g.name),l,o,r,a,u,f,c,d,h=s&&Oh(n);return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),h&&h.c(),l=E(),o=v("button"),r=v("span"),a=U(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(m,_){w(m,e,_),b(e,t),w(m,i,_),h&&h.m(m,_),w(m,l,_),w(m,o,_),b(o,r),b(r,a),f=!0,c||(d=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(m,_){var y;(!f||_[0]&64)&&(e.disabled=m[6]),_[0]&512&&(s=j.hasImageExtension((y=m[9])==null?void 0:y.name)),s?h?(h.p(m,_),_[0]&512&&A(h,1)):(h=Oh(m),h.c(),A(h,1),h.m(l.parentNode,l)):h&&(re(),I(h,1,1,()=>{h=null}),ae()),(!f||_[0]&2)&&le(a,m[1]),(!f||_[0]&8192&&u!==(u=!m[13]))&&(o.disabled=u)},i(m){f||(A(h),f=!0)},o(m){I(h),f=!1},d(m){m&&(k(e),k(i),k(l),k(o)),h&&h.d(m),c=!1,$e(d)}}}function MO(n){let e,t,i,s;const l=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[$O],header:[TO],default:[SO]},$$scope:{ctx:n}};for(let a=0;at(27,u=we));const f=dt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:h="Insert"}=e,{fileTypes:g=["image","document","video","audio","file"]}=e,m,_,y="",S=[],C=1,T=0,$=!1,O=[],M=[],D=[],L={},N={},P="";function F(){return G(!0),m==null?void 0:m.show()}function R(){return m==null?void 0:m.hide()}function q(){t(5,S=[]),t(9,N={}),t(12,P="")}function B(){t(4,y="")}async function G(we=!1){if(L!=null&&L.id){t(6,$=!0),we&&q();try{const Ue=we?1:C+1,it=j.getAllCollectionIdentifiers(L);let ne=j.normalizeSearchFilter(y,it)||"";ne&&(ne+=" && "),ne+="("+M.map(Ce=>`${Ce.name}:length>0`).join("||")+")";const qe=await de.collection(L.id).getList(Ue,Eh,{filter:ne,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(qe.items))),C=qe.page,t(26,T=qe.items.length),t(6,$=!1)}catch(Ue){Ue.isAbort||(de.error(Ue),t(6,$=!1))}}}function X(){var Ue,it;let we=["100x100"];if((Ue=N==null?void 0:N.record)!=null&&Ue.id){for(const ne of M)if(j.toArray(N.record[ne.name]).includes(N.name)){we=we.concat(j.toArray((it=ne.options)==null?void 0:it.thumbs));break}}t(11,D=[{label:"Original size",value:""}]);for(const ne of we)D.push({label:`${ne} thumb`,value:ne});P&&!we.includes(P)&&t(12,P="")}function J(we){let Ue=[];for(const it of M){const ne=j.toArray(we[it.name]);for(const qe of ne)g.includes(j.getFileType(qe))&&Ue.push(qe)}return Ue}function W(we,Ue){t(9,N={record:we,name:Ue})}function oe(){o&&(f("submit",Object.assign({size:P},N)),R())}function ee(we){P=we,t(12,P)}const se=we=>{t(8,L=we)},Ee=we=>t(4,y=we.detail),Re=()=>_==null?void 0:_.show(),Ve=()=>{l&&G()};function We(we){te[we?"unshift":"push"](()=>{m=we,t(3,m)})}function ke(we){Fe.call(this,n,we)}function Me(we){Fe.call(this,n,we)}function Je(we){te[we?"unshift":"push"](()=>{_=we,t(10,_)})}const ct=we=>{j.removeByKey(S,"id",we.detail.record.id),S.unshift(we.detail.record),t(5,S);const Ue=J(we.detail.record);Ue.length>0&&W(we.detail.record,Ue[0])},Se=we=>{var Ue;((Ue=N==null?void 0:N.record)==null?void 0:Ue.id)==we.detail.id&&t(9,N={}),j.removeByKey(S,"id",we.detail.id),t(5,S)};return n.$$set=we=>{e=je(je({},e),xt(we)),t(22,a=tt(e,r)),"title"in we&&t(0,d=we.title),"submitText"in we&&t(1,h=we.submitText),"fileTypes"in we&&t(24,g=we.fileTypes)},n.$$.update=()=>{var we;n.$$.dirty[0]&134217728&&t(7,O=u.filter(Ue=>Ue.type!=="view"&&!!j.toArray(Ue.schema).find(it=>{var ne;return it.type==="file"&&!((ne=it.options)!=null&&ne.protected)}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&O.length>0&&t(8,L=O[0]),n.$$.dirty[0]&256&&(M=(we=L==null?void 0:L.schema)==null?void 0:we.filter(Ue=>{var it;return Ue.type==="file"&&!((it=Ue.options)!=null&&it.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(B(),X()),n.$$.dirty[0]&512&&N!=null&&N.name&&X(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&m!=null&&m.isActive()&&G(!0),n.$$.dirty[0]&512&&t(16,i=(Ue,it)=>{var ne;return(N==null?void 0:N.name)==it&&((ne=N==null?void 0:N.record)==null?void 0:ne.id)==Ue.id}),n.$$.dirty[0]&32&&t(15,s=S.find(Ue=>J(Ue).length>0)),n.$$.dirty[0]&67108928&&t(14,l=!$&&T==Eh),n.$$.dirty[0]&576&&t(13,o=!$&&!!(N!=null&&N.name))},[d,h,R,m,y,S,$,O,L,N,_,D,P,o,l,s,i,B,G,J,W,oe,a,c,g,F,T,u,ee,se,Ee,Re,Ve,We,ke,Me,Je,ct,Se]}class EO extends be{constructor(e){super(),_e(this,e,OO,MO,ge,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function DO(n){let e;return{c(){e=v("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function AO(n){let e,t,i;function s(o){n[6](o)}let l={id:n[11],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:n[5]};return n[0]!==void 0&&(l.value=n[0]),e=new au({props:l}),te.push(()=>he(e,"value",s)),e.$on("init",n[7]),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function IO(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h;const g=[AO,DO],m=[];function _(y,S){return y[4]?0:1}return f=_(n),c=m[f]=g[f](n),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),m[f].m(y,S),w(y,d,S),h=!0},p(y,S){(!h||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!h||S&2)&&o!==(o=y[1].name+"")&&le(r,o),(!h||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let C=f;f=_(y),f===C?m[f].p(y,S):(re(),I(m[C],1,1,()=>{m[C]=null}),ae(),c=m[f],c?c.p(y,S):(c=m[f]=g[f](y),c.c()),A(c,1),c.m(d.parentNode,d))},i(y){h||(A(c),h=!0)},o(y){I(c),h=!1},d(y){y&&(k(e),k(u),k(d)),m[f].d(y)}}}function LO(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[IO,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let l={title:"Select an image",fileTypes:["image"]};return i=new EO({props:l}),n[8](i),i.$on("submit",n[9]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),s=!1},d(o){o&&k(t),V(e,o),n[8](null),V(i,o)}}}function PO(n,e,t){let i,{field:s}=e,{value:l=""}=e,o,r,a=!1,u=null;Kt(()=>(u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(g){l=g,t(0,l)}const c=g=>{t(3,r=g.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(g){te[g?"unshift":"push"](()=>{o=g,t(2,o)})}const h=g=>{r==null||r.execCommand("InsertImage",!1,de.files.getUrl(g.detail.record,g.detail.name,{thumb:g.detail.size}))};return n.$$set=g=>{"field"in g&&t(1,s=g.field),"value"in g&&t(0,l=g.value)},n.$$.update=()=>{var g;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(g=s.options)==null?void 0:g.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof l>"u"&&t(0,l="")},[l,s,o,r,a,i,f,c,d,h]}class NO extends be{constructor(e){super(),_e(this,e,PO,LO,ge,{field:1,value:0})}}function FO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].authUrl),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].authUrl&&ce(l,u[0].authUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function RO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].tokenUrl),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&ce(l,u[0].tokenUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function qO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("User API URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].userApiUrl),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&ce(l,u[0].userApiUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function jO(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[FO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[RO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[qO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Selfhosted endpoints (optional)",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),p(e,"class","section-title")},m(u,f){w(u,e,f),w(u,t,f),H(i,u,f),w(u,s,f),H(l,u,f),w(u,o,f),H(r,u,f),a=!0},p(u,[f]){const c={};f&2&&(c.name=u[1]+".authUrl"),f&97&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&2&&(d.name=u[1]+".tokenUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),l.$set(d);const h={};f&2&&(h.name=u[1]+".userApiUrl"),f&97&&(h.$$scope={dirty:f,ctx:u}),r.$set(h)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){I(i.$$.fragment,u),I(l.$$.fragment,u),I(r.$$.fragment,u),a=!1},d(u){u&&(k(e),k(t),k(s),k(o)),V(i,u),V(l,u),V(r,u)}}}function HO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Dh extends be{constructor(e){super(),_e(this,e,HO,jO,ge,{key:1,config:0})}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ce(l,n[0].authUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[2]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].authUrl&&ce(l,d[0].authUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function zO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ce(l,n[0].tokenUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[3]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].tokenUrl&&ce(l,d[0].tokenUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function BO(n){let e,t,i,s,l,o;return i=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[VO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[zO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s)),V(i,r),V(l,r)}}}function UO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class WO extends be{constructor(e){super(),_e(this,e,UO,BO,ge,{key:1,config:0})}}function YO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ce(l,n[0].authUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[2]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].authUrl&&ce(l,d[0].authUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function KO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ce(l,n[0].tokenUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[3]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].tokenUrl&&ce(l,d[0].tokenUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function JO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("User API URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ce(l,n[0].userApiUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[4]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].userApiUrl&&ce(l,d[0].userApiUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function GO(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[YO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[KO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[JO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),p(e,"class","section-title")},m(u,f){w(u,e,f),w(u,t,f),H(i,u,f),w(u,s,f),H(l,u,f),w(u,o,f),H(r,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.class="form-field "+(u[0].enabled?"required":"")),f&2&&(c.name=u[1]+".authUrl"),f&97&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(u[0].enabled?"required":"")),f&2&&(d.name=u[1]+".tokenUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),l.$set(d);const h={};f&1&&(h.class="form-field "+(u[0].enabled?"required":"")),f&2&&(h.name=u[1]+".userApiUrl"),f&97&&(h.$$scope={dirty:f,ctx:u}),r.$set(h)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){I(i.$$.fragment,u),I(l.$$.fragment,u),I(r.$$.fragment,u),a=!1},d(u){u&&(k(e),k(t),k(s),k(o)),V(i,u),V(l,u),V(r,u)}}}function ZO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Rr extends be{constructor(e){super(),_e(this,e,ZO,GO,ge,{key:1,config:0})}}function XO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[2]),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&4&&l.value!==u[2]&&ce(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function QO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Team ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[3]),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&8&&l.value!==u[3]&&ce(l,u[3])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function xO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Key ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[4]),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&ce(l,u[4])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function eE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Duration (in seconds)",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",po),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ce(r,n[6]),u||(f=[Te(Be.call(null,s,{text:`Max ${po} seconds (~${po/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&ce(r,c[6])},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function tE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Private key"),s=E(),l=v("textarea"),r=E(),a=v("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- +(record: `+n[44].id+")"),c[0]&589856&&Q(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&k(e),u.d(),l=!1,$e(o)}}}function $h(n,e){let t,i,s=pe(e[45]),l=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kO(n){let e,t;function i(r,a){if(r[15])return bO;if(!r[6])return _O}let s=i(n),l=s&&s(n),o=n[6]&&Mh();return{c(){l&&l.c(),e=E(),o&&o.c(),t=ye()},m(r,a){l&&l.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){s===(s=i(r))&&l?l.p(r,a):(l&&l.d(1),l=s&&s(r),l&&(l.c(),l.m(e.parentNode,e))),r[6]?o||(o=Mh(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(k(e),k(t)),l&&l.d(r),o&&o.d(r)}}}function wO(n){let e,t,i,s;const l=[gO,mO],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function SO(n){let e,t;return{c(){e=v("h4"),t=W(n[0])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&1&&le(t,i[0])},d(i){i&&k(e)}}}function Oh(n){let e,t;return e=new me({props:{class:"form-field file-picker-size-select",$$slots:{default:[TO,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&8402944|s[1]&8388608&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function TO(n){let e,t,i;function s(o){n[28](o)}let l={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(l.keyOfSelected=n[12]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CO(n){var g;let e,t,i,s=j.hasImageExtension((g=n[9])==null?void 0:g.name),l,o,r,a,u,f,c,d,h=s&&Oh(n);return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),h&&h.c(),l=E(),o=v("button"),r=v("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(m,_){w(m,e,_),b(e,t),w(m,i,_),h&&h.m(m,_),w(m,l,_),w(m,o,_),b(o,r),b(r,a),f=!0,c||(d=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(m,_){var y;(!f||_[0]&64)&&(e.disabled=m[6]),_[0]&512&&(s=j.hasImageExtension((y=m[9])==null?void 0:y.name)),s?h?(h.p(m,_),_[0]&512&&A(h,1)):(h=Oh(m),h.c(),A(h,1),h.m(l.parentNode,l)):h&&(re(),I(h,1,1,()=>{h=null}),ae()),(!f||_[0]&2)&&le(a,m[1]),(!f||_[0]&8192&&u!==(u=!m[13]))&&(o.disabled=u)},i(m){f||(A(h),f=!0)},o(m){I(h),f=!1},d(m){m&&(k(e),k(i),k(l),k(o)),h&&h.d(m),c=!1,$e(d)}}}function $O(n){let e,t,i,s;const l=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[CO],header:[SO],default:[wO]},$$scope:{ctx:n}};for(let a=0;at(27,u=we));const f=dt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:h="Insert"}=e,{fileTypes:g=["image","document","video","audio","file"]}=e,m,_,y="",S=[],C=1,T=0,$=!1,O=[],M=[],D=[],L={},N={},P="";function F(){return G(!0),m==null?void 0:m.show()}function R(){return m==null?void 0:m.hide()}function q(){t(5,S=[]),t(9,N={}),t(12,P="")}function B(){t(4,y="")}async function G(we=!1){if(L!=null&&L.id){t(6,$=!0),we&&q();try{const Ue=we?1:C+1,it=j.getAllCollectionIdentifiers(L);let ne=j.normalizeSearchFilter(y,it)||"";ne&&(ne+=" && "),ne+="("+M.map(Ce=>`${Ce.name}:length>0`).join("||")+")";const qe=await ce.collection(L.id).getList(Ue,Eh,{filter:ne,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(qe.items))),C=qe.page,t(26,T=qe.items.length),t(6,$=!1)}catch(Ue){Ue.isAbort||(ce.error(Ue),t(6,$=!1))}}}function X(){var Ue,it;let we=["100x100"];if((Ue=N==null?void 0:N.record)!=null&&Ue.id){for(const ne of M)if(j.toArray(N.record[ne.name]).includes(N.name)){we=we.concat(j.toArray((it=ne.options)==null?void 0:it.thumbs));break}}t(11,D=[{label:"Original size",value:""}]);for(const ne of we)D.push({label:`${ne} thumb`,value:ne});P&&!we.includes(P)&&t(12,P="")}function J(we){let Ue=[];for(const it of M){const ne=j.toArray(we[it.name]);for(const qe of ne)g.includes(j.getFileType(qe))&&Ue.push(qe)}return Ue}function U(we,Ue){t(9,N={record:we,name:Ue})}function oe(){o&&(f("submit",Object.assign({size:P},N)),R())}function ee(we){P=we,t(12,P)}const se=we=>{t(8,L=we)},Ee=we=>t(4,y=we.detail),Re=()=>_==null?void 0:_.show(),Ve=()=>{l&&G()};function We(we){te[we?"unshift":"push"](()=>{m=we,t(3,m)})}function ke(we){Fe.call(this,n,we)}function Me(we){Fe.call(this,n,we)}function Je(we){te[we?"unshift":"push"](()=>{_=we,t(10,_)})}const ct=we=>{j.removeByKey(S,"id",we.detail.record.id),S.unshift(we.detail.record),t(5,S);const Ue=J(we.detail.record);Ue.length>0&&U(we.detail.record,Ue[0])},Se=we=>{var Ue;((Ue=N==null?void 0:N.record)==null?void 0:Ue.id)==we.detail.id&&t(9,N={}),j.removeByKey(S,"id",we.detail.id),t(5,S)};return n.$$set=we=>{e=je(je({},e),xt(we)),t(22,a=tt(e,r)),"title"in we&&t(0,d=we.title),"submitText"in we&&t(1,h=we.submitText),"fileTypes"in we&&t(24,g=we.fileTypes)},n.$$.update=()=>{var we;n.$$.dirty[0]&134217728&&t(7,O=u.filter(Ue=>Ue.type!=="view"&&!!j.toArray(Ue.schema).find(it=>{var ne;return it.type==="file"&&!((ne=it.options)!=null&&ne.protected)}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&O.length>0&&t(8,L=O[0]),n.$$.dirty[0]&256&&(M=(we=L==null?void 0:L.schema)==null?void 0:we.filter(Ue=>{var it;return Ue.type==="file"&&!((it=Ue.options)!=null&&it.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(B(),X()),n.$$.dirty[0]&512&&N!=null&&N.name&&X(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&m!=null&&m.isActive()&&G(!0),n.$$.dirty[0]&512&&t(16,i=(Ue,it)=>{var ne;return(N==null?void 0:N.name)==it&&((ne=N==null?void 0:N.record)==null?void 0:ne.id)==Ue.id}),n.$$.dirty[0]&32&&t(15,s=S.find(Ue=>J(Ue).length>0)),n.$$.dirty[0]&67108928&&t(14,l=!$&&T==Eh),n.$$.dirty[0]&576&&t(13,o=!$&&!!(N!=null&&N.name))},[d,h,R,m,y,S,$,O,L,N,_,D,P,o,l,s,i,B,G,J,U,oe,a,c,g,F,T,u,ee,se,Ee,Re,Ve,We,ke,Me,Je,ct,Se]}class OO extends ve{constructor(e){super(),be(this,e,MO,$O,ge,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function EO(n){let e;return{c(){e=v("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function DO(n){let e,t,i;function s(o){n[6](o)}let l={id:n[11],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:n[5]};return n[0]!==void 0&&(l.value=n[0]),e=new au({props:l}),te.push(()=>he(e,"value",s)),e.$on("init",n[7]),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function AO(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h;const g=[DO,EO],m=[];function _(y,S){return y[4]?0:1}return f=_(n),c=m[f]=g[f](n),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),m[f].m(y,S),w(y,d,S),h=!0},p(y,S){(!h||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!h||S&2)&&o!==(o=y[1].name+"")&&le(r,o),(!h||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let C=f;f=_(y),f===C?m[f].p(y,S):(re(),I(m[C],1,1,()=>{m[C]=null}),ae(),c=m[f],c?c.p(y,S):(c=m[f]=g[f](y),c.c()),A(c,1),c.m(d.parentNode,d))},i(y){h||(A(c),h=!0)},o(y){I(c),h=!1},d(y){y&&(k(e),k(u),k(d)),m[f].d(y)}}}function IO(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[AO,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let l={title:"Select an image",fileTypes:["image"]};return i=new OO({props:l}),n[8](i),i.$on("submit",n[9]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),s=!1},d(o){o&&k(t),V(e,o),n[8](null),V(i,o)}}}function LO(n,e,t){let i,{field:s}=e,{value:l=""}=e,o,r,a=!1,u=null;Kt(()=>(u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(g){l=g,t(0,l)}const c=g=>{t(3,r=g.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(g){te[g?"unshift":"push"](()=>{o=g,t(2,o)})}const h=g=>{r==null||r.execCommand("InsertImage",!1,ce.files.getUrl(g.detail.record,g.detail.name,{thumb:g.detail.size}))};return n.$$set=g=>{"field"in g&&t(1,s=g.field),"value"in g&&t(0,l=g.value)},n.$$.update=()=>{var g;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(g=s.options)==null?void 0:g.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof l>"u"&&t(0,l="")},[l,s,o,r,a,i,f,c,d,h]}class PO extends ve{constructor(e){super(),be(this,e,LO,IO,ge,{field:1,value:0})}}function NO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Auth URL"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].authUrl),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].authUrl&&de(l,u[0].authUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function FO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Token URL"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].tokenUrl),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].tokenUrl&&de(l,u[0].tokenUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function RO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("User API URL"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].userApiUrl),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].userApiUrl&&de(l,u[0].userApiUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function qO(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[NO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[FO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[RO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=W(n[2]),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),b(e,t),w(f,i,c),H(s,f,c),w(f,l,c),H(o,f,c),w(f,r,c),H(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&le(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".tokenUrl"),c&777&&(h.$$scope={dirty:c,ctx:f}),o.$set(h);const g={};c&8&&(g.class="form-field "+(f[3]?"required":"")),c&2&&(g.name=f[1]+".userApiUrl"),c&777&&(g.$$scope={dirty:c,ctx:f}),a.$set(g)},i(f){u||(A(s.$$.fragment,f),A(o.$$.fragment,f),A(a.$$.fragment,f),u=!0)},o(f){I(s.$$.fragment,f),I(o.$$.fragment,f),I(a.$$.fragment,f),u=!1},d(f){f&&(k(e),k(i),k(l),k(r)),V(s,f),V(o,f),V(a,f)}}}function jO(n,e,t){let i,{key:s=""}=e,{config:l={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){l.authUrl=this.value,t(0,l)}function u(){l.tokenUrl=this.value,t(0,l)}function f(){l.userApiUrl=this.value,t(0,l)}return n.$$set=c=>{"key"in c&&t(1,s=c.key),"config"in c&&t(0,l=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(l==null?void 0:l.enabled))},[l,s,r,i,o,a,u,f]}class vs extends ve{constructor(e){super(),be(this,e,jO,qO,ge,{key:1,config:0,required:4,title:2})}}function HO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=W("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),de(l,n[0].authUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[2]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].authUrl&&de(l,d[0].authUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=W("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),de(l,n[0].tokenUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[3]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].tokenUrl&&de(l,d[0].tokenUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function zO(n){let e,t,i,s,l,o;return i=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[HO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[VO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s)),V(i,r),V(l,r)}}}function BO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class UO extends ve{constructor(e){super(),be(this,e,BO,zO,ge,{key:1,config:0})}}function WO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[2]),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&4&&l.value!==u[2]&&de(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function YO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Team ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[3]),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&8&&l.value!==u[3]&&de(l,u[3])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function KO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Key ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[4]),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&de(l,u[4])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function JO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Duration (in seconds)",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",ho),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[6]),u||(f=[Te(Be.call(null,s,{text:`Max ${ho} seconds (~${ho/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&de(r,c[6])},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function GO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=W("Private key"),s=E(),l=v("textarea"),r=E(),a=v("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ce(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&ce(l,c[5])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function nE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return s=new me({props:{class:"form-field required",name:"clientId",$$slots:{default:[XO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"teamId",$$slots:{default:[QO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"keyId",$$slots:{default:[xO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"duration",$$slots:{default:[eE,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:"privateKey",$$slots:{default:[tE,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),z(m.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(C,T){w(C,e,T),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),b(t,a),b(t,u),H(f,u,null),b(t,c),b(t,d),H(h,d,null),b(t,g),H(m,t,null),_=!0,y||(S=Y(e,"submit",Ze(n[17])),y=!0)},p(C,T){const $={};T&25165828&&($.$$scope={dirty:T,ctx:C}),s.$set($);const O={};T&25165832&&(O.$$scope={dirty:T,ctx:C}),r.$set(O);const M={};T&25165840&&(M.$$scope={dirty:T,ctx:C}),f.$set(M);const D={};T&25165888&&(D.$$scope={dirty:T,ctx:C}),h.$set(D);const L={};T&25165856&&(L.$$scope={dirty:T,ctx:C}),m.$set(L)},i(C){_||(A(s.$$.fragment,C),A(r.$$.fragment,C),A(f.$$.fragment,C),A(h.$$.fragment,C),A(m.$$.fragment,C),_=!0)},o(C){I(s.$$.fragment,C),I(r.$$.fragment,C),I(f.$$.fragment,C),I(h.$$.fragment,C),I(m.$$.fragment,C),_=!1},d(C){C&&k(e),V(s),V(r),V(f),V(h),V(m),y=!1,S()}}}function iE(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function sE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function lE(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[sE],header:[iE],default:[nE]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[19](null),V(e,s)}}}const po=15777e3;function oE(n,e,t){let i;const s=dt(),l="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function h(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,c=N.duration||po),ln({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function m(){t(7,d=!0);try{const N=await de.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),zt("Successfully generated client secret."),s("submit",N),o==null||o.hide()}catch(N){de.error(N)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function C(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const $=()=>m(),O=()=>!d;function M(N){te[N?"unshift":"push"](()=>{o=N,t(1,o)})}function D(N){Fe.call(this,n,N)}function L(N){Fe.call(this,n,N)}return t(8,i=!0),[g,o,r,a,u,f,c,d,i,l,m,h,_,y,S,C,T,$,O,M,D,L]}class rE extends be{constructor(e){super(),_e(this,e,oE,lE,ge,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function aE(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new rE({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=E(),s=v("span"),s.textContent="Generate secret",o=E(),z(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,h){w(d,e,h),b(e,t),b(e,i),b(e,s),w(d,o,h),H(r,d,h),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[h]){(!a||h&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const g={};r.$set(g)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){I(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),V(r,d),u=!1,f()}}}function uE(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class fE extends be{constructor(e){super(),_e(this,e,uE,aE,ge,{key:1,config:0})}}const ho=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:fE},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:WO},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:Dh},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:Dh},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Rr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Rr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Rr}];function Ah(n,e,t){const i=n.slice();return i[9]=e[t],i}function cE(n){let e;return{c(){e=v("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function dE(n){let e,t=pe(n[1]),i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ih(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",h,g,m,_,y,S;function C(){return n[6](n[9])}return{c(){var T;e=v("div"),t=v("figure"),i=v("img"),l=E(),o=v("span"),a=U(r),u=E(),f=v("div"),c=U("ID: "),h=U(d),g=E(),m=v("button"),m.innerHTML='',_=E(),un(i.src,s="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(m,"type","button"),p(m,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(e,l),b(e,o),b(o,a),b(e,u),b(e,f),b(f,c),b(f,h),b(e,g),b(e,m),b(e,_),y||(S=Y(m,"click",C),y=!0)},p(T,$){var O;n=T,$&2&&!un(i.src,s="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",s),$&2&&r!==(r=n[4](n[9].provider)+"")&&le(a,r),$&2&&d!==(d=n[9].providerId+"")&&le(h,d)},d(T){T&&k(e),y=!1,S()}}}function hE(n){let e;function t(l,o){var r;return l[2]?pE:(r=l[0])!=null&&r.id&&l[1].length?dE:cE}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function mE(n,e,t){const i=dt();let{record:s}=e,l=[],o=!1;function r(d){return ho.find(h=>h.key==d+"Auth")||{}}function a(d){var h;return((h=r(d))==null?void 0:h.title)||j.sentenize(d,!1)}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await de.collection(s.collectionId).listExternalAuths(s.id))}catch(d){de.error(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||_n(`Do you really want to unlink the ${a(d)} provider?`,()=>de.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{zt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(h=>{de.error(h)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class gE extends be{constructor(e){super(),_e(this,e,mE,hE,ge,{record:0})}}function Lh(n,e,t){const i=n.slice();return i[69]=e[t],i[70]=e,i[71]=t,i}function Ph(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=U(`The record has previous unsaved changes. - `),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),h=!0,g||(m=[Y(r,"click",n[38]),Te(Be.call(null,u,"Discard draft")),Y(u,"click",Ze(n[39]))],g=!0)},p:x,i(_){h||(d&&d.end(1),h=!0)},o(_){_&&(d=ya(e,lt,{duration:150})),h=!1},d(_){_&&k(e),_&&d&&d.end(),g=!1,$e(m)}}}function Nh(n){let e,t,i;return t=new z1({props:{model:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","form-field-addon")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.model=s[3]),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function _E(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y=!n[6]&&Nh(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),y&&y.c(),u=E(),f=v("input"),p(t,"class",ii(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[72]),p(f,"type","text"),p(f,"id",c=n[72]),p(f,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=h=!n[6]},m(S,C){w(S,e,C),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(S,a,C),y&&y.m(S,C),w(S,u,C),w(S,f,C),ce(f,n[3].id),g=!0,m||(_=Y(f,"input",n[40]),m=!0)},p(S,C){(!g||C[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?y&&(re(),I(y,1,1,()=>{y=null}),ae()):y?(y.p(S,C),C[0]&64&&A(y,1)):(y=Nh(S),y.c(),A(y,1),y.m(u.parentNode,u)),(!g||C[2]&1024&&c!==(c=S[72]))&&p(f,"id",c),(!g||C[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!g||C[0]&64&&h!==(h=!S[6]))&&(f.readOnly=h),C[0]&8&&f.value!==S[3].id&&ce(f,S[3].id)},i(S){g||(A(y),g=!0)},o(S){I(y),g=!1},d(S){S&&(k(e),k(a),k(u),k(f)),y&&y.d(S),m=!1,_()}}}function Fh(n){var u,f;let e,t,i,s,l;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new O5({props:r}),te.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Rh();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=ye()},m(c,d){H(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var g,m;const h={};d[0]&64&&(h.isNew=c[6]),d[0]&1&&(h.collection=c[0]),!t&&d[0]&8&&(t=!0,h.record=c[3],ve(()=>t=!1)),e.$set(h),(m=(g=c[0])==null?void 0:g.schema)!=null&&m.length?a||(a=Rh(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){I(e.$$.fragment,c),l=!1},d(c){c&&(k(i),k(s)),V(e,c),a&&a.d(c)}}}function Rh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function bE(n){let e,t,i;function s(o){n[54](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new rO({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function vE(n){let e,t,i,s,l;function o(f){n[51](f,n[69])}function r(f){n[52](f,n[69])}function a(f){n[53](f,n[69])}let u={field:n[69],record:n[3]};return n[3][n[69].name]!==void 0&&(u.value=n[3][n[69].name]),n[4][n[69].name]!==void 0&&(u.uploadedFiles=n[4][n[69].name]),n[5][n[69].name]!==void 0&&(u.deletedFileNames=n[5][n[69].name]),e=new z6({props:u}),te.push(()=>he(e,"value",o)),te.push(()=>he(e,"uploadedFiles",r)),te.push(()=>he(e,"deletedFileNames",a)),{c(){z(e.$$.fragment)},m(f,c){H(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[69]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[69].name],ve(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ve(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[69].name],ve(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function yE(n){let e,t,i;function s(o){n[50](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new h6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function kE(n){let e,t,i;function s(o){n[49](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new l6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wE(n){let e,t,i;function s(o){n[48](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new t6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function SE(n){let e,t,i;function s(o){n[47](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new NO({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function TE(n){let e,t,i;function s(o){n[46](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new X5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CE(n){let e,t,i;function s(o){n[45](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new K5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $E(n){let e,t,i;function s(o){n[44](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new B5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ME(n){let e,t,i;function s(o){n[43](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new j5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function OE(n){let e,t,i;function s(o){n[42](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new N5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function qh(n,e){let t,i,s,l,o;const r=[OE,ME,$E,CE,TE,SE,wE,kE,yE,vE,bE],a=[];function u(f,c){return f[69].type==="text"?0:f[69].type==="number"?1:f[69].type==="bool"?2:f[69].type==="email"?3:f[69].type==="url"?4:f[69].type==="editor"?5:f[69].type==="date"?6:f[69].type==="select"?7:f[69].type==="json"?8:f[69].type==="file"?9:f[69].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),s&&s.c(),l=ye(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(re(),I(a[d],1,1,()=>{a[d]=null}),ae()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){I(s),o=!1},d(f){f&&(k(t),k(l)),~i&&a[i].d(f)}}}function jh(n){let e,t,i;return t=new gE({props:{record:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[13]===wl)},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&8192)&&Q(e,"active",s[13]===wl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function EE(n){var S;let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,h=!n[8]&&n[10]&&!n[7]&&Ph(n);s=new me({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[_E,({uniqueId:C})=>({72:C}),({uniqueId:C})=>[0,0,C?1024:0]]},$$scope:{ctx:n}}});let g=n[14]&&Fh(n),m=pe(((S=n[0])==null?void 0:S.schema)||[]);const _=C=>C[69].name;for(let C=0;C{h=null}),ae());const $={};T[0]&64&&($.class="form-field "+(C[6]?"":"readonly")),T[0]&200|T[2]&3072&&($.$$scope={dirty:T,ctx:C}),s.$set($),C[14]?g?(g.p(C,T),T[0]&16384&&A(g,1)):(g=Fh(C),g.c(),A(g,1),g.m(t,o)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),T[0]&57&&(m=pe(((O=C[0])==null?void 0:O.schema)||[]),re(),r=gt(r,T,_,1,C,m,a,t,Rt,qh,null,Lh),ae()),(!f||T[0]&128)&&Q(t,"no-pointer-events",C[7]),(!f||T[0]&8192)&&Q(t,"active",C[13]===rs),C[14]&&!C[6]?y?(y.p(C,T),T[0]&16448&&A(y,1)):(y=jh(C),y.c(),A(y,1),y.m(e,null)):y&&(re(),I(y,1,1,()=>{y=null}),ae())},i(C){if(!f){A(h),A(s.$$.fragment,C),A(g);for(let T=0;T Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function zh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[33]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function IE(n){let e,t,i,s,l,o,r,a=n[14]&&!n[2].verified&&n[2].email&&Vh(n),u=n[14]&&n[2].email&&zh(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=v("button"),i.innerHTML=' Duplicate',s=E(),l=v("button"),l.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),o||(r=[Y(i,"click",n[34]),Y(l,"click",Sn(Ze(n[35])))],o=!0)},p(f,c){f[14]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=Vh(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[14]&&f[2].email?u?u.p(f,c):(u=zh(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(k(e),k(t),k(i),k(s),k(l)),a&&a.d(f),u&&u.d(f),o=!1,$e(r)}}}function Bh(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=E(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[13]===rs),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[13]===wl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[Y(t,"click",n[36]),Y(s,"click",n[37])],l=!0)},p(r,a){a[0]&8192&&Q(t,"active",r[13]===rs),a[0]&8192&&Q(s,"active",r[13]===wl)},d(r){r&&k(e),l=!1,$e(o)}}}function LE(n){let e,t,i,s;function l(f,c){return f[7]?AE:DE}let o=l(n),r=o(n),a=!n[6]&&Hh(n),u=n[14]&&!n[6]&&Bh(n);return{c(){r.c(),e=E(),a&&a.c(),t=E(),u&&u.c(),i=ye()},m(f,c){r.m(f,c),w(f,e,c),a&&a.m(f,c),w(f,t,c),u&&u.m(f,c),w(f,i,c),s=!0},p(f,c){o===(o=l(f))&&r?r.p(f,c):(r.d(1),r=o(f),r&&(r.c(),r.m(e.parentNode,e))),f[6]?a&&(re(),I(a,1,1,()=>{a=null}),ae()):a?(a.p(f,c),c[0]&64&&A(a,1)):(a=Hh(f),a.c(),A(a,1),a.m(t.parentNode,t)),f[14]&&!f[6]?u?u.p(f,c):(u=Bh(f),u.c(),u.m(i.parentNode,i)):u&&(u.d(1),u=null)},i(f){s||(A(a),s=!0)},o(f){I(a),s=!1},d(f){f&&(k(e),k(t),k(i)),r.d(f),a&&a.d(f),u&&u.d(f)}}}function PE(n){let e,t,i,s,l,o,r=n[6]?"Create":"Save changes",a,u,f,c;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=U(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[17]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[15]||n[11],Q(l,"btn-loading",n[11]||n[7])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),b(l,o),b(o,a),f||(c=Y(e,"click",n[31]),f=!0)},p(d,h){h[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),h[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&le(a,r),h[0]&34816&&u!==(u=!d[15]||d[11])&&(l.disabled=u),h[0]&2176&&Q(l,"btn-loading",d[11]||d[7])},d(d){d&&(k(e),k(s),k(l)),f=!1,c()}}}function NE(n){let e,t,i={class:` +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),de(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&de(l,c[5])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function ZO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return s=new me({props:{class:"form-field required",name:"clientId",$$slots:{default:[WO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"teamId",$$slots:{default:[YO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"keyId",$$slots:{default:[KO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"duration",$$slots:{default:[JO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:"privateKey",$$slots:{default:[GO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),z(m.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(C,T){w(C,e,T),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),b(t,a),b(t,u),H(f,u,null),b(t,c),b(t,d),H(h,d,null),b(t,g),H(m,t,null),_=!0,y||(S=Y(e,"submit",Ze(n[17])),y=!0)},p(C,T){const $={};T&25165828&&($.$$scope={dirty:T,ctx:C}),s.$set($);const O={};T&25165832&&(O.$$scope={dirty:T,ctx:C}),r.$set(O);const M={};T&25165840&&(M.$$scope={dirty:T,ctx:C}),f.$set(M);const D={};T&25165888&&(D.$$scope={dirty:T,ctx:C}),h.$set(D);const L={};T&25165856&&(L.$$scope={dirty:T,ctx:C}),m.$set(L)},i(C){_||(A(s.$$.fragment,C),A(r.$$.fragment,C),A(f.$$.fragment,C),A(h.$$.fragment,C),A(m.$$.fragment,C),_=!0)},o(C){I(s.$$.fragment,C),I(r.$$.fragment,C),I(f.$$.fragment,C),I(h.$$.fragment,C),I(m.$$.fragment,C),_=!1},d(C){C&&k(e),V(s),V(r),V(f),V(h),V(m),y=!1,S()}}}function XO(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function QO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=W("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function xO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[QO],header:[XO],default:[ZO]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[19](null),V(e,s)}}}const ho=15777e3;function eE(n,e,t){let i;const s=dt(),l="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function h(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,c=N.duration||ho),ln({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function m(){t(7,d=!0);try{const N=await ce.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),zt("Successfully generated client secret."),s("submit",N),o==null||o.hide()}catch(N){ce.error(N)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function C(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const $=()=>m(),O=()=>!d;function M(N){te[N?"unshift":"push"](()=>{o=N,t(1,o)})}function D(N){Fe.call(this,n,N)}function L(N){Fe.call(this,n,N)}return t(8,i=!0),[g,o,r,a,u,f,c,d,i,l,m,h,_,y,S,C,T,$,O,M,D,L]}class tE extends ve{constructor(e){super(),be(this,e,eE,xO,ge,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function nE(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new tE({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=E(),s=v("span"),s.textContent="Generate secret",o=E(),z(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,h){w(d,e,h),b(e,t),b(e,i),b(e,s),w(d,o,h),H(r,d,h),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[h]){(!a||h&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const g={};r.$set(g)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){I(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),V(r,d),u=!1,f()}}}function iE(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class sE extends ve{constructor(e){super(),be(this,e,iE,nE,ge,{key:1,config:0})}}const mo=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:sE},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:UO},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:vs,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:vs,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:vs,optionsComponentProps:{required:!0}},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:vs,optionsComponentProps:{required:!0}},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:vs,optionsComponentProps:{required:!0}},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:vs,optionsComponentProps:{required:!0}}];function Dh(n,e,t){const i=n.slice();return i[9]=e[t],i}function lE(n){let e;return{c(){e=v("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oE(n){let e,t=pe(n[1]),i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ah(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",h,g,m,_,y,S;function C(){return n[6](n[9])}return{c(){var T;e=v("div"),t=v("figure"),i=v("img"),l=E(),o=v("span"),a=W(r),u=E(),f=v("div"),c=W("ID: "),h=W(d),g=E(),m=v("button"),m.innerHTML='',_=E(),un(i.src,s="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(m,"type","button"),p(m,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(e,l),b(e,o),b(o,a),b(e,u),b(e,f),b(f,c),b(f,h),b(e,g),b(e,m),b(e,_),y||(S=Y(m,"click",C),y=!0)},p(T,$){var O;n=T,$&2&&!un(i.src,s="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",s),$&2&&r!==(r=n[4](n[9].provider)+"")&&le(a,r),$&2&&d!==(d=n[9].providerId+"")&&le(h,d)},d(T){T&&k(e),y=!1,S()}}}function aE(n){let e;function t(l,o){var r;return l[2]?rE:(r=l[0])!=null&&r.id&&l[1].length?oE:lE}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function uE(n,e,t){const i=dt();let{record:s}=e,l=[],o=!1;function r(d){return mo.find(h=>h.key==d+"Auth")||{}}function a(d){var h;return((h=r(d))==null?void 0:h.title)||j.sentenize(d,!1)}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await ce.collection(s.collectionId).listExternalAuths(s.id))}catch(d){ce.error(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||_n(`Do you really want to unlink the ${a(d)} provider?`,()=>ce.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{zt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(h=>{ce.error(h)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class fE extends ve{constructor(e){super(),be(this,e,uE,aE,ge,{record:0})}}function Ih(n,e,t){const i=n.slice();return i[69]=e[t],i[70]=e,i[71]=t,i}function Lh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=W(`The record has previous unsaved changes. + `),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),h=!0,g||(m=[Y(r,"click",n[38]),Te(Be.call(null,u,"Discard draft")),Y(u,"click",Ze(n[39]))],g=!0)},p:x,i(_){h||(d&&d.end(1),h=!0)},o(_){_&&(d=ya(e,lt,{duration:150})),h=!1},d(_){_&&k(e),_&&d&&d.end(),g=!1,$e(m)}}}function Ph(n){let e,t,i;return t=new V1({props:{model:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","form-field-addon")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.model=s[3]),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function cE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y=!n[6]&&Ph(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),y&&y.c(),u=E(),f=v("input"),p(t,"class",ii(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[72]),p(f,"type","text"),p(f,"id",c=n[72]),p(f,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=h=!n[6]},m(S,C){w(S,e,C),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(S,a,C),y&&y.m(S,C),w(S,u,C),w(S,f,C),de(f,n[3].id),g=!0,m||(_=Y(f,"input",n[40]),m=!0)},p(S,C){(!g||C[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?y&&(re(),I(y,1,1,()=>{y=null}),ae()):y?(y.p(S,C),C[0]&64&&A(y,1)):(y=Ph(S),y.c(),A(y,1),y.m(u.parentNode,u)),(!g||C[2]&1024&&c!==(c=S[72]))&&p(f,"id",c),(!g||C[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!g||C[0]&64&&h!==(h=!S[6]))&&(f.readOnly=h),C[0]&8&&f.value!==S[3].id&&de(f,S[3].id)},i(S){g||(A(y),g=!0)},o(S){I(y),g=!1},d(S){S&&(k(e),k(a),k(u),k(f)),y&&y.d(S),m=!1,_()}}}function Nh(n){var u,f;let e,t,i,s,l;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new M6({props:r}),te.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Fh();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=ye()},m(c,d){H(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var g,m;const h={};d[0]&64&&(h.isNew=c[6]),d[0]&1&&(h.collection=c[0]),!t&&d[0]&8&&(t=!0,h.record=c[3],_e(()=>t=!1)),e.$set(h),(m=(g=c[0])==null?void 0:g.schema)!=null&&m.length?a||(a=Fh(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){I(e.$$.fragment,c),l=!1},d(c){c&&(k(i),k(s)),V(e,c),a&&a.d(c)}}}function Fh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dE(n){let e,t,i;function s(o){n[54](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new oO({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function pE(n){let e,t,i,s,l;function o(f){n[51](f,n[69])}function r(f){n[52](f,n[69])}function a(f){n[53](f,n[69])}let u={field:n[69],record:n[3]};return n[3][n[69].name]!==void 0&&(u.value=n[3][n[69].name]),n[4][n[69].name]!==void 0&&(u.uploadedFiles=n[4][n[69].name]),n[5][n[69].name]!==void 0&&(u.deletedFileNames=n[5][n[69].name]),e=new V5({props:u}),te.push(()=>he(e,"value",o)),te.push(()=>he(e,"uploadedFiles",r)),te.push(()=>he(e,"deletedFileNames",a)),{c(){z(e.$$.fragment)},m(f,c){H(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[69]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[69].name],_e(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],_e(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[69].name],_e(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function hE(n){let e,t,i;function s(o){n[50](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new p5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function mE(n){let e,t,i;function s(o){n[49](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new s5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function gE(n){let e,t,i;function s(o){n[48](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new e5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function _E(n){let e,t,i;function s(o){n[47](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new PO({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function bE(n){let e,t,i;function s(o){n[46](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new Z6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function vE(n){let e,t,i;function s(o){n[45](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new Y6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function yE(n){let e,t,i;function s(o){n[44](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new z6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function kE(n){let e,t,i;function s(o){n[43](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new q6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wE(n){let e,t,i;function s(o){n[42](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new P6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Rh(n,e){let t,i,s,l,o;const r=[wE,kE,yE,vE,bE,_E,gE,mE,hE,pE,dE],a=[];function u(f,c){return f[69].type==="text"?0:f[69].type==="number"?1:f[69].type==="bool"?2:f[69].type==="email"?3:f[69].type==="url"?4:f[69].type==="editor"?5:f[69].type==="date"?6:f[69].type==="select"?7:f[69].type==="json"?8:f[69].type==="file"?9:f[69].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),s&&s.c(),l=ye(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(re(),I(a[d],1,1,()=>{a[d]=null}),ae()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){I(s),o=!1},d(f){f&&(k(t),k(l)),~i&&a[i].d(f)}}}function qh(n){let e,t,i;return t=new fE({props:{record:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[13]===Sl)},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&8192)&&Q(e,"active",s[13]===Sl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function SE(n){var S;let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,h=!n[8]&&n[10]&&!n[7]&&Lh(n);s=new me({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[cE,({uniqueId:C})=>({72:C}),({uniqueId:C})=>[0,0,C?1024:0]]},$$scope:{ctx:n}}});let g=n[14]&&Nh(n),m=pe(((S=n[0])==null?void 0:S.schema)||[]);const _=C=>C[69].name;for(let C=0;C{h=null}),ae());const $={};T[0]&64&&($.class="form-field "+(C[6]?"":"readonly")),T[0]&200|T[2]&3072&&($.$$scope={dirty:T,ctx:C}),s.$set($),C[14]?g?(g.p(C,T),T[0]&16384&&A(g,1)):(g=Nh(C),g.c(),A(g,1),g.m(t,o)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),T[0]&57&&(m=pe(((O=C[0])==null?void 0:O.schema)||[]),re(),r=gt(r,T,_,1,C,m,a,t,Rt,Rh,null,Ih),ae()),(!f||T[0]&128)&&Q(t,"no-pointer-events",C[7]),(!f||T[0]&8192)&&Q(t,"active",C[13]===rs),C[14]&&!C[6]?y?(y.p(C,T),T[0]&16448&&A(y,1)):(y=qh(C),y.c(),A(y,1),y.m(e,null)):y&&(re(),I(y,1,1,()=>{y=null}),ae())},i(C){if(!f){A(h),A(s.$$.fragment,C),A(g);for(let T=0;T Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Vh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[33]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function $E(n){let e,t,i,s,l,o,r,a=n[14]&&!n[2].verified&&n[2].email&&Hh(n),u=n[14]&&n[2].email&&Vh(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=v("button"),i.innerHTML=' Duplicate',s=E(),l=v("button"),l.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),o||(r=[Y(i,"click",n[34]),Y(l,"click",Sn(Ze(n[35])))],o=!0)},p(f,c){f[14]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=Hh(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[14]&&f[2].email?u?u.p(f,c):(u=Vh(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(k(e),k(t),k(i),k(s),k(l)),a&&a.d(f),u&&u.d(f),o=!1,$e(r)}}}function zh(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=E(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[13]===rs),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[13]===Sl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[Y(t,"click",n[36]),Y(s,"click",n[37])],l=!0)},p(r,a){a[0]&8192&&Q(t,"active",r[13]===rs),a[0]&8192&&Q(s,"active",r[13]===Sl)},d(r){r&&k(e),l=!1,$e(o)}}}function ME(n){let e,t,i,s;function l(f,c){return f[7]?CE:TE}let o=l(n),r=o(n),a=!n[6]&&jh(n),u=n[14]&&!n[6]&&zh(n);return{c(){r.c(),e=E(),a&&a.c(),t=E(),u&&u.c(),i=ye()},m(f,c){r.m(f,c),w(f,e,c),a&&a.m(f,c),w(f,t,c),u&&u.m(f,c),w(f,i,c),s=!0},p(f,c){o===(o=l(f))&&r?r.p(f,c):(r.d(1),r=o(f),r&&(r.c(),r.m(e.parentNode,e))),f[6]?a&&(re(),I(a,1,1,()=>{a=null}),ae()):a?(a.p(f,c),c[0]&64&&A(a,1)):(a=jh(f),a.c(),A(a,1),a.m(t.parentNode,t)),f[14]&&!f[6]?u?u.p(f,c):(u=zh(f),u.c(),u.m(i.parentNode,i)):u&&(u.d(1),u=null)},i(f){s||(A(a),s=!0)},o(f){I(a),s=!1},d(f){f&&(k(e),k(t),k(i)),r.d(f),a&&a.d(f),u&&u.d(f)}}}function OE(n){let e,t,i,s,l,o,r=n[6]?"Create":"Save changes",a,u,f,c;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=W(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[17]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[15]||n[11],Q(l,"btn-loading",n[11]||n[7])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),b(l,o),b(o,a),f||(c=Y(e,"click",n[31]),f=!0)},p(d,h){h[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),h[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&le(a,r),h[0]&34816&&u!==(u=!d[15]||d[11])&&(l.disabled=u),h[0]&2176&&Q(l,"btn-loading",d[11]||d[7])},d(d){d&&(k(e),k(s),k(l)),f=!1,c()}}}function EE(n){let e,t,i={class:` record-panel `+(n[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(n[14]&&!n[6]?"colored-header":"")+` - `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[55],$$slots:{footer:[PE],header:[LE],default:[EE]},$$scope:{ctx:n}};return e=new on({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&81984&&(o.class=` + `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[55],$$slots:{footer:[OE],header:[ME],default:[SE]},$$scope:{ctx:n}};return e=new on({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&81984&&(o.class=` record-panel `+(s[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(s[14]&&!s[6]?"colored-header":"")+` - `),l[0]&128&&(o.btnClose=!s[7]),l[0]&128&&(o.escClose=!s[7]),l[0]&128&&(o.overlayClose=!s[7]),l[0]&4352&&(o.beforeHide=s[55]),l[0]&60925|l[2]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[56](null),V(e,s)}}}const rs="form",wl="providers";function FE(n,e,t){let i,s,l,o,r;const a=dt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d=null,h=null,g=null,m=!1,_=!1,y={},S={},C=JSON.stringify(d),T=C,$=rs,O=!0,M=!0;function D(ue){return F(ue),t(12,_=!0),t(13,$=rs),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function N(){t(12,_=!1),L()}async function P(ue){if(ue&&typeof ue=="string"){try{return await de.collection(f.id).getOne(ue)}catch(De){De.isAbort||(N(),console.warn("resolveModel:",De),Ci(`Unable to load record with id "${ue}"`))}return null}return ue}async function F(ue){t(7,M=!0),ln({}),t(4,y={}),t(5,S={}),t(2,d=typeof ue=="string"?{id:ue,collectionId:f==null?void 0:f.id,collectionName:f==null?void 0:f.name}:ue||{}),t(3,h=structuredClone(d)),t(2,d=await P(ue)||{}),t(3,h=structuredClone(d)),await sn(),t(10,g=B()),!g||J(h,g)?t(10,g=null):(delete g.password,delete g.passwordConfirm),t(28,C=JSON.stringify(h)),t(7,M=!1)}async function R(ue){var Xe,Jt;ln({}),t(2,d=ue||{}),t(4,y={}),t(5,S={});const De=((Jt=(Xe=f==null?void 0:f.schema)==null?void 0:Xe.filter(nt=>nt.type!="file"))==null?void 0:Jt.map(nt=>nt.name))||[];for(let nt in ue)De.includes(nt)||t(3,h[nt]=ue[nt],h);await sn(),t(28,C=JSON.stringify(h)),W()}function q(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function B(ue){try{const De=window.localStorage.getItem(q());if(De)return JSON.parse(De)}catch{}return ue}function G(ue){try{window.localStorage.setItem(q(),ue)}catch(De){console.warn("updateDraft failure:",De),window.localStorage.removeItem(q())}}function X(){g&&(t(3,h=g),t(10,g=null))}function J(ue,De){var At;const Xe=structuredClone(ue||{}),Jt=structuredClone(De||{}),nt=(At=f==null?void 0:f.schema)==null?void 0:At.filter(Rn=>Rn.type==="file");for(let Rn of nt)delete Xe[Rn.name],delete Jt[Rn.name];const Dt=["expand","password","passwordConfirm"];for(let Rn of Dt)delete Xe[Rn],delete Jt[Rn];return JSON.stringify(Xe)==JSON.stringify(Jt)}function W(){t(10,g=null),window.localStorage.removeItem(q())}async function oe(ue=!0){if(!(m||!r||!(f!=null&&f.id))){t(11,m=!0);try{const De=se();let Xe;O?Xe=await de.collection(f.id).create(De):Xe=await de.collection(f.id).update(h.id,De),zt(O?"Successfully created record.":"Successfully updated record."),W(),ue?N():R(Xe),a("save",{isNew:O,record:Xe})}catch(De){de.error(De)}t(11,m=!1)}}function ee(){d!=null&&d.id&&_n("Do you really want to delete the selected record?",()=>de.collection(d.collectionId).delete(d.id).then(()=>{L(),zt("Successfully deleted record."),a("delete",d)}).catch(ue=>{de.error(ue)}))}function se(){const ue=structuredClone(h||{}),De=new FormData,Xe={id:ue.id},Jt={};for(const nt of(f==null?void 0:f.schema)||[])Xe[nt.name]=!0,nt.type=="json"&&(Jt[nt.name]=!0);i&&(Xe.username=!0,Xe.email=!0,Xe.emailVisibility=!0,Xe.password=!0,Xe.passwordConfirm=!0,Xe.verified=!0);for(const nt in ue)if(Xe[nt]){if(typeof ue[nt]>"u"&&(ue[nt]=null),Jt[nt]&&ue[nt]!=="")try{JSON.parse(ue[nt])}catch(Dt){const At={};throw At[nt]={code:"invalid_json",message:Dt.toString()},new Kn({status:400,response:{data:At}})}j.addValueToFormData(De,nt,ue[nt])}for(const nt in y){const Dt=j.toArray(y[nt]);for(const At of Dt)De.append(nt,At)}for(const nt in S){const Dt=j.toArray(S[nt]);for(const At of Dt)De.append(nt+"."+At,"")}return De}function Ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||_n(`Do you really want to sent verification email to ${d.email}?`,()=>de.collection(f.id).requestVerification(d.email).then(()=>{zt(`Successfully sent verification email to ${d.email}.`)}).catch(ue=>{de.error(ue)}))}function Re(){!(f!=null&&f.id)||!(d!=null&&d.email)||_n(`Do you really want to sent password reset email to ${d.email}?`,()=>de.collection(f.id).requestPasswordReset(d.email).then(()=>{zt(`Successfully sent password reset email to ${d.email}.`)}).catch(ue=>{de.error(ue)}))}function Ve(){o?_n("You have unsaved changes. Do you really want to discard them?",()=>{We()}):We()}async function We(){let ue=d?structuredClone(d):null;if(ue){ue.id="",ue.created="",ue.updated="";const De=(f==null?void 0:f.schema)||[];for(const Xe of De)Xe.type==="file"&&delete ue[Xe.name]}W(),D(ue),await sn(),t(28,C="")}function ke(ue){(ue.ctrlKey||ue.metaKey)&&ue.code=="KeyS"&&(ue.preventDefault(),ue.stopPropagation(),oe(!1))}const Me=()=>L(),Je=()=>Ee(),ct=()=>Re(),Se=()=>Ve(),we=()=>ee(),Ue=()=>t(13,$=rs),it=()=>t(13,$=wl),ne=()=>X(),qe=()=>W();function Ce(){h.id=this.value,t(3,h)}function pt(ue){h=ue,t(3,h)}function qt(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function fn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function nn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function rn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Nn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function _i(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Fn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Ie(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Tt(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function oi(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function cn(ue,De){n.$$.not_equal(y[De.name],ue)&&(y[De.name]=ue,t(4,y))}function Xn(ue,De){n.$$.not_equal(S[De.name],ue)&&(S[De.name]=ue,t(5,S))}function Ai(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}const Cn=()=>o&&_?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{N()}),!1):(ln({}),W(),!0);function Qn(ue){te[ue?"unshift":"push"](()=>{c=ue,t(9,c)})}function en(ue){Fe.call(this,n,ue)}function et(ue){Fe.call(this,n,ue)}return n.$$set=ue=>{"collection"in ue&&t(0,f=ue.collection)},n.$$.update=()=>{var ue;n.$$.dirty[0]&1&&t(14,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(16,s=!!((ue=f==null?void 0:f.schema)!=null&&ue.find(De=>De.type==="editor"))),n.$$.dirty[0]&48&&t(30,l=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,T=JSON.stringify(h)),n.$$.dirty[0]&1879048192&&t(8,o=l||C!=T),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!M&&(O||o)),n.$$.dirty[0]&536871040&&(M||G(T))},[f,L,d,h,y,S,O,M,o,c,g,m,_,$,i,r,s,u,N,X,W,oe,ee,Ee,Re,Ve,ke,D,C,T,l,Me,Je,ct,Se,we,Ue,it,ne,qe,Ce,pt,qt,fn,nn,rn,Nn,_i,Fn,Ie,Tt,oi,cn,Xn,Ai,Cn,Qn,en,et]}class uu extends be{constructor(e){super(),_e(this,e,FE,NE,ge,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function Uh(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Wh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Yh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Kh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function RE(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function qE(n){var l,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(l=e[0])==null?void 0:l.expand)==null?void 0:o[e[1].name]);e[10]=i;const s=e[2]?20:500;return e[11]=s,e}function jE(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function HE(n){let e,t;return{c(){e=v("div"),t=U(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&le(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function VE(n){let e,t=j.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=j.truncate(n[3]))},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&8&&t!==(t=j.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=j.truncate(l[3]))&&p(e,"title",s)},i:x,o:x,d(l){l&&k(e)}}}function zE(n){let e,t=[],i=new Map,s,l,o=pe(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;un[17]&&Gh();return{c(){var u;e=v("div");for(let f=0;fu[17]?a||(a=Gh(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!l||f&2)&&Q(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!l){for(let f=0;fn[11]&&Qh();return{c(){e=v("div"),i.c(),s=E(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),b(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Qh(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){I(i),l=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function UE(n){let e,t=[],i=new Map,s=pe(j.toArray(n[3]));const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function KE(n){let e,t=j.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=U(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),b(e,i),s||(l=[Te(Be.call(null,e,"Open in new tab")),Y(e,"click",Sn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function JE(n){let e,t;return{c(){e=v("span"),t=U(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&le(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function GE(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function ZE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function XE(n){let e,t,i,s;const l=[iD,nD],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function Jh(n,e){let t,i,s;return i=new ru({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function Gh(n){let e;return{c(){e=U("...")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function QE(n){let e,t=pe(n[9].slice(0,n[11])),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&em(n);return{c(){e=v("span"),i=U(t),s=E(),r&&r.c(),l=ye(),p(e,"class","txt")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=em(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){o||(A(r),o=!0)},o(a){I(r),o=!1},d(a){a&&(k(e),k(s),k(l)),r&&r.d(a)}}}function iD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=j.truncate(s[5])+"")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function em(n){let e,t;return e=new js({props:{value:JSON.stringify(n[3],null,2)}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function sD(n){let e,t,i,s,l;const o=[XE,ZE,GE,JE,KE,YE,WE,UE,BE,zE,VE,HE],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?jE(f):c===8?qE(f):c===9?RE(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=ye()},m(f,c){r[t].m(f,c),w(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){I(i),l=!1},d(f){f&&k(s),r[t].d(f)}}}function lD(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){Fe.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[l.name])},[s,l,o,i,r]}class W1 extends be{constructor(e){super(),_e(this,e,lD,sD,ge,{record:0,field:1,short:2})}}function tm(n,e,t){const i=n.slice();return i[13]=e[t],i}function nm(n){let e,t,i=n[13].name+"",s,l,o,r,a;return r=new W1({props:{field:n[13],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=U(i),l=E(),o=v("td"),z(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){w(u,e,f),b(e,t),b(t,s),b(e,l),b(e,o),H(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&le(s,i);const c={};f&1&&(c.field=u[13]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){I(r.$$.fragment,u),a=!1},d(u){u&&k(e),V(r)}}}function im(n){let e,t,i,s,l,o;return l=new $i({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),H(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){I(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(l)}}}function sm(n){let e,t,i,s,l,o;return l=new $i({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),H(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){I(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(l)}}}function oD(n){var O;let e,t,i,s,l,o,r,a,u,f,c=(n[3].id||"...")+"",d,h,g,m,_;a=new js({props:{value:n[3].id}});let y=pe((O=n[0])==null?void 0:O.schema),S=[];for(let M=0;MI(S[M],1,1,()=>{S[M]=null});let T=n[3].created&&im(n),$=n[3].updated&&sm(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=E(),o=v("td"),r=v("div"),z(a.$$.fragment),u=E(),f=v("span"),d=U(c),h=E();for(let M=0;M{T=null}),ae()),M[3].updated?$?($.p(M,D),D&8&&A($,1)):($=sm(M),$.c(),A($,1),$.m(t,null)):$&&(re(),I($,1,1,()=>{$=null}),ae()),(!_||D&16)&&Q(e,"table-loading",M[4])},i(M){if(!_){A(a.$$.fragment,M);for(let D=0;DClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[7]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function uD(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[aD],header:[rD],default:[oD]},$$scope:{ctx:n}};return e=new on({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&32&&(o.class="record-preview-panel "+(s[5]?"overlay-panel-xl":"overlay-panel-lg")),l&65561&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[8](null),V(e,s)}}}function fD(n,e,t){let i,{collection:s}=e,l,o={},r=!1;function a(_){return f(_),l==null?void 0:l.show()}function u(){return t(4,r=!1),l==null?void 0:l.hide()}async function f(_){t(3,o={}),t(4,r=!0),t(3,o=await c(_)||{}),t(4,r=!1)}async function c(_){if(_&&typeof _=="string"){try{return await de.collection(s.id).getOne(_)}catch(y){y.isAbort||(u(),console.warn("resolveModel:",y),Ci(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function h(_){te[_?"unshift":"push"](()=>{l=_,t(2,l)})}function g(_){Fe.call(this,n,_)}function m(_){Fe.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,s=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=s==null?void 0:s.schema)!=null&&_.find(y=>y.type==="editor")))},[s,u,l,o,r,i,a,d,h,g,m]}class cD extends be{constructor(e){super(),_e(this,e,fD,uD,ge,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function lm(n,e,t){const i=n.slice();return i[63]=e[t],i}function om(n,e,t){const i=n.slice();return i[66]=e[t],i}function rm(n,e,t){const i=n.slice();return i[66]=e[t],i}function am(n,e,t){const i=n.slice();return i[59]=e[t],i}function um(n){let e;function t(l,o){return l[13]?pD:dD}let i=t(n),s=i(n);return{c(){e=v("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&k(e),s.d()}}}function dD(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=E(),l=v("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),o||(r=Y(t,"change",n[32]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&131072&&(t.checked=a[17])},d(a){a&&k(e),o=!1,r()}}}function pD(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function fm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[hD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function hD(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function cm(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l,o=e&&dm(n),r=i&&pm(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=ye()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,s,u),l=!0},p(a,u){u[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,u),u[0]&32&&A(o,1)):(o=dm(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),u[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=pm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){l||(A(o),A(r),l=!0)},o(a){I(o),I(r),l=!1},d(a){a&&(k(t),k(s)),o&&o.d(a),r&&r.d(a)}}}function dm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[mD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function mD(n){let e;return{c(){e=v("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function pm(n){let e,t,i;function s(o){n[35](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[gD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function gD(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _D(n){let e,t,i,s,l,o=n[66].name+"",r;return{c(){e=v("div"),t=v("i"),s=E(),l=v("span"),r=U(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),b(l,r)},p(a,u){u[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),u[0]&524288&&o!==(o=a[66].name+"")&&le(r,o)},d(a){a&&k(e)}}}function hm(n,e){let t,i,s,l;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[_D]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new hn({props:r}),te.push(()=>he(i,"sort",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&524288&&(f.class="col-type-"+e[66].type+" col-field-"+e[66].name),u[0]&524288&&(f.name=e[66].name),u[0]&524288|u[2]&512&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function mm(n){let e,t,i;function s(o){n[37](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[bD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function bD(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function gm(n){let e,t,i;function s(o){n[38](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[vD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function vD(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _m(n){let e;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:x,d(t){t&&k(e),n[39](null)}}}function bm(n){let e;function t(l,o){return l[13]?kD:yD}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function yD(n){let e,t,i,s;function l(a,u){var f;if((f=a[1])!=null&&f.length)return SD;if(!a[10])return wD}let o=l(n),r=o&&o(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=E(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),r&&r.m(t,null)},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&k(e),r&&r.d()}}}function kD(n){let e;return{c(){e=v("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function wD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[44]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function SD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[43]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function vm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[40](n[63])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=E(),r=v("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[63].id),i.checked=l=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,h){w(d,e,h),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[Y(i,"change",c),Y(t,"click",Sn(n[30]))],u=!0)},p(d,h){n=d,h[0]&8&&s!==(s="checkbox_"+n[63].id)&&p(i,"id",s),h[0]&24&&l!==(l=n[4][n[63].id])&&(i.checked=l),h[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,$e(f)}}}function ym(n){let e,t,i,s,l,o,r=n[63].id+"",a,u,f;s=new js({props:{value:n[63].id}});let c=n[9]&&km(n);return{c(){e=v("td"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),a=U(r),u=E(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,h){w(d,e,h),b(e,t),b(t,i),H(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,h){const g={};h[0]&8&&(g.value=d[63].id),s.$set(g),(!f||h[0]&8)&&r!==(r=d[63].id+"")&&le(a,r),d[9]?c?c.p(d,h):(c=km(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){I(s.$$.fragment,d),f=!1},d(d){d&&k(e),V(s),c&&c.d()}}}function km(n){let e;function t(l,o){return l[63].verified?CD:TD}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function TD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Te(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function CD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=Te(Be.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function wm(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l=e&&Sm(n),o=i&&Tm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=ye()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?l?l.p(r,a):(l=Sm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Tm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){r&&(k(t),k(s)),l&&l.d(r),o&&o.d(r)}}}function Sm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?MD:$D}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function $D(n){let e,t=n[63].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[63].username)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[63].username+"")&&le(i,t),o[0]&8&&s!==(s=l[63].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function MD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Tm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?ED:OD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function OD(n){let e,t=n[63].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[63].email)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[63].email+"")&&le(i,t),o[0]&8&&s!==(s=l[63].email)&&p(e,"title",s)},d(l){l&&k(e)}}}function ED(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Cm(n,e){let t,i,s,l;return i=new W1({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=v("td"),z(i.$$.fragment),p(t,"class",s="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),H(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!l||r[0]&524288&&s!==(s="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){I(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function $m(n){let e,t,i;return t=new $i({props:{date:n[63].created}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[63].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function Mm(n){let e,t,i;return t=new $i({props:{date:n[63].updated}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[63].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function Om(n,e){let t,i,s=!e[5].includes("@id"),l,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),h,g,m,_,y,S=!e[10]&&vm(e),C=s&&ym(e),T=e[9]&&wm(e),$=pe(e[19]);const O=P=>P[66].name;for(let P=0;P<$.length;P+=1){let F=om(e,$,P),R=O(F);a.set(R,r[P]=Cm(R,F))}let M=f&&$m(e),D=d&&Mm(e);function L(){return e[41](e[63])}function N(...P){return e[42](e[63],...P)}return{key:n,first:null,c(){t=v("tr"),S&&S.c(),i=E(),C&&C.c(),l=E(),T&&T.c(),o=E();for(let P=0;P',p(g,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(P,F){w(P,t,F),S&&S.m(t,null),b(t,i),C&&C.m(t,null),b(t,l),T&&T.m(t,null),b(t,o);for(let R=0;R{C=null}),ae()),e[9]?T?T.p(e,F):(T=wm(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),F[0]&524296&&($=pe(e[19]),re(),r=gt(r,F,O,1,e,$,a,t,Rt,Cm,u,om),ae()),F[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?M?(M.p(e,F),F[0]&288&&A(M,1)):(M=$m(e),M.c(),A(M,1),M.m(t,c)):M&&(re(),I(M,1,1,()=>{M=null}),ae()),F[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?D?(D.p(e,F),F[0]&160&&A(D,1)):(D=Mm(e),D.c(),A(D,1),D.m(t,h)):D&&(re(),I(D,1,1,()=>{D=null}),ae())},i(P){if(!m){A(C);for(let F=0;F<$.length;F+=1)A(r[F]);A(M),A(D),m=!0}},o(P){I(C);for(let F=0;FJ[66].name;for(let J=0;JJ[10]?J[63]:J[63].id;for(let J=0;J{M=null}),ae()),J[9]?D?(D.p(J,W),W[0]&512&&A(D,1)):(D=cm(J),D.c(),A(D,1),D.m(i,r)):D&&(re(),I(D,1,1,()=>{D=null}),ae()),W[0]&524289&&(L=pe(J[19]),re(),a=gt(a,W,N,1,J,L,u,i,Rt,hm,f,rm),ae()),W[0]&288&&(c=J[8]&&!J[5].includes("@created")),c?P?(P.p(J,W),W[0]&288&&A(P,1)):(P=mm(J),P.c(),A(P,1),P.m(i,d)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),W[0]&160&&(h=J[7]&&!J[5].includes("@updated")),h?F?(F.p(J,W),W[0]&160&&A(F,1)):(F=gm(J),F.c(),A(F,1),F.m(i,g)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),J[16].length?R?R.p(J,W):(R=_m(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null),W[0]&9971642&&(q=pe(J[3]),re(),S=gt(S,W,B,1,J,q,C,y,Rt,Om,T,lm),ae(),!q.length&&G?G.p(J,W):q.length?G&&(G.d(1),G=null):(G=bm(J),G.c(),G.m(y,T))),J[3].length&&J[18]?X?X.p(J,W):(X=Em(J),X.c(),X.m(y,null)):X&&(X.d(1),X=null),(!$||W[0]&8192)&&Q(e,"table-loading",J[13])},i(J){if(!$){A(M),A(D);for(let W=0;W({62:l}),({uniqueId:l})=>[0,0,l?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function ID(n){let e,t,i=[],s=new Map,l,o,r=pe(n[16]);const a=u=>u[59].id+u[59].name;for(let u=0;u{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function Im(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,m,_,y,S;return{c(){e=v("div"),t=v("div"),i=U("Selected "),s=v("strong"),l=U(n[6]),o=E(),a=U(r),u=E(),f=v("button"),f.innerHTML='Reset',c=E(),d=v("div"),h=E(),g=v("button"),g.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-transparent btn-danger"),Q(g,"btn-loading",n[14]),Q(g,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(s,l),b(t,o),b(t,a),b(e,u),b(e,f),b(e,c),b(e,d),b(e,h),b(e,g),_=!0,y||(S=[Y(f,"click",n[47]),Y(g,"click",n[48])],y=!0)},p(C,T){(!_||T[0]&64)&&le(l,C[6]),(!_||T[0]&64)&&r!==(r=C[6]===1?"record":"records")&&le(a,r),(!_||T[0]&16384)&&Q(f,"btn-disabled",C[14]),(!_||T[0]&16384)&&Q(g,"btn-loading",C[14]),(!_||T[0]&16384)&&Q(g,"btn-disabled",C[14])},i(C){_||(C&&xe(()=>{_&&(m||(m=He(e,mi,{duration:150,y:5},!0)),m.run(1))}),_=!0)},o(C){C&&(m||(m=He(e,mi,{duration:150,y:5},!1)),m.run(0)),_=!1},d(C){C&&k(e),C&&m&&m.end(),y=!1,$e(S)}}}function PD(n){let e,t,i,s,l={class:"table-wrapper",$$slots:{before:[LD],default:[DD]},$$scope:{ctx:n}};e=new Jo({props:l}),n[46](e);let o=n[6]&&Im(n);return{c(){z(e.$$.fragment),t=E(),o&&o.c(),i=ye()},m(r,a){H(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!0},p(r,a){const u={};a[0]&1030075|a[2]&512&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&A(o,1)):(o=Im(r),o.c(),A(o,1),o.m(i.parentNode,i)):o&&(re(),I(o,1,1,()=>{o=null}),ae())},i(r){s||(A(e.$$.fragment,r),A(o),s=!0)},o(r){I(e.$$.fragment,r),I(o),s=!1},d(r){r&&(k(t),k(i)),n[46](null),V(e,r),o&&o.d(r)}}}const ND=/^([\+\-])?(\w+)$/,Lm=40;function FD(n,e,t){let i,s,l,o,r,a,u,f,c,d,h,g;Ge(n,Zn,Ie=>t(53,g=Ie));const m=dt();let{collection:_}=e,{sort:y=""}=e,{filter:S=""}=e,C,T=[],$=1,O=0,M={},D=!0,L=!1,N=0,P,F=[],R=[],q="";function B(){_!=null&&_.id&&(F.length?localStorage.setItem(q,JSON.stringify(F)):localStorage.removeItem(q))}function G(){if(t(5,F=[]),!!(_!=null&&_.id))try{const Ie=localStorage.getItem(q);Ie&&t(5,F=JSON.parse(Ie)||[])}catch{}}function X(Ie){return!!T.find(Tt=>Tt.id)}async function J(){const Ie=$;for(let Tt=1;Tt<=Ie;Tt++)(Tt===1||u)&&await W(Tt,!1)}async function W(Ie=1,Tt=!0){var Qn,en,et;if(!(_!=null&&_.id))return;t(13,D=!0);let oi=y;const cn=oi.match(ND),Xn=cn?r.find(ue=>ue.name===cn[2]):null;if(cn&&Xn){const ue=((et=(en=(Qn=g==null?void 0:g.find(Xe=>{var Jt;return Xe.id==((Jt=Xn.options)==null?void 0:Jt.collectionId)}))==null?void 0:Qn.schema)==null?void 0:en.filter(Xe=>Xe.presentable))==null?void 0:et.map(Xe=>Xe.name))||[],De=[];for(const Xe of ue)De.push((cn[1]||"")+cn[2]+"."+Xe);De.length>0&&(oi=De.join(","))}const Ai=j.getAllCollectionIdentifiers(_),Cn=o.map(ue=>ue.name+":excerpt(200)").concat(r.map(ue=>"expand."+ue.name+".*:excerpt(200)"));return Cn.length&&Cn.unshift("*"),de.collection(_.id).getList(Ie,Lm,{sort:oi,skipTotal:1,filter:j.normalizeSearchFilter(S,Ai),expand:r.map(ue=>ue.name).join(","),fields:Cn.join(","),requestKey:"records_list"}).then(async ue=>{var De;if(Ie<=1&&oe(),t(13,D=!1),t(12,$=ue.page),t(28,O=ue.items.length),m("load",T.concat(ue.items)),o.length)for(let Xe of ue.items)Xe._partial=!0;if(Tt){const Xe=++N;for(;(De=ue.items)!=null&&De.length&&N==Xe;)t(3,T=T.concat(ue.items.splice(0,20))),await j.yieldToMain()}else t(3,T=T.concat(ue.items))}).catch(ue=>{ue!=null&&ue.isAbort||(t(13,D=!1),console.warn(ue),oe(),de.error(ue,(ue==null?void 0:ue.status)!=400))})}function oe(){C==null||C.resetVerticalScroll(),t(3,T=[]),t(12,$=1),t(28,O=0),t(4,M={})}function ee(){c?se():Ee()}function se(){t(4,M={})}function Ee(){for(const Ie of T)t(4,M[Ie.id]=Ie,M);t(4,M)}function Re(Ie){M[Ie.id]?delete M[Ie.id]:t(4,M[Ie.id]=Ie,M),t(4,M)}function Ve(){_n(`Do you really want to delete the selected ${f===1?"record":"records"}?`,We)}async function We(){if(L||!f||!(_!=null&&_.id))return;let Ie=[];for(const Tt of Object.keys(M))Ie.push(de.collection(_.id).delete(Tt));return t(14,L=!0),Promise.all(Ie).then(()=>{zt(`Successfully deleted the selected ${f===1?"record":"records"}.`),m("delete",M),se()}).catch(Tt=>{de.error(Tt)}).finally(()=>(t(14,L=!1),J()))}function ke(Ie){Fe.call(this,n,Ie)}const Me=(Ie,Tt)=>{Tt.target.checked?j.removeByValue(F,Ie.id):j.pushUnique(F,Ie.id),t(5,F)},Je=()=>ee();function ct(Ie){y=Ie,t(0,y)}function Se(Ie){y=Ie,t(0,y)}function we(Ie){y=Ie,t(0,y)}function Ue(Ie){y=Ie,t(0,y)}function it(Ie){y=Ie,t(0,y)}function ne(Ie){y=Ie,t(0,y)}function qe(Ie){te[Ie?"unshift":"push"](()=>{P=Ie,t(15,P)})}const Ce=Ie=>Re(Ie),pt=Ie=>m("select",Ie),qt=(Ie,Tt)=>{Tt.code==="Enter"&&(Tt.preventDefault(),m("select",Ie))},fn=()=>t(1,S=""),nn=()=>m("new"),rn=()=>W($+1);function Nn(Ie){te[Ie?"unshift":"push"](()=>{C=Ie,t(11,C)})}const _i=()=>se(),Fn=()=>Ve();return n.$$set=Ie=>{"collection"in Ie&&t(25,_=Ie.collection),"sort"in Ie&&t(0,y=Ie.sort),"filter"in Ie&&t(1,S=Ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(q=_.id+"@hiddenColumns",G(),oe()),n.$$.dirty[0]&33554432&&t(10,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(9,s=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,l=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&536870912&&(o=l.filter(Ie=>Ie.type==="editor")),n.$$.dirty[0]&536870912&&(r=l.filter(Ie=>Ie.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=l.filter(Ie=>!F.includes(Ie.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&y!==-1&&S!==-1&&W(1),n.$$.dirty[0]&268435456&&t(18,u=O>=Lm),n.$$.dirty[0]&16&&t(6,f=Object.keys(M).length),n.$$.dirty[0]&72&&t(17,c=T.length&&f===T.length),n.$$.dirty[0]&32&&F!==-1&&B(),n.$$.dirty[0]&1032&&t(8,d=!i||T.length>0&&typeof T[0].created<"u"),n.$$.dirty[0]&1032&&t(7,h=!i||T.length>0&&typeof T[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,R=[].concat(s?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],l.map(Ie=>({id:Ie.id,name:Ie.name})),d?{id:"@created",name:"created"}:[],h?{id:"@updated",name:"updated"}:[]))},[y,S,W,T,M,F,f,h,d,s,i,C,$,D,L,P,R,c,u,a,m,ee,se,Re,Ve,_,X,J,O,l,ke,Me,Je,ct,Se,we,Ue,it,ne,qe,Ce,pt,qt,fn,nn,rn,Nn,_i,Fn]}class RD extends be{constructor(e){super(),_e(this,e,FD,PD,ge,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function qD(n){let e,t,i,s,l=(n[2]?"...":n[0])+"",o,r;return{c(){e=v("div"),t=v("span"),t.textContent="Total found:",i=E(),s=v("span"),o=U(l),p(t,"class","txt"),p(s,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),b(e,t),b(e,i),b(e,s),b(s,o)},p(a,[u]){u&5&&l!==(l=(a[2]?"...":a[0])+"")&&le(o,l),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:x,o:x,d(a){a&&k(e)}}}function jD(n,e,t){const i=dt();let{collection:s}=e,{filter:l=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(s!=null&&s.id){t(2,a=!0),t(0,o=0);try{const f=j.getAllCollectionIdentifiers(s),c=await de.collection(s.id).getList(1,1,{filter:j.normalizeSearchFilter(l,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,s=f.collection),"filter"in f&&t(4,l=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&s!=null&&s.id&&l!==-1&&u()},[o,r,a,s,l,u]}class HD extends be{constructor(e){super(),_e(this,e,jD,qD,ge,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function VD(n){let e,t,i,s;return e=new s5({}),i=new Tn({props:{class:"flex-content",$$slots:{footer:[WD],default:[UD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function zD(n){let e,t;return e=new Tn({props:{center:!0,$$slots:{default:[JD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&4112|s[1]&8192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function BD(n){let e,t;return e=new Tn({props:{center:!0,$$slots:{default:[GD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[1]&8192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Pm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[Te(Be.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[20])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function Nm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function UD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N,P=!n[12]&&Pm(n);c=new Ko({}),c.$on("refresh",n[21]);let F=n[2].type!=="view"&&Nm(n);y=new El({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function R(G){n[26](G)}function q(G){n[27](G)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),$=new RD({props:B}),n[25]($),te.push(()=>he($,"filter",R)),te.push(()=>he($,"sort",q)),$.$on("select",n[28]),$.$on("delete",n[29]),$.$on("new",n[30]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=E(),l=v("div"),r=U(o),a=E(),u=v("div"),P&&P.c(),f=E(),z(c.$$.fragment),d=E(),h=v("div"),g=v("button"),g.innerHTML=' API Preview',m=E(),F&&F.c(),_=E(),z(y.$$.fragment),S=E(),C=v("div"),T=E(),z($.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(h,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-sm")},m(G,X){w(G,e,X),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),P&&P.m(u,null),b(u,f),H(c,u,null),b(e,d),b(e,h),b(h,g),b(h,m),F&&F.m(h,null),w(G,_,X),H(y,G,X),w(G,S,X),w(G,C,X),w(G,T,X),H($,G,X),D=!0,L||(N=Y(g,"click",n[22]),L=!0)},p(G,X){(!D||X[0]&4)&&o!==(o=G[2].name+"")&&le(r,o),G[12]?P&&(P.d(1),P=null):P?P.p(G,X):(P=Pm(G),P.c(),P.m(u,f)),G[2].type!=="view"?F?F.p(G,X):(F=Nm(G),F.c(),F.m(h,null)):F&&(F.d(1),F=null);const J={};X[0]&1&&(J.value=G[0]),X[0]&4&&(J.autocompleteCollection=G[2]),y.$set(J);const W={};X[0]&4&&(W.collection=G[2]),!O&&X[0]&1&&(O=!0,W.filter=G[0],ve(()=>O=!1)),!M&&X[0]&2&&(M=!0,W.sort=G[1],ve(()=>M=!1)),$.$set(W)},i(G){D||(A(c.$$.fragment,G),A(y.$$.fragment,G),A($.$$.fragment,G),D=!0)},o(G){I(c.$$.fragment,G),I(y.$$.fragment,G),I($.$$.fragment,G),D=!1},d(G){G&&(k(e),k(_),k(S),k(C),k(T)),P&&P.d(),V(c),F&&F.d(),V(y,G),n[25](null),V($,G),L=!1,N()}}}function WD(n){let e,t,i;function s(o){n[19](o)}let l={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(l.totalCount=n[10]),e=new HD({props:l}),n[18](e),te.push(()=>he(e,"totalCount",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){n[18](null),V(e,o)}}}function YD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=E(),i=v("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[17]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function KD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function JD(n){let e,t,i;function s(r,a){return r[12]?KD:YD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='',i=E(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),b(e,t),b(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function GD(n){let e;return{c(){e=v("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function ZD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[BD,zD,VD],h=[];function g(C,T){return C[3]&&!C[11].length?0:C[11].length?2:1}e=g(n),t=h[e]=d[e](n);let m={};s=new ou({props:m}),n[31](s);let _={};o=new d5({props:_}),n[32](o);let y={collection:n[2]};a=new uu({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return f=new cD({props:S}),n[37](f),f.$on("hide",n[38]),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(C,T){h[e].m(C,T),w(C,i,T),H(s,C,T),w(C,l,T),H(o,C,T),w(C,r,T),H(a,C,T),w(C,u,T),H(f,C,T),c=!0},p(C,T){let $=e;e=g(C),e===$?h[e].p(C,T):(re(),I(h[$],1,1,()=>{h[$]=null}),ae(),t=h[e],t?t.p(C,T):(t=h[e]=d[e](C),t.c()),A(t,1),t.m(i.parentNode,i));const O={};s.$set(O);const M={};o.$set(M);const D={};T[0]&4&&(D.collection=C[2]),a.$set(D);const L={};T[0]&4&&(L.collection=C[2]),f.$set(L)},i(C){c||(A(t),A(s.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),A(f.$$.fragment,C),c=!0)},o(C){I(t),I(s.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),I(f.$$.fragment,C),c=!1},d(C){C&&(k(i),k(l),k(r),k(u)),h[e].d(C),n[31](null),V(s,C),n[32](null),V(o,C),n[33](null),V(a,C),n[37](null),V(f,C)}}}function XD(n,e,t){let i,s,l,o,r,a,u;Ge(n,hi,Se=>t(2,s=Se)),Ge(n,Nt,Se=>t(39,l=Se)),Ge(n,ko,Se=>t(3,o=Se)),Ge(n,ka,Se=>t(16,r=Se)),Ge(n,Zn,Se=>t(11,a=Se)),Ge(n,Os,Se=>t(12,u=Se));const f=new URLSearchParams(r);let c,d,h,g,m,_,y=f.get("filter")||"",S=f.get("sort")||"-created",C=f.get("collectionId")||(s==null?void 0:s.id),T=0;tk(C);async function $(Se){await sn(),(s==null?void 0:s.type)==="view"?g.show(Se):h==null||h.show(Se)}function O(){t(14,C=s==null?void 0:s.id),t(0,y=""),t(1,S="-created"),D({recordId:null}),M()}async function M(){if(!S)return;const Se=j.getAllCollectionIdentifiers(s),we=S.split(",").map(Ue=>Ue.startsWith("+")||Ue.startsWith("-")?Ue.substring(1):Ue);we.filter(Ue=>Se.includes(Ue)).length!=we.length&&(Se.includes("created")?t(1,S="-created"):t(1,S=""))}function D(Se={}){const we=Object.assign({collectionId:(s==null?void 0:s.id)||"",filter:y,sort:S},Se);j.replaceQueryParams(we)}const L=()=>c==null?void 0:c.show();function N(Se){te[Se?"unshift":"push"](()=>{_=Se,t(9,_)})}function P(Se){T=Se,t(10,T)}const F=()=>c==null?void 0:c.show(s),R=()=>{m==null||m.load(),_==null||_.reload()},q=()=>d==null?void 0:d.show(s),B=()=>h==null?void 0:h.show(),G=Se=>t(0,y=Se.detail);function X(Se){te[Se?"unshift":"push"](()=>{m=Se,t(8,m)})}function J(Se){y=Se,t(0,y)}function W(Se){S=Se,t(1,S)}const oe=Se=>{D({recordId:Se.detail.id});let we=Se.detail._partial?Se.detail.id:Se.detail;s.type==="view"?g==null||g.show(we):h==null||h.show(we)},ee=()=>{_==null||_.reload()},se=()=>h==null?void 0:h.show();function Ee(Se){te[Se?"unshift":"push"](()=>{c=Se,t(4,c)})}function Re(Se){te[Se?"unshift":"push"](()=>{d=Se,t(5,d)})}function Ve(Se){te[Se?"unshift":"push"](()=>{h=Se,t(6,h)})}const We=()=>{D({recordId:null})},ke=Se=>{y?_==null||_.reload():Se.detail.isNew&&t(10,T++,T),m==null||m.reloadLoadedPages()},Me=Se=>{(!y||m!=null&&m.hasRecord(Se.detail.id))&&t(10,T--,T),m==null||m.reloadLoadedPages()};function Je(Se){te[Se?"unshift":"push"](()=>{g=Se,t(7,g)})}const ct=()=>{D({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=C&&Qy(i.get("collectionId")),n.$$.dirty[0]&16388&&s!=null&&s.id&&C!=s.id&&O(),n.$$.dirty[0]&4&&s!=null&&s.id&&M(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&$(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||s!=null&&s.id)&&D(),n.$$.dirty[0]&4&&an(Nt,l=(s==null?void 0:s.name)||"Collections",l)},[y,S,s,o,c,d,h,g,m,_,T,a,u,D,C,i,r,L,N,P,F,R,q,B,G,X,J,W,oe,ee,se,Ee,Re,Ve,We,ke,Me,Je,ct]}class QD extends be{constructor(e){super(),_e(this,e,XD,ZD,ge,{},null,[-1,-1])}}function xD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N,P;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=E(),l=v("a"),l.innerHTML=' Application',o=E(),r=v("a"),r.innerHTML=' Mail settings',a=E(),u=v("a"),u.innerHTML=' Files storage',f=E(),c=v("a"),c.innerHTML=' Backups',d=E(),h=v("div"),h.innerHTML='Sync',g=E(),m=v("a"),m.innerHTML=' Export collections',_=E(),y=v("a"),y.innerHTML=' Import collections',S=E(),C=v("div"),C.textContent="Authentication",T=E(),$=v("a"),$.innerHTML=' Auth providers',O=E(),M=v("a"),M.innerHTML=' Token options',D=E(),L=v("a"),L.innerHTML=' Admins',p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"href","/settings/backups"),p(c,"class","sidebar-list-item"),p(h,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(y,"href","/settings/import-collections"),p(y,"class","sidebar-list-item"),p(C,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(L,"href","/settings/admins"),p(L,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(F,R){w(F,e,R),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),b(t,f),b(t,c),b(t,d),b(t,h),b(t,g),b(t,m),b(t,_),b(t,y),b(t,S),b(t,C),b(t,T),b(t,$),b(t,O),b(t,M),b(t,D),b(t,L),N||(P=[Te(zn.call(null,l,{path:"/settings"})),Te(dn.call(null,l)),Te(zn.call(null,r,{path:"/settings/mail/?.*"})),Te(dn.call(null,r)),Te(zn.call(null,u,{path:"/settings/storage/?.*"})),Te(dn.call(null,u)),Te(zn.call(null,c,{path:"/settings/backups/?.*"})),Te(dn.call(null,c)),Te(zn.call(null,m,{path:"/settings/export-collections/?.*"})),Te(dn.call(null,m)),Te(zn.call(null,y,{path:"/settings/import-collections/?.*"})),Te(dn.call(null,y)),Te(zn.call(null,$,{path:"/settings/auth-providers/?.*"})),Te(dn.call(null,$)),Te(zn.call(null,M,{path:"/settings/tokens/?.*"})),Te(dn.call(null,M)),Te(zn.call(null,L,{path:"/settings/admins/?.*"})),Te(dn.call(null,L))],N=!0)},p:x,i:x,o:x,d(F){F&&k(e),N=!1,$e(P)}}}class Di extends be{constructor(e){super(),_e(this,e,null,xD,ge,{})}}function Fm(n,e,t){const i=n.slice();return i[31]=e[t],i}function Rm(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[eA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function eA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return a=new z1({props:{model:n[1]}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",o=E(),r=v("div"),z(a.$$.fragment),u=E(),f=v("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"class","form-field-addon"),p(f,"type","text"),p(f,"id",c=n[30]),f.value=d=n[1].id,f.readOnly=!0},m(g,m){w(g,e,m),b(e,t),b(e,i),b(e,s),w(g,o,m),w(g,r,m),H(a,r,null),w(g,u,m),w(g,f,m),h=!0},p(g,m){(!h||m[0]&1073741824&&l!==(l=g[30]))&&p(e,"for",l);const _={};m[0]&2&&(_.model=g[1]),a.$set(_),(!h||m[0]&1073741824&&c!==(c=g[30]))&&p(f,"id",c),(!h||m[0]&2&&d!==(d=g[1].id)&&f.value!==d)&&(f.value=d)},i(g){h||(A(a.$$.fragment,g),h=!0)},o(g){I(a.$$.fragment,g),h=!1},d(g){g&&(k(e),k(o),k(r),k(u),k(f)),V(a)}}}function qm(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=E(),un(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(u,f){w(u,e,f),b(e,t),b(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),o=!1,r()}}}function tA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("input"),p(t,"class",j.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ce(r,n[3]),u||(f=Y(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&ce(r,c[3])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function jm(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[nA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Hm(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[iA,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[sA,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742848|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(t,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=He(t,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function iA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new B1({}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),ce(r,n[9]),w(m,u,_),w(m,f,_),H(c,f,null),d=!0,h||(g=Y(r,"input",n[21]),h=!0)},p(m,_){(!d||_[0]&1073741824&&l!==(l=m[30]))&&p(e,"for",l),(!d||_[0]&1073741824&&a!==(a=m[30]))&&p(r,"id",a),_[0]&512&&r.value!==m[9]&&ce(r,m[9])},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){I(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),V(c),h=!1,g()}}}function sA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ce(r,n[10]),u||(f=Y(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&ce(r,c[10])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function lA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[5]&&Rm(n),m=pe([0,1,2,3,4,5,6,7,8,9]),_=[];for(let C=0;C<10;C+=1)_[C]=qm(Fm(n,m,C));a=new me({props:{class:"form-field required",name:"email",$$slots:{default:[tA,({uniqueId:C})=>({30:C}),({uniqueId:C})=>[C?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&jm(n),S=(n[5]||n[4])&&Hm(n);return{c(){e=v("form"),g&&g.c(),t=E(),i=v("div"),s=v("p"),s.textContent="Avatar",l=E(),o=v("div");for(let C=0;C<10;C+=1)_[C].c();r=E(),z(a.$$.fragment),u=E(),y&&y.c(),f=E(),S&&S.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(C,T){w(C,e,T),g&&g.m(e,null),b(e,t),b(e,i),b(i,s),b(i,l),b(i,o);for(let $=0;$<10;$+=1)_[$]&&_[$].m(o,null);b(e,r),H(a,e,null),b(e,u),y&&y.m(e,null),b(e,f),S&&S.m(e,null),c=!0,d||(h=Y(e,"submit",Ze(n[13])),d=!0)},p(C,T){if(C[5]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(C,T),T[0]&32&&A(g,1)):(g=Rm(C),g.c(),A(g,1),g.m(e,t)),T[0]&4){m=pe([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const M=Fm(C,m,O);_[O]?_[O].p(M,T):(_[O]=qm(M),_[O].c(),_[O].m(o,null))}for(;O<10;O+=1)_[O].d(1)}const $={};T[0]&1073741832|T[1]&8&&($.$$scope={dirty:T,ctx:C}),a.$set($),C[5]?y&&(re(),I(y,1,1,()=>{y=null}),ae()):y?(y.p(C,T),T[0]&32&&A(y,1)):(y=jm(C),y.c(),A(y,1),y.m(e,f)),C[5]||C[4]?S?(S.p(C,T),T[0]&48&&A(S,1)):(S=Hm(C),S.c(),A(S,1),S.m(e,null)):S&&(re(),I(S,1,1,()=>{S=null}),ae())},i(C){c||(A(g),A(a.$$.fragment,C),A(y),A(S),c=!0)},o(C){I(g),I(a.$$.fragment,C),I(y),I(S),c=!1},d(C){C&&k(e),g&&g.d(),bt(_,C),V(a),y&&y.d(),S&&S.d(),d=!1,h()}}}function oA(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&32&&t!==(t=s[5]?"New admin":"Edit admin")&&le(i,t)},d(s){s&&k(e)}}}function Vm(n){let e,t,i,s,l,o,r,a,u;return o=new Pn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[rA]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=E(),s=v("i"),l=E(),z(o.$$.fragment),r=E(),a=v("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),H(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){I(o.$$.fragment,f),u=!1},d(f){f&&(k(e),k(r),k(a)),V(o)}}}function rA(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[16]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function aA(n){let e,t,i,s,l,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,h=!n[5]&&Vm(n);return{c(){h&&h.c(),e=E(),t=v("button"),i=v("span"),i.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=U(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[12]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[11]||n[7],Q(l,"btn-loading",n[7])},m(g,m){h&&h.m(g,m),w(g,e,m),w(g,t,m),b(t,i),w(g,s,m),w(g,l,m),b(l,o),b(o,a),f=!0,c||(d=Y(t,"click",n[17]),c=!0)},p(g,m){g[5]?h&&(re(),I(h,1,1,()=>{h=null}),ae()):h?(h.p(g,m),m[0]&32&&A(h,1)):(h=Vm(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||m[0]&128)&&(t.disabled=g[7]),(!f||m[0]&32)&&r!==(r=g[5]?"Create":"Save changes")&&le(a,r),(!f||m[0]&2176&&u!==(u=!g[11]||g[7]))&&(l.disabled=u),(!f||m[0]&128)&&Q(l,"btn-loading",g[7])},i(g){f||(A(h),f=!0)},o(g){I(h),f=!1},d(g){g&&(k(e),k(t),k(s),k(l)),h&&h.d(g),c=!1,d()}}}function uA(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[aA],header:[oA],default:[lA]},$$scope:{ctx:n}};return e=new on({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&2304&&(o.beforeHide=s[23]),l[0]&3774|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[24](null),V(e,s)}}}function fA(n,e,t){let i,s;const l=dt(),o="admin_"+j.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",h="",g="",m=!1;function _(X){return S(X),t(8,f=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(X){t(1,a=structuredClone(X||{})),C()}function C(){t(4,m=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,h=""),t(10,g=""),ln({})}function T(){if(u||!s)return;t(7,u=!0);const X={email:d,avatar:c};(i||m)&&(X.password=h,X.passwordConfirm=g);let J;i?J=de.admins.create(X):J=de.admins.update(a.id,X),J.then(async W=>{var oe;t(8,f=!1),y(),zt(i?"Successfully created admin.":"Successfully updated admin."),((oe=de.authStore.model)==null?void 0:oe.id)===W.id&&de.authStore.save(de.authStore.token,W),l("save",W)}).catch(W=>{de.error(W)}).finally(()=>{t(7,u=!1)})}function $(){a!=null&&a.id&&_n("Do you really want to delete the selected admin?",()=>de.admins.delete(a.id).then(()=>{t(8,f=!1),y(),zt("Successfully deleted admin."),l("delete",a)}).catch(X=>{de.error(X)}))}const O=()=>$(),M=()=>y(),D=X=>t(2,c=X);function L(){d=this.value,t(3,d)}function N(){m=this.checked,t(4,m)}function P(){h=this.value,t(9,h)}function F(){g=this.value,t(10,g)}const R=()=>s&&f?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),y()}),!1):!0;function q(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function B(X){Fe.call(this,n,X)}function G(X){Fe.call(this,n,X)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,s=i&&d!=""||m||d!==a.email||c!==a.avatar)},[y,a,c,d,m,i,r,u,f,h,g,s,o,T,$,_,O,M,D,L,N,P,F,R,q,B,G]}class cA extends be{constructor(e){super(),_e(this,e,fA,uA,ge,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function zm(n,e,t){const i=n.slice();return i[24]=e[t],i}function dA(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function pA(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function hA(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function mA(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Bm(n){let e;function t(l,o){return l[5]?_A:gA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function gA(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Um(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Um(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function _A(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Um(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Wm(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ym(n,e){let t,i,s,l,o,r,a,u,f,c,d,h=e[24].id+"",g,m,_,y,S,C=e[24].email+"",T,$,O,M,D,L,N,P,F,R,q,B,G,X;f=new js({props:{value:e[24].id}});let J=e[24].id===e[7].id&&Wm();D=new $i({props:{date:e[24].created}}),P=new $i({props:{date:e[24].updated}});function W(){return e[15](e[24])}function oe(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=E(),a=v("td"),u=v("div"),z(f.$$.fragment),c=E(),d=v("span"),g=U(h),m=E(),J&&J.c(),_=E(),y=v("td"),S=v("span"),T=U(C),O=E(),M=v("td"),z(D.$$.fragment),L=E(),N=v("td"),z(P.$$.fragment),F=E(),R=v("td"),R.innerHTML='',q=E(),un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",$=e[24].email),p(y,"class","col-type-email col-field-email"),p(M,"class","col-type-date col-field-created"),p(N,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,se){w(ee,t,se),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),H(f,u,null),b(u,c),b(u,d),b(d,g),b(a,m),J&&J.m(a,null),b(t,_),b(t,y),b(y,S),b(S,T),b(t,O),b(t,M),H(D,M,null),b(t,L),b(t,N),H(P,N,null),b(t,F),b(t,R),b(t,q),B=!0,G||(X=[Y(t,"click",W),Y(t,"keydown",oe)],G=!0)},p(ee,se){e=ee,(!B||se&16&&!un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Ee={};se&16&&(Ee.value=e[24].id),f.$set(Ee),(!B||se&16)&&h!==(h=e[24].id+"")&&le(g,h),e[24].id===e[7].id?J||(J=Wm(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!B||se&16)&&C!==(C=e[24].email+"")&&le(T,C),(!B||se&16&&$!==($=e[24].email))&&p(S,"title",$);const Re={};se&16&&(Re.date=e[24].created),D.$set(Re);const Ve={};se&16&&(Ve.date=e[24].updated),P.$set(Ve)},i(ee){B||(A(f.$$.fragment,ee),A(D.$$.fragment,ee),A(P.$$.fragment,ee),B=!0)},o(ee){I(f.$$.fragment,ee),I(D.$$.fragment,ee),I(P.$$.fragment,ee),B=!1},d(ee){ee&&k(t),V(f),J&&J.d(),V(D),V(P),G=!1,$e(X)}}}function bA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$=[],O=new Map,M;function D(W){n[11](W)}let L={class:"col-type-text",name:"id",$$slots:{default:[dA]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new hn({props:L}),te.push(()=>he(o,"sort",D));function N(W){n[12](W)}let P={class:"col-type-email col-field-email",name:"email",$$slots:{default:[pA]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),u=new hn({props:P}),te.push(()=>he(u,"sort",N));function F(W){n[13](W)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[hA]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new hn({props:R}),te.push(()=>he(d,"sort",F));function q(W){n[14](W)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[mA]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),m=new hn({props:B}),te.push(()=>he(m,"sort",q));let G=pe(n[4]);const X=W=>W[24].id;for(let W=0;Wr=!1)),o.$set(ee);const se={};oe&134217728&&(se.$$scope={dirty:oe,ctx:W}),!f&&oe&4&&(f=!0,se.sort=W[2],ve(()=>f=!1)),u.$set(se);const Ee={};oe&134217728&&(Ee.$$scope={dirty:oe,ctx:W}),!h&&oe&4&&(h=!0,Ee.sort=W[2],ve(()=>h=!1)),d.$set(Ee);const Re={};oe&134217728&&(Re.$$scope={dirty:oe,ctx:W}),!_&&oe&4&&(_=!0,Re.sort=W[2],ve(()=>_=!1)),m.$set(Re),oe&186&&(G=pe(W[4]),re(),$=gt($,oe,X,1,W,G,O,T,Rt,Ym,null,zm),ae(),!G.length&&J?J.p(W,oe):G.length?J&&(J.d(1),J=null):(J=Bm(W),J.c(),J.m(T,null))),(!M||oe&32)&&Q(e,"table-loading",W[5])},i(W){if(!M){A(o.$$.fragment,W),A(u.$$.fragment,W),A(d.$$.fragment,W),A(m.$$.fragment,W);for(let oe=0;oe New admin',g=E(),z(m.$$.fragment),_=E(),y=v("div"),S=E(),z(C.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(M,D){w(M,e,D),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),H(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),b(d,h),w(M,g,D),H(m,M,D),w(M,_,D),w(M,y,D),w(M,S,D),H(C,M,D),T=!0,$||(O=Y(h,"click",n[9]),$=!0)},p(M,D){(!T||D&64)&&le(o,M[6]);const L={};D&2&&(L.value=M[1]),m.$set(L);const N={};D&134217918&&(N.$$scope={dirty:D,ctx:M}),C.$set(N)},i(M){T||(A(a.$$.fragment,M),A(m.$$.fragment,M),A(C.$$.fragment,M),T=!0)},o(M){I(a.$$.fragment,M),I(m.$$.fragment,M),I(C.$$.fragment,M),T=!1},d(M){M&&(k(e),k(g),k(_),k(y),k(S)),V(a),V(m,M),V(C,M),$=!1,O()}}}function yA(n){let e,t,i=n[4].length+"",s;return{c(){e=v("div"),t=U("Total found: "),s=U(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(l,o){w(l,e,o),b(e,t),b(e,s)},p(l,o){o&16&&i!==(i=l[4].length+"")&&le(s,i)},d(l){l&&k(e)}}}function kA(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{footer:[yA],default:[vA]},$$scope:{ctx:n}}});let r={};return l=new cA({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[18](null),V(l,a)}}}function wA(n,e,t){let i,s,l;Ge(n,ka,P=>t(21,i=P)),Ge(n,Nt,P=>t(6,s=P)),Ge(n,Pa,P=>t(7,l=P)),an(Nt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const P=j.normalizeSearchFilter(f,["id","email","created","updated"]);return de.admins.getFullList(100,{sort:c||"-created",filter:P}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),de.error(F,(F==null?void 0:F.status)!=400))})}function h(){t(4,a=[])}const g=()=>d(),m=()=>r==null?void 0:r.show(),_=P=>t(1,f=P.detail);function y(P){c=P,t(2,c)}function S(P){c=P,t(2,c)}function C(P){c=P,t(2,c)}function T(P){c=P,t(2,c)}const $=P=>r==null?void 0:r.show(P),O=(P,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(P))},M=()=>t(1,f="");function D(P){te[P?"unshift":"push"](()=>{r=P,t(3,r)})}const L=()=>d(),N=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const P=new URLSearchParams({filter:f,sort:c}).toString();us("/settings/admins?"+P),d()}},[d,f,c,r,a,u,s,l,g,m,_,y,S,C,T,$,O,M,D,L,N]}class SA extends be{constructor(e){super(),_e(this,e,wA,kA,ge,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function TA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&ce(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function CA(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ce(l,n[1]),w(d,r,h),w(d,a,h),b(a,u),f||(c=[Y(l,"input",n[5]),Te(dn.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&ce(l,d[1])},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),f=!1,$e(c)}}}function $A(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[TA,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[CA,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Admin sign in

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),a=v("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),b(e,t),b(e,i),H(s,e,null),b(e,l),H(o,e,null),b(e,r),b(e,a),u=!0,f||(c=Y(e,"submit",Ze(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const m={};h&770&&(m.$$scope={dirty:h,ctx:d}),o.$set(m),(!u||h&4)&&Q(a,"btn-disabled",d[2]),(!u||h&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(s.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&k(e),V(s),V(o),f=!1,c()}}}function MA(n){let e,t;return e=new Pb({props:{$$slots:{default:[$A]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function OA(n,e,t){let i;Ge(n,ka,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),de.admins.authWithPassword(l,o).then(()=>{Ia(),us("/")}).catch(()=>{Ci("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class EA extends be{constructor(e){super(),_e(this,e,OA,MA,ge,{})}}function DA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[IA,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[LA,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[PA,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[NA,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}});let O=n[3]&&Km(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),d=v("div"),h=v("div"),g=E(),O&&O.c(),m=E(),_=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(_,"type","submit"),p(_,"class","btn btn-expanded"),_.disabled=S=!n[3]||n[2],Q(_,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(M,D){w(M,e,D),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),H(a,e,null),b(e,u),H(f,e,null),b(e,c),b(e,d),b(d,h),b(d,g),O&&O.m(d,null),b(d,m),b(d,_),b(_,y),C=!0,T||($=Y(_,"click",n[13]),T=!0)},p(M,D){const L={};D&1572865&&(L.$$scope={dirty:D,ctx:M}),i.$set(L);const N={};D&1572865&&(N.$$scope={dirty:D,ctx:M}),o.$set(N);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:M}),a.$set(P);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:M}),f.$set(F),M[3]?O?O.p(M,D):(O=Km(M),O.c(),O.m(d,m)):O&&(O.d(1),O=null),(!C||D&12&&S!==(S=!M[3]||M[2]))&&(_.disabled=S),(!C||D&4)&&Q(_,"btn-loading",M[2])},i(M){C||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(a.$$.fragment,M),A(f.$$.fragment,M),C=!0)},o(M){I(i.$$.fragment,M),I(o.$$.fragment,M),I(a.$$.fragment,M),I(f.$$.fragment,M),C=!1},d(M){M&&k(e),V(i),V(o),V(a),V(f),O&&O.d(),T=!1,$()}}}function AA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function IA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ce(l,u[0].meta.appName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function LA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application URL"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&ce(l,u[0].meta.appUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function PA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Logs max days retention"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&vt(l.value)!==u[0].logs.maxDays&&ce(l,u[0].logs.maxDays)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function NA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),Te(Be.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Km(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function FA(n){let e,t,i,s,l,o,r,a,u;const f=[AA,DA],c=[];function d(h,g){return h[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML='',t=E(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),b(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",Ze(n[4])),a=!0)},p(h,g){let m=l;l=d(h),l===m?c[l].p(h,g):(re(),I(c[m],1,1,()=>{c[m]=null}),ae(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){I(o),r=!1},d(h){h&&(k(e),k(t),k(i)),c[l].d(),a=!1,u()}}}function RA(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[FA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function qA(n,e,t){let i,s,l,o;Ge(n,Os,O=>t(14,s=O)),Ge(n,So,O=>t(15,l=O)),Ge(n,Nt,O=>t(16,o=O)),an(Nt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const O=await de.settings.update(j.filterRedactedProps(a));g(O),zt("Successfully saved application settings.")}catch(O){de.error(O)}t(2,f=!1)}}function g(O={}){var M,D;an(So,l=(M=O==null?void 0:O.meta)==null?void 0:M.appName,l),an(Os,s=!!((D=O==null?void 0:O.meta)!=null&&D.hideControls),s),t(0,a={meta:(O==null?void 0:O.meta)||{},logs:(O==null?void 0:O.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function m(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.logs.maxDays=vt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>m(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,m,r,c,_,y,S,C,T,$]}class jA extends be{constructor(e){super(),_e(this,e,qA,RA,ge,{})}}function HA(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),di(s,a)},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Te(Be.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){di(s,a=kt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(k(e),k(i),k(s)),l=!1,$e(o)}}}function zA(n){let e;function t(l,o){return l[3]?VA:HA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function BA(n,e,t){const i=["value","mask"];let s=tt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(h){te[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(5,s=tt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class fu extends be{constructor(e){super(),_e(this,e,BA,zA,ge,{value:0,mask:1})}}function UA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;return{c(){e=v("label"),t=U("Subject"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters: - `),f=v("button"),f.textContent="{APP_NAME} ",c=U(`, - `),d=v("button"),d.textContent="{APP_URL} ",h=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),w(_,l,y),ce(l,n[0].subject),w(_,r,y),w(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),g||(m=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],g=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&p(e,"for",i),y[1]&1&&o!==(o=_[31])&&p(l,"id",o),y[0]&1&&l.value!==_[0].subject&&ce(l,_[0].subject)},d(_){_&&(k(e),k(s),k(l),k(r),k(a)),g=!1,$e(m)}}}function WA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return{c(){e=v("label"),t=U("Action URL"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters: - `),f=v("button"),f.textContent="{APP_NAME} ",c=U(`, - `),d=v("button"),d.textContent="{APP_URL} ",h=U(`, - `),g=v("button"),g.textContent="{TOKEN} ",m=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(S,C){w(S,e,C),b(e,t),w(S,s,C),w(S,l,C),ce(l,n[0].actionUrl),w(S,r,C),w(S,a,C),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),_||(y=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(g,"click",n[19])],_=!0)},p(S,C){C[1]&1&&i!==(i=S[31])&&p(e,"for",i),C[1]&1&&o!==(o=S[31])&&p(l,"id",o),C[0]&1&&l.value!==S[0].actionUrl&&ce(l,S[0].actionUrl)},d(S){S&&(k(e),k(s),k(l),k(r),k(a)),_=!1,$e(y)}}}function YA(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),ce(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&ce(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function KA(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Lt(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Lt(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ve(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function JA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;const $=[KA,YA],O=[];function M(D,L){return D[4]&&!D[5]?0:1}return l=M(n),o=O[l]=$[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=U(`Available placeholder parameters: - `),f=v("button"),f.textContent="{APP_NAME} ",c=U(`, - `),d=v("button"),d.textContent="{APP_URL} ",h=U(`, - `),g=v("button"),g.textContent="{TOKEN} ",m=U(`, - `),_=v("button"),_.textContent="{ACTION_URL} ",y=U("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(D,L){w(D,e,L),b(e,t),w(D,s,L),O[l].m(D,L),w(D,r,L),w(D,a,L),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),b(a,_),b(a,y),S=!0,C||(T=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(g,"click",n[24]),Y(_,"click",n[25])],C=!0)},p(D,L){(!S||L[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let N=l;l=M(D),l===N?O[l].p(D,L):(re(),I(O[N],1,1,()=>{O[N]=null}),ae(),o=O[l],o?o.p(D,L):(o=O[l]=$[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){I(o),S=!1},d(D){D&&(k(e),k(s),k(r),k(a)),O[l].d(D),C=!1,$e(T)}}}function GA(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[UA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[WA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[JA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&(k(t),k(s)),V(e,r),V(i,r),V(l,r)}}}function Jm(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function ZA(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Jm();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=U(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Jm(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function XA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[ZA],default:[GA]},$$scope:{ctx:n}};for(let l=0;lt(12,o=W));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Gm,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function m(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await ut(()=>import("./CodeEditor-19c882f6.js"),["./CodeEditor-19c882f6.js","./index-808c8630.js"],import.meta.url)).default),Gm=c,t(5,d=!1))}function y(W){j.copyToClipboard(W),yo(`Copied ${W} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),T=()=>y("{APP_URL}");function $(){u.actionUrl=this.value,t(0,u)}const O=()=>y("{APP_NAME}"),M=()=>y("{APP_URL}"),D=()=>y("{TOKEN}");function L(W){n.$$.not_equal(u.body,W)&&(u.body=W,t(0,u))}function N(){u.body=this.value,t(0,u)}const P=()=>y("{APP_NAME}"),F=()=>y("{APP_URL}"),R=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function B(W){te[W?"unshift":"push"](()=>{f=W,t(3,f)})}function G(W){Fe.call(this,n,W)}function X(W){Fe.call(this,n,W)}function J(W){Fe.call(this,n,W)}return n.$$set=W=>{e=je(je({},e),xt(W)),t(8,l=tt(e,s)),"key"in W&&t(1,r=W.key),"title"in W&&t(2,a=W.title),"config"in W&&t(0,u=W.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||pi(r))},[u,r,a,f,c,d,i,y,l,h,g,m,o,S,C,T,$,O,M,D,L,N,P,F,R,q,B,G,X,J]}class qr extends be{constructor(e){super(),_e(this,e,QA,XA,ge,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Zm(n,e,t){const i=n.slice();return i[21]=e[t],i}function Xm(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,c,d,h;return c=d0(e[11][0]),{key:n,first:null,c(){t=v("div"),i=v("input"),l=E(),o=v("label"),a=U(r),f=E(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,ce(i,i.__value),p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(g,m){w(g,t,m),b(t,i),i.checked=i.__value===e[2],b(t,l),b(t,o),b(o,a),b(t,f),d||(h=Y(i,"change",e[10]),d=!0)},p(g,m){e=g,m&1048576&&s!==(s=e[20]+e[21].value)&&p(i,"id",s),m&4&&(i.checked=i.__value===e[2]),m&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(g){g&&k(t),c.r(),d=!1,h()}}}function xA(n){let e=[],t=new Map,i,s=pe(n[7]);const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[e8,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),z(t.$$.fragment),i=E(),z(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),H(t,e,null),b(e,i),H(s,e,null),l=!0,o||(r=Y(e,"submit",Ze(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){I(t.$$.fragment,a),I(s.$$.fragment,a),l=!1},d(a){a&&k(e),V(t),V(s),o=!1,r()}}}function n8(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function i8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function s8(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[i8],header:[n8],default:[t8]},$$scope:{ctx:n}};return e=new on({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[15](null),V(e,s)}}}const jr="last_email_test",Qm="email_test_request";function l8(n,e,t){let i;const s=dt(),l="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(jr),u=o[0].value,f=!1,c=null;function d(M="",D=""){t(1,a=M||localStorage.getItem(jr)),t(2,u=D||o[0].value),ln({}),r==null||r.show()}function h(){return clearTimeout(c),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(jr,a),clearTimeout(c),c=setTimeout(()=>{de.cancelRequest(Qm),Ci("Test email send timeout.")},3e4);try{await de.settings.testEmail(a,u,{$cancelKey:Qm}),zt("Successfully sent test email."),s("submit"),t(4,f=!1),await sn(),h()}catch(M){t(4,f=!1),de.error(M)}clearTimeout(c)}}const m=[[]];function _(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const S=()=>g(),C=()=>!f;function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){Fe.call(this,n,M)}function O(M){Fe.call(this,n,M)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[h,a,u,r,f,i,l,o,g,d,_,m,y,S,C,T,$,O]}class o8 extends be{constructor(e){super(),_e(this,e,l8,s8,ge,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function r8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[u8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[f8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});function P(ee){n[15](ee)}let F={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(F.config=n[0].meta.verificationTemplate),u=new qr({props:F}),te.push(()=>he(u,"config",P));function R(ee){n[16](ee)}let q={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(q.config=n[0].meta.resetPasswordTemplate),d=new qr({props:q}),te.push(()=>he(d,"config",R));function B(ee){n[17](ee)}let G={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(G.config=n[0].meta.confirmEmailChangeTemplate),m=new qr({props:G}),te.push(()=>he(m,"config",B)),T=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[c8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&xm(n);function J(ee,se){return ee[5]?w8:k8}let W=J(n),oe=W(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),c=E(),z(d.$$.fragment),g=E(),z(m.$$.fragment),y=E(),S=v("hr"),C=E(),z(T.$$.fragment),$=E(),X&&X.c(),O=E(),M=v("div"),D=v("div"),L=E(),oe.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(D,"class","flex-fill"),p(M,"class","flex")},m(ee,se){w(ee,e,se),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),w(ee,r,se),w(ee,a,se),H(u,a,null),b(a,c),H(d,a,null),b(a,g),H(m,a,null),w(ee,y,se),w(ee,S,se),w(ee,C,se),H(T,ee,se),w(ee,$,se),X&&X.m(ee,se),w(ee,O,se),w(ee,M,se),b(M,D),b(M,L),oe.m(M,null),N=!0},p(ee,se){const Ee={};se[0]&1|se[1]&24&&(Ee.$$scope={dirty:se,ctx:ee}),i.$set(Ee);const Re={};se[0]&1|se[1]&24&&(Re.$$scope={dirty:se,ctx:ee}),o.$set(Re);const Ve={};!f&&se[0]&1&&(f=!0,Ve.config=ee[0].meta.verificationTemplate,ve(()=>f=!1)),u.$set(Ve);const We={};!h&&se[0]&1&&(h=!0,We.config=ee[0].meta.resetPasswordTemplate,ve(()=>h=!1)),d.$set(We);const ke={};!_&&se[0]&1&&(_=!0,ke.config=ee[0].meta.confirmEmailChangeTemplate,ve(()=>_=!1)),m.$set(ke);const Me={};se[0]&1|se[1]&24&&(Me.$$scope={dirty:se,ctx:ee}),T.$set(Me),ee[0].smtp.enabled?X?(X.p(ee,se),se[0]&1&&A(X,1)):(X=xm(ee),X.c(),A(X,1),X.m(O.parentNode,O)):X&&(re(),I(X,1,1,()=>{X=null}),ae()),W===(W=J(ee))&&oe?oe.p(ee,se):(oe.d(1),oe=W(ee),oe&&(oe.c(),oe.m(M,null)))},i(ee){N||(A(i.$$.fragment,ee),A(o.$$.fragment,ee),A(u.$$.fragment,ee),A(d.$$.fragment,ee),A(m.$$.fragment,ee),A(T.$$.fragment,ee),A(X),N=!0)},o(ee){I(i.$$.fragment,ee),I(o.$$.fragment,ee),I(u.$$.fragment,ee),I(d.$$.fragment,ee),I(m.$$.fragment,ee),I(T.$$.fragment,ee),I(X),N=!1},d(ee){ee&&(k(e),k(r),k(a),k(y),k(S),k(C),k($),k(O),k(M)),V(i),V(o),V(u),V(d),V(m),V(T,ee),X&&X.d(ee),oe.d()}}}function a8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function u8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender name"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].meta.senderName),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&ce(l,u[0].meta.senderName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function f8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender address"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","email"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&ce(l,u[0].meta.senderAddress)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function c8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[18]),Te(Be.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function xm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;s=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[d8,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[p8,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field",name:"smtp.username",$$slots:{default:[h8,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[m8,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function $(L,N){return L[4]?_8:g8}let O=$(n),M=O(n),D=n[4]&&eg(n);return{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),m=v("button"),M.c(),_=E(),D&&D.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(m,"type","button"),p(m,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,N){w(L,e,N),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),b(t,a),b(t,u),H(f,u,null),b(t,c),b(t,d),H(h,d,null),b(e,g),b(e,m),M.m(m,null),b(e,_),D&&D.m(e,null),S=!0,C||(T=Y(m,"click",Ze(n[23])),C=!0)},p(L,N){const P={};N[0]&1|N[1]&24&&(P.$$scope={dirty:N,ctx:L}),s.$set(P);const F={};N[0]&1|N[1]&24&&(F.$$scope={dirty:N,ctx:L}),r.$set(F);const R={};N[0]&1|N[1]&24&&(R.$$scope={dirty:N,ctx:L}),f.$set(R);const q={};N[0]&1|N[1]&24&&(q.$$scope={dirty:N,ctx:L}),h.$set(q),O!==(O=$(L))&&(M.d(1),M=O(L),M&&(M.c(),M.m(m,null))),L[4]?D?(D.p(L,N),N[0]&16&&A(D,1)):(D=eg(L),D.c(),A(D,1),D.m(e,null)):D&&(re(),I(D,1,1,()=>{D=null}),ae())},i(L){S||(A(s.$$.fragment,L),A(r.$$.fragment,L),A(f.$$.fragment,L),A(h.$$.fragment,L),A(D),L&&xe(()=>{S&&(y||(y=He(e,lt,{duration:150},!0)),y.run(1))}),S=!0)},o(L){I(s.$$.fragment,L),I(r.$$.fragment,L),I(f.$$.fragment,L),I(h.$$.fragment,L),I(D),L&&(y||(y=He(e,lt,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&k(e),V(s),V(r),V(f),V(h),M.d(),D&&D.d(),L&&y&&y.end(),C=!1,T()}}}function d8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("SMTP server host"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].smtp.host),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&ce(l,u[0].smtp.host)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function p8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Port"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","number"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].smtp.port),r||(a=Y(l,"input",n[20]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&vt(l.value)!==u[0].smtp.port&&ce(l,u[0].smtp.port)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function h8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Username"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].smtp.username),r||(a=Y(l,"input",n[21]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&ce(l,u[0].smtp.username)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function m8(n){let e,t,i,s,l,o,r;function a(f){n[22](f)}let u={id:n[34]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new fu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Password"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function g8(n){let e,t,i;return{c(){e=v("span"),e.textContent="Show more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function _8(n){let e,t,i;return{c(){e=v("span"),e.textContent="Hide more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function eg(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new me({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[b8,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[v8,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[y8,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),p(t,"class","col-lg-3"),p(l,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(g,m){w(g,e,m),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),b(e,f),b(e,c),h=!0},p(g,m){const _={};m[0]&1|m[1]&24&&(_.$$scope={dirty:m,ctx:g}),i.$set(_);const y={};m[0]&1|m[1]&24&&(y.$$scope={dirty:m,ctx:g}),o.$set(y);const S={};m[0]&1|m[1]&24&&(S.$$scope={dirty:m,ctx:g}),u.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),g&&xe(()=>{h&&(d||(d=He(e,lt,{duration:150},!0)),d.run(1))}),h=!0)},o(g){I(i.$$.fragment,g),I(o.$$.fragment,g),I(u.$$.fragment,g),g&&(d||(d=He(e,lt,{duration:150},!1)),d.run(0)),h=!1},d(g){g&&k(e),V(i),V(o),V(u),g&&d&&d.end()}}}function b8(n){let e,t,i,s,l,o,r;function a(f){n[24](f)}let u={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new Ei({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("TLS encryption"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function v8(n){let e,t,i,s,l,o,r;function a(f){n[25](f)}let u={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new Ei({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("AUTH method"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function y8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="EHLO/HELO domain",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ce(r,n[0].smtp.localName),u||(f=[Te(Be.call(null,s,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),Y(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&l!==(l=c[34])&&p(e,"for",l),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&ce(r,c[0].smtp.localName)},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function k8(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[29]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function w8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[3],Q(s,"btn-loading",n[3])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"click",n[27]),Y(s,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function S8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[a8,r8],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[6]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=Y(u,"submit",Ze(n[30])),m=!0)},p(T,$){(!g||$[0]&64)&&le(o,T[6]);let O=d;d=C(T),d===O?S[d].p(T,$):(re(),I(S[O],1,1,()=>{S[O]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){I(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function T8(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{default:[S8]},$$scope:{ctx:n}}});let r={};return l=new o8({props:r}),n[31](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&127|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[31](null),V(l,a)}}}function C8(n,e,t){let i,s,l;Ge(n,Nt,ee=>t(6,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];an(Nt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1,h=!1;g();async function g(){t(2,c=!0);try{const ee=await de.settings.getAll()||{};_(ee)}catch(ee){de.error(ee)}t(2,c=!1)}async function m(){if(!(d||!s)){t(3,d=!0);try{const ee=await de.settings.update(j.filterRedactedProps(f));_(ee),ln({}),zt("Successfully saved mail settings.")}catch(ee){de.error(ee)}t(3,d=!1)}}function _(ee={}){t(0,f={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(11,u=JSON.parse(JSON.stringify(f)))}function y(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function C(){f.meta.senderAddress=this.value,t(0,f)}function T(ee){n.$$.not_equal(f.meta.verificationTemplate,ee)&&(f.meta.verificationTemplate=ee,t(0,f))}function $(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function O(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=vt(this.value),t(0,f)}function N(){f.smtp.username=this.value,t(0,f)}function P(ee){n.$$.not_equal(f.smtp.password,ee)&&(f.smtp.password=ee,t(0,f))}const F=()=>{t(4,h=!h)};function R(ee){n.$$.not_equal(f.smtp.tls,ee)&&(f.smtp.tls=ee,t(0,f))}function q(ee){n.$$.not_equal(f.smtp.authMethod,ee)&&(f.smtp.authMethod=ee,t(0,f))}function B(){f.smtp.localName=this.value,t(0,f)}const G=()=>y(),X=()=>m(),J=()=>a==null?void 0:a.show(),W=()=>m();function oe(ee){te[ee?"unshift":"push"](()=>{a=ee,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(u)),n.$$.dirty[0]&4097&&t(5,s=i!=JSON.stringify(f))},[f,a,c,d,h,s,l,o,r,m,y,u,i,S,C,T,$,O,M,D,L,N,P,F,R,q,B,G,X,J,W,oe]}class $8 extends be{constructor(e){super(),_e(this,e,C8,T8,ge,{},null,[-1,-1])}}const M8=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),tg=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function O8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&le(l,u[4]),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function ng(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O;return i=new me({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[E8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[D8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[A8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[I8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[L8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),S=new me({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[P8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),z(d.$$.fragment),h=E(),g=v("div"),z(m.$$.fragment),_=E(),y=v("div"),z(S.$$.fragment),C=E(),T=v("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(M,D){w(M,e,D),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),b(e,f),b(e,c),H(d,c,null),b(e,h),b(e,g),H(m,g,null),b(e,_),b(e,y),H(S,y,null),b(e,C),b(e,T),O=!0},p(M,D){const L={};D&8&&(L.name=M[3]+".endpoint"),D&1081345&&(L.$$scope={dirty:D,ctx:M}),i.$set(L);const N={};D&8&&(N.name=M[3]+".bucket"),D&1081345&&(N.$$scope={dirty:D,ctx:M}),o.$set(N);const P={};D&8&&(P.name=M[3]+".region"),D&1081345&&(P.$$scope={dirty:D,ctx:M}),u.$set(P);const F={};D&8&&(F.name=M[3]+".accessKey"),D&1081345&&(F.$$scope={dirty:D,ctx:M}),d.$set(F);const R={};D&8&&(R.name=M[3]+".secret"),D&1081345&&(R.$$scope={dirty:D,ctx:M}),m.$set(R);const q={};D&8&&(q.name=M[3]+".forcePathStyle"),D&1081345&&(q.$$scope={dirty:D,ctx:M}),S.$set(q)},i(M){O||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(u.$$.fragment,M),A(d.$$.fragment,M),A(m.$$.fragment,M),A(S.$$.fragment,M),M&&xe(()=>{O&&($||($=He(e,lt,{duration:150},!0)),$.run(1))}),O=!0)},o(M){I(i.$$.fragment,M),I(o.$$.fragment,M),I(u.$$.fragment,M),I(d.$$.fragment,M),I(m.$$.fragment,M),I(S.$$.fragment,M),M&&($||($=He(e,lt,{duration:150},!1)),$.run(0)),O=!1},d(M){M&&k(e),V(i),V(o),V(u),V(d),V(m),V(S),M&&$&&$.end()}}}function E8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Endpoint"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].endpoint),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].endpoint&&ce(l,u[0].endpoint)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function D8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Bucket"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].bucket),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].bucket&&ce(l,u[0].bucket)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function A8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Region"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].region),r||(a=Y(l,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].region&&ce(l,u[0].region)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function I8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Access key"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[0].accessKey),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].accessKey&&ce(l,u[0].accessKey)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function L8(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new fu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].secret,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function P8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[14]),Te(Be.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function N8(n){let e,t,i,s,l;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[O8,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=Ct(o,n,n[15],tg);let a=n[0].enabled&&ng(n);return{c(){z(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=ye()},m(u,f){H(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!l||f&32775)&&Mt(r,o,u,u[15],l?$t(o,u[15],f,M8):Ot(u[15]),tg),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=ng(u),a.c(),A(a,1),a.m(s.parentNode,s)):a&&(re(),I(a,1,1,()=>{a=null}),ae())},i(u){l||(A(e.$$.fragment,u),A(r,u),A(a),l=!0)},o(u){I(e.$$.fragment,u),I(r,u),I(a),l=!1},d(u){u&&(k(t),k(i),k(s)),V(e,u),r&&r.d(u),a&&a.d(u)}}}const Hr="s3_test_request";function F8(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,h=null;function g(M){t(2,c=!0),clearTimeout(h),h=setTimeout(()=>{m()},M)}async function m(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;de.cancelRequest(Hr),clearTimeout(d),d=setTimeout(()=>{de.cancelRequest(Hr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let M;try{await de.settings.testS3(u,{$cancelKey:Hr})}catch(D){M=D}return M!=null&&M.isAbort||(t(1,f=M),t(2,c=!1),clearTimeout(d)),f}Kt(()=>()=>{clearTimeout(d),clearTimeout(h)});function _(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function C(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function $(M){n.$$.not_equal(o.secret,M)&&(o.secret=M,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=M=>{"originalConfig"in M&&t(5,l=M.originalConfig),"config"in M&&t(0,o=M.config),"configKey"in M&&t(3,r=M.configKey),"toggleLabel"in M&&t(4,a=M.toggleLabel),"testFilesystem"in M&&t(6,u=M.testFilesystem),"testError"in M&&t(1,f=M.testError),"isTesting"in M&&t(2,c=M.isTesting),"$$scope"in M&&t(15,s=M.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l!=null&&l.enabled&&g(100),n.$$.dirty&9&&(o.enabled||pi(r))},[o,f,c,r,a,l,u,i,_,y,S,C,T,$,O,s]}class Y1 extends be{constructor(e){super(),_e(this,e,F8,N8,ge,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function R8(n){var M;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;function y(D){n[11](D)}function S(D){n[12](D)}function C(D){n[13](D)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[j8]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new Y1({props:T}),te.push(()=>he(e,"config",y)),te.push(()=>he(e,"isTesting",S)),te.push(()=>he(e,"testError",C));let $=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&sg(n),O=n[6]&&lg(n);return{c(){z(e.$$.fragment),l=E(),o=v("div"),r=v("div"),a=E(),$&&$.c(),u=E(),O&&O.c(),f=E(),c=v("button"),d=v("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=h=!n[6]||n[3],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(D,L){H(e,D,L),w(D,l,L),w(D,o,L),b(o,r),b(o,a),$&&$.m(o,null),b(o,u),O&&O.m(o,null),b(o,f),b(o,c),b(c,d),g=!0,m||(_=Y(c,"click",n[15]),m=!0)},p(D,L){var P;const N={};L&1&&(N.originalConfig=D[0].s3),L&524291&&(N.$$scope={dirty:L,ctx:D}),!t&&L&2&&(t=!0,N.config=D[1].s3,ve(()=>t=!1)),!i&&L&16&&(i=!0,N.isTesting=D[4],ve(()=>i=!1)),!s&&L&32&&(s=!0,N.testError=D[5],ve(()=>s=!1)),e.$set(N),(P=D[1].s3)!=null&&P.enabled&&!D[6]&&!D[3]?$?$.p(D,L):($=sg(D),$.c(),$.m(o,u)):$&&($.d(1),$=null),D[6]?O?O.p(D,L):(O=lg(D),O.c(),O.m(o,f)):O&&(O.d(1),O=null),(!g||L&72&&h!==(h=!D[6]||D[3]))&&(c.disabled=h),(!g||L&8)&&Q(c,"btn-loading",D[3])},i(D){g||(A(e.$$.fragment,D),g=!0)},o(D){I(e.$$.fragment,D),g=!1},d(D){D&&(k(l),k(o)),V(e,D),$&&$.d(),O&&O.d(),m=!1,_()}}}function q8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function ig(n){var L;let e,t,i,s,l,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",h,g,m,_,y,S,C,T,$,O,M,D;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually + `),l[0]&128&&(o.btnClose=!s[7]),l[0]&128&&(o.escClose=!s[7]),l[0]&128&&(o.overlayClose=!s[7]),l[0]&4352&&(o.beforeHide=s[55]),l[0]&60925|l[2]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[56](null),V(e,s)}}}const rs="form",Sl="providers";function DE(n,e,t){let i,s,l,o,r;const a=dt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d=null,h=null,g=null,m=!1,_=!1,y={},S={},C=JSON.stringify(d),T=C,$=rs,O=!0,M=!0;function D(ue){return F(ue),t(12,_=!0),t(13,$=rs),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function N(){t(12,_=!1),L()}async function P(ue){if(ue&&typeof ue=="string"){try{return await ce.collection(f.id).getOne(ue)}catch(De){De.isAbort||(N(),console.warn("resolveModel:",De),Ci(`Unable to load record with id "${ue}"`))}return null}return ue}async function F(ue){t(7,M=!0),ln({}),t(4,y={}),t(5,S={}),t(2,d=typeof ue=="string"?{id:ue,collectionId:f==null?void 0:f.id,collectionName:f==null?void 0:f.name}:ue||{}),t(3,h=structuredClone(d)),t(2,d=await P(ue)||{}),t(3,h=structuredClone(d)),await sn(),t(10,g=B()),!g||J(h,g)?t(10,g=null):(delete g.password,delete g.passwordConfirm),t(28,C=JSON.stringify(h)),t(7,M=!1)}async function R(ue){var Xe,Jt;ln({}),t(2,d=ue||{}),t(4,y={}),t(5,S={});const De=((Jt=(Xe=f==null?void 0:f.schema)==null?void 0:Xe.filter(nt=>nt.type!="file"))==null?void 0:Jt.map(nt=>nt.name))||[];for(let nt in ue)De.includes(nt)||t(3,h[nt]=ue[nt],h);await sn(),t(28,C=JSON.stringify(h)),U()}function q(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function B(ue){try{const De=window.localStorage.getItem(q());if(De)return JSON.parse(De)}catch{}return ue}function G(ue){try{window.localStorage.setItem(q(),ue)}catch(De){console.warn("updateDraft failure:",De),window.localStorage.removeItem(q())}}function X(){g&&(t(3,h=g),t(10,g=null))}function J(ue,De){var It;const Xe=structuredClone(ue||{}),Jt=structuredClone(De||{}),nt=(It=f==null?void 0:f.schema)==null?void 0:It.filter(Rn=>Rn.type==="file");for(let Rn of nt)delete Xe[Rn.name],delete Jt[Rn.name];const At=["expand","password","passwordConfirm"];for(let Rn of At)delete Xe[Rn],delete Jt[Rn];return JSON.stringify(Xe)==JSON.stringify(Jt)}function U(){t(10,g=null),window.localStorage.removeItem(q())}async function oe(ue=!0){if(!(m||!r||!(f!=null&&f.id))){t(11,m=!0);try{const De=se();let Xe;O?Xe=await ce.collection(f.id).create(De):Xe=await ce.collection(f.id).update(h.id,De),zt(O?"Successfully created record.":"Successfully updated record."),U(),ue?N():R(Xe),a("save",{isNew:O,record:Xe})}catch(De){ce.error(De)}t(11,m=!1)}}function ee(){d!=null&&d.id&&_n("Do you really want to delete the selected record?",()=>ce.collection(d.collectionId).delete(d.id).then(()=>{L(),zt("Successfully deleted record."),a("delete",d)}).catch(ue=>{ce.error(ue)}))}function se(){const ue=structuredClone(h||{}),De=new FormData,Xe={id:ue.id},Jt={};for(const nt of(f==null?void 0:f.schema)||[])Xe[nt.name]=!0,nt.type=="json"&&(Jt[nt.name]=!0);i&&(Xe.username=!0,Xe.email=!0,Xe.emailVisibility=!0,Xe.password=!0,Xe.passwordConfirm=!0,Xe.verified=!0);for(const nt in ue)if(Xe[nt]){if(typeof ue[nt]>"u"&&(ue[nt]=null),Jt[nt]&&ue[nt]!=="")try{JSON.parse(ue[nt])}catch(At){const It={};throw It[nt]={code:"invalid_json",message:At.toString()},new Kn({status:400,response:{data:It}})}j.addValueToFormData(De,nt,ue[nt])}for(const nt in y){const At=j.toArray(y[nt]);for(const It of At)De.append(nt,It)}for(const nt in S){const At=j.toArray(S[nt]);for(const It of At)De.append(nt+"."+It,"")}return De}function Ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||_n(`Do you really want to sent verification email to ${d.email}?`,()=>ce.collection(f.id).requestVerification(d.email).then(()=>{zt(`Successfully sent verification email to ${d.email}.`)}).catch(ue=>{ce.error(ue)}))}function Re(){!(f!=null&&f.id)||!(d!=null&&d.email)||_n(`Do you really want to sent password reset email to ${d.email}?`,()=>ce.collection(f.id).requestPasswordReset(d.email).then(()=>{zt(`Successfully sent password reset email to ${d.email}.`)}).catch(ue=>{ce.error(ue)}))}function Ve(){o?_n("You have unsaved changes. Do you really want to discard them?",()=>{We()}):We()}async function We(){let ue=d?structuredClone(d):null;if(ue){ue.id="",ue.created="",ue.updated="";const De=(f==null?void 0:f.schema)||[];for(const Xe of De)Xe.type==="file"&&delete ue[Xe.name]}U(),D(ue),await sn(),t(28,C="")}function ke(ue){(ue.ctrlKey||ue.metaKey)&&ue.code=="KeyS"&&(ue.preventDefault(),ue.stopPropagation(),oe(!1))}const Me=()=>L(),Je=()=>Ee(),ct=()=>Re(),Se=()=>Ve(),we=()=>ee(),Ue=()=>t(13,$=rs),it=()=>t(13,$=Sl),ne=()=>X(),qe=()=>U();function Ce(){h.id=this.value,t(3,h)}function pt(ue){h=ue,t(3,h)}function qt(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function fn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function nn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function rn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Nn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function _i(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Fn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Ie(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Tt(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function oi(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function cn(ue,De){n.$$.not_equal(y[De.name],ue)&&(y[De.name]=ue,t(4,y))}function Xn(ue,De){n.$$.not_equal(S[De.name],ue)&&(S[De.name]=ue,t(5,S))}function Ai(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}const Cn=()=>o&&_?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{N()}),!1):(ln({}),U(),!0);function Qn(ue){te[ue?"unshift":"push"](()=>{c=ue,t(9,c)})}function en(ue){Fe.call(this,n,ue)}function et(ue){Fe.call(this,n,ue)}return n.$$set=ue=>{"collection"in ue&&t(0,f=ue.collection)},n.$$.update=()=>{var ue;n.$$.dirty[0]&1&&t(14,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(16,s=!!((ue=f==null?void 0:f.schema)!=null&&ue.find(De=>De.type==="editor"))),n.$$.dirty[0]&48&&t(30,l=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,T=JSON.stringify(h)),n.$$.dirty[0]&1879048192&&t(8,o=l||C!=T),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!M&&(O||o)),n.$$.dirty[0]&536871040&&(M||G(T))},[f,L,d,h,y,S,O,M,o,c,g,m,_,$,i,r,s,u,N,X,U,oe,ee,Ee,Re,Ve,ke,D,C,T,l,Me,Je,ct,Se,we,Ue,it,ne,qe,Ce,pt,qt,fn,nn,rn,Nn,_i,Fn,Ie,Tt,oi,cn,Xn,Ai,Cn,Qn,en,et]}class uu extends ve{constructor(e){super(),be(this,e,DE,EE,ge,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function Bh(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Uh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Wh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Yh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function AE(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function IE(n){var l,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(l=e[0])==null?void 0:l.expand)==null?void 0:o[e[1].name]);e[10]=i;const s=e[2]?20:500;return e[11]=s,e}function LE(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function PE(n){let e,t;return{c(){e=v("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&le(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function NE(n){let e,t=j.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=j.truncate(n[3]))},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&8&&t!==(t=j.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=j.truncate(l[3]))&&p(e,"title",s)},i:x,o:x,d(l){l&&k(e)}}}function FE(n){let e,t=[],i=new Map,s,l,o=pe(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;un[17]&&Jh();return{c(){var u;e=v("div");for(let f=0;fu[17]?a||(a=Jh(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!l||f&2)&&Q(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!l){for(let f=0;fn[11]&&Xh();return{c(){e=v("div"),i.c(),s=E(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),b(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Xh(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){I(i),l=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function qE(n){let e,t=[],i=new Map,s=pe(j.toArray(n[3]));const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function VE(n){let e,t=j.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),b(e,i),s||(l=[Te(Be.call(null,e,"Open in new tab")),Y(e,"click",Sn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function zE(n){let e,t;return{c(){e=v("span"),t=W(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&le(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function BE(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=W(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function UE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function WE(n){let e,t,i,s;const l=[XE,ZE],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function Kh(n,e){let t,i,s;return i=new ru({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function Jh(n){let e;return{c(){e=W("...")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function YE(n){let e,t=pe(n[9].slice(0,n[11])),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&xh(n);return{c(){e=v("span"),i=W(t),s=E(),r&&r.c(),l=ye(),p(e,"class","txt")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=xh(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){o||(A(r),o=!0)},o(a){I(r),o=!1},d(a){a&&(k(e),k(s),k(l)),r&&r.d(a)}}}function XE(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=v("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=j.truncate(s[5])+"")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function xh(n){let e,t;return e=new Hs({props:{value:JSON.stringify(n[3],null,2)}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QE(n){let e,t,i,s,l;const o=[WE,UE,BE,zE,VE,HE,jE,qE,RE,FE,NE,PE],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?LE(f):c===8?IE(f):c===9?AE(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=ye()},m(f,c){r[t].m(f,c),w(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){I(i),l=!1},d(f){f&&k(s),r[t].d(f)}}}function xE(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){Fe.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[l.name])},[s,l,o,i,r]}class U1 extends ve{constructor(e){super(),be(this,e,xE,QE,ge,{record:0,field:1,short:2})}}function em(n,e,t){const i=n.slice();return i[13]=e[t],i}function tm(n){let e,t,i=n[13].name+"",s,l,o,r,a;return r=new U1({props:{field:n[13],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=W(i),l=E(),o=v("td"),z(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){w(u,e,f),b(e,t),b(t,s),b(e,l),b(e,o),H(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&le(s,i);const c={};f&1&&(c.field=u[13]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){I(r.$$.fragment,u),a=!1},d(u){u&&k(e),V(r)}}}function nm(n){let e,t,i,s,l,o;return l=new $i({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),H(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){I(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(l)}}}function im(n){let e,t,i,s,l,o;return l=new $i({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),H(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){I(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(l)}}}function eD(n){var O;let e,t,i,s,l,o,r,a,u,f,c=(n[3].id||"...")+"",d,h,g,m,_;a=new Hs({props:{value:n[3].id}});let y=pe((O=n[0])==null?void 0:O.schema),S=[];for(let M=0;MI(S[M],1,1,()=>{S[M]=null});let T=n[3].created&&nm(n),$=n[3].updated&&im(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=E(),o=v("td"),r=v("div"),z(a.$$.fragment),u=E(),f=v("span"),d=W(c),h=E();for(let M=0;M{T=null}),ae()),M[3].updated?$?($.p(M,D),D&8&&A($,1)):($=im(M),$.c(),A($,1),$.m(t,null)):$&&(re(),I($,1,1,()=>{$=null}),ae()),(!_||D&16)&&Q(e,"table-loading",M[4])},i(M){if(!_){A(a.$$.fragment,M);for(let D=0;DClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[7]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function iD(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[nD],header:[tD],default:[eD]},$$scope:{ctx:n}};return e=new on({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&32&&(o.class="record-preview-panel "+(s[5]?"overlay-panel-xl":"overlay-panel-lg")),l&65561&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[8](null),V(e,s)}}}function sD(n,e,t){let i,{collection:s}=e,l,o={},r=!1;function a(_){return f(_),l==null?void 0:l.show()}function u(){return t(4,r=!1),l==null?void 0:l.hide()}async function f(_){t(3,o={}),t(4,r=!0),t(3,o=await c(_)||{}),t(4,r=!1)}async function c(_){if(_&&typeof _=="string"){try{return await ce.collection(s.id).getOne(_)}catch(y){y.isAbort||(u(),console.warn("resolveModel:",y),Ci(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function h(_){te[_?"unshift":"push"](()=>{l=_,t(2,l)})}function g(_){Fe.call(this,n,_)}function m(_){Fe.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,s=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=s==null?void 0:s.schema)!=null&&_.find(y=>y.type==="editor")))},[s,u,l,o,r,i,a,d,h,g,m]}class lD extends ve{constructor(e){super(),be(this,e,sD,iD,ge,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function sm(n,e,t){const i=n.slice();return i[63]=e[t],i}function lm(n,e,t){const i=n.slice();return i[66]=e[t],i}function om(n,e,t){const i=n.slice();return i[66]=e[t],i}function rm(n,e,t){const i=n.slice();return i[59]=e[t],i}function am(n){let e;function t(l,o){return l[13]?rD:oD}let i=t(n),s=i(n);return{c(){e=v("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&k(e),s.d()}}}function oD(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=E(),l=v("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),o||(r=Y(t,"change",n[32]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&131072&&(t.checked=a[17])},d(a){a&&k(e),o=!1,r()}}}function rD(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function um(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[aD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function aD(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function fm(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l,o=e&&cm(n),r=i&&dm(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=ye()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,s,u),l=!0},p(a,u){u[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,u),u[0]&32&&A(o,1)):(o=cm(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),u[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=dm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){l||(A(o),A(r),l=!0)},o(a){I(o),I(r),l=!1},d(a){a&&(k(t),k(s)),o&&o.d(a),r&&r.d(a)}}}function cm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[uD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function uD(n){let e;return{c(){e=v("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function dm(n){let e,t,i;function s(o){n[35](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[fD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function fD(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function cD(n){let e,t,i,s,l,o=n[66].name+"",r;return{c(){e=v("div"),t=v("i"),s=E(),l=v("span"),r=W(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),b(l,r)},p(a,u){u[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),u[0]&524288&&o!==(o=a[66].name+"")&&le(r,o)},d(a){a&&k(e)}}}function pm(n,e){let t,i,s,l;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[cD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new hn({props:r}),te.push(()=>he(i,"sort",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&524288&&(f.class="col-type-"+e[66].type+" col-field-"+e[66].name),u[0]&524288&&(f.name=e[66].name),u[0]&524288|u[2]&512&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],_e(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function hm(n){let e,t,i;function s(o){n[37](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function dD(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function mm(n){let e,t,i;function s(o){n[38](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[pD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function pD(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function gm(n){let e;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:x,d(t){t&&k(e),n[39](null)}}}function _m(n){let e;function t(l,o){return l[13]?mD:hD}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function hD(n){let e,t,i,s;function l(a,u){var f;if((f=a[1])!=null&&f.length)return _D;if(!a[10])return gD}let o=l(n),r=o&&o(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=E(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),r&&r.m(t,null)},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&k(e),r&&r.d()}}}function mD(n){let e;return{c(){e=v("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function gD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[44]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function _D(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[43]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function bm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[40](n[63])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=E(),r=v("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[63].id),i.checked=l=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,h){w(d,e,h),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[Y(i,"change",c),Y(t,"click",Sn(n[30]))],u=!0)},p(d,h){n=d,h[0]&8&&s!==(s="checkbox_"+n[63].id)&&p(i,"id",s),h[0]&24&&l!==(l=n[4][n[63].id])&&(i.checked=l),h[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,$e(f)}}}function vm(n){let e,t,i,s,l,o,r=n[63].id+"",a,u,f;s=new Hs({props:{value:n[63].id}});let c=n[9]&&ym(n);return{c(){e=v("td"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),a=W(r),u=E(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,h){w(d,e,h),b(e,t),b(t,i),H(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,h){const g={};h[0]&8&&(g.value=d[63].id),s.$set(g),(!f||h[0]&8)&&r!==(r=d[63].id+"")&&le(a,r),d[9]?c?c.p(d,h):(c=ym(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){I(s.$$.fragment,d),f=!1},d(d){d&&k(e),V(s),c&&c.d()}}}function ym(n){let e;function t(l,o){return l[63].verified?vD:bD}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function bD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Te(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function vD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=Te(Be.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function km(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l=e&&wm(n),o=i&&Sm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=ye()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?l?l.p(r,a):(l=wm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Sm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){r&&(k(t),k(s)),l&&l.d(r),o&&o.d(r)}}}function wm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?kD:yD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function yD(n){let e,t=n[63].username+"",i,s;return{c(){e=v("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[63].username)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[63].username+"")&&le(i,t),o[0]&8&&s!==(s=l[63].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function kD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Sm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?SD:wD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function wD(n){let e,t=n[63].email+"",i,s;return{c(){e=v("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[63].email)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[63].email+"")&&le(i,t),o[0]&8&&s!==(s=l[63].email)&&p(e,"title",s)},d(l){l&&k(e)}}}function SD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Tm(n,e){let t,i,s,l;return i=new U1({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=v("td"),z(i.$$.fragment),p(t,"class",s="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),H(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!l||r[0]&524288&&s!==(s="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){I(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function Cm(n){let e,t,i;return t=new $i({props:{date:n[63].created}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[63].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function $m(n){let e,t,i;return t=new $i({props:{date:n[63].updated}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[63].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function Mm(n,e){let t,i,s=!e[5].includes("@id"),l,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),h,g,m,_,y,S=!e[10]&&bm(e),C=s&&vm(e),T=e[9]&&km(e),$=pe(e[19]);const O=P=>P[66].name;for(let P=0;P<$.length;P+=1){let F=lm(e,$,P),R=O(F);a.set(R,r[P]=Tm(R,F))}let M=f&&Cm(e),D=d&&$m(e);function L(){return e[41](e[63])}function N(...P){return e[42](e[63],...P)}return{key:n,first:null,c(){t=v("tr"),S&&S.c(),i=E(),C&&C.c(),l=E(),T&&T.c(),o=E();for(let P=0;P',p(g,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(P,F){w(P,t,F),S&&S.m(t,null),b(t,i),C&&C.m(t,null),b(t,l),T&&T.m(t,null),b(t,o);for(let R=0;R{C=null}),ae()),e[9]?T?T.p(e,F):(T=km(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),F[0]&524296&&($=pe(e[19]),re(),r=gt(r,F,O,1,e,$,a,t,Rt,Tm,u,lm),ae()),F[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?M?(M.p(e,F),F[0]&288&&A(M,1)):(M=Cm(e),M.c(),A(M,1),M.m(t,c)):M&&(re(),I(M,1,1,()=>{M=null}),ae()),F[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?D?(D.p(e,F),F[0]&160&&A(D,1)):(D=$m(e),D.c(),A(D,1),D.m(t,h)):D&&(re(),I(D,1,1,()=>{D=null}),ae())},i(P){if(!m){A(C);for(let F=0;F<$.length;F+=1)A(r[F]);A(M),A(D),m=!0}},o(P){I(C);for(let F=0;FJ[66].name;for(let J=0;JJ[10]?J[63]:J[63].id;for(let J=0;J{M=null}),ae()),J[9]?D?(D.p(J,U),U[0]&512&&A(D,1)):(D=fm(J),D.c(),A(D,1),D.m(i,r)):D&&(re(),I(D,1,1,()=>{D=null}),ae()),U[0]&524289&&(L=pe(J[19]),re(),a=gt(a,U,N,1,J,L,u,i,Rt,pm,f,om),ae()),U[0]&288&&(c=J[8]&&!J[5].includes("@created")),c?P?(P.p(J,U),U[0]&288&&A(P,1)):(P=hm(J),P.c(),A(P,1),P.m(i,d)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),U[0]&160&&(h=J[7]&&!J[5].includes("@updated")),h?F?(F.p(J,U),U[0]&160&&A(F,1)):(F=mm(J),F.c(),A(F,1),F.m(i,g)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),J[16].length?R?R.p(J,U):(R=gm(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null),U[0]&9971642&&(q=pe(J[3]),re(),S=gt(S,U,B,1,J,q,C,y,Rt,Mm,T,sm),ae(),!q.length&&G?G.p(J,U):q.length?G&&(G.d(1),G=null):(G=_m(J),G.c(),G.m(y,T))),J[3].length&&J[18]?X?X.p(J,U):(X=Om(J),X.c(),X.m(y,null)):X&&(X.d(1),X=null),(!$||U[0]&8192)&&Q(e,"table-loading",J[13])},i(J){if(!$){A(M),A(D);for(let U=0;U({62:l}),({uniqueId:l})=>[0,0,l?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function $D(n){let e,t,i=[],s=new Map,l,o,r=pe(n[16]);const a=u=>u[59].id+u[59].name;for(let u=0;u{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function Am(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,m,_,y,S;return{c(){e=v("div"),t=v("div"),i=W("Selected "),s=v("strong"),l=W(n[6]),o=E(),a=W(r),u=E(),f=v("button"),f.innerHTML='Reset',c=E(),d=v("div"),h=E(),g=v("button"),g.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-transparent btn-danger"),Q(g,"btn-loading",n[14]),Q(g,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(s,l),b(t,o),b(t,a),b(e,u),b(e,f),b(e,c),b(e,d),b(e,h),b(e,g),_=!0,y||(S=[Y(f,"click",n[47]),Y(g,"click",n[48])],y=!0)},p(C,T){(!_||T[0]&64)&&le(l,C[6]),(!_||T[0]&64)&&r!==(r=C[6]===1?"record":"records")&&le(a,r),(!_||T[0]&16384)&&Q(f,"btn-disabled",C[14]),(!_||T[0]&16384)&&Q(g,"btn-loading",C[14]),(!_||T[0]&16384)&&Q(g,"btn-disabled",C[14])},i(C){_||(C&&xe(()=>{_&&(m||(m=He(e,mi,{duration:150,y:5},!0)),m.run(1))}),_=!0)},o(C){C&&(m||(m=He(e,mi,{duration:150,y:5},!1)),m.run(0)),_=!1},d(C){C&&k(e),C&&m&&m.end(),y=!1,$e(S)}}}function OD(n){let e,t,i,s,l={class:"table-wrapper",$$slots:{before:[MD],default:[TD]},$$scope:{ctx:n}};e=new Go({props:l}),n[46](e);let o=n[6]&&Am(n);return{c(){z(e.$$.fragment),t=E(),o&&o.c(),i=ye()},m(r,a){H(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!0},p(r,a){const u={};a[0]&1030075|a[2]&512&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&A(o,1)):(o=Am(r),o.c(),A(o,1),o.m(i.parentNode,i)):o&&(re(),I(o,1,1,()=>{o=null}),ae())},i(r){s||(A(e.$$.fragment,r),A(o),s=!0)},o(r){I(e.$$.fragment,r),I(o),s=!1},d(r){r&&(k(t),k(i)),n[46](null),V(e,r),o&&o.d(r)}}}const ED=/^([\+\-])?(\w+)$/,Im=40;function DD(n,e,t){let i,s,l,o,r,a,u,f,c,d,h,g;Ge(n,Zn,Ie=>t(53,g=Ie));const m=dt();let{collection:_}=e,{sort:y=""}=e,{filter:S=""}=e,C,T=[],$=1,O=0,M={},D=!0,L=!1,N=0,P,F=[],R=[],q="";function B(){_!=null&&_.id&&(F.length?localStorage.setItem(q,JSON.stringify(F)):localStorage.removeItem(q))}function G(){if(t(5,F=[]),!!(_!=null&&_.id))try{const Ie=localStorage.getItem(q);Ie&&t(5,F=JSON.parse(Ie)||[])}catch{}}function X(Ie){return!!T.find(Tt=>Tt.id)}async function J(){const Ie=$;for(let Tt=1;Tt<=Ie;Tt++)(Tt===1||u)&&await U(Tt,!1)}async function U(Ie=1,Tt=!0){var Qn,en,et;if(!(_!=null&&_.id))return;t(13,D=!0);let oi=y;const cn=oi.match(ED),Xn=cn?r.find(ue=>ue.name===cn[2]):null;if(cn&&Xn){const ue=((et=(en=(Qn=g==null?void 0:g.find(Xe=>{var Jt;return Xe.id==((Jt=Xn.options)==null?void 0:Jt.collectionId)}))==null?void 0:Qn.schema)==null?void 0:en.filter(Xe=>Xe.presentable))==null?void 0:et.map(Xe=>Xe.name))||[],De=[];for(const Xe of ue)De.push((cn[1]||"")+cn[2]+"."+Xe);De.length>0&&(oi=De.join(","))}const Ai=j.getAllCollectionIdentifiers(_),Cn=o.map(ue=>ue.name+":excerpt(200)").concat(r.map(ue=>"expand."+ue.name+".*:excerpt(200)"));return Cn.length&&Cn.unshift("*"),ce.collection(_.id).getList(Ie,Im,{sort:oi,skipTotal:1,filter:j.normalizeSearchFilter(S,Ai),expand:r.map(ue=>ue.name).join(","),fields:Cn.join(","),requestKey:"records_list"}).then(async ue=>{var De;if(Ie<=1&&oe(),t(13,D=!1),t(12,$=ue.page),t(28,O=ue.items.length),m("load",T.concat(ue.items)),o.length)for(let Xe of ue.items)Xe._partial=!0;if(Tt){const Xe=++N;for(;(De=ue.items)!=null&&De.length&&N==Xe;)t(3,T=T.concat(ue.items.splice(0,20))),await j.yieldToMain()}else t(3,T=T.concat(ue.items))}).catch(ue=>{ue!=null&&ue.isAbort||(t(13,D=!1),console.warn(ue),oe(),ce.error(ue,(ue==null?void 0:ue.status)!=400))})}function oe(){C==null||C.resetVerticalScroll(),t(3,T=[]),t(12,$=1),t(28,O=0),t(4,M={})}function ee(){c?se():Ee()}function se(){t(4,M={})}function Ee(){for(const Ie of T)t(4,M[Ie.id]=Ie,M);t(4,M)}function Re(Ie){M[Ie.id]?delete M[Ie.id]:t(4,M[Ie.id]=Ie,M),t(4,M)}function Ve(){_n(`Do you really want to delete the selected ${f===1?"record":"records"}?`,We)}async function We(){if(L||!f||!(_!=null&&_.id))return;let Ie=[];for(const Tt of Object.keys(M))Ie.push(ce.collection(_.id).delete(Tt));return t(14,L=!0),Promise.all(Ie).then(()=>{zt(`Successfully deleted the selected ${f===1?"record":"records"}.`),m("delete",M),se()}).catch(Tt=>{ce.error(Tt)}).finally(()=>(t(14,L=!1),J()))}function ke(Ie){Fe.call(this,n,Ie)}const Me=(Ie,Tt)=>{Tt.target.checked?j.removeByValue(F,Ie.id):j.pushUnique(F,Ie.id),t(5,F)},Je=()=>ee();function ct(Ie){y=Ie,t(0,y)}function Se(Ie){y=Ie,t(0,y)}function we(Ie){y=Ie,t(0,y)}function Ue(Ie){y=Ie,t(0,y)}function it(Ie){y=Ie,t(0,y)}function ne(Ie){y=Ie,t(0,y)}function qe(Ie){te[Ie?"unshift":"push"](()=>{P=Ie,t(15,P)})}const Ce=Ie=>Re(Ie),pt=Ie=>m("select",Ie),qt=(Ie,Tt)=>{Tt.code==="Enter"&&(Tt.preventDefault(),m("select",Ie))},fn=()=>t(1,S=""),nn=()=>m("new"),rn=()=>U($+1);function Nn(Ie){te[Ie?"unshift":"push"](()=>{C=Ie,t(11,C)})}const _i=()=>se(),Fn=()=>Ve();return n.$$set=Ie=>{"collection"in Ie&&t(25,_=Ie.collection),"sort"in Ie&&t(0,y=Ie.sort),"filter"in Ie&&t(1,S=Ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(q=_.id+"@hiddenColumns",G(),oe()),n.$$.dirty[0]&33554432&&t(10,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(9,s=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,l=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&536870912&&(o=l.filter(Ie=>Ie.type==="editor")),n.$$.dirty[0]&536870912&&(r=l.filter(Ie=>Ie.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=l.filter(Ie=>!F.includes(Ie.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&y!==-1&&S!==-1&&U(1),n.$$.dirty[0]&268435456&&t(18,u=O>=Im),n.$$.dirty[0]&16&&t(6,f=Object.keys(M).length),n.$$.dirty[0]&72&&t(17,c=T.length&&f===T.length),n.$$.dirty[0]&32&&F!==-1&&B(),n.$$.dirty[0]&1032&&t(8,d=!i||T.length>0&&typeof T[0].created<"u"),n.$$.dirty[0]&1032&&t(7,h=!i||T.length>0&&typeof T[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,R=[].concat(s?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],l.map(Ie=>({id:Ie.id,name:Ie.name})),d?{id:"@created",name:"created"}:[],h?{id:"@updated",name:"updated"}:[]))},[y,S,U,T,M,F,f,h,d,s,i,C,$,D,L,P,R,c,u,a,m,ee,se,Re,Ve,_,X,J,O,l,ke,Me,Je,ct,Se,we,Ue,it,ne,qe,Ce,pt,qt,fn,nn,rn,Nn,_i,Fn]}class AD extends ve{constructor(e){super(),be(this,e,DD,OD,ge,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function ID(n){let e,t,i,s,l=(n[2]?"...":n[0])+"",o,r;return{c(){e=v("div"),t=v("span"),t.textContent="Total found:",i=E(),s=v("span"),o=W(l),p(t,"class","txt"),p(s,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),b(e,t),b(e,i),b(e,s),b(s,o)},p(a,[u]){u&5&&l!==(l=(a[2]?"...":a[0])+"")&&le(o,l),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:x,o:x,d(a){a&&k(e)}}}function LD(n,e,t){const i=dt();let{collection:s}=e,{filter:l=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(s!=null&&s.id){t(2,a=!0),t(0,o=0);try{const f=j.getAllCollectionIdentifiers(s),c=await ce.collection(s.id).getList(1,1,{filter:j.normalizeSearchFilter(l,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,s=f.collection),"filter"in f&&t(4,l=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&s!=null&&s.id&&l!==-1&&u()},[o,r,a,s,l,u]}class PD extends ve{constructor(e){super(),be(this,e,LD,ID,ge,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function ND(n){let e,t,i,s;return e=new i6({}),i=new Tn({props:{class:"flex-content",$$slots:{footer:[jD],default:[qD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function FD(n){let e,t;return e=new Tn({props:{center:!0,$$slots:{default:[zD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&4112|s[1]&8192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function RD(n){let e,t;return e=new Tn({props:{center:!0,$$slots:{default:[BD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[1]&8192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Lm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[Te(Be.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[20])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function Pm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function qD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N,P=!n[12]&&Lm(n);c=new Jo({}),c.$on("refresh",n[21]);let F=n[2].type!=="view"&&Pm(n);y=new Dl({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function R(G){n[26](G)}function q(G){n[27](G)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),$=new AD({props:B}),n[25]($),te.push(()=>he($,"filter",R)),te.push(()=>he($,"sort",q)),$.$on("select",n[28]),$.$on("delete",n[29]),$.$on("new",n[30]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=E(),l=v("div"),r=W(o),a=E(),u=v("div"),P&&P.c(),f=E(),z(c.$$.fragment),d=E(),h=v("div"),g=v("button"),g.innerHTML=' API Preview',m=E(),F&&F.c(),_=E(),z(y.$$.fragment),S=E(),C=v("div"),T=E(),z($.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(h,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-sm")},m(G,X){w(G,e,X),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),P&&P.m(u,null),b(u,f),H(c,u,null),b(e,d),b(e,h),b(h,g),b(h,m),F&&F.m(h,null),w(G,_,X),H(y,G,X),w(G,S,X),w(G,C,X),w(G,T,X),H($,G,X),D=!0,L||(N=Y(g,"click",n[22]),L=!0)},p(G,X){(!D||X[0]&4)&&o!==(o=G[2].name+"")&&le(r,o),G[12]?P&&(P.d(1),P=null):P?P.p(G,X):(P=Lm(G),P.c(),P.m(u,f)),G[2].type!=="view"?F?F.p(G,X):(F=Pm(G),F.c(),F.m(h,null)):F&&(F.d(1),F=null);const J={};X[0]&1&&(J.value=G[0]),X[0]&4&&(J.autocompleteCollection=G[2]),y.$set(J);const U={};X[0]&4&&(U.collection=G[2]),!O&&X[0]&1&&(O=!0,U.filter=G[0],_e(()=>O=!1)),!M&&X[0]&2&&(M=!0,U.sort=G[1],_e(()=>M=!1)),$.$set(U)},i(G){D||(A(c.$$.fragment,G),A(y.$$.fragment,G),A($.$$.fragment,G),D=!0)},o(G){I(c.$$.fragment,G),I(y.$$.fragment,G),I($.$$.fragment,G),D=!1},d(G){G&&(k(e),k(_),k(S),k(C),k(T)),P&&P.d(),V(c),F&&F.d(),V(y,G),n[25](null),V($,G),L=!1,N()}}}function jD(n){let e,t,i;function s(o){n[19](o)}let l={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(l.totalCount=n[10]),e=new PD({props:l}),n[18](e),te.push(()=>he(e,"totalCount",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],_e(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){n[18](null),V(e,o)}}}function HD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=E(),i=v("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[17]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function VD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zD(n){let e,t,i;function s(r,a){return r[12]?VD:HD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='',i=E(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),b(e,t),b(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function BD(n){let e;return{c(){e=v("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function UD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[RD,FD,ND],h=[];function g(C,T){return C[3]&&!C[11].length?0:C[11].length?2:1}e=g(n),t=h[e]=d[e](n);let m={};s=new ou({props:m}),n[31](s);let _={};o=new c6({props:_}),n[32](o);let y={collection:n[2]};a=new uu({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return f=new lD({props:S}),n[37](f),f.$on("hide",n[38]),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(C,T){h[e].m(C,T),w(C,i,T),H(s,C,T),w(C,l,T),H(o,C,T),w(C,r,T),H(a,C,T),w(C,u,T),H(f,C,T),c=!0},p(C,T){let $=e;e=g(C),e===$?h[e].p(C,T):(re(),I(h[$],1,1,()=>{h[$]=null}),ae(),t=h[e],t?t.p(C,T):(t=h[e]=d[e](C),t.c()),A(t,1),t.m(i.parentNode,i));const O={};s.$set(O);const M={};o.$set(M);const D={};T[0]&4&&(D.collection=C[2]),a.$set(D);const L={};T[0]&4&&(L.collection=C[2]),f.$set(L)},i(C){c||(A(t),A(s.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),A(f.$$.fragment,C),c=!0)},o(C){I(t),I(s.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),I(f.$$.fragment,C),c=!1},d(C){C&&(k(i),k(l),k(r),k(u)),h[e].d(C),n[31](null),V(s,C),n[32](null),V(o,C),n[33](null),V(a,C),n[37](null),V(f,C)}}}function WD(n,e,t){let i,s,l,o,r,a,u;Ge(n,hi,Se=>t(2,s=Se)),Ge(n,Nt,Se=>t(39,l=Se)),Ge(n,wo,Se=>t(3,o=Se)),Ge(n,ka,Se=>t(16,r=Se)),Ge(n,Zn,Se=>t(11,a=Se)),Ge(n,Es,Se=>t(12,u=Se));const f=new URLSearchParams(r);let c,d,h,g,m,_,y=f.get("filter")||"",S=f.get("sort")||"-created",C=f.get("collectionId")||(s==null?void 0:s.id),T=0;ek(C);async function $(Se){await sn(),(s==null?void 0:s.type)==="view"?g.show(Se):h==null||h.show(Se)}function O(){t(14,C=s==null?void 0:s.id),t(0,y=""),t(1,S="-created"),D({recordId:null}),M()}async function M(){if(!S)return;const Se=j.getAllCollectionIdentifiers(s),we=S.split(",").map(Ue=>Ue.startsWith("+")||Ue.startsWith("-")?Ue.substring(1):Ue);we.filter(Ue=>Se.includes(Ue)).length!=we.length&&(Se.includes("created")?t(1,S="-created"):t(1,S=""))}function D(Se={}){const we=Object.assign({collectionId:(s==null?void 0:s.id)||"",filter:y,sort:S},Se);j.replaceQueryParams(we)}const L=()=>c==null?void 0:c.show();function N(Se){te[Se?"unshift":"push"](()=>{_=Se,t(9,_)})}function P(Se){T=Se,t(10,T)}const F=()=>c==null?void 0:c.show(s),R=()=>{m==null||m.load(),_==null||_.reload()},q=()=>d==null?void 0:d.show(s),B=()=>h==null?void 0:h.show(),G=Se=>t(0,y=Se.detail);function X(Se){te[Se?"unshift":"push"](()=>{m=Se,t(8,m)})}function J(Se){y=Se,t(0,y)}function U(Se){S=Se,t(1,S)}const oe=Se=>{D({recordId:Se.detail.id});let we=Se.detail._partial?Se.detail.id:Se.detail;s.type==="view"?g==null||g.show(we):h==null||h.show(we)},ee=()=>{_==null||_.reload()},se=()=>h==null?void 0:h.show();function Ee(Se){te[Se?"unshift":"push"](()=>{c=Se,t(4,c)})}function Re(Se){te[Se?"unshift":"push"](()=>{d=Se,t(5,d)})}function Ve(Se){te[Se?"unshift":"push"](()=>{h=Se,t(6,h)})}const We=()=>{D({recordId:null})},ke=Se=>{y?_==null||_.reload():Se.detail.isNew&&t(10,T++,T),m==null||m.reloadLoadedPages()},Me=Se=>{(!y||m!=null&&m.hasRecord(Se.detail.id))&&t(10,T--,T),m==null||m.reloadLoadedPages()};function Je(Se){te[Se?"unshift":"push"](()=>{g=Se,t(7,g)})}const ct=()=>{D({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=C&&Xy(i.get("collectionId")),n.$$.dirty[0]&16388&&s!=null&&s.id&&C!=s.id&&O(),n.$$.dirty[0]&4&&s!=null&&s.id&&M(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&$(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||s!=null&&s.id)&&D(),n.$$.dirty[0]&4&&an(Nt,l=(s==null?void 0:s.name)||"Collections",l)},[y,S,s,o,c,d,h,g,m,_,T,a,u,D,C,i,r,L,N,P,F,R,q,B,G,X,J,U,oe,ee,se,Ee,Re,Ve,We,ke,Me,Je,ct]}class YD extends ve{constructor(e){super(),be(this,e,WD,UD,ge,{},null,[-1,-1])}}function KD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N,P;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=E(),l=v("a"),l.innerHTML=' Application',o=E(),r=v("a"),r.innerHTML=' Mail settings',a=E(),u=v("a"),u.innerHTML=' Files storage',f=E(),c=v("a"),c.innerHTML=' Backups',d=E(),h=v("div"),h.innerHTML='Sync',g=E(),m=v("a"),m.innerHTML=' Export collections',_=E(),y=v("a"),y.innerHTML=' Import collections',S=E(),C=v("div"),C.textContent="Authentication",T=E(),$=v("a"),$.innerHTML=' Auth providers',O=E(),M=v("a"),M.innerHTML=' Token options',D=E(),L=v("a"),L.innerHTML=' Admins',p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"href","/settings/backups"),p(c,"class","sidebar-list-item"),p(h,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(y,"href","/settings/import-collections"),p(y,"class","sidebar-list-item"),p(C,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(L,"href","/settings/admins"),p(L,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(F,R){w(F,e,R),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),b(t,f),b(t,c),b(t,d),b(t,h),b(t,g),b(t,m),b(t,_),b(t,y),b(t,S),b(t,C),b(t,T),b(t,$),b(t,O),b(t,M),b(t,D),b(t,L),N||(P=[Te(zn.call(null,l,{path:"/settings"})),Te(dn.call(null,l)),Te(zn.call(null,r,{path:"/settings/mail/?.*"})),Te(dn.call(null,r)),Te(zn.call(null,u,{path:"/settings/storage/?.*"})),Te(dn.call(null,u)),Te(zn.call(null,c,{path:"/settings/backups/?.*"})),Te(dn.call(null,c)),Te(zn.call(null,m,{path:"/settings/export-collections/?.*"})),Te(dn.call(null,m)),Te(zn.call(null,y,{path:"/settings/import-collections/?.*"})),Te(dn.call(null,y)),Te(zn.call(null,$,{path:"/settings/auth-providers/?.*"})),Te(dn.call(null,$)),Te(zn.call(null,M,{path:"/settings/tokens/?.*"})),Te(dn.call(null,M)),Te(zn.call(null,L,{path:"/settings/admins/?.*"})),Te(dn.call(null,L))],N=!0)},p:x,i:x,o:x,d(F){F&&k(e),N=!1,$e(P)}}}class Di extends ve{constructor(e){super(),be(this,e,null,KD,ge,{})}}function Nm(n,e,t){const i=n.slice();return i[31]=e[t],i}function Fm(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[JD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function JD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return a=new V1({props:{model:n[1]}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",o=E(),r=v("div"),z(a.$$.fragment),u=E(),f=v("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"class","form-field-addon"),p(f,"type","text"),p(f,"id",c=n[30]),f.value=d=n[1].id,f.readOnly=!0},m(g,m){w(g,e,m),b(e,t),b(e,i),b(e,s),w(g,o,m),w(g,r,m),H(a,r,null),w(g,u,m),w(g,f,m),h=!0},p(g,m){(!h||m[0]&1073741824&&l!==(l=g[30]))&&p(e,"for",l);const _={};m[0]&2&&(_.model=g[1]),a.$set(_),(!h||m[0]&1073741824&&c!==(c=g[30]))&&p(f,"id",c),(!h||m[0]&2&&d!==(d=g[1].id)&&f.value!==d)&&(f.value=d)},i(g){h||(A(a.$$.fragment,g),h=!0)},o(g){I(a.$$.fragment,g),h=!1},d(g){g&&(k(e),k(o),k(r),k(u),k(f)),V(a)}}}function Rm(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=E(),un(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(u,f){w(u,e,f),b(e,t),b(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),o=!1,r()}}}function GD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("input"),p(t,"class",j.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[3]),u||(f=Y(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&de(r,c[3])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function qm(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[ZD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ZD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function jm(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[XD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[QD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742848|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(t,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=He(t,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function XD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new z1({}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),de(r,n[9]),w(m,u,_),w(m,f,_),H(c,f,null),d=!0,h||(g=Y(r,"input",n[21]),h=!0)},p(m,_){(!d||_[0]&1073741824&&l!==(l=m[30]))&&p(e,"for",l),(!d||_[0]&1073741824&&a!==(a=m[30]))&&p(r,"id",a),_[0]&512&&r.value!==m[9]&&de(r,m[9])},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){I(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),V(c),h=!1,g()}}}function QD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[10]),u||(f=Y(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&de(r,c[10])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function xD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[5]&&Fm(n),m=pe([0,1,2,3,4,5,6,7,8,9]),_=[];for(let C=0;C<10;C+=1)_[C]=Rm(Nm(n,m,C));a=new me({props:{class:"form-field required",name:"email",$$slots:{default:[GD,({uniqueId:C})=>({30:C}),({uniqueId:C})=>[C?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&qm(n),S=(n[5]||n[4])&&jm(n);return{c(){e=v("form"),g&&g.c(),t=E(),i=v("div"),s=v("p"),s.textContent="Avatar",l=E(),o=v("div");for(let C=0;C<10;C+=1)_[C].c();r=E(),z(a.$$.fragment),u=E(),y&&y.c(),f=E(),S&&S.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(C,T){w(C,e,T),g&&g.m(e,null),b(e,t),b(e,i),b(i,s),b(i,l),b(i,o);for(let $=0;$<10;$+=1)_[$]&&_[$].m(o,null);b(e,r),H(a,e,null),b(e,u),y&&y.m(e,null),b(e,f),S&&S.m(e,null),c=!0,d||(h=Y(e,"submit",Ze(n[13])),d=!0)},p(C,T){if(C[5]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(C,T),T[0]&32&&A(g,1)):(g=Fm(C),g.c(),A(g,1),g.m(e,t)),T[0]&4){m=pe([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const M=Nm(C,m,O);_[O]?_[O].p(M,T):(_[O]=Rm(M),_[O].c(),_[O].m(o,null))}for(;O<10;O+=1)_[O].d(1)}const $={};T[0]&1073741832|T[1]&8&&($.$$scope={dirty:T,ctx:C}),a.$set($),C[5]?y&&(re(),I(y,1,1,()=>{y=null}),ae()):y?(y.p(C,T),T[0]&32&&A(y,1)):(y=qm(C),y.c(),A(y,1),y.m(e,f)),C[5]||C[4]?S?(S.p(C,T),T[0]&48&&A(S,1)):(S=jm(C),S.c(),A(S,1),S.m(e,null)):S&&(re(),I(S,1,1,()=>{S=null}),ae())},i(C){c||(A(g),A(a.$$.fragment,C),A(y),A(S),c=!0)},o(C){I(g),I(a.$$.fragment,C),I(y),I(S),c=!1},d(C){C&&k(e),g&&g.d(),vt(_,C),V(a),y&&y.d(),S&&S.d(),d=!1,h()}}}function eA(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=W(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&32&&t!==(t=s[5]?"New admin":"Edit admin")&&le(i,t)},d(s){s&&k(e)}}}function Hm(n){let e,t,i,s,l,o,r,a,u;return o=new Pn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[tA]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=E(),s=v("i"),l=E(),z(o.$$.fragment),r=E(),a=v("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),H(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){I(o.$$.fragment,f),u=!1},d(f){f&&(k(e),k(r),k(a)),V(o)}}}function tA(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[16]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function nA(n){let e,t,i,s,l,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,h=!n[5]&&Hm(n);return{c(){h&&h.c(),e=E(),t=v("button"),i=v("span"),i.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=W(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[12]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[11]||n[7],Q(l,"btn-loading",n[7])},m(g,m){h&&h.m(g,m),w(g,e,m),w(g,t,m),b(t,i),w(g,s,m),w(g,l,m),b(l,o),b(o,a),f=!0,c||(d=Y(t,"click",n[17]),c=!0)},p(g,m){g[5]?h&&(re(),I(h,1,1,()=>{h=null}),ae()):h?(h.p(g,m),m[0]&32&&A(h,1)):(h=Hm(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||m[0]&128)&&(t.disabled=g[7]),(!f||m[0]&32)&&r!==(r=g[5]?"Create":"Save changes")&&le(a,r),(!f||m[0]&2176&&u!==(u=!g[11]||g[7]))&&(l.disabled=u),(!f||m[0]&128)&&Q(l,"btn-loading",g[7])},i(g){f||(A(h),f=!0)},o(g){I(h),f=!1},d(g){g&&(k(e),k(t),k(s),k(l)),h&&h.d(g),c=!1,d()}}}function iA(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[nA],header:[eA],default:[xD]},$$scope:{ctx:n}};return e=new on({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&2304&&(o.beforeHide=s[23]),l[0]&3774|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[24](null),V(e,s)}}}function sA(n,e,t){let i,s;const l=dt(),o="admin_"+j.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",h="",g="",m=!1;function _(X){return S(X),t(8,f=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(X){t(1,a=structuredClone(X||{})),C()}function C(){t(4,m=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,h=""),t(10,g=""),ln({})}function T(){if(u||!s)return;t(7,u=!0);const X={email:d,avatar:c};(i||m)&&(X.password=h,X.passwordConfirm=g);let J;i?J=ce.admins.create(X):J=ce.admins.update(a.id,X),J.then(async U=>{var oe;t(8,f=!1),y(),zt(i?"Successfully created admin.":"Successfully updated admin."),((oe=ce.authStore.model)==null?void 0:oe.id)===U.id&&ce.authStore.save(ce.authStore.token,U),l("save",U)}).catch(U=>{ce.error(U)}).finally(()=>{t(7,u=!1)})}function $(){a!=null&&a.id&&_n("Do you really want to delete the selected admin?",()=>ce.admins.delete(a.id).then(()=>{t(8,f=!1),y(),zt("Successfully deleted admin."),l("delete",a)}).catch(X=>{ce.error(X)}))}const O=()=>$(),M=()=>y(),D=X=>t(2,c=X);function L(){d=this.value,t(3,d)}function N(){m=this.checked,t(4,m)}function P(){h=this.value,t(9,h)}function F(){g=this.value,t(10,g)}const R=()=>s&&f?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),y()}),!1):!0;function q(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function B(X){Fe.call(this,n,X)}function G(X){Fe.call(this,n,X)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,s=i&&d!=""||m||d!==a.email||c!==a.avatar)},[y,a,c,d,m,i,r,u,f,h,g,s,o,T,$,_,O,M,D,L,N,P,F,R,q,B,G]}class lA extends ve{constructor(e){super(),be(this,e,sA,iA,ge,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Vm(n,e,t){const i=n.slice();return i[24]=e[t],i}function oA(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rA(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function aA(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function uA(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zm(n){let e;function t(l,o){return l[5]?cA:fA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function fA(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Bm(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Bm(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function cA(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Bm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Um(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wm(n,e){let t,i,s,l,o,r,a,u,f,c,d,h=e[24].id+"",g,m,_,y,S,C=e[24].email+"",T,$,O,M,D,L,N,P,F,R,q,B,G,X;f=new Hs({props:{value:e[24].id}});let J=e[24].id===e[7].id&&Um();D=new $i({props:{date:e[24].created}}),P=new $i({props:{date:e[24].updated}});function U(){return e[15](e[24])}function oe(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=E(),a=v("td"),u=v("div"),z(f.$$.fragment),c=E(),d=v("span"),g=W(h),m=E(),J&&J.c(),_=E(),y=v("td"),S=v("span"),T=W(C),O=E(),M=v("td"),z(D.$$.fragment),L=E(),N=v("td"),z(P.$$.fragment),F=E(),R=v("td"),R.innerHTML='',q=E(),un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",$=e[24].email),p(y,"class","col-type-email col-field-email"),p(M,"class","col-type-date col-field-created"),p(N,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,se){w(ee,t,se),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),H(f,u,null),b(u,c),b(u,d),b(d,g),b(a,m),J&&J.m(a,null),b(t,_),b(t,y),b(y,S),b(S,T),b(t,O),b(t,M),H(D,M,null),b(t,L),b(t,N),H(P,N,null),b(t,F),b(t,R),b(t,q),B=!0,G||(X=[Y(t,"click",U),Y(t,"keydown",oe)],G=!0)},p(ee,se){e=ee,(!B||se&16&&!un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Ee={};se&16&&(Ee.value=e[24].id),f.$set(Ee),(!B||se&16)&&h!==(h=e[24].id+"")&&le(g,h),e[24].id===e[7].id?J||(J=Um(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!B||se&16)&&C!==(C=e[24].email+"")&&le(T,C),(!B||se&16&&$!==($=e[24].email))&&p(S,"title",$);const Re={};se&16&&(Re.date=e[24].created),D.$set(Re);const Ve={};se&16&&(Ve.date=e[24].updated),P.$set(Ve)},i(ee){B||(A(f.$$.fragment,ee),A(D.$$.fragment,ee),A(P.$$.fragment,ee),B=!0)},o(ee){I(f.$$.fragment,ee),I(D.$$.fragment,ee),I(P.$$.fragment,ee),B=!1},d(ee){ee&&k(t),V(f),J&&J.d(),V(D),V(P),G=!1,$e(X)}}}function dA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$=[],O=new Map,M;function D(U){n[11](U)}let L={class:"col-type-text",name:"id",$$slots:{default:[oA]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new hn({props:L}),te.push(()=>he(o,"sort",D));function N(U){n[12](U)}let P={class:"col-type-email col-field-email",name:"email",$$slots:{default:[rA]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),u=new hn({props:P}),te.push(()=>he(u,"sort",N));function F(U){n[13](U)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[aA]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new hn({props:R}),te.push(()=>he(d,"sort",F));function q(U){n[14](U)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[uA]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),m=new hn({props:B}),te.push(()=>he(m,"sort",q));let G=pe(n[4]);const X=U=>U[24].id;for(let U=0;Ur=!1)),o.$set(ee);const se={};oe&134217728&&(se.$$scope={dirty:oe,ctx:U}),!f&&oe&4&&(f=!0,se.sort=U[2],_e(()=>f=!1)),u.$set(se);const Ee={};oe&134217728&&(Ee.$$scope={dirty:oe,ctx:U}),!h&&oe&4&&(h=!0,Ee.sort=U[2],_e(()=>h=!1)),d.$set(Ee);const Re={};oe&134217728&&(Re.$$scope={dirty:oe,ctx:U}),!_&&oe&4&&(_=!0,Re.sort=U[2],_e(()=>_=!1)),m.$set(Re),oe&186&&(G=pe(U[4]),re(),$=gt($,oe,X,1,U,G,O,T,Rt,Wm,null,Vm),ae(),!G.length&&J?J.p(U,oe):G.length?J&&(J.d(1),J=null):(J=zm(U),J.c(),J.m(T,null))),(!M||oe&32)&&Q(e,"table-loading",U[5])},i(U){if(!M){A(o.$$.fragment,U),A(u.$$.fragment,U),A(d.$$.fragment,U),A(m.$$.fragment,U);for(let oe=0;oe New admin',g=E(),z(m.$$.fragment),_=E(),y=v("div"),S=E(),z(C.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(M,D){w(M,e,D),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),H(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),b(d,h),w(M,g,D),H(m,M,D),w(M,_,D),w(M,y,D),w(M,S,D),H(C,M,D),T=!0,$||(O=Y(h,"click",n[9]),$=!0)},p(M,D){(!T||D&64)&&le(o,M[6]);const L={};D&2&&(L.value=M[1]),m.$set(L);const N={};D&134217918&&(N.$$scope={dirty:D,ctx:M}),C.$set(N)},i(M){T||(A(a.$$.fragment,M),A(m.$$.fragment,M),A(C.$$.fragment,M),T=!0)},o(M){I(a.$$.fragment,M),I(m.$$.fragment,M),I(C.$$.fragment,M),T=!1},d(M){M&&(k(e),k(g),k(_),k(y),k(S)),V(a),V(m,M),V(C,M),$=!1,O()}}}function hA(n){let e,t,i=n[4].length+"",s;return{c(){e=v("div"),t=W("Total found: "),s=W(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(l,o){w(l,e,o),b(e,t),b(e,s)},p(l,o){o&16&&i!==(i=l[4].length+"")&&le(s,i)},d(l){l&&k(e)}}}function mA(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{footer:[hA],default:[pA]},$$scope:{ctx:n}}});let r={};return l=new lA({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[18](null),V(l,a)}}}function gA(n,e,t){let i,s,l;Ge(n,ka,P=>t(21,i=P)),Ge(n,Nt,P=>t(6,s=P)),Ge(n,Pa,P=>t(7,l=P)),an(Nt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const P=j.normalizeSearchFilter(f,["id","email","created","updated"]);return ce.admins.getFullList(100,{sort:c||"-created",filter:P}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),ce.error(F,(F==null?void 0:F.status)!=400))})}function h(){t(4,a=[])}const g=()=>d(),m=()=>r==null?void 0:r.show(),_=P=>t(1,f=P.detail);function y(P){c=P,t(2,c)}function S(P){c=P,t(2,c)}function C(P){c=P,t(2,c)}function T(P){c=P,t(2,c)}const $=P=>r==null?void 0:r.show(P),O=(P,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(P))},M=()=>t(1,f="");function D(P){te[P?"unshift":"push"](()=>{r=P,t(3,r)})}const L=()=>d(),N=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const P=new URLSearchParams({filter:f,sort:c}).toString();us("/settings/admins?"+P),d()}},[d,f,c,r,a,u,s,l,g,m,_,y,S,C,T,$,O,M,D,L,N]}class _A extends ve{constructor(e){super(),be(this,e,gA,mA,ge,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function bA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Email"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&de(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function vA(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=W("Password"),s=E(),l=v("input"),r=E(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),de(l,n[1]),w(d,r,h),w(d,a,h),b(a,u),f||(c=[Y(l,"input",n[5]),Te(dn.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&de(l,d[1])},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),f=!1,$e(c)}}}function yA(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[bA,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[vA,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Admin sign in

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),a=v("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),b(e,t),b(e,i),H(s,e,null),b(e,l),H(o,e,null),b(e,r),b(e,a),u=!0,f||(c=Y(e,"submit",Ze(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const m={};h&770&&(m.$$scope={dirty:h,ctx:d}),o.$set(m),(!u||h&4)&&Q(a,"btn-disabled",d[2]),(!u||h&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(s.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&k(e),V(s),V(o),f=!1,c()}}}function kA(n){let e,t;return e=new Lb({props:{$$slots:{default:[yA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function wA(n,e,t){let i;Ge(n,ka,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ce.admins.authWithPassword(l,o).then(()=>{Ia(),us("/")}).catch(()=>{Ci("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class SA extends ve{constructor(e){super(),be(this,e,wA,kA,ge,{})}}function TA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[$A,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[MA,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[OA,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[EA,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}});let O=n[3]&&Ym(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),d=v("div"),h=v("div"),g=E(),O&&O.c(),m=E(),_=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(_,"type","submit"),p(_,"class","btn btn-expanded"),_.disabled=S=!n[3]||n[2],Q(_,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(M,D){w(M,e,D),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),H(a,e,null),b(e,u),H(f,e,null),b(e,c),b(e,d),b(d,h),b(d,g),O&&O.m(d,null),b(d,m),b(d,_),b(_,y),C=!0,T||($=Y(_,"click",n[13]),T=!0)},p(M,D){const L={};D&1572865&&(L.$$scope={dirty:D,ctx:M}),i.$set(L);const N={};D&1572865&&(N.$$scope={dirty:D,ctx:M}),o.$set(N);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:M}),a.$set(P);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:M}),f.$set(F),M[3]?O?O.p(M,D):(O=Ym(M),O.c(),O.m(d,m)):O&&(O.d(1),O=null),(!C||D&12&&S!==(S=!M[3]||M[2]))&&(_.disabled=S),(!C||D&4)&&Q(_,"btn-loading",M[2])},i(M){C||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(a.$$.fragment,M),A(f.$$.fragment,M),C=!0)},o(M){I(i.$$.fragment,M),I(o.$$.fragment,M),I(a.$$.fragment,M),I(f.$$.fragment,M),C=!1},d(M){M&&k(e),V(i),V(o),V(a),V(f),O&&O.d(),T=!1,$()}}}function CA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function $A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Application name"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&de(l,u[0].meta.appName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function MA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Application URL"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&de(l,u[0].meta.appUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function OA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Logs max days retention"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].logs.maxDays&&de(l,u[0].logs.maxDays)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function EA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),Te(Be.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Ym(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function DA(n){let e,t,i,s,l,o,r,a,u;const f=[CA,TA],c=[];function d(h,g){return h[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML='',t=E(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),b(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",Ze(n[4])),a=!0)},p(h,g){let m=l;l=d(h),l===m?c[l].p(h,g):(re(),I(c[m],1,1,()=>{c[m]=null}),ae(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){I(o),r=!1},d(h){h&&(k(e),k(t),k(i)),c[l].d(),a=!1,u()}}}function AA(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[DA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function IA(n,e,t){let i,s,l,o;Ge(n,Es,O=>t(14,s=O)),Ge(n,To,O=>t(15,l=O)),Ge(n,Nt,O=>t(16,o=O)),an(Nt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const O=await ce.settings.getAll()||{};g(O)}catch(O){ce.error(O)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const O=await ce.settings.update(j.filterRedactedProps(a));g(O),zt("Successfully saved application settings.")}catch(O){ce.error(O)}t(2,f=!1)}}function g(O={}){var M,D;an(To,l=(M=O==null?void 0:O.meta)==null?void 0:M.appName,l),an(Es,s=!!((D=O==null?void 0:O.meta)!=null&&D.hideControls),s),t(0,a={meta:(O==null?void 0:O.meta)||{},logs:(O==null?void 0:O.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function m(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.logs.maxDays=yt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>m(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,m,r,c,_,y,S,C,T,$]}class LA extends ve{constructor(e){super(),be(this,e,IA,AA,ge,{})}}function PA(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),di(s,a)},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Te(Be.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){di(s,a=_t(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(k(e),k(i),k(s)),l=!1,$e(o)}}}function FA(n){let e;function t(l,o){return l[3]?NA:PA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function RA(n,e,t){const i=["value","mask"];let s=tt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(h){te[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(5,s=tt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class fu extends ve{constructor(e){super(),be(this,e,RA,FA,ge,{value:0,mask:1})}}function qA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;return{c(){e=v("label"),t=W("Subject"),s=E(),l=v("input"),r=E(),a=v("div"),u=W(`Available placeholder parameters: + `),f=v("button"),f.textContent="{APP_NAME} ",c=W(`, + `),d=v("button"),d.textContent="{APP_URL} ",h=W("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),w(_,l,y),de(l,n[0].subject),w(_,r,y),w(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),g||(m=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],g=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&p(e,"for",i),y[1]&1&&o!==(o=_[31])&&p(l,"id",o),y[0]&1&&l.value!==_[0].subject&&de(l,_[0].subject)},d(_){_&&(k(e),k(s),k(l),k(r),k(a)),g=!1,$e(m)}}}function jA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return{c(){e=v("label"),t=W("Action URL"),s=E(),l=v("input"),r=E(),a=v("div"),u=W(`Available placeholder parameters: + `),f=v("button"),f.textContent="{APP_NAME} ",c=W(`, + `),d=v("button"),d.textContent="{APP_URL} ",h=W(`, + `),g=v("button"),g.textContent="{TOKEN} ",m=W("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(S,C){w(S,e,C),b(e,t),w(S,s,C),w(S,l,C),de(l,n[0].actionUrl),w(S,r,C),w(S,a,C),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),_||(y=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(g,"click",n[19])],_=!0)},p(S,C){C[1]&1&&i!==(i=S[31])&&p(e,"for",i),C[1]&1&&o!==(o=S[31])&&p(l,"id",o),C[0]&1&&l.value!==S[0].actionUrl&&de(l,S[0].actionUrl)},d(S){S&&(k(e),k(s),k(l),k(r),k(a)),_=!1,$e(y)}}}function HA(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),de(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&de(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function VA(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Pt(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Pt(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,_e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function zA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;const $=[VA,HA],O=[];function M(D,L){return D[4]&&!D[5]?0:1}return l=M(n),o=O[l]=$[l](n),{c(){e=v("label"),t=W("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=W(`Available placeholder parameters: + `),f=v("button"),f.textContent="{APP_NAME} ",c=W(`, + `),d=v("button"),d.textContent="{APP_URL} ",h=W(`, + `),g=v("button"),g.textContent="{TOKEN} ",m=W(`, + `),_=v("button"),_.textContent="{ACTION_URL} ",y=W("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(D,L){w(D,e,L),b(e,t),w(D,s,L),O[l].m(D,L),w(D,r,L),w(D,a,L),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),b(a,_),b(a,y),S=!0,C||(T=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(g,"click",n[24]),Y(_,"click",n[25])],C=!0)},p(D,L){(!S||L[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let N=l;l=M(D),l===N?O[l].p(D,L):(re(),I(O[N],1,1,()=>{O[N]=null}),ae(),o=O[l],o?o.p(D,L):(o=O[l]=$[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){I(o),S=!1},d(D){D&&(k(e),k(s),k(r),k(a)),O[l].d(D),C=!1,$e(T)}}}function BA(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[qA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[jA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[zA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&(k(t),k(s)),V(e,r),V(i,r),V(l,r)}}}function Km(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function UA(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Km();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=W(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Km(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function WA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[UA],default:[BA]},$$scope:{ctx:n}};for(let l=0;lt(12,o=U));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Jm,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function m(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await ut(()=>import("./CodeEditor-4c129c80.js"),["./CodeEditor-4c129c80.js","./index-808c8630.js"],import.meta.url)).default),Jm=c,t(5,d=!1))}function y(U){j.copyToClipboard(U),ko(`Copied ${U} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),T=()=>y("{APP_URL}");function $(){u.actionUrl=this.value,t(0,u)}const O=()=>y("{APP_NAME}"),M=()=>y("{APP_URL}"),D=()=>y("{TOKEN}");function L(U){n.$$.not_equal(u.body,U)&&(u.body=U,t(0,u))}function N(){u.body=this.value,t(0,u)}const P=()=>y("{APP_NAME}"),F=()=>y("{APP_URL}"),R=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function B(U){te[U?"unshift":"push"](()=>{f=U,t(3,f)})}function G(U){Fe.call(this,n,U)}function X(U){Fe.call(this,n,U)}function J(U){Fe.call(this,n,U)}return n.$$set=U=>{e=je(je({},e),xt(U)),t(8,l=tt(e,s)),"key"in U&&t(1,r=U.key),"title"in U&&t(2,a=U.title),"config"in U&&t(0,u=U.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||pi(r))},[u,r,a,f,c,d,i,y,l,h,g,m,o,S,C,T,$,O,M,D,L,N,P,F,R,q,B,G,X,J]}class qr extends ve{constructor(e){super(),be(this,e,YA,WA,ge,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Gm(n,e,t){const i=n.slice();return i[21]=e[t],i}function Zm(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,c,d,h;return c=c0(e[11][0]),{key:n,first:null,c(){t=v("div"),i=v("input"),l=E(),o=v("label"),a=W(r),f=E(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,de(i,i.__value),p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(g,m){w(g,t,m),b(t,i),i.checked=i.__value===e[2],b(t,l),b(t,o),b(o,a),b(t,f),d||(h=Y(i,"change",e[10]),d=!0)},p(g,m){e=g,m&1048576&&s!==(s=e[20]+e[21].value)&&p(i,"id",s),m&4&&(i.checked=i.__value===e[2]),m&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(g){g&&k(t),c.r(),d=!1,h()}}}function KA(n){let e=[],t=new Map,i,s=pe(n[7]);const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[JA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),z(t.$$.fragment),i=E(),z(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),H(t,e,null),b(e,i),H(s,e,null),l=!0,o||(r=Y(e,"submit",Ze(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){I(t.$$.fragment,a),I(s.$$.fragment,a),l=!1},d(a){a&&k(e),V(t),V(s),o=!1,r()}}}function ZA(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function XA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=W("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function QA(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[XA],header:[ZA],default:[GA]},$$scope:{ctx:n}};return e=new on({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[15](null),V(e,s)}}}const jr="last_email_test",Xm="email_test_request";function xA(n,e,t){let i;const s=dt(),l="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(jr),u=o[0].value,f=!1,c=null;function d(M="",D=""){t(1,a=M||localStorage.getItem(jr)),t(2,u=D||o[0].value),ln({}),r==null||r.show()}function h(){return clearTimeout(c),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(jr,a),clearTimeout(c),c=setTimeout(()=>{ce.cancelRequest(Xm),Ci("Test email send timeout.")},3e4);try{await ce.settings.testEmail(a,u,{$cancelKey:Xm}),zt("Successfully sent test email."),s("submit"),t(4,f=!1),await sn(),h()}catch(M){t(4,f=!1),ce.error(M)}clearTimeout(c)}}const m=[[]];function _(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const S=()=>g(),C=()=>!f;function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){Fe.call(this,n,M)}function O(M){Fe.call(this,n,M)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[h,a,u,r,f,i,l,o,g,d,_,m,y,S,C,T,$,O]}class e8 extends ve{constructor(e){super(),be(this,e,xA,QA,ge,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function t8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[i8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[s8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});function P(ee){n[15](ee)}let F={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(F.config=n[0].meta.verificationTemplate),u=new qr({props:F}),te.push(()=>he(u,"config",P));function R(ee){n[16](ee)}let q={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(q.config=n[0].meta.resetPasswordTemplate),d=new qr({props:q}),te.push(()=>he(d,"config",R));function B(ee){n[17](ee)}let G={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(G.config=n[0].meta.confirmEmailChangeTemplate),m=new qr({props:G}),te.push(()=>he(m,"config",B)),T=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[l8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&Qm(n);function J(ee,se){return ee[5]?g8:m8}let U=J(n),oe=U(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),c=E(),z(d.$$.fragment),g=E(),z(m.$$.fragment),y=E(),S=v("hr"),C=E(),z(T.$$.fragment),$=E(),X&&X.c(),O=E(),M=v("div"),D=v("div"),L=E(),oe.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(D,"class","flex-fill"),p(M,"class","flex")},m(ee,se){w(ee,e,se),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),w(ee,r,se),w(ee,a,se),H(u,a,null),b(a,c),H(d,a,null),b(a,g),H(m,a,null),w(ee,y,se),w(ee,S,se),w(ee,C,se),H(T,ee,se),w(ee,$,se),X&&X.m(ee,se),w(ee,O,se),w(ee,M,se),b(M,D),b(M,L),oe.m(M,null),N=!0},p(ee,se){const Ee={};se[0]&1|se[1]&24&&(Ee.$$scope={dirty:se,ctx:ee}),i.$set(Ee);const Re={};se[0]&1|se[1]&24&&(Re.$$scope={dirty:se,ctx:ee}),o.$set(Re);const Ve={};!f&&se[0]&1&&(f=!0,Ve.config=ee[0].meta.verificationTemplate,_e(()=>f=!1)),u.$set(Ve);const We={};!h&&se[0]&1&&(h=!0,We.config=ee[0].meta.resetPasswordTemplate,_e(()=>h=!1)),d.$set(We);const ke={};!_&&se[0]&1&&(_=!0,ke.config=ee[0].meta.confirmEmailChangeTemplate,_e(()=>_=!1)),m.$set(ke);const Me={};se[0]&1|se[1]&24&&(Me.$$scope={dirty:se,ctx:ee}),T.$set(Me),ee[0].smtp.enabled?X?(X.p(ee,se),se[0]&1&&A(X,1)):(X=Qm(ee),X.c(),A(X,1),X.m(O.parentNode,O)):X&&(re(),I(X,1,1,()=>{X=null}),ae()),U===(U=J(ee))&&oe?oe.p(ee,se):(oe.d(1),oe=U(ee),oe&&(oe.c(),oe.m(M,null)))},i(ee){N||(A(i.$$.fragment,ee),A(o.$$.fragment,ee),A(u.$$.fragment,ee),A(d.$$.fragment,ee),A(m.$$.fragment,ee),A(T.$$.fragment,ee),A(X),N=!0)},o(ee){I(i.$$.fragment,ee),I(o.$$.fragment,ee),I(u.$$.fragment,ee),I(d.$$.fragment,ee),I(m.$$.fragment,ee),I(T.$$.fragment,ee),I(X),N=!1},d(ee){ee&&(k(e),k(r),k(a),k(y),k(S),k(C),k($),k(O),k(M)),V(i),V(o),V(u),V(d),V(m),V(T,ee),X&&X.d(ee),oe.d()}}}function n8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function i8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Sender name"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].meta.senderName),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&de(l,u[0].meta.senderName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function s8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Sender address"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","email"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&de(l,u[0].meta.senderAddress)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function l8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[18]),Te(Be.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Qm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;s=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[o8,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[r8,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field",name:"smtp.username",$$slots:{default:[a8,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[u8,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function $(L,N){return L[4]?c8:f8}let O=$(n),M=O(n),D=n[4]&&xm(n);return{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),m=v("button"),M.c(),_=E(),D&&D.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(m,"type","button"),p(m,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,N){w(L,e,N),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),b(t,a),b(t,u),H(f,u,null),b(t,c),b(t,d),H(h,d,null),b(e,g),b(e,m),M.m(m,null),b(e,_),D&&D.m(e,null),S=!0,C||(T=Y(m,"click",Ze(n[23])),C=!0)},p(L,N){const P={};N[0]&1|N[1]&24&&(P.$$scope={dirty:N,ctx:L}),s.$set(P);const F={};N[0]&1|N[1]&24&&(F.$$scope={dirty:N,ctx:L}),r.$set(F);const R={};N[0]&1|N[1]&24&&(R.$$scope={dirty:N,ctx:L}),f.$set(R);const q={};N[0]&1|N[1]&24&&(q.$$scope={dirty:N,ctx:L}),h.$set(q),O!==(O=$(L))&&(M.d(1),M=O(L),M&&(M.c(),M.m(m,null))),L[4]?D?(D.p(L,N),N[0]&16&&A(D,1)):(D=xm(L),D.c(),A(D,1),D.m(e,null)):D&&(re(),I(D,1,1,()=>{D=null}),ae())},i(L){S||(A(s.$$.fragment,L),A(r.$$.fragment,L),A(f.$$.fragment,L),A(h.$$.fragment,L),A(D),L&&xe(()=>{S&&(y||(y=He(e,lt,{duration:150},!0)),y.run(1))}),S=!0)},o(L){I(s.$$.fragment,L),I(r.$$.fragment,L),I(f.$$.fragment,L),I(h.$$.fragment,L),I(D),L&&(y||(y=He(e,lt,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&k(e),V(s),V(r),V(f),V(h),M.d(),D&&D.d(),L&&y&&y.end(),C=!1,T()}}}function o8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("SMTP server host"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].smtp.host),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&de(l,u[0].smtp.host)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function r8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Port"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","number"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].smtp.port),r||(a=Y(l,"input",n[20]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&yt(l.value)!==u[0].smtp.port&&de(l,u[0].smtp.port)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function a8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Username"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].smtp.username),r||(a=Y(l,"input",n[21]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&de(l,u[0].smtp.username)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function u8(n){let e,t,i,s,l,o,r;function a(f){n[22](f)}let u={id:n[34]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new fu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=W("Password"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,_e(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function f8(n){let e,t,i;return{c(){e=v("span"),e.textContent="Show more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function c8(n){let e,t,i;return{c(){e=v("span"),e.textContent="Hide more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function xm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new me({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[d8,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[p8,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[h8,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),p(t,"class","col-lg-3"),p(l,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(g,m){w(g,e,m),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),b(e,f),b(e,c),h=!0},p(g,m){const _={};m[0]&1|m[1]&24&&(_.$$scope={dirty:m,ctx:g}),i.$set(_);const y={};m[0]&1|m[1]&24&&(y.$$scope={dirty:m,ctx:g}),o.$set(y);const S={};m[0]&1|m[1]&24&&(S.$$scope={dirty:m,ctx:g}),u.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),g&&xe(()=>{h&&(d||(d=He(e,lt,{duration:150},!0)),d.run(1))}),h=!0)},o(g){I(i.$$.fragment,g),I(o.$$.fragment,g),I(u.$$.fragment,g),g&&(d||(d=He(e,lt,{duration:150},!1)),d.run(0)),h=!1},d(g){g&&k(e),V(i),V(o),V(u),g&&d&&d.end()}}}function d8(n){let e,t,i,s,l,o,r;function a(f){n[24](f)}let u={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new Ei({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=W("TLS encryption"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,_e(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function p8(n){let e,t,i,s,l,o,r;function a(f){n[25](f)}let u={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new Ei({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=W("AUTH method"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,_e(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function h8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="EHLO/HELO domain",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[0].smtp.localName),u||(f=[Te(Be.call(null,s,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),Y(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&l!==(l=c[34])&&p(e,"for",l),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&de(r,c[0].smtp.localName)},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function m8(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[29]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function g8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[3],Q(s,"btn-loading",n[3])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"click",n[27]),Y(s,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function _8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[n8,t8],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[6]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=Y(u,"submit",Ze(n[30])),m=!0)},p(T,$){(!g||$[0]&64)&&le(o,T[6]);let O=d;d=C(T),d===O?S[d].p(T,$):(re(),I(S[O],1,1,()=>{S[O]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){I(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function b8(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{default:[_8]},$$scope:{ctx:n}}});let r={};return l=new e8({props:r}),n[31](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&127|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[31](null),V(l,a)}}}function v8(n,e,t){let i,s,l;Ge(n,Nt,ee=>t(6,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];an(Nt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1,h=!1;g();async function g(){t(2,c=!0);try{const ee=await ce.settings.getAll()||{};_(ee)}catch(ee){ce.error(ee)}t(2,c=!1)}async function m(){if(!(d||!s)){t(3,d=!0);try{const ee=await ce.settings.update(j.filterRedactedProps(f));_(ee),ln({}),zt("Successfully saved mail settings.")}catch(ee){ce.error(ee)}t(3,d=!1)}}function _(ee={}){t(0,f={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(11,u=JSON.parse(JSON.stringify(f)))}function y(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function C(){f.meta.senderAddress=this.value,t(0,f)}function T(ee){n.$$.not_equal(f.meta.verificationTemplate,ee)&&(f.meta.verificationTemplate=ee,t(0,f))}function $(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function O(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=yt(this.value),t(0,f)}function N(){f.smtp.username=this.value,t(0,f)}function P(ee){n.$$.not_equal(f.smtp.password,ee)&&(f.smtp.password=ee,t(0,f))}const F=()=>{t(4,h=!h)};function R(ee){n.$$.not_equal(f.smtp.tls,ee)&&(f.smtp.tls=ee,t(0,f))}function q(ee){n.$$.not_equal(f.smtp.authMethod,ee)&&(f.smtp.authMethod=ee,t(0,f))}function B(){f.smtp.localName=this.value,t(0,f)}const G=()=>y(),X=()=>m(),J=()=>a==null?void 0:a.show(),U=()=>m();function oe(ee){te[ee?"unshift":"push"](()=>{a=ee,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(u)),n.$$.dirty[0]&4097&&t(5,s=i!=JSON.stringify(f))},[f,a,c,d,h,s,l,o,r,m,y,u,i,S,C,T,$,O,M,D,L,N,P,F,R,q,B,G,X,J,U,oe]}class y8 extends ve{constructor(e){super(),be(this,e,v8,b8,ge,{},null,[-1,-1])}}const k8=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),eg=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function w8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&le(l,u[4]),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function tg(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O;return i=new me({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[S8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[T8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[C8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[$8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[M8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),S=new me({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[O8,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),z(d.$$.fragment),h=E(),g=v("div"),z(m.$$.fragment),_=E(),y=v("div"),z(S.$$.fragment),C=E(),T=v("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(M,D){w(M,e,D),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),b(e,f),b(e,c),H(d,c,null),b(e,h),b(e,g),H(m,g,null),b(e,_),b(e,y),H(S,y,null),b(e,C),b(e,T),O=!0},p(M,D){const L={};D&8&&(L.name=M[3]+".endpoint"),D&1081345&&(L.$$scope={dirty:D,ctx:M}),i.$set(L);const N={};D&8&&(N.name=M[3]+".bucket"),D&1081345&&(N.$$scope={dirty:D,ctx:M}),o.$set(N);const P={};D&8&&(P.name=M[3]+".region"),D&1081345&&(P.$$scope={dirty:D,ctx:M}),u.$set(P);const F={};D&8&&(F.name=M[3]+".accessKey"),D&1081345&&(F.$$scope={dirty:D,ctx:M}),d.$set(F);const R={};D&8&&(R.name=M[3]+".secret"),D&1081345&&(R.$$scope={dirty:D,ctx:M}),m.$set(R);const q={};D&8&&(q.name=M[3]+".forcePathStyle"),D&1081345&&(q.$$scope={dirty:D,ctx:M}),S.$set(q)},i(M){O||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(u.$$.fragment,M),A(d.$$.fragment,M),A(m.$$.fragment,M),A(S.$$.fragment,M),M&&xe(()=>{O&&($||($=He(e,lt,{duration:150},!0)),$.run(1))}),O=!0)},o(M){I(i.$$.fragment,M),I(o.$$.fragment,M),I(u.$$.fragment,M),I(d.$$.fragment,M),I(m.$$.fragment,M),I(S.$$.fragment,M),M&&($||($=He(e,lt,{duration:150},!1)),$.run(0)),O=!1},d(M){M&&k(e),V(i),V(o),V(u),V(d),V(m),V(S),M&&$&&$.end()}}}function S8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Endpoint"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].endpoint),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].endpoint&&de(l,u[0].endpoint)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function T8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Bucket"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].bucket),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].bucket&&de(l,u[0].bucket)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function C8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Region"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].region),r||(a=Y(l,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].region&&de(l,u[0].region)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function $8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Access key"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].accessKey),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].accessKey&&de(l,u[0].accessKey)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function M8(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new fu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=W("Secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].secret,_e(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function O8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[14]),Te(Be.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function E8(n){let e,t,i,s,l;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[w8,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=Ct(o,n,n[15],eg);let a=n[0].enabled&&tg(n);return{c(){z(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=ye()},m(u,f){H(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!l||f&32775)&&Mt(r,o,u,u[15],l?$t(o,u[15],f,k8):Ot(u[15]),eg),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=tg(u),a.c(),A(a,1),a.m(s.parentNode,s)):a&&(re(),I(a,1,1,()=>{a=null}),ae())},i(u){l||(A(e.$$.fragment,u),A(r,u),A(a),l=!0)},o(u){I(e.$$.fragment,u),I(r,u),I(a),l=!1},d(u){u&&(k(t),k(i),k(s)),V(e,u),r&&r.d(u),a&&a.d(u)}}}const Hr="s3_test_request";function D8(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,h=null;function g(M){t(2,c=!0),clearTimeout(h),h=setTimeout(()=>{m()},M)}async function m(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;ce.cancelRequest(Hr),clearTimeout(d),d=setTimeout(()=>{ce.cancelRequest(Hr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let M;try{await ce.settings.testS3(u,{$cancelKey:Hr})}catch(D){M=D}return M!=null&&M.isAbort||(t(1,f=M),t(2,c=!1),clearTimeout(d)),f}Kt(()=>()=>{clearTimeout(d),clearTimeout(h)});function _(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function C(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function $(M){n.$$.not_equal(o.secret,M)&&(o.secret=M,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=M=>{"originalConfig"in M&&t(5,l=M.originalConfig),"config"in M&&t(0,o=M.config),"configKey"in M&&t(3,r=M.configKey),"toggleLabel"in M&&t(4,a=M.toggleLabel),"testFilesystem"in M&&t(6,u=M.testFilesystem),"testError"in M&&t(1,f=M.testError),"isTesting"in M&&t(2,c=M.isTesting),"$$scope"in M&&t(15,s=M.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l!=null&&l.enabled&&g(100),n.$$.dirty&9&&(o.enabled||pi(r))},[o,f,c,r,a,l,u,i,_,y,S,C,T,$,O,s]}class W1 extends ve{constructor(e){super(),be(this,e,D8,E8,ge,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function A8(n){var M;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;function y(D){n[11](D)}function S(D){n[12](D)}function C(D){n[13](D)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[L8]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new W1({props:T}),te.push(()=>he(e,"config",y)),te.push(()=>he(e,"isTesting",S)),te.push(()=>he(e,"testError",C));let $=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&ig(n),O=n[6]&&sg(n);return{c(){z(e.$$.fragment),l=E(),o=v("div"),r=v("div"),a=E(),$&&$.c(),u=E(),O&&O.c(),f=E(),c=v("button"),d=v("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=h=!n[6]||n[3],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(D,L){H(e,D,L),w(D,l,L),w(D,o,L),b(o,r),b(o,a),$&&$.m(o,null),b(o,u),O&&O.m(o,null),b(o,f),b(o,c),b(c,d),g=!0,m||(_=Y(c,"click",n[15]),m=!0)},p(D,L){var P;const N={};L&1&&(N.originalConfig=D[0].s3),L&524291&&(N.$$scope={dirty:L,ctx:D}),!t&&L&2&&(t=!0,N.config=D[1].s3,_e(()=>t=!1)),!i&&L&16&&(i=!0,N.isTesting=D[4],_e(()=>i=!1)),!s&&L&32&&(s=!0,N.testError=D[5],_e(()=>s=!1)),e.$set(N),(P=D[1].s3)!=null&&P.enabled&&!D[6]&&!D[3]?$?$.p(D,L):($=ig(D),$.c(),$.m(o,u)):$&&($.d(1),$=null),D[6]?O?O.p(D,L):(O=sg(D),O.c(),O.m(o,f)):O&&(O.d(1),O=null),(!g||L&72&&h!==(h=!D[6]||D[3]))&&(c.disabled=h),(!g||L&8)&&Q(c,"btn-loading",D[3])},i(D){g||(A(e.$$.fragment,D),g=!0)},o(D){I(e.$$.fragment,D),g=!1},d(D){D&&(k(l),k(o)),V(e,D),$&&$.d(),O&&O.d(),m=!1,_()}}}function I8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function ng(n){var L;let e,t,i,s,l,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",h,g,m,_,y,S,C,T,$,O,M,D;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually from the - `),r=v("strong"),u=U(a),f=U(` + `),r=v("strong"),u=W(a),f=W(` to the - `),c=v("strong"),h=U(d),g=U(`. - `),m=v("br"),_=U(` + `),c=v("strong"),h=W(d),g=W(`. + `),m=v("br"),_=W(` There are numerous command line tools that can help you, such as: `),y=v("a"),y.textContent=`rclone - `,S=U(`, + `,S=W(`, `),C=v("a"),C.textContent=`s5cmd - `,T=U(", etc."),$=E(),O=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(O,"class","clearfix m-t-base")},m(N,P){w(N,e,P),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,h),b(l,g),b(l,m),b(l,_),b(l,y),b(l,S),b(l,C),b(l,T),b(e,$),b(e,O),D=!0},p(N,P){var F;(!D||P&1)&&a!==(a=(F=N[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!D||P&2)&&d!==(d=N[1].s3.enabled?"S3 storage":"local file system")&&le(h,d)},i(N){D||(N&&xe(()=>{D&&(M||(M=He(e,lt,{duration:150},!0)),M.run(1))}),D=!0)},o(N){N&&(M||(M=He(e,lt,{duration:150},!1)),M.run(0)),D=!1},d(N){N&&k(e),N&&M&&M.end()}}}function j8(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&ig(n);return{c(){t&&t.c(),e=ye()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=ig(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(re(),I(t,1,1,()=>{t=null}),ae())},d(s){s&&k(e),t&&t.d(s)}}}function sg(n){let e;function t(l,o){return l[4]?z8:l[5]?V8:H8}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function H8(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function V8(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Et(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function z8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function lg(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function B8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[q8,R8],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[7]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=Y(u,"submit",Ze(n[16])),m=!0)},p(T,$){(!g||$&128)&&le(o,T[7]);let O=d;d=C(T),d===O?S[d].p(T,$):(re(),I(S[O],1,1,()=>{S[O]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){I(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function U8(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[B8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}const W8="s3_test_request";function Y8(n,e,t){let i,s,l;Ge(n,Nt,O=>t(7,l=O)),an(Nt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{de.cancelRequest(W8);const O=await de.settings.update(j.filterRedactedProps(r));ln({}),await g(O),Ia(),c?Xy("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(O){de.error(O)}t(3,u=!1)}}async function g(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function m(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){f=O,t(4,f)}function S(O){c=O,t(5,c)}const C=()=>m(),T=()=>h(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,m,i,_,y,S,C,T,$]}class K8 extends be{constructor(e){super(),_e(this,e,Y8,U8,ge,{})}}function J8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function G8(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ce(l,n[1].clientId),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(l,"id",o),c&2&&r!==(r=f[1].enabled)&&(l.required=r),c&2&&l.value!==f[1].clientId&&ce(l,f[1].clientId)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function Z8(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new fu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function og(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a,u){let f={key:a[3].key};return a[1]!==void 0&&(f.config=a[1]),{props:f}}return o&&(t=Lt(o,r(n)),te.push(()=>he(t,"config",l))),{c(){e=v("div"),t&&z(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){w(a,e,u),t&&H(t,e,null),s=!0},p(a,u){if(u&8&&o!==(o=a[3].optionsComponent)){if(t){re();const f=t;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(t=Lt(o,r(a)),te.push(()=>he(t,"config",l)),z(t.$$.fragment),A(t.$$.fragment,1),H(t,e,null)):t=null}else if(o){const f={};u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[1],ve(()=>i=!1)),t.$set(f)}},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&I(t.$$.fragment,a),s=!1},d(a){a&&k(e),t&&V(t)}}}function X8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new me({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[J8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[G8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[Z8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}});let g=n[3].optionsComponent&&og(n);return{c(){e=v("form"),t=v("div"),z(i.$$.fragment),s=E(),l=v("button"),l.innerHTML='Clear all fields',o=E(),z(r.$$.fragment),a=E(),z(u.$$.fragment),f=E(),g&&g.c(),p(l,"type","button"),p(l,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(m,_){w(m,e,_),b(e,t),H(i,t,null),b(t,s),b(t,l),b(e,o),H(r,e,null),b(e,a),H(u,e,null),b(e,f),g&&g.m(e,null),c=!0,d||(h=[Y(l,"click",n[8]),Y(e,"submit",Ze(n[15]))],d=!0)},p(m,_){const y={};_&8&&(y.name=m[3].key+".enabled"),_&3145730&&(y.$$scope={dirty:_,ctx:m}),i.$set(y);const S={};_&2&&(S.class="form-field "+(m[1].enabled?"required":"")),_&8&&(S.name=m[3].key+".clientId"),_&3145730&&(S.$$scope={dirty:_,ctx:m}),r.$set(S);const C={};_&2&&(C.class="form-field "+(m[1].enabled?"required":"")),_&8&&(C.name=m[3].key+".clientSecret"),_&3145730&&(C.$$scope={dirty:_,ctx:m}),u.$set(C),m[3].optionsComponent?g?(g.p(m,_),_&8&&A(g,1)):(g=og(m),g.c(),A(g,1),g.m(e,null)):g&&(re(),I(g,1,1,()=>{g=null}),ae())},i(m){c||(A(i.$$.fragment,m),A(r.$$.fragment,m),A(u.$$.fragment,m),A(g),c=!0)},o(m){I(i.$$.fragment,m),I(r.$$.fragment,m),I(u.$$.fragment,m),I(g),c=!1},d(m){m&&k(e),V(i),V(r),V(u),g&&g.d(),d=!1,$e(h)}}}function Q8(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=v("h4"),i=U(t),s=U(" provider"),p(e,"class","center txt-break")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&le(i,t)},d(l){l&&k(e)}}}function x8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function eI(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[x8],header:[Q8],default:[X8]},$$scope:{ctx:n}};return e=new on({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[16](null),V(e,s)}}}function tI(n,e,t){let i;const s=dt(),l="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function c(M,D){ln({}),t(3,r=Object.assign({},M)),t(1,a=Object.assign({enabled:!0},D)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function h(){t(4,u=!0);try{const M={};M[r.key]=j.filterRedactedProps(a);const D=await de.settings.update(M);ln({}),zt("Successfully updated provider settings."),s("submit",D),d()}catch(M){de.error(M)}t(4,u=!1)}function g(){for(let M in a)t(1,a[M]="",a);t(1,a.enabled=!1,a)}function m(){a.enabled=this.checked,t(1,a)}function _(){a.clientId=this.value,t(1,a)}function y(M){n.$$.not_equal(a.clientSecret,M)&&(a.clientSecret=M,t(1,a))}function S(M){a=M,t(1,a)}const C=()=>h();function T(M){te[M?"unshift":"push"](()=>{o=M,t(2,o)})}function $(M){Fe.call(this,n,M)}function O(M){Fe.call(this,n,M)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,l,h,g,c,f,m,_,y,S,C,T,$,O]}class nI extends be{constructor(e){super(),_e(this,e,tI,eI,ge,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function rg(n){let e,t,i;return{c(){e=v("img"),un(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&2&&!un(e.src,t="./images/oauth2/"+s[1].logo)&&p(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&p(e,"alt",i)},d(s){s&&k(e)}}}function ag(n){let e;return{c(){e=v("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function iI(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,h,g,m,_,y,S,C,T,$=n[1].logo&&rg(n),O=n[0].enabled&&ag(),M={};return y=new nI({props:M}),n[4](y),y.$on("submit",n[5]),{c(){e=v("div"),t=v("figure"),$&&$.c(),i=E(),s=v("div"),o=U(l),r=E(),a=v("em"),u=U("("),c=U(f),d=U(")"),h=E(),O&&O.c(),g=E(),m=v("button"),m.innerHTML='',_=E(),z(y.$$.fragment),p(t,"class","provider-logo"),p(s,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(m,"type","button"),p(m,"class","btn btn-circle btn-hint btn-transparent"),p(m,"aria-label","Provider settings"),p(e,"class","provider-card")},m(D,L){w(D,e,L),b(e,t),$&&$.m(t,null),b(e,i),b(e,s),b(s,o),b(e,r),b(e,a),b(a,u),b(a,c),b(a,d),b(e,h),O&&O.m(e,null),b(e,g),b(e,m),w(D,_,L),H(y,D,L),S=!0,C||(T=Y(m,"click",n[3]),C=!0)},p(D,[L]){D[1].logo?$?$.p(D,L):($=rg(D),$.c(),$.m(t,null)):$&&($.d(1),$=null),(!S||L&2)&&l!==(l=D[1].title+"")&&le(o,l),(!S||L&2)&&f!==(f=D[1].key.slice(0,-4)+"")&&le(c,f),D[0].enabled?O||(O=ag(),O.c(),O.m(e,g)):O&&(O.d(1),O=null);const N={};y.$set(N)},i(D){S||(A(y.$$.fragment,D),S=!0)},o(D){I(y.$$.fragment,D),S=!1},d(D){D&&(k(e),k(_)),$&&$.d(),O&&O.d(),n[4](null),V(y,D),C=!1,T()}}}function sI(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class K1 extends be{constructor(e){super(),_e(this,e,sI,iI,ge,{provider:1,config:0})}}function ug(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function fg(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function lI(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=pe(n[3]);const c=m=>m[9].key;for(let m=0;m0&&n[2].length>0&&dg(),h=pe(n[2]);const g=m=>m[9].key;for(let m=0;m0&&m[2].length>0?d||(d=dg(),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null),_&5&&(h=pe(m[2]),re(),r=gt(r,_,g,1,m,h,a,o,Rt,pg,null,ug),ae())},i(m){if(!u){for(let _=0;_he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!s&&f&9&&(s=!0,c.config=e[0][e[9].key],ve(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&k(t),V(i)}}}function dg(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pg(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new K1({props:a}),te.push(()=>he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!s&&f&5&&(s=!0,c.config=e[0][e[9].key],ve(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&k(t),V(i)}}}function rI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;const m=[oI,lI],_=[];function y(S,C){return S[1]?0:1}return d=y(n),h=_[d]=m[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[4]),r=E(),a=v("div"),u=v("div"),f=v("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(a,"class","wrapper")},m(S,C){w(S,e,C),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(S,r,C),w(S,a,C),b(a,u),b(u,f),b(u,c),_[d].m(u,null),g=!0},p(S,C){(!g||C&16)&&le(o,S[4]);let T=d;d=y(S),d===T?_[d].p(S,C):(re(),I(_[T],1,1,()=>{_[T]=null}),ae(),h=_[d],h?h.p(S,C):(h=_[d]=m[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){I(h),g=!1},d(S){S&&(k(e),k(r),k(a)),_[d].d()}}}function aI(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[rI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function uI(n,e,t){let i,s,l;Ge(n,Nt,d=>t(4,l=d)),an(Nt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await de.settings.getAll()||{};u(d)}catch(d){de.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const h of ho)t(0,r[h.key]=Object.assign({enabled:!1},d[h.key]),r)}function f(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}function c(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=ho.filter(d=>{var h;return(h=r[d.key])==null?void 0:h.enabled})),n.$$.dirty&1&&t(2,s=ho.filter(d=>{var h;return!((h=r[d.key])!=null&&h.enabled)}))},[r,o,s,i,l,f,c]}class fI extends be{constructor(e){super(),_e(this,e,uI,aI,ge,{})}}function cI(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=U(n[3]),i=U(" duration (in seconds)"),l=E(),o=v("input"),a=E(),u=v("div"),f=v("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),Q(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(h,g){w(h,e,g),b(e,t),b(e,i),w(h,l,g),w(h,o,g),ce(o,n[0]),w(h,a,g),w(h,u,g),b(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(h,g){g&8&&le(t,h[3]),g&64&&s!==(s=h[6])&&p(e,"for",s),g&64&&r!==(r=h[6])&&p(o,"id",r),g&1&&vt(o.value)!==h[0]&&ce(o,h[0]),g&2&&Q(f,"txt-success",!!h[1])},d(h){h&&(k(e),k(l),k(o),k(a),k(u)),c=!1,$e(d)}}}function dI(n){let e,t;return e=new me({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[cI,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function pI(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=vt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class J1 extends be{constructor(e){super(),_e(this,e,pI,dI,ge,{key:2,label:3,duration:0,secret:1})}}function hg(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function mg(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function hI(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],c=new Map,d,h,g,m,_,y,S,C,T,$,O,M=pe(n[5]);const D=F=>F[19].key;for(let F=0;FF[19].key;for(let F=0;Fhe(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&33&&(s=!0,d.duration=e[0][e[19].key].duration,ve(()=>s=!1)),!l&&c&33&&(l=!0,d.secret=e[0][e[19].key].secret,ve(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&k(t),V(i,f)}}}function _g(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new J1({props:u}),te.push(()=>he(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&65&&(s=!0,d.duration=e[0][e[19].key].duration,ve(()=>s=!1)),!l&&c&65&&(l=!0,d.secret=e[0][e[19].key].secret,ve(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&k(t),V(i,f)}}}function bg(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function gI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[mI,hI],S=[];function C(T,$){return T[1]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[4]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Adjust common token options.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=Y(u,"submit",Ze(n[7])),m=!0)},p(T,$){(!g||$&16)&&le(o,T[4]);let O=d;d=C(T),d===O?S[d].p(T,$):(re(),I(S[O],1,1,()=>{S[O]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){I(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function _I(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[gI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function bI(n,e,t){let i,s,l;Ge(n,Nt,O=>t(4,l=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];an(Nt,l="Token options",l);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(1,f=!1)}async function h(){if(!(c||!s)){t(2,c=!0);try{const O=await de.settings.update(j.filterRedactedProps(u));g(O),zt("Successfully saved tokens options.")}catch(O){de.error(O)}t(2,c=!1)}}function g(O){var D;O=O||{},t(0,u={});const M=o.concat(r);for(const L of M)t(0,u[L.key]={duration:((D=O[L.key])==null?void 0:D.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function m(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function _(O,M){n.$$.not_equal(u[M.key].duration,O)&&(u[M.key].duration=O,t(0,u))}function y(O,M){n.$$.not_equal(u[M.key].secret,O)&&(u[M.key].secret=O,t(0,u))}function S(O,M){n.$$.not_equal(u[M.key].duration,O)&&(u[M.key].duration=O,t(0,u))}function C(O,M){n.$$.not_equal(u[M.key].secret,O)&&(u[M.key].secret=O,t(0,u))}const T=()=>m(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,c,s,l,o,r,h,m,a,i,_,y,S,C,T,$]}class vI extends be{constructor(e){super(),_e(this,e,bI,_I,ge,{})}}function yI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return o=new P1({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`

    Below you'll find your current collections configuration that you could import in - another PocketBase environment.

    `,t=E(),i=v("div"),s=v("button"),s.innerHTML='Copy',l=E(),z(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),b(i,s),b(i,l),H(o,i,null),n[8](i),w(m,r,_),w(m,a,_),b(a,u),b(a,f),b(a,c),d=!0,h||(g=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],h=!0)},p(m,_){const y={};_&4&&(y.content=m[2]),o.$set(y)},i(m){d||(A(o.$$.fragment,m),d=!0)},o(m){I(o.$$.fragment,m),d=!1},d(m){m&&(k(e),k(t),k(i),k(r),k(a)),V(o),n[8](null),h=!1,$e(g)}}}function kI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function wI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[kI,yI],g=[];function m(_,y){return _[1]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[3]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&le(o,_[3]);let S=f;f=m(_),f===S?g[f].p(_,y):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function SI(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[wI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function TI(n,e,t){let i,s;Ge(n,Nt,_=>t(3,s=_)),an(Nt,s="Export collections",s);const l="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await de.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){de.error(_)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),yo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},m=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,m]}class CI extends be{constructor(e){super(),_e(this,e,TI,SI,ge,{})}}function vg(n,e,t){const i=n.slice();return i[14]=e[t],i}function yg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function kg(n,e,t){const i=n.slice();return i[14]=e[t],i}function wg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Sg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Tg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Cg(n,e,t){const i=n.slice();return i[30]=e[t],i}function $I(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&$g(),a=n[0].name!==n[1].name&&Mg(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=$g(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Mg(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function MI(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=E(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function OI(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=E(),i=v("strong"),l=U(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function $g(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mg(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=E(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),b(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&(k(e),k(s),k(l))}}}function Og(n){var g,m;let e,t,i,s,l,o,r=n[12]((g=n[0])==null?void 0:g[n[30]])+"",a,u,f,c,d=n[12]((m=n[1])==null?void 0:m[n[30]])+"",h;return{c(){var _,y,S,C,T,$;e=v("tr"),t=v("td"),i=v("span"),i.textContent=`${n[30]}`,s=E(),l=v("td"),o=v("pre"),a=U(r),u=E(),f=v("td"),c=v("pre"),h=U(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(l,"class","svelte-lmkr38"),Q(l,"changed-old-col",!n[10]&&yn((_=n[0])==null?void 0:_[n[30]],(y=n[1])==null?void 0:y[n[30]])),Q(l,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),Q(f,"changed-new-col",!n[5]&&yn((S=n[0])==null?void 0:S[n[30]],(C=n[1])==null?void 0:C[n[30]])),Q(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",yn((T=n[0])==null?void 0:T[n[30]],($=n[1])==null?void 0:$[n[30]]))},m(_,y){w(_,e,y),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(o,a),b(e,u),b(e,f),b(f,c),b(c,h)},p(_,y){var S,C,T,$,O,M,D,L;y[0]&1&&r!==(r=_[12]((S=_[0])==null?void 0:S[_[30]])+"")&&le(a,r),y[0]&3075&&Q(l,"changed-old-col",!_[10]&&yn((C=_[0])==null?void 0:C[_[30]],(T=_[1])==null?void 0:T[_[30]])),y[0]&1024&&Q(l,"changed-none-col",_[10]),y[0]&2&&d!==(d=_[12](($=_[1])==null?void 0:$[_[30]])+"")&&le(h,d),y[0]&2083&&Q(f,"changed-new-col",!_[5]&&yn((O=_[0])==null?void 0:O[_[30]],(M=_[1])==null?void 0:M[_[30]])),y[0]&32&&Q(f,"changed-none-col",_[5]),y[0]&2051&&Q(e,"txt-primary",yn((D=_[0])==null?void 0:D[_[30]],(L=_[1])==null?void 0:L[_[30]]))},d(_){_&&k(e)}}}function Eg(n){let e,t=pe(n[6]),i=[];for(let s=0;sProps Old New',l=E(),o=v("tbody");for(let T=0;T!["schema","created","updated"].includes(y));function m(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(S=>y.id==S.id))))}function _(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&m(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,_]}class AI extends be{constructor(e){super(),_e(this,e,DI,EI,ge,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Rg(n,e,t){const i=n.slice();return i[17]=e[t],i}function qg(n){let e,t;return e=new AI({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function II(n){let e,t,i=pe(n[2]),s=[];for(let o=0;oI(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{D&&(M||(M=He(e,lt,{duration:150},!0)),M.run(1))}),D=!0)},o(N){N&&(M||(M=He(e,lt,{duration:150},!1)),M.run(0)),D=!1},d(N){N&&k(e),N&&M&&M.end()}}}function L8(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&ng(n);return{c(){t&&t.c(),e=ye()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=ng(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(re(),I(t,1,1,()=>{t=null}),ae())},d(s){s&&k(e),t&&t.d(s)}}}function ig(n){let e;function t(l,o){return l[4]?F8:l[5]?N8:P8}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function P8(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function N8(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Et(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function F8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function sg(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function R8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[I8,A8],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[7]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=Y(u,"submit",Ze(n[16])),m=!0)},p(T,$){(!g||$&128)&&le(o,T[7]);let O=d;d=C(T),d===O?S[d].p(T,$):(re(),I(S[O],1,1,()=>{S[O]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){I(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function q8(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[R8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}const j8="s3_test_request";function H8(n,e,t){let i,s,l;Ge(n,Nt,O=>t(7,l=O)),an(Nt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await ce.settings.getAll()||{};g(O)}catch(O){ce.error(O)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{ce.cancelRequest(j8);const O=await ce.settings.update(j.filterRedactedProps(r));ln({}),await g(O),Ia(),c?Zy("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(O){ce.error(O)}t(3,u=!1)}}async function g(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function m(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){f=O,t(4,f)}function S(O){c=O,t(5,c)}const C=()=>m(),T=()=>h(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,m,i,_,y,S,C,T,$]}class V8 extends ve{constructor(e){super(),be(this,e,H8,q8,ge,{})}}function z8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function B8(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=W("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),de(l,n[1].clientId),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(l,"id",o),c&2&&r!==(r=f[1].enabled)&&(l.required=r),c&2&&l.value!==f[1].clientId&&de(l,f[1].clientId)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function U8(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new fu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=W("Client secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,_e(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function lg(n){let e,t,i,s;const l=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(u){n[14](u)}var r=n[3].optionsComponent;function a(u,f){let c={};if(f!==void 0&&f&8)c=_t(l,[{key:u[3].key},Dt(u[3].optionsComponentProps||{})]);else for(let d=0;dhe(t,"config",o))),{c(){e=v("div"),t&&z(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&H(t,e,null),s=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}r?(t=Pt(r,a(u,f)),te.push(()=>he(t,"config",o)),z(t.$$.fragment),A(t.$$.fragment,1),H(t,e,null)):t=null}else if(r){const c=f&8?_t(l,[{key:u[3].key},Dt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],_e(()=>i=!1)),t.$set(c)}},i(u){s||(t&&A(t.$$.fragment,u),s=!0)},o(u){t&&I(t.$$.fragment,u),s=!1},d(u){u&&k(e),t&&V(t)}}}function W8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new me({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[z8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[B8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[U8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}});let g=n[3].optionsComponent&&lg(n);return{c(){e=v("form"),t=v("div"),z(i.$$.fragment),s=E(),l=v("button"),l.innerHTML='Clear all fields',o=E(),z(r.$$.fragment),a=E(),z(u.$$.fragment),f=E(),g&&g.c(),p(l,"type","button"),p(l,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(m,_){w(m,e,_),b(e,t),H(i,t,null),b(t,s),b(t,l),b(e,o),H(r,e,null),b(e,a),H(u,e,null),b(e,f),g&&g.m(e,null),c=!0,d||(h=[Y(l,"click",n[8]),Y(e,"submit",Ze(n[15]))],d=!0)},p(m,_){const y={};_&8&&(y.name=m[3].key+".enabled"),_&3145730&&(y.$$scope={dirty:_,ctx:m}),i.$set(y);const S={};_&2&&(S.class="form-field "+(m[1].enabled?"required":"")),_&8&&(S.name=m[3].key+".clientId"),_&3145730&&(S.$$scope={dirty:_,ctx:m}),r.$set(S);const C={};_&2&&(C.class="form-field "+(m[1].enabled?"required":"")),_&8&&(C.name=m[3].key+".clientSecret"),_&3145730&&(C.$$scope={dirty:_,ctx:m}),u.$set(C),m[3].optionsComponent?g?(g.p(m,_),_&8&&A(g,1)):(g=lg(m),g.c(),A(g,1),g.m(e,null)):g&&(re(),I(g,1,1,()=>{g=null}),ae())},i(m){c||(A(i.$$.fragment,m),A(r.$$.fragment,m),A(u.$$.fragment,m),A(g),c=!0)},o(m){I(i.$$.fragment,m),I(r.$$.fragment,m),I(u.$$.fragment,m),I(g),c=!1},d(m){m&&k(e),V(i),V(r),V(u),g&&g.d(),d=!1,$e(h)}}}function Y8(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=v("h4"),i=W(t),s=W(" provider"),p(e,"class","center txt-break")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&le(i,t)},d(l){l&&k(e)}}}function K8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=W("Close"),i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function J8(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[K8],header:[Y8],default:[W8]},$$scope:{ctx:n}};return e=new on({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[16](null),V(e,s)}}}function G8(n,e,t){let i;const s=dt(),l="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function c(M,D){ln({}),t(3,r=Object.assign({},M)),t(1,a=Object.assign({enabled:!0},D)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function h(){t(4,u=!0);try{const M={};M[r.key]=j.filterRedactedProps(a);const D=await ce.settings.update(M);ln({}),zt("Successfully updated provider settings."),s("submit",D),d()}catch(M){ce.error(M)}t(4,u=!1)}function g(){for(let M in a)t(1,a[M]="",a);t(1,a.enabled=!1,a)}function m(){a.enabled=this.checked,t(1,a)}function _(){a.clientId=this.value,t(1,a)}function y(M){n.$$.not_equal(a.clientSecret,M)&&(a.clientSecret=M,t(1,a))}function S(M){a=M,t(1,a)}const C=()=>h();function T(M){te[M?"unshift":"push"](()=>{o=M,t(2,o)})}function $(M){Fe.call(this,n,M)}function O(M){Fe.call(this,n,M)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,l,h,g,c,f,m,_,y,S,C,T,$,O]}class Z8 extends ve{constructor(e){super(),be(this,e,G8,J8,ge,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function og(n){let e,t,i;return{c(){e=v("img"),un(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&2&&!un(e.src,t="./images/oauth2/"+s[1].logo)&&p(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&p(e,"alt",i)},d(s){s&&k(e)}}}function rg(n){let e;return{c(){e=v("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function X8(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,h,g,m,_,y,S,C,T,$=n[1].logo&&og(n),O=n[0].enabled&&rg(),M={};return y=new Z8({props:M}),n[4](y),y.$on("submit",n[5]),{c(){e=v("div"),t=v("figure"),$&&$.c(),i=E(),s=v("div"),o=W(l),r=E(),a=v("em"),u=W("("),c=W(f),d=W(")"),h=E(),O&&O.c(),g=E(),m=v("button"),m.innerHTML='',_=E(),z(y.$$.fragment),p(t,"class","provider-logo"),p(s,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(m,"type","button"),p(m,"class","btn btn-circle btn-hint btn-transparent"),p(m,"aria-label","Provider settings"),p(e,"class","provider-card")},m(D,L){w(D,e,L),b(e,t),$&&$.m(t,null),b(e,i),b(e,s),b(s,o),b(e,r),b(e,a),b(a,u),b(a,c),b(a,d),b(e,h),O&&O.m(e,null),b(e,g),b(e,m),w(D,_,L),H(y,D,L),S=!0,C||(T=Y(m,"click",n[3]),C=!0)},p(D,[L]){D[1].logo?$?$.p(D,L):($=og(D),$.c(),$.m(t,null)):$&&($.d(1),$=null),(!S||L&2)&&l!==(l=D[1].title+"")&&le(o,l),(!S||L&2)&&f!==(f=D[1].key.slice(0,-4)+"")&&le(c,f),D[0].enabled?O||(O=rg(),O.c(),O.m(e,g)):O&&(O.d(1),O=null);const N={};y.$set(N)},i(D){S||(A(y.$$.fragment,D),S=!0)},o(D){I(y.$$.fragment,D),S=!1},d(D){D&&(k(e),k(_)),$&&$.d(),O&&O.d(),n[4](null),V(y,D),C=!1,T()}}}function Q8(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class Y1 extends ve{constructor(e){super(),be(this,e,Q8,X8,ge,{provider:1,config:0})}}function ag(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function ug(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function x8(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=pe(n[3]);const c=m=>m[9].key;for(let m=0;m0&&n[2].length>0&&cg(),h=pe(n[2]);const g=m=>m[9].key;for(let m=0;m0&&m[2].length>0?d||(d=cg(),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null),_&5&&(h=pe(m[2]),re(),r=gt(r,_,g,1,m,h,a,o,Rt,dg,null,ag),ae())},i(m){if(!u){for(let _=0;_he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!s&&f&9&&(s=!0,c.config=e[0][e[9].key],_e(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&k(t),V(i)}}}function cg(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dg(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new Y1({props:a}),te.push(()=>he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!s&&f&5&&(s=!0,c.config=e[0][e[9].key],_e(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&k(t),V(i)}}}function tI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;const m=[eI,x8],_=[];function y(S,C){return S[1]?0:1}return d=y(n),h=_[d]=m[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[4]),r=E(),a=v("div"),u=v("div"),f=v("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(a,"class","wrapper")},m(S,C){w(S,e,C),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(S,r,C),w(S,a,C),b(a,u),b(u,f),b(u,c),_[d].m(u,null),g=!0},p(S,C){(!g||C&16)&&le(o,S[4]);let T=d;d=y(S),d===T?_[d].p(S,C):(re(),I(_[T],1,1,()=>{_[T]=null}),ae(),h=_[d],h?h.p(S,C):(h=_[d]=m[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){I(h),g=!1},d(S){S&&(k(e),k(r),k(a)),_[d].d()}}}function nI(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[tI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function iI(n,e,t){let i,s,l;Ge(n,Nt,d=>t(4,l=d)),an(Nt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ce.settings.getAll()||{};u(d)}catch(d){ce.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const h of mo)t(0,r[h.key]=Object.assign({enabled:!1},d[h.key]),r)}function f(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}function c(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=mo.filter(d=>{var h;return(h=r[d.key])==null?void 0:h.enabled})),n.$$.dirty&1&&t(2,s=mo.filter(d=>{var h;return!((h=r[d.key])!=null&&h.enabled)}))},[r,o,s,i,l,f,c]}class sI extends ve{constructor(e){super(),be(this,e,iI,nI,ge,{})}}function lI(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=W(n[3]),i=W(" duration (in seconds)"),l=E(),o=v("input"),a=E(),u=v("div"),f=v("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),Q(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(h,g){w(h,e,g),b(e,t),b(e,i),w(h,l,g),w(h,o,g),de(o,n[0]),w(h,a,g),w(h,u,g),b(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(h,g){g&8&&le(t,h[3]),g&64&&s!==(s=h[6])&&p(e,"for",s),g&64&&r!==(r=h[6])&&p(o,"id",r),g&1&&yt(o.value)!==h[0]&&de(o,h[0]),g&2&&Q(f,"txt-success",!!h[1])},d(h){h&&(k(e),k(l),k(o),k(a),k(u)),c=!1,$e(d)}}}function oI(n){let e,t;return e=new me({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[lI,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rI(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=yt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class K1 extends ve{constructor(e){super(),be(this,e,rI,oI,ge,{key:2,label:3,duration:0,secret:1})}}function pg(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function hg(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function aI(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],c=new Map,d,h,g,m,_,y,S,C,T,$,O,M=pe(n[5]);const D=F=>F[19].key;for(let F=0;FF[19].key;for(let F=0;Fhe(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&33&&(s=!0,d.duration=e[0][e[19].key].duration,_e(()=>s=!1)),!l&&c&33&&(l=!0,d.secret=e[0][e[19].key].secret,_e(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&k(t),V(i,f)}}}function gg(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new K1({props:u}),te.push(()=>he(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&65&&(s=!0,d.duration=e[0][e[19].key].duration,_e(()=>s=!1)),!l&&c&65&&(l=!0,d.secret=e[0][e[19].key].secret,_e(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&k(t),V(i,f)}}}function _g(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function fI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[uI,aI],S=[];function C(T,$){return T[1]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[4]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Adjust common token options.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=Y(u,"submit",Ze(n[7])),m=!0)},p(T,$){(!g||$&16)&&le(o,T[4]);let O=d;d=C(T),d===O?S[d].p(T,$):(re(),I(S[O],1,1,()=>{S[O]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){I(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function cI(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[fI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function dI(n,e,t){let i,s,l;Ge(n,Nt,O=>t(4,l=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];an(Nt,l="Token options",l);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const O=await ce.settings.getAll()||{};g(O)}catch(O){ce.error(O)}t(1,f=!1)}async function h(){if(!(c||!s)){t(2,c=!0);try{const O=await ce.settings.update(j.filterRedactedProps(u));g(O),zt("Successfully saved tokens options.")}catch(O){ce.error(O)}t(2,c=!1)}}function g(O){var D;O=O||{},t(0,u={});const M=o.concat(r);for(const L of M)t(0,u[L.key]={duration:((D=O[L.key])==null?void 0:D.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function m(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function _(O,M){n.$$.not_equal(u[M.key].duration,O)&&(u[M.key].duration=O,t(0,u))}function y(O,M){n.$$.not_equal(u[M.key].secret,O)&&(u[M.key].secret=O,t(0,u))}function S(O,M){n.$$.not_equal(u[M.key].duration,O)&&(u[M.key].duration=O,t(0,u))}function C(O,M){n.$$.not_equal(u[M.key].secret,O)&&(u[M.key].secret=O,t(0,u))}const T=()=>m(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,c,s,l,o,r,h,m,a,i,_,y,S,C,T,$]}class pI extends ve{constructor(e){super(),be(this,e,dI,cI,ge,{})}}function hI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return o=new L1({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`

    Below you'll find your current collections configuration that you could import in + another PocketBase environment.

    `,t=E(),i=v("div"),s=v("button"),s.innerHTML='Copy',l=E(),z(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),b(i,s),b(i,l),H(o,i,null),n[8](i),w(m,r,_),w(m,a,_),b(a,u),b(a,f),b(a,c),d=!0,h||(g=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],h=!0)},p(m,_){const y={};_&4&&(y.content=m[2]),o.$set(y)},i(m){d||(A(o.$$.fragment,m),d=!0)},o(m){I(o.$$.fragment,m),d=!1},d(m){m&&(k(e),k(t),k(i),k(r),k(a)),V(o),n[8](null),h=!1,$e(g)}}}function mI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function gI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[mI,hI],g=[];function m(_,y){return _[1]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[3]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&le(o,_[3]);let S=f;f=m(_),f===S?g[f].p(_,y):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function _I(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[gI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function bI(n,e,t){let i,s;Ge(n,Nt,_=>t(3,s=_)),an(Nt,s="Export collections",s);const l="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ce.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){ce.error(_)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),ko("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},m=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,m]}class vI extends ve{constructor(e){super(),be(this,e,bI,_I,ge,{})}}function bg(n,e,t){const i=n.slice();return i[14]=e[t],i}function vg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function yg(n,e,t){const i=n.slice();return i[14]=e[t],i}function kg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function wg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Sg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Tg(n,e,t){const i=n.slice();return i[30]=e[t],i}function yI(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Cg(),a=n[0].name!==n[1].name&&$g(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=W(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=Cg(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=$g(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function kI(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=E(),i=v("strong"),l=W(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function wI(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=E(),i=v("strong"),l=W(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function Cg(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $g(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=W(t),s=E(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),b(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&(k(e),k(s),k(l))}}}function Mg(n){var g,m;let e,t,i,s,l,o,r=n[12]((g=n[0])==null?void 0:g[n[30]])+"",a,u,f,c,d=n[12]((m=n[1])==null?void 0:m[n[30]])+"",h;return{c(){var _,y,S,C,T,$;e=v("tr"),t=v("td"),i=v("span"),i.textContent=`${n[30]}`,s=E(),l=v("td"),o=v("pre"),a=W(r),u=E(),f=v("td"),c=v("pre"),h=W(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(l,"class","svelte-lmkr38"),Q(l,"changed-old-col",!n[10]&&yn((_=n[0])==null?void 0:_[n[30]],(y=n[1])==null?void 0:y[n[30]])),Q(l,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),Q(f,"changed-new-col",!n[5]&&yn((S=n[0])==null?void 0:S[n[30]],(C=n[1])==null?void 0:C[n[30]])),Q(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",yn((T=n[0])==null?void 0:T[n[30]],($=n[1])==null?void 0:$[n[30]]))},m(_,y){w(_,e,y),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(o,a),b(e,u),b(e,f),b(f,c),b(c,h)},p(_,y){var S,C,T,$,O,M,D,L;y[0]&1&&r!==(r=_[12]((S=_[0])==null?void 0:S[_[30]])+"")&&le(a,r),y[0]&3075&&Q(l,"changed-old-col",!_[10]&&yn((C=_[0])==null?void 0:C[_[30]],(T=_[1])==null?void 0:T[_[30]])),y[0]&1024&&Q(l,"changed-none-col",_[10]),y[0]&2&&d!==(d=_[12](($=_[1])==null?void 0:$[_[30]])+"")&&le(h,d),y[0]&2083&&Q(f,"changed-new-col",!_[5]&&yn((O=_[0])==null?void 0:O[_[30]],(M=_[1])==null?void 0:M[_[30]])),y[0]&32&&Q(f,"changed-none-col",_[5]),y[0]&2051&&Q(e,"txt-primary",yn((D=_[0])==null?void 0:D[_[30]],(L=_[1])==null?void 0:L[_[30]]))},d(_){_&&k(e)}}}function Og(n){let e,t=pe(n[6]),i=[];for(let s=0;sProps Old New',l=E(),o=v("tbody");for(let T=0;T!["schema","created","updated"].includes(y));function m(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(S=>y.id==S.id))))}function _(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&m(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,_]}class CI extends ve{constructor(e){super(),be(this,e,TI,SI,ge,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Fg(n,e,t){const i=n.slice();return i[17]=e[t],i}function Rg(n){let e,t;return e=new CI({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $I(n){let e,t,i=pe(n[2]),s=[];for(let o=0;oI(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await de.collections.import(o,a),zt("Successfully imported collections configuration."),i("submit")}catch(T){de.error(T)}t(4,u=!1),c()}}const m=()=>h(),_=()=>!u;function y(T){te[T?"unshift":"push"](()=>{s=T,t(1,s)})}function S(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,m,_,y,S,C]}class RI extends be{constructor(e){super(),_e(this,e,FI,NI,ge,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function jg(n,e,t){const i=n.slice();return i[32]=e[t],i}function Hg(n,e,t){const i=n.slice();return i[35]=e[t],i}function Vg(n,e,t){const i=n.slice();return i[32]=e[t],i}function qI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[HI,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let D=!1,L=n[6]&&n[1].length&&!n[7]&&Bg(),N=n[6]&&n[1].length&&n[7]&&Ug(n),P=n[13].length&&t_(n),F=!!n[0]&&n_(n);return{c(){e=v("input"),t=E(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or - `),o=v("button"),o.innerHTML='Load from JSON file',r=E(),z(a.$$.fragment),u=E(),f=E(),L&&L.c(),c=E(),N&&N.c(),d=E(),P&&P.c(),h=E(),g=v("div"),F&&F.c(),m=E(),_=v("div"),y=E(),S=v("button"),C=v("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p(C,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=T=!n[14],p(g,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),b(i,s),b(s,l),b(s,o),w(R,r,q),H(a,R,q),w(R,u,q),w(R,f,q),L&&L.m(R,q),w(R,c,q),N&&N.m(R,q),w(R,d,q),P&&P.m(R,q),w(R,h,q),w(R,g,q),F&&F.m(g,null),b(g,m),b(g,_),b(g,y),b(g,S),b(S,C),$=!0,O||(M=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(S,"click",n[26])],O=!0)},p(R,q){(!$||q[0]&4096)&&Q(o,"btn-loading",R[12]);const B={};q[0]&64&&(B.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(B.$$scope={dirty:q,ctx:R}),a.$set(B),R[6]&&R[1].length&&!R[7]?L||(L=Bg(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),R[6]&&R[1].length&&R[7]?N?N.p(R,q):(N=Ug(R),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),R[13].length?P?P.p(R,q):(P=t_(R),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),R[0]?F?F.p(R,q):(F=n_(R),F.c(),F.m(g,m)):F&&(F.d(1),F=null),(!$||q[0]&16384&&T!==(T=!R[14]))&&(S.disabled=T)},i(R){$||(A(a.$$.fragment,R),A(D),$=!0)},o(R){I(a.$$.fragment,R),I(D),$=!1},d(R){R&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(h),k(g)),n[19](null),V(a,R),L&&L.d(R),N&&N.d(R),P&&P.d(R),F&&F.d(),O=!1,$e(M)}}}function jI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function zg(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function HI(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&zg();return{c(){e=v("label"),t=U("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=ye(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ce(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=Y(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&ce(l,d[0]),d[0]&&!d[6]?c||(c=zg(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function Bg(n){let e;return{c(){e=v("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ug(n){let e,t,i,s,l,o=n[9].length&&Wg(n),r=n[4].length&&Jg(n),a=n[8].length&&Qg(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Wg(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Jg(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Qg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(k(e),k(t),k(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Wg(n){let e=[],t=new Map,i,s=pe(n[9]);const l=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=E(),s=v("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are +- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await ce.collections.import(o,a),zt("Successfully imported collections configuration."),i("submit")}catch(T){ce.error(T)}t(4,u=!1),c()}}const m=()=>h(),_=()=>!u;function y(T){te[T?"unshift":"push"](()=>{s=T,t(1,s)})}function S(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,m,_,y,S,C]}class AI extends ve{constructor(e){super(),be(this,e,DI,EI,ge,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function qg(n,e,t){const i=n.slice();return i[32]=e[t],i}function jg(n,e,t){const i=n.slice();return i[35]=e[t],i}function Hg(n,e,t){const i=n.slice();return i[32]=e[t],i}function II(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[PI,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let D=!1,L=n[6]&&n[1].length&&!n[7]&&zg(),N=n[6]&&n[1].length&&n[7]&&Bg(n),P=n[13].length&&e_(n),F=!!n[0]&&t_(n);return{c(){e=v("input"),t=E(),i=v("div"),s=v("p"),l=W(`Paste below the collections configuration you want to import or + `),o=v("button"),o.innerHTML='Load from JSON file',r=E(),z(a.$$.fragment),u=E(),f=E(),L&&L.c(),c=E(),N&&N.c(),d=E(),P&&P.c(),h=E(),g=v("div"),F&&F.c(),m=E(),_=v("div"),y=E(),S=v("button"),C=v("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p(C,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=T=!n[14],p(g,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),b(i,s),b(s,l),b(s,o),w(R,r,q),H(a,R,q),w(R,u,q),w(R,f,q),L&&L.m(R,q),w(R,c,q),N&&N.m(R,q),w(R,d,q),P&&P.m(R,q),w(R,h,q),w(R,g,q),F&&F.m(g,null),b(g,m),b(g,_),b(g,y),b(g,S),b(S,C),$=!0,O||(M=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(S,"click",n[26])],O=!0)},p(R,q){(!$||q[0]&4096)&&Q(o,"btn-loading",R[12]);const B={};q[0]&64&&(B.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(B.$$scope={dirty:q,ctx:R}),a.$set(B),R[6]&&R[1].length&&!R[7]?L||(L=zg(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),R[6]&&R[1].length&&R[7]?N?N.p(R,q):(N=Bg(R),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),R[13].length?P?P.p(R,q):(P=e_(R),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),R[0]?F?F.p(R,q):(F=t_(R),F.c(),F.m(g,m)):F&&(F.d(1),F=null),(!$||q[0]&16384&&T!==(T=!R[14]))&&(S.disabled=T)},i(R){$||(A(a.$$.fragment,R),A(D),$=!0)},o(R){I(a.$$.fragment,R),I(D),$=!1},d(R){R&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(h),k(g)),n[19](null),V(a,R),L&&L.d(R),N&&N.d(R),P&&P.d(R),F&&F.d(),O=!1,$e(M)}}}function LI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Vg(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function PI(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Vg();return{c(){e=v("label"),t=W("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=ye(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),de(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=Y(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&de(l,d[0]),d[0]&&!d[6]?c||(c=Vg(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function zg(n){let e;return{c(){e=v("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bg(n){let e,t,i,s,l,o=n[9].length&&Ug(n),r=n[4].length&&Kg(n),a=n[8].length&&Xg(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Ug(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Kg(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Xg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(k(e),k(t),k(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Ug(n){let e=[],t=new Map,i,s=pe(n[9]);const l=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=E(),s=v("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,l=E(),o=v("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:x,d(u){u&&k(e),r=!1,a()}}}function n_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function VI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[jI,qI],g=[];function m(_,y){return _[5]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[15]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&le(o,_[15]);let S=f;f=m(_),f===S?g[f].p(_,y):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function zI(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{default:[VI]},$$scope:{ctx:n}}});let r={};return l=new RI({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[27](null),V(l,a)}}}function BI(n,e,t){let i,s,l,o,r,a,u;Ge(n,Nt,W=>t(15,u=W)),an(Nt,u="Import collections",u);let f,c,d="",h=!1,g=[],m=[],_=!0,y=[],S=!1;C();async function C(){t(5,S=!0);try{t(2,m=await de.collections.getFullList(200));for(let W of m)delete W.created,delete W.updated}catch(W){de.error(W)}t(5,S=!1)}function T(){if(t(4,y=[]),!!i)for(let W of g){const oe=j.findByKey(m,"id",W.id);!(oe!=null&&oe.id)||!j.hasCollectionChanges(oe,W,_)||y.push({new:W,old:oe})}}function $(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=j.filterDuplicatesByKey(g)):t(1,g=[]);for(let W of g)delete W.created,delete W.updated,W.schema=j.filterDuplicatesByKey(W.schema)}function O(){var W,oe;for(let ee of g){const se=j.findByKey(m,"name",ee.name)||j.findByKey(m,"id",ee.id);if(!se)continue;const Ee=ee.id,Re=se.id;ee.id=Re;const Ve=Array.isArray(se.schema)?se.schema:[],We=Array.isArray(ee.schema)?ee.schema:[];for(const ke of We){const Me=j.findByKey(Ve,"name",ke.name);Me&&Me.id&&(ke.id=Me.id)}for(let ke of g)if(Array.isArray(ke.schema))for(let Me of ke.schema)(W=Me.options)!=null&&W.collectionId&&((oe=Me.options)==null?void 0:oe.collectionId)===Ee&&(Me.options.collectionId=Re)}t(0,d=JSON.stringify(g,null,4))}function M(W){t(12,h=!0);const oe=new FileReader;oe.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,d=ee.target.result),await sn(),g.length||(Ci("Invalid collections configuration."),D())},oe.onerror=ee=>{console.warn(ee),Ci("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},oe.readAsText(W)}function D(){t(0,d=""),t(10,f.value="",f),ln({})}function L(W){te[W?"unshift":"push"](()=>{f=W,t(10,f)})}const N=()=>{f.files.length&&M(f.files[0])},P=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const q=()=>O(),B=()=>D(),G=()=>c==null?void 0:c.show(m,g,_);function X(W){te[W?"unshift":"push"](()=>{c=W,t(11,c)})}const J=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&$(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(W=>!!W.id&&!!W.name).length),n.$$.dirty[0]&78&&t(9,s=m.filter(W=>i&&_&&!j.findByKey(g,"id",W.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(W=>i&&!j.findByKey(m,"id",W.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof _<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(W=>{let oe=j.findByKey(m,"name",W.name)||j.findByKey(m,"id",W.id);if(!oe)return!1;if(oe.id!=W.id)return!0;const ee=Array.isArray(oe.schema)?oe.schema:[],se=Array.isArray(W.schema)?W.schema:[];for(const Ee of se){if(j.findByKey(ee,"id",Ee.id))continue;const Ve=j.findByKey(ee,"name",Ee.name);if(Ve&&Ee.id!=Ve.id)return!0}return!1}))},[d,g,m,_,y,S,i,o,l,s,f,c,h,a,r,u,O,M,D,L,N,P,F,R,q,B,G,X,J]}class UI extends be{constructor(e){super(),_e(this,e,BI,zI,ge,{},null,[-1,-1])}}function WI(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),r=E(),a=v("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ce(l,n[2]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(l,"id",o),d&4&&l.value!==c[2]&&ce(l,c[2])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function YI(n){let e,t,i,s,l,o,r;return s=new me({props:{class:"form-field m-0",name:"name",$$slots:{default:[WI,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + to.`,l=E(),o=v("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:x,d(u){u&&k(e),r=!1,a()}}}function t_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function NI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[LI,II],g=[];function m(_,y){return _[5]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[15]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&le(o,_[15]);let S=f;f=m(_),f===S?g[f].p(_,y):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function FI(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{default:[NI]},$$scope:{ctx:n}}});let r={};return l=new AI({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[27](null),V(l,a)}}}function RI(n,e,t){let i,s,l,o,r,a,u;Ge(n,Nt,U=>t(15,u=U)),an(Nt,u="Import collections",u);let f,c,d="",h=!1,g=[],m=[],_=!0,y=[],S=!1;C();async function C(){t(5,S=!0);try{t(2,m=await ce.collections.getFullList(200));for(let U of m)delete U.created,delete U.updated}catch(U){ce.error(U)}t(5,S=!1)}function T(){if(t(4,y=[]),!!i)for(let U of g){const oe=j.findByKey(m,"id",U.id);!(oe!=null&&oe.id)||!j.hasCollectionChanges(oe,U,_)||y.push({new:U,old:oe})}}function $(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=j.filterDuplicatesByKey(g)):t(1,g=[]);for(let U of g)delete U.created,delete U.updated,U.schema=j.filterDuplicatesByKey(U.schema)}function O(){var U,oe;for(let ee of g){const se=j.findByKey(m,"name",ee.name)||j.findByKey(m,"id",ee.id);if(!se)continue;const Ee=ee.id,Re=se.id;ee.id=Re;const Ve=Array.isArray(se.schema)?se.schema:[],We=Array.isArray(ee.schema)?ee.schema:[];for(const ke of We){const Me=j.findByKey(Ve,"name",ke.name);Me&&Me.id&&(ke.id=Me.id)}for(let ke of g)if(Array.isArray(ke.schema))for(let Me of ke.schema)(U=Me.options)!=null&&U.collectionId&&((oe=Me.options)==null?void 0:oe.collectionId)===Ee&&(Me.options.collectionId=Re)}t(0,d=JSON.stringify(g,null,4))}function M(U){t(12,h=!0);const oe=new FileReader;oe.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,d=ee.target.result),await sn(),g.length||(Ci("Invalid collections configuration."),D())},oe.onerror=ee=>{console.warn(ee),Ci("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},oe.readAsText(U)}function D(){t(0,d=""),t(10,f.value="",f),ln({})}function L(U){te[U?"unshift":"push"](()=>{f=U,t(10,f)})}const N=()=>{f.files.length&&M(f.files[0])},P=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const q=()=>O(),B=()=>D(),G=()=>c==null?void 0:c.show(m,g,_);function X(U){te[U?"unshift":"push"](()=>{c=U,t(11,c)})}const J=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&$(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(U=>!!U.id&&!!U.name).length),n.$$.dirty[0]&78&&t(9,s=m.filter(U=>i&&_&&!j.findByKey(g,"id",U.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(U=>i&&!j.findByKey(m,"id",U.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof _<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(U=>{let oe=j.findByKey(m,"name",U.name)||j.findByKey(m,"id",U.id);if(!oe)return!1;if(oe.id!=U.id)return!0;const ee=Array.isArray(oe.schema)?oe.schema:[],se=Array.isArray(U.schema)?U.schema:[];for(const Ee of se){if(j.findByKey(ee,"id",Ee.id))continue;const Ve=j.findByKey(ee,"name",Ee.name);if(Ve&&Ee.id!=Ve.id)return!0}return!1}))},[d,g,m,_,y,S,i,o,l,s,f,c,h,a,r,u,O,M,D,L,N,P,F,R,q,B,G,X,J]}class qI extends ve{constructor(e){super(),be(this,e,RI,FI,ge,{},null,[-1,-1])}}function jI(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=W("Backup name"),s=E(),l=v("input"),r=E(),a=v("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),de(l,n[2]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(l,"id",o),d&4&&l.value!==c[2]&&de(l,c[2])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function HI(n){let e,t,i,s,l,o,r;return s=new me({props:{class:"form-field m-0",name:"name",$$slots:{default:[jI,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the database will be temporary "locked" (this usually happens only during the ZIP generation).

    If you are using S3 storage for the collections file upload, you'll have to backup them - separately since they are not locally stored and will not be included in the final backup!

    `,t=E(),i=v("form"),z(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),H(s,i,null),l=!0,o||(r=Y(i,"submit",Ze(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){I(s.$$.fragment,a),l=!1},d(a){a&&(k(e),k(t),k(i)),V(s),o=!1,r()}}}function KI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function JI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(s)),o=!1,r()}}}function GI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[JI],header:[KI],default:[YI]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function ZI(n,e,t){const i=dt(),s="backup_create_"+j.randomString(5);let l,o="",r=!1,a;function u(S){ln({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await de.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),zt("Successfully generated new backup.")}catch(S){S.isAbort||de.error(S)}clearTimeout(a),t(3,r=!1)}}Ls(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const h=()=>r?(yo("A backup has already been started, please wait."),!1):!0,g=()=>(r&&yo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function m(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return[f,l,o,r,s,c,u,d,h,g,m,_,y]}class XI extends be{constructor(e){super(),_e(this,e,ZI,GI,ge,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function QI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[2]),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(l,"id",o),f&4&&l.value!==u[2]&&ce(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function xI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;return u=new js({props:{value:n[1]}}),h=new me({props:{class:"form-field required m-0",name:"name",$$slots:{default:[QI,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please proceed with caution. + separately since they are not locally stored and will not be included in the final backup!

    `,t=E(),i=v("form"),z(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),H(s,i,null),l=!0,o||(r=Y(i,"submit",Ze(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){I(s.$$.fragment,a),l=!1},d(a){a&&(k(e),k(t),k(i)),V(s),o=!1,r()}}}function VI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(s)),o=!1,r()}}}function BI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[zI],header:[VI],default:[HI]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function UI(n,e,t){const i=dt(),s="backup_create_"+j.randomString(5);let l,o="",r=!1,a;function u(S){ln({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await ce.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),zt("Successfully generated new backup.")}catch(S){S.isAbort||ce.error(S)}clearTimeout(a),t(3,r=!1)}}Ps(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const h=()=>r?(ko("A backup has already been started, please wait."),!1):!0,g=()=>(r&&ko("The backup was started but may take a while to complete. You can come back later.",4500),!0);function m(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return[f,l,o,r,s,c,u,d,h,g,m,_,y]}class WI extends ve{constructor(e){super(),be(this,e,UI,BI,ge,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function YI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[2]),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(l,"id",o),f&4&&l.value!==u[2]&&de(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function KI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;return u=new Hs({props:{value:n[1]}}),h=new me({props:{class:"form-field required m-0",name:"name",$$slots:{default:[YI,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please proceed with caution.
    Backup restore is still experimental and currently works only on UNIX based systems.

    The restore operation will attempt to replace your existing pb_data with the one from - the backup and will restart the application process.

    Nothing will happen if the backup file is invalid or incompatible.

    `,t=E(),i=v("div"),s=U(`Type the backup name - `),l=v("div"),o=v("span"),r=U(n[1]),a=E(),z(u.$$.fragment),f=U(` - to confirm:`),c=E(),d=v("form"),z(h.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),H(u,l,null),b(i,f),w(y,c,S),w(y,d,S),H(h,d,null),g=!0,m||(_=Y(d,"submit",Ze(n[7])),m=!0)},p(y,S){(!g||S&2)&&le(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:y}),h.$set(T)},i(y){g||(A(u.$$.fragment,y),A(h.$$.fragment,y),g=!0)},o(y){I(u.$$.fragment,y),I(h.$$.fragment,y),g=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),V(u),V(h),m=!1,_()}}}function eL(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&le(s,l[1])},d(l){l&&k(e)}}}function tL(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function nL(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[tL],header:[eL],default:[xI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function iL(n,e,t){let i;const s="backup_restore_"+j.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){ln({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await de.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),Ci(((S=C.response)==null?void 0:S.message)||C.message))}}}Ls(()=>{clearTimeout(u)});function h(){r=this.value,t(2,r)}const g=()=>!a;function m(S){te[S?"unshift":"push"](()=>{l=S,t(3,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,h,g,m,_,y]}class sL extends be{constructor(e){super(),_e(this,e,iL,nL,ge,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function i_(n,e,t){const i=n.slice();return i[22]=e[t],i}function s_(n,e,t){const i=n.slice();return i[19]=e[t],i}function lL(n){let e=[],t=new Map,i,s,l=pe(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function o_(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d,h=j.formattedFileSize(e[22].size)+"",g,m,_,y,S,C,T,$,O,M,D,L,N,P,F,R,q,B,G,X;function J(){return e[10](e[22])}function W(){return e[11](e[22])}function oe(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=E(),l=v("div"),o=v("span"),a=U(r),f=E(),c=v("span"),d=U("("),g=U(h),m=U(")"),_=E(),y=v("div"),S=v("button"),C=v("i"),$=E(),O=v("button"),M=v("i"),L=E(),N=v("button"),P=v("i"),R=E(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(C,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),Q(S,"btn-loading",e[5][e[22].key]),p(M,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=D=e[6][e[22].key],p(O,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(N,"type","button"),p(N,"class","btn btn-sm btn-circle btn-hint btn-transparent"),N.disabled=F=e[6][e[22].key],p(N,"aria-label","Delete"),Q(N,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,se){w(ee,t,se),b(t,i),b(t,s),b(t,l),b(l,o),b(o,a),b(l,f),b(l,c),b(c,d),b(c,g),b(c,m),b(t,_),b(t,y),b(y,S),b(S,C),b(y,$),b(y,O),b(O,M),b(y,L),b(y,N),b(N,P),b(t,R),B=!0,G||(X=[Te(Be.call(null,S,"Download")),Y(S,"click",Ze(J)),Te(Be.call(null,O,"Restore")),Y(O,"click",Ze(W)),Te(Be.call(null,N,"Delete")),Y(N,"click",Ze(oe))],G=!0)},p(ee,se){e=ee,(!B||se&8)&&r!==(r=e[22].key+"")&&le(a,r),(!B||se&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||se&8)&&h!==(h=j.formattedFileSize(e[22].size)+"")&&le(g,h),(!B||se&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||se&40)&&Q(S,"btn-loading",e[5][e[22].key]),(!B||se&72&&D!==(D=e[6][e[22].key]))&&(O.disabled=D),(!B||se&72&&F!==(F=e[6][e[22].key]))&&(N.disabled=F),(!B||se&72)&&Q(N,"btn-loading",e[6][e[22].key])},i(ee){B||(ee&&xe(()=>{B&&(q||(q=He(t,lt,{duration:150},!0)),q.run(1))}),B=!0)},o(ee){ee&&(q||(q=He(t,lt,{duration:150},!1)),q.run(0)),B=!1},d(ee){ee&&k(t),ee&&q&&q.end(),G=!1,$e(X)}}}function r_(n){let e;return{c(){e=v("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rL(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function aL(n){let e,t,i;return{c(){e=v("i"),t=E(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function uL(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;const _=[oL,lL],y=[];function S(D,L){return D[4]?0:1}i=S(n),s=y[i]=_[i](n);function C(D,L){return D[7]?aL:rL}let T=C(n),$=T(n),O={};f=new XI({props:O}),n[14](f),f.$on("submit",n[15]);let M={};return d=new sL({props:M}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=E(),o=v("div"),r=v("button"),$.c(),u=E(),z(f.$$.fragment),c=E(),z(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(D,L){w(D,e,L),b(e,t),y[i].m(t,null),b(e,l),b(e,o),b(o,r),$.m(r,null),w(D,u,L),H(f,D,L),w(D,c,L),H(d,D,L),h=!0,g||(m=Y(r,"click",n[13]),g=!0)},p(D,[L]){let N=i;i=S(D),i===N?y[i].p(D,L):(re(),I(y[N],1,1,()=>{y[N]=null}),ae(),s=y[i],s?s.p(D,L):(s=y[i]=_[i](D),s.c()),A(s,1),s.m(t,null)),T!==(T=C(D))&&($.d(1),$=T(D),$&&($.c(),$.m(r,null))),(!h||L&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const P={};f.$set(P);const F={};d.$set(F)},i(D){h||(A(s),A(f.$$.fragment,D),A(d.$$.fragment,D),h=!0)},o(D){I(s),I(f.$$.fragment,D),I(d.$$.fragment,D),h=!1},d(D){D&&(k(e),k(u),k(c)),y[i].d(),$.d(),n[14](null),V(f,D),n[16](null),V(d,D),g=!1,m()}}}function fL(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,l=await de.backups.getFullList()),l.sort((O,M)=>O.modifiedM.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(de.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const M=await de.getAdminFileToken(),D=de.backups.getDownloadUrl(M,O);j.download(D)}catch(M){M.isAbort||de.error(M)}delete r[O],t(5,r)}}function d(O){_n(`Do you really want to delete ${O}?`,()=>h(O))}async function h(O){if(!a[O]){t(6,a[O]=!0,a);try{await de.backups.delete(O),j.removeByKey(l,"name",O),f(),zt(`Successfully deleted ${O}.`)}catch(M){M.isAbort||de.error(M)}delete a[O],t(6,a)}}async function g(){var O;try{const M=await de.health.check({$autoCancel:!1}),D=u;t(7,u=((O=M==null?void 0:M.data)==null?void 0:O.canBackup)||!1),D!=u&&u&&f()}catch{}}Kt(()=>{let O=setInterval(()=>{g()},3e3);return()=>{clearInterval(O)}});const m=O=>c(O.key),_=O=>s.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function C(O){te[O?"unshift":"push"](()=>{i=O,t(1,i)})}const T=()=>{f()};function $(O){te[O?"unshift":"push"](()=>{s=O,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,m,_,y,S,C,T,$]}class cL extends be{constructor(e){super(),_e(this,e,fL,uL,ge,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function dL(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("i"),s=E(),l=v("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),Q(e,"btn-loading",n[2]),Q(e,"btn-disabled",n[2]),p(l,"type","file"),p(l,"accept","application/zip"),p(l,"class","hidden")},m(a,u){w(a,e,u),b(e,t),w(a,s,u),w(a,l,u),n[5](l),o||(r=[Te(Be.call(null,e,"Upload backup")),Y(e,"click",n[4]),Y(l,"change",n[3])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&Q(e,"btn-loading",a[2]),u&5&&Q(e,"btn-disabled",a[2])},i:x,o:x,d(a){a&&(k(e),k(s),k(l)),n[5](null),o=!1,$e(r)}}}const a_="upload_backup";function pL(n,e,t){const i=dt();let{class:s=""}=e,l,o=!1;async function r(f){var d,h,g,m,_;if(o||!((h=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&h.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await de.backups.upload(c,{requestKey:a_}),t(2,o=!1),i("success"),zt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(_=(m=(g=y.response)==null?void 0:g.data)==null?void 0:m.file)!=null&&_.message?Ci(y.response.data.file.message):de.error(y))}}Ls(()=>{de.cancelRequest(a_)});const a=()=>l==null?void 0:l.click();function u(f){te[f?"unshift":"push"](()=>{l=f,t(1,l)})}return n.$$set=f=>{"class"in f&&t(0,s=f.class)},[s,l,o,r,a,u]}class hL extends be{constructor(e){super(),_e(this,e,pL,dL,ge,{class:0})}}function mL(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function gL(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function u_(n){var B,G,X;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M;t=new me({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[_L,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});let D=n[2]&&f_(n);function L(J){n[24](J)}function N(J){n[25](J)}function P(J){n[26](J)}let F={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(F.config=n[1].backups.s3),n[7]!==void 0&&(F.isTesting=n[7]),n[8]!==void 0&&(F.testError=n[8]),r=new Y1({props:F}),te.push(()=>he(r,"config",L)),te.push(()=>he(r,"isTesting",N)),te.push(()=>he(r,"testError",P));let R=((X=(G=n[1].backups)==null?void 0:G.s3)==null?void 0:X.enabled)&&!n[9]&&!n[5]&&c_(n),q=n[9]&&d_(n);return{c(){e=v("form"),z(t.$$.fragment),i=E(),D&&D.c(),s=E(),l=v("div"),o=E(),z(r.$$.fragment),c=E(),d=v("div"),h=v("div"),g=E(),R&&R.c(),m=E(),q&&q.c(),_=E(),y=v("button"),S=v("span"),S.textContent="Save changes",p(l,"class","clearfix m-b-base"),p(h,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=C=!n[9]||n[5],Q(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(J,W){w(J,e,W),H(t,e,null),b(e,i),D&&D.m(e,null),b(e,s),b(e,l),b(e,o),H(r,e,null),b(e,c),b(e,d),b(d,h),b(d,g),R&&R.m(d,null),b(d,m),q&&q.m(d,null),b(d,_),b(d,y),b(y,S),$=!0,O||(M=[Y(y,"click",n[28]),Y(e,"submit",Ze(n[11]))],O=!0)},p(J,W){var se,Ee,Re;const oe={};W[0]&4|W[1]&3&&(oe.$$scope={dirty:W,ctx:J}),t.$set(oe),J[2]?D?(D.p(J,W),W[0]&4&&A(D,1)):(D=f_(J),D.c(),A(D,1),D.m(e,s)):D&&(re(),I(D,1,1,()=>{D=null}),ae());const ee={};W[0]&1&&(ee.originalConfig=(se=J[0].backups)==null?void 0:se.s3),!a&&W[0]&2&&(a=!0,ee.config=J[1].backups.s3,ve(()=>a=!1)),!u&&W[0]&128&&(u=!0,ee.isTesting=J[7],ve(()=>u=!1)),!f&&W[0]&256&&(f=!0,ee.testError=J[8],ve(()=>f=!1)),r.$set(ee),(Re=(Ee=J[1].backups)==null?void 0:Ee.s3)!=null&&Re.enabled&&!J[9]&&!J[5]?R?R.p(J,W):(R=c_(J),R.c(),R.m(d,m)):R&&(R.d(1),R=null),J[9]?q?q.p(J,W):(q=d_(J),q.c(),q.m(d,_)):q&&(q.d(1),q=null),(!$||W[0]&544&&C!==(C=!J[9]||J[5]))&&(y.disabled=C),(!$||W[0]&32)&&Q(y,"btn-loading",J[5])},i(J){$||(A(t.$$.fragment,J),A(D),A(r.$$.fragment,J),J&&xe(()=>{$&&(T||(T=He(e,lt,{duration:150},!0)),T.run(1))}),$=!0)},o(J){I(t.$$.fragment,J),I(D),I(r.$$.fragment,J),J&&(T||(T=He(e,lt,{duration:150},!1)),T.run(0)),$=!1},d(J){J&&k(e),V(t),D&&D.d(),V(r),R&&R.d(),q&&q.d(),J&&T&&T.end(),O=!1,$e(M)}}}function _L(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function f_(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[vL,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[yL,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&2|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function bL(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Every day at 00:00h',t=E(),i=v("button"),i.innerHTML='Every sunday at 00:00h',s=E(),l=v("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=E(),r=v("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[19]),Y(i,"click",n[20]),Y(l,"click",n[21]),Y(r,"click",n[22])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function vL(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N;return m=new Pn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[bL]},$$scope:{ctx:n}}}),{c(){var P,F;e=v("label"),t=U("Cron expression"),s=E(),l=v("input"),a=E(),u=v("div"),f=v("button"),c=v("span"),c.textContent="Presets",d=E(),h=v("i"),g=E(),z(m.$$.fragment),_=E(),y=v("div"),S=v("p"),C=U(`Supports numeric list, steps, ranges or - `),T=v("span"),T.textContent="macros",$=U(`. - `),O=v("br"),M=U(` - The timezone is in UTC.`),p(e,"for",i=n[31]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((F=(P=n[0])==null?void 0:P.backups)!=null&&F.cron),p(c,"class","txt"),p(h,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(y,"class","help-block")},m(P,F){var R,q;w(P,e,F),b(e,t),w(P,s,F),w(P,l,F),ce(l,n[1].backups.cron),w(P,a,F),w(P,u,F),b(u,f),b(f,c),b(f,d),b(f,h),b(f,g),H(m,f,null),w(P,_,F),w(P,y,F),b(y,S),b(S,C),b(S,T),b(S,$),b(S,O),b(S,M),D=!0,(q=(R=n[0])==null?void 0:R.backups)!=null&&q.cron||l.focus(),L||(N=[Y(l,"input",n[18]),Te(Be.call(null,T,`@yearly + the backup and will restart the application process.

    Nothing will happen if the backup file is invalid or incompatible.

    `,t=E(),i=v("div"),s=W(`Type the backup name + `),l=v("div"),o=v("span"),r=W(n[1]),a=E(),z(u.$$.fragment),f=W(` + to confirm:`),c=E(),d=v("form"),z(h.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),H(u,l,null),b(i,f),w(y,c,S),w(y,d,S),H(h,d,null),g=!0,m||(_=Y(d,"submit",Ze(n[7])),m=!0)},p(y,S){(!g||S&2)&&le(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:y}),h.$set(T)},i(y){g||(A(u.$$.fragment,y),A(h.$$.fragment,y),g=!0)},o(y){I(u.$$.fragment,y),I(h.$$.fragment,y),g=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),V(u),V(h),m=!1,_()}}}function JI(n){let e,t,i,s;return{c(){e=v("h4"),t=W("Restore "),i=v("strong"),s=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&le(s,l[1])},d(l){l&&k(e)}}}function GI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=W("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function ZI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[GI],header:[JI],default:[KI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function XI(n,e,t){let i;const s="backup_restore_"+j.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){ln({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await ce.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),Ci(((S=C.response)==null?void 0:S.message)||C.message))}}}Ps(()=>{clearTimeout(u)});function h(){r=this.value,t(2,r)}const g=()=>!a;function m(S){te[S?"unshift":"push"](()=>{l=S,t(3,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,h,g,m,_,y]}class QI extends ve{constructor(e){super(),be(this,e,XI,ZI,ge,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function n_(n,e,t){const i=n.slice();return i[22]=e[t],i}function i_(n,e,t){const i=n.slice();return i[19]=e[t],i}function xI(n){let e=[],t=new Map,i,s,l=pe(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function l_(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d,h=j.formattedFileSize(e[22].size)+"",g,m,_,y,S,C,T,$,O,M,D,L,N,P,F,R,q,B,G,X;function J(){return e[10](e[22])}function U(){return e[11](e[22])}function oe(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=E(),l=v("div"),o=v("span"),a=W(r),f=E(),c=v("span"),d=W("("),g=W(h),m=W(")"),_=E(),y=v("div"),S=v("button"),C=v("i"),$=E(),O=v("button"),M=v("i"),L=E(),N=v("button"),P=v("i"),R=E(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(C,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),Q(S,"btn-loading",e[5][e[22].key]),p(M,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=D=e[6][e[22].key],p(O,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(N,"type","button"),p(N,"class","btn btn-sm btn-circle btn-hint btn-transparent"),N.disabled=F=e[6][e[22].key],p(N,"aria-label","Delete"),Q(N,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,se){w(ee,t,se),b(t,i),b(t,s),b(t,l),b(l,o),b(o,a),b(l,f),b(l,c),b(c,d),b(c,g),b(c,m),b(t,_),b(t,y),b(y,S),b(S,C),b(y,$),b(y,O),b(O,M),b(y,L),b(y,N),b(N,P),b(t,R),B=!0,G||(X=[Te(Be.call(null,S,"Download")),Y(S,"click",Ze(J)),Te(Be.call(null,O,"Restore")),Y(O,"click",Ze(U)),Te(Be.call(null,N,"Delete")),Y(N,"click",Ze(oe))],G=!0)},p(ee,se){e=ee,(!B||se&8)&&r!==(r=e[22].key+"")&&le(a,r),(!B||se&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||se&8)&&h!==(h=j.formattedFileSize(e[22].size)+"")&&le(g,h),(!B||se&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||se&40)&&Q(S,"btn-loading",e[5][e[22].key]),(!B||se&72&&D!==(D=e[6][e[22].key]))&&(O.disabled=D),(!B||se&72&&F!==(F=e[6][e[22].key]))&&(N.disabled=F),(!B||se&72)&&Q(N,"btn-loading",e[6][e[22].key])},i(ee){B||(ee&&xe(()=>{B&&(q||(q=He(t,lt,{duration:150},!0)),q.run(1))}),B=!0)},o(ee){ee&&(q||(q=He(t,lt,{duration:150},!1)),q.run(0)),B=!1},d(ee){ee&&k(t),ee&&q&&q.end(),G=!1,$e(X)}}}function o_(n){let e;return{c(){e=v("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function tL(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function nL(n){let e,t,i;return{c(){e=v("i"),t=E(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function iL(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;const _=[eL,xI],y=[];function S(D,L){return D[4]?0:1}i=S(n),s=y[i]=_[i](n);function C(D,L){return D[7]?nL:tL}let T=C(n),$=T(n),O={};f=new WI({props:O}),n[14](f),f.$on("submit",n[15]);let M={};return d=new QI({props:M}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=E(),o=v("div"),r=v("button"),$.c(),u=E(),z(f.$$.fragment),c=E(),z(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(D,L){w(D,e,L),b(e,t),y[i].m(t,null),b(e,l),b(e,o),b(o,r),$.m(r,null),w(D,u,L),H(f,D,L),w(D,c,L),H(d,D,L),h=!0,g||(m=Y(r,"click",n[13]),g=!0)},p(D,[L]){let N=i;i=S(D),i===N?y[i].p(D,L):(re(),I(y[N],1,1,()=>{y[N]=null}),ae(),s=y[i],s?s.p(D,L):(s=y[i]=_[i](D),s.c()),A(s,1),s.m(t,null)),T!==(T=C(D))&&($.d(1),$=T(D),$&&($.c(),$.m(r,null))),(!h||L&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const P={};f.$set(P);const F={};d.$set(F)},i(D){h||(A(s),A(f.$$.fragment,D),A(d.$$.fragment,D),h=!0)},o(D){I(s),I(f.$$.fragment,D),I(d.$$.fragment,D),h=!1},d(D){D&&(k(e),k(u),k(c)),y[i].d(),$.d(),n[14](null),V(f,D),n[16](null),V(d,D),g=!1,m()}}}function sL(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,l=await ce.backups.getFullList()),l.sort((O,M)=>O.modifiedM.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(ce.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const M=await ce.getAdminFileToken(),D=ce.backups.getDownloadUrl(M,O);j.download(D)}catch(M){M.isAbort||ce.error(M)}delete r[O],t(5,r)}}function d(O){_n(`Do you really want to delete ${O}?`,()=>h(O))}async function h(O){if(!a[O]){t(6,a[O]=!0,a);try{await ce.backups.delete(O),j.removeByKey(l,"name",O),f(),zt(`Successfully deleted ${O}.`)}catch(M){M.isAbort||ce.error(M)}delete a[O],t(6,a)}}async function g(){var O;try{const M=await ce.health.check({$autoCancel:!1}),D=u;t(7,u=((O=M==null?void 0:M.data)==null?void 0:O.canBackup)||!1),D!=u&&u&&f()}catch{}}Kt(()=>{let O=setInterval(()=>{g()},3e3);return()=>{clearInterval(O)}});const m=O=>c(O.key),_=O=>s.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function C(O){te[O?"unshift":"push"](()=>{i=O,t(1,i)})}const T=()=>{f()};function $(O){te[O?"unshift":"push"](()=>{s=O,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,m,_,y,S,C,T,$]}class lL extends ve{constructor(e){super(),be(this,e,sL,iL,ge,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function oL(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("i"),s=E(),l=v("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),Q(e,"btn-loading",n[2]),Q(e,"btn-disabled",n[2]),p(l,"type","file"),p(l,"accept","application/zip"),p(l,"class","hidden")},m(a,u){w(a,e,u),b(e,t),w(a,s,u),w(a,l,u),n[5](l),o||(r=[Te(Be.call(null,e,"Upload backup")),Y(e,"click",n[4]),Y(l,"change",n[3])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&Q(e,"btn-loading",a[2]),u&5&&Q(e,"btn-disabled",a[2])},i:x,o:x,d(a){a&&(k(e),k(s),k(l)),n[5](null),o=!1,$e(r)}}}const r_="upload_backup";function rL(n,e,t){const i=dt();let{class:s=""}=e,l,o=!1;async function r(f){var d,h,g,m,_;if(o||!((h=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&h.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await ce.backups.upload(c,{requestKey:r_}),t(2,o=!1),i("success"),zt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(_=(m=(g=y.response)==null?void 0:g.data)==null?void 0:m.file)!=null&&_.message?Ci(y.response.data.file.message):ce.error(y))}}Ps(()=>{ce.cancelRequest(r_)});const a=()=>l==null?void 0:l.click();function u(f){te[f?"unshift":"push"](()=>{l=f,t(1,l)})}return n.$$set=f=>{"class"in f&&t(0,s=f.class)},[s,l,o,r,a,u]}class aL extends ve{constructor(e){super(),be(this,e,rL,oL,ge,{class:0})}}function uL(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fL(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function a_(n){var B,G,X;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M;t=new me({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[cL,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});let D=n[2]&&u_(n);function L(J){n[24](J)}function N(J){n[25](J)}function P(J){n[26](J)}let F={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(F.config=n[1].backups.s3),n[7]!==void 0&&(F.isTesting=n[7]),n[8]!==void 0&&(F.testError=n[8]),r=new W1({props:F}),te.push(()=>he(r,"config",L)),te.push(()=>he(r,"isTesting",N)),te.push(()=>he(r,"testError",P));let R=((X=(G=n[1].backups)==null?void 0:G.s3)==null?void 0:X.enabled)&&!n[9]&&!n[5]&&f_(n),q=n[9]&&c_(n);return{c(){e=v("form"),z(t.$$.fragment),i=E(),D&&D.c(),s=E(),l=v("div"),o=E(),z(r.$$.fragment),c=E(),d=v("div"),h=v("div"),g=E(),R&&R.c(),m=E(),q&&q.c(),_=E(),y=v("button"),S=v("span"),S.textContent="Save changes",p(l,"class","clearfix m-b-base"),p(h,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=C=!n[9]||n[5],Q(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(J,U){w(J,e,U),H(t,e,null),b(e,i),D&&D.m(e,null),b(e,s),b(e,l),b(e,o),H(r,e,null),b(e,c),b(e,d),b(d,h),b(d,g),R&&R.m(d,null),b(d,m),q&&q.m(d,null),b(d,_),b(d,y),b(y,S),$=!0,O||(M=[Y(y,"click",n[28]),Y(e,"submit",Ze(n[11]))],O=!0)},p(J,U){var se,Ee,Re;const oe={};U[0]&4|U[1]&3&&(oe.$$scope={dirty:U,ctx:J}),t.$set(oe),J[2]?D?(D.p(J,U),U[0]&4&&A(D,1)):(D=u_(J),D.c(),A(D,1),D.m(e,s)):D&&(re(),I(D,1,1,()=>{D=null}),ae());const ee={};U[0]&1&&(ee.originalConfig=(se=J[0].backups)==null?void 0:se.s3),!a&&U[0]&2&&(a=!0,ee.config=J[1].backups.s3,_e(()=>a=!1)),!u&&U[0]&128&&(u=!0,ee.isTesting=J[7],_e(()=>u=!1)),!f&&U[0]&256&&(f=!0,ee.testError=J[8],_e(()=>f=!1)),r.$set(ee),(Re=(Ee=J[1].backups)==null?void 0:Ee.s3)!=null&&Re.enabled&&!J[9]&&!J[5]?R?R.p(J,U):(R=f_(J),R.c(),R.m(d,m)):R&&(R.d(1),R=null),J[9]?q?q.p(J,U):(q=c_(J),q.c(),q.m(d,_)):q&&(q.d(1),q=null),(!$||U[0]&544&&C!==(C=!J[9]||J[5]))&&(y.disabled=C),(!$||U[0]&32)&&Q(y,"btn-loading",J[5])},i(J){$||(A(t.$$.fragment,J),A(D),A(r.$$.fragment,J),J&&xe(()=>{$&&(T||(T=He(e,lt,{duration:150},!0)),T.run(1))}),$=!0)},o(J){I(t.$$.fragment,J),I(D),I(r.$$.fragment,J),J&&(T||(T=He(e,lt,{duration:150},!1)),T.run(0)),$=!1},d(J){J&&k(e),V(t),D&&D.d(),V(r),R&&R.d(),q&&q.d(),J&&T&&T.end(),O=!1,$e(M)}}}function cL(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function u_(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[pL,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[hL,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&2|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function dL(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Every day at 00:00h',t=E(),i=v("button"),i.innerHTML='Every sunday at 00:00h',s=E(),l=v("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=E(),r=v("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[19]),Y(i,"click",n[20]),Y(l,"click",n[21]),Y(r,"click",n[22])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function pL(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N;return m=new Pn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[dL]},$$scope:{ctx:n}}}),{c(){var P,F;e=v("label"),t=W("Cron expression"),s=E(),l=v("input"),a=E(),u=v("div"),f=v("button"),c=v("span"),c.textContent="Presets",d=E(),h=v("i"),g=E(),z(m.$$.fragment),_=E(),y=v("div"),S=v("p"),C=W(`Supports numeric list, steps, ranges or + `),T=v("span"),T.textContent="macros",$=W(`. + `),O=v("br"),M=W(` + The timezone is in UTC.`),p(e,"for",i=n[31]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((F=(P=n[0])==null?void 0:P.backups)!=null&&F.cron),p(c,"class","txt"),p(h,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(y,"class","help-block")},m(P,F){var R,q;w(P,e,F),b(e,t),w(P,s,F),w(P,l,F),de(l,n[1].backups.cron),w(P,a,F),w(P,u,F),b(u,f),b(f,c),b(f,d),b(f,h),b(f,g),H(m,f,null),w(P,_,F),w(P,y,F),b(y,S),b(S,C),b(S,T),b(S,$),b(S,O),b(S,M),D=!0,(q=(R=n[0])==null?void 0:R.backups)!=null&&q.cron||l.focus(),L||(N=[Y(l,"input",n[18]),Te(Be.call(null,T,`@yearly @annually @monthly @weekly @daily @midnight -@hourly`))],L=!0)},p(P,F){var q,B;(!D||F[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!D||F[1]&1&&o!==(o=P[31]))&&p(l,"id",o),(!D||F[0]&1&&r!==(r=!((B=(q=P[0])==null?void 0:q.backups)!=null&&B.cron)))&&(l.autofocus=r),F[0]&2&&l.value!==P[1].backups.cron&&ce(l,P[1].backups.cron);const R={};F[0]&2|F[1]&2&&(R.$$scope={dirty:F,ctx:P}),m.$set(R)},i(P){D||(A(m.$$.fragment,P),D=!0)},o(P){I(m.$$.fragment,P),D=!1},d(P){P&&(k(e),k(s),k(l),k(a),k(u),k(_),k(y)),V(m),L=!1,$e(N)}}}function yL(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max @auto backups to keep"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ce(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&2&&vt(l.value)!==u[1].backups.cronMaxKeep&&ce(l,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function c_(n){let e;function t(l,o){return l[7]?SL:l[8]?wL:kL}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function kL(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function wL(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=Be.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Et(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function SL(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function d_(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function TL(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N,P;h=new Ko({props:{class:"btn-sm",tooltip:"Refresh"}}),h.$on("refresh",n[13]),m=new hL({props:{class:"btn-sm"}}),m.$on("success",n[13]);let F={};y=new cL({props:F}),n[15](y);function R(X,J){return X[6]?gL:mL}let q=R(n),B=q(n),G=n[6]&&!n[4]&&u_(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),z(h.$$.fragment),g=E(),z(m.$$.fragment),_=E(),z(y.$$.fragment),S=E(),C=v("hr"),T=E(),$=v("button"),O=v("span"),O.textContent="Backups options",M=E(),B.c(),D=E(),G&&G.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p($,"type","button"),p($,"class","btn btn-secondary"),$.disabled=n[4],Q($,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(X,J){w(X,e,J),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(X,r,J),w(X,a,J),b(a,u),b(u,f),b(f,c),b(f,d),H(h,f,null),b(f,g),H(m,f,null),b(u,_),H(y,u,null),b(u,S),b(u,C),b(u,T),b(u,$),b($,O),b($,M),B.m($,null),b(u,D),G&&G.m(u,null),L=!0,N||(P=[Y($,"click",n[16]),Y(u,"submit",Ze(n[11]))],N=!0)},p(X,J){(!L||J[0]&1024)&&le(o,X[10]);const W={};y.$set(W),q!==(q=R(X))&&(B.d(1),B=q(X),B&&(B.c(),B.m($,null))),(!L||J[0]&16)&&($.disabled=X[4]),(!L||J[0]&16)&&Q($,"btn-loading",X[4]),X[6]&&!X[4]?G?(G.p(X,J),J[0]&80&&A(G,1)):(G=u_(X),G.c(),A(G,1),G.m(u,null)):G&&(re(),I(G,1,1,()=>{G=null}),ae())},i(X){L||(A(h.$$.fragment,X),A(m.$$.fragment,X),A(y.$$.fragment,X),A(G),L=!0)},o(X){I(h.$$.fragment,X),I(m.$$.fragment,X),I(y.$$.fragment,X),I(G),L=!1},d(X){X&&(k(e),k(r),k(a)),V(h),V(m),n[15](null),V(y),B.d(),G&&G.d(),N=!1,$e(P)}}}function CL(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[TL]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function $L(n,e,t){let i,s;Ge(n,Nt,J=>t(10,s=J)),an(Nt,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,h=!1,g=null;m();async function m(){t(4,a=!0);try{const J=await de.settings.getAll()||{};y(J)}catch(J){de.error(J)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const J=await de.settings.update(j.filterRedactedProps(r));await C(),y(J),zt("Successfully saved application settings.")}catch(J){de.error(J)}t(5,u=!1)}}function y(J={}){t(1,r={backups:(J==null?void 0:J.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function C(){return l==null?void 0:l.loadBackups()}function T(J){te[J?"unshift":"push"](()=>{l=J,t(3,l)})}const $=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function M(){r.backups.cron=this.value,t(1,r),t(2,c)}const D=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},N=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},P=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function F(){r.backups.cronMaxKeep=vt(this.value),t(1,r),t(2,c)}function R(J){n.$$.not_equal(r.backups.s3,J)&&(r.backups.s3=J,t(1,r),t(2,c))}function q(J){h=J,t(7,h)}function B(J){g=J,t(8,g)}const G=()=>S(),X=()=>_();return n.$$.update=()=>{var J;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(J=r==null?void 0:r.backups)!=null&&J.cron&&(pi("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,l,a,u,d,h,g,i,s,_,S,C,f,T,$,O,M,D,L,N,P,F,R,q,B,G,X]}class ML extends be{constructor(e){super(),_e(this,e,$L,CL,ge,{},null,[-1,-1])}}const Wt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?us("/"):!0}],OL={"/login":jt({component:EA,conditions:Wt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":jt({asyncComponent:()=>ut(()=>import("./PageAdminRequestPasswordReset-d1821282.js"),[],import.meta.url),conditions:Wt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":jt({asyncComponent:()=>ut(()=>import("./PageAdminConfirmPasswordReset-5a295016.js"),[],import.meta.url),conditions:Wt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":jt({component:QD,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":jt({component:iT,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":jt({component:jA,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":jt({component:SA,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":jt({component:$8,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":jt({component:K8,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":jt({component:fI,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":jt({component:vI,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":jt({component:CI,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":jt({component:UI,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":jt({component:ML,conditions:Wt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmPasswordReset-fa2a1b3b.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmPasswordReset-fa2a1b3b.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmVerification-e61306a8.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmVerification-e61306a8.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmEmailChange-c25d0a1e.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmEmailChange-c25d0a1e.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":jt({asyncComponent:()=>ut(()=>import("./PageOAuth2Redirect-b5bd7fcc.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"*":jt({component:Tk,userData:{showAppSidebar:!1}})};function EL(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=Yo}=i;return{delay:f,duration:Et(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const m=g*a,_=g*u,y=h+g*e.width/t.width,S=h+g*e.height/t.height;return`transform: ${l} translate(${m}px, ${_}px) scale(${y}, ${S});`}}}function p_(n,e,t){const i=n.slice();return i[2]=e[t],i}function DL(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function AL(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function IL(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function LL(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function h_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,h,g=x,m,_,y;function S(O,M){return O[2].type==="info"?LL:O[2].type==="success"?IL:O[2].type==="warning"?AL:DL}let C=S(e),T=C(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),T.c(),s=E(),l=v("div"),r=U(o),a=E(),u=v("button"),u.innerHTML='',f=E(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,M){w(O,t,M),b(t,i),T.m(i,null),b(t,s),b(t,l),b(l,r),b(t,a),b(t,u),b(t,f),m=!0,_||(y=Y(u,"click",Ze($)),_=!0)},p(O,M){e=O,C!==(C=S(e))&&(T.d(1),T=C(e),T&&(T.c(),T.m(i,null))),(!m||M&1)&&o!==(o=e[2].message+"")&&le(r,o),(!m||M&1)&&Q(t,"alert-info",e[2].type=="info"),(!m||M&1)&&Q(t,"alert-success",e[2].type=="success"),(!m||M&1)&&Q(t,"alert-danger",e[2].type=="error"),(!m||M&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){h=t.getBoundingClientRect()},f(){b0(t),g(),S_(t,h)},a(){g(),g=_0(t,h,EL,{duration:150})},i(O){m||(O&&xe(()=>{m&&(d&&d.end(1),c=$_(t,lt,{duration:150}),c.start())}),m=!0)},o(O){c&&c.invalidate(),O&&(d=ya(t,hl,{duration:150})),m=!1},d(O){O&&k(t),T.d(),O&&d&&d.end(),_=!1,y()}}}function PL(n){let e,t=[],i=new Map,s,l=pe(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>Ib(l)]}class FL extends be{constructor(e){super(),_e(this,e,NL,PL,ge,{})}}function RL(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=U(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){w(l,e,o),b(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&le(i,t)},d(l){l&&k(e)}}}function qL(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=E(),s=v("button"),l=v("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(s)),o=!1,$e(r)}}}function jL(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[qL],header:[RL]},$$scope:{ctx:n}};return e=new on({props:i}),n[6](e),e.$on("hide",n[7]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[6](null),V(e,s)}}}function HL(n,e,t){let i;Ge(n,su,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){te[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await sn(),t(3,o=!1),F1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class VL extends be{constructor(e){super(),_e(this,e,HL,jL,ge,{})}}function m_(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return m=new Pn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[zL]},$$scope:{ctx:n}}}),{c(){var C;e=v("aside"),t=v("a"),t.innerHTML='PocketBase logo',i=E(),s=v("nav"),l=v("a"),l.innerHTML='',o=E(),r=v("a"),r.innerHTML='',a=E(),u=v("a"),u.innerHTML='',f=E(),c=v("figure"),d=v("img"),g=E(),z(m.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),un(d.src,h="./images/avatars/avatar"+(((C=n[0])==null?void 0:C.avatar)||0)+".svg")||p(d,"src",h),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(C,T){w(C,e,T),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(e,f),b(e,c),b(c,d),b(c,g),H(m,c,null),_=!0,y||(S=[Te(dn.call(null,t)),Te(dn.call(null,l)),Te(zn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Te(Be.call(null,l,{text:"Collections",position:"right"})),Te(dn.call(null,r)),Te(zn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Te(Be.call(null,r,{text:"Logs",position:"right"})),Te(dn.call(null,u)),Te(zn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Te(Be.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p(C,T){var O;(!_||T&1&&!un(d.src,h="./images/avatars/avatar"+(((O=C[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",h);const $={};T&4096&&($.$$scope={dirty:T,ctx:C}),m.$set($)},i(C){_||(A(m.$$.fragment,C),_=!0)},o(C){I(m.$$.fragment,C),_=!1},d(C){C&&k(e),V(m),y=!1,$e(S)}}}function zL(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=' Manage admins',t=E(),i=v("hr"),s=E(),l=v("button"),l.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Te(dn.call(null,e)),Y(l,"click",n[7])],o=!0)},p:x,d(a){a&&(k(e),k(t),k(i),k(s),k(l)),o=!1,$e(r)}}}function g_(n){let e,t,i;return t=new au({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function BL(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((_=n[0])==null?void 0:_.id)&&n[1]&&m_(n);o=new I0({props:{routes:OL}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new FL({}),f=new VL({});let m=n[1]&&!n[2]&&g_(n);return{c(){t=E(),i=v("div"),g&&g.c(),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),m&&m.c(),d=ye(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),g&&g.m(i,null),b(i,s),b(i,l),H(o,l,null),b(l,r),H(a,l,null),w(y,u,S),H(f,y,S),w(y,c,S),m&&m.m(y,S),w(y,d,S),h=!0},p(y,[S]){var C;(!h||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(C=y[0])!=null&&C.id&&y[1]?g?(g.p(y,S),S&3&&A(g,1)):(g=m_(y),g.c(),A(g,1),g.m(i,s)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),y[1]&&!y[2]?m?(m.p(y,S),S&6&&A(m,1)):(m=g_(y),m.c(),A(m,1),m.m(d.parentNode,d)):m&&(re(),I(m,1,1,()=>{m=null}),ae())},i(y){h||(A(g),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(m),h=!0)},o(y){I(g),I(o.$$.fragment,y),I(a.$$.fragment,y),I(f.$$.fragment,y),I(m),h=!1},d(y){y&&(k(t),k(i),k(u),k(c),k(d)),g&&g.d(),V(o),V(a),V(f,y),m&&m.d(y)}}}function UL(n,e,t){let i,s,l,o;Ge(n,Os,m=>t(10,i=m)),Ge(n,So,m=>t(3,s=m)),Ge(n,Pa,m=>t(0,l=m)),Ge(n,Nt,m=>t(4,o=m));let r,a=!1,u=!1;function f(m){var _,y,S,C;((_=m==null?void 0:m.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(y=m==null?void 0:m.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(C=m==null?void 0:m.detail)==null?void 0:C.location,an(Nt,o="",o),ln({}),F1())}function c(){us("/")}async function d(){var m,_;if(l!=null&&l.id)try{const y=await de.settings.getAll({$cancelKey:"initialAppSettings"});an(So,s=((m=y==null?void 0:y.meta)==null?void 0:m.appName)||"",s),an(Os,i=!!((_=y==null?void 0:y.meta)!=null&&_.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function h(){de.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,h,g]}class WL extends be{constructor(e){super(),_e(this,e,UL,BL,ge,{})}}new WL({target:document.getElementById("app")});export{$e as A,zt as B,j as C,us as D,ye as E,Pb as F,Ho as G,ro as H,Kt as I,Ge as J,Zn as K,dt as L,te as M,P1 as N,pe as O,gt as P,Ui as Q,Rt as R,be as S,bt as T,Vr as U,I as a,E as b,z as c,V as d,v as e,p as f,w as g,b as h,_e as i,Te as j,re as k,dn as l,H as m,ae as n,k as o,de as p,me as q,Q as r,ge as s,A as t,Y as u,Ze as v,U as w,le as x,x as y,ce as z}; +@hourly`))],L=!0)},p(P,F){var q,B;(!D||F[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!D||F[1]&1&&o!==(o=P[31]))&&p(l,"id",o),(!D||F[0]&1&&r!==(r=!((B=(q=P[0])==null?void 0:q.backups)!=null&&B.cron)))&&(l.autofocus=r),F[0]&2&&l.value!==P[1].backups.cron&&de(l,P[1].backups.cron);const R={};F[0]&2|F[1]&2&&(R.$$scope={dirty:F,ctx:P}),m.$set(R)},i(P){D||(A(m.$$.fragment,P),D=!0)},o(P){I(m.$$.fragment,P),D=!1},d(P){P&&(k(e),k(s),k(l),k(a),k(u),k(_),k(y)),V(m),L=!1,$e(N)}}}function hL(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Max @auto backups to keep"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&2&&yt(l.value)!==u[1].backups.cronMaxKeep&&de(l,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function f_(n){let e;function t(l,o){return l[7]?_L:l[8]?gL:mL}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function mL(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function gL(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=Be.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Et(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function _L(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function c_(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function bL(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,L,N,P;h=new Jo({props:{class:"btn-sm",tooltip:"Refresh"}}),h.$on("refresh",n[13]),m=new aL({props:{class:"btn-sm"}}),m.$on("success",n[13]);let F={};y=new lL({props:F}),n[15](y);function R(X,J){return X[6]?fL:uL}let q=R(n),B=q(n),G=n[6]&&!n[4]&&a_(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),z(h.$$.fragment),g=E(),z(m.$$.fragment),_=E(),z(y.$$.fragment),S=E(),C=v("hr"),T=E(),$=v("button"),O=v("span"),O.textContent="Backups options",M=E(),B.c(),D=E(),G&&G.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p($,"type","button"),p($,"class","btn btn-secondary"),$.disabled=n[4],Q($,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(X,J){w(X,e,J),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(X,r,J),w(X,a,J),b(a,u),b(u,f),b(f,c),b(f,d),H(h,f,null),b(f,g),H(m,f,null),b(u,_),H(y,u,null),b(u,S),b(u,C),b(u,T),b(u,$),b($,O),b($,M),B.m($,null),b(u,D),G&&G.m(u,null),L=!0,N||(P=[Y($,"click",n[16]),Y(u,"submit",Ze(n[11]))],N=!0)},p(X,J){(!L||J[0]&1024)&&le(o,X[10]);const U={};y.$set(U),q!==(q=R(X))&&(B.d(1),B=q(X),B&&(B.c(),B.m($,null))),(!L||J[0]&16)&&($.disabled=X[4]),(!L||J[0]&16)&&Q($,"btn-loading",X[4]),X[6]&&!X[4]?G?(G.p(X,J),J[0]&80&&A(G,1)):(G=a_(X),G.c(),A(G,1),G.m(u,null)):G&&(re(),I(G,1,1,()=>{G=null}),ae())},i(X){L||(A(h.$$.fragment,X),A(m.$$.fragment,X),A(y.$$.fragment,X),A(G),L=!0)},o(X){I(h.$$.fragment,X),I(m.$$.fragment,X),I(y.$$.fragment,X),I(G),L=!1},d(X){X&&(k(e),k(r),k(a)),V(h),V(m),n[15](null),V(y),B.d(),G&&G.d(),N=!1,$e(P)}}}function vL(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[bL]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function yL(n,e,t){let i,s;Ge(n,Nt,J=>t(10,s=J)),an(Nt,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,h=!1,g=null;m();async function m(){t(4,a=!0);try{const J=await ce.settings.getAll()||{};y(J)}catch(J){ce.error(J)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const J=await ce.settings.update(j.filterRedactedProps(r));await C(),y(J),zt("Successfully saved application settings.")}catch(J){ce.error(J)}t(5,u=!1)}}function y(J={}){t(1,r={backups:(J==null?void 0:J.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function C(){return l==null?void 0:l.loadBackups()}function T(J){te[J?"unshift":"push"](()=>{l=J,t(3,l)})}const $=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function M(){r.backups.cron=this.value,t(1,r),t(2,c)}const D=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},N=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},P=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function F(){r.backups.cronMaxKeep=yt(this.value),t(1,r),t(2,c)}function R(J){n.$$.not_equal(r.backups.s3,J)&&(r.backups.s3=J,t(1,r),t(2,c))}function q(J){h=J,t(7,h)}function B(J){g=J,t(8,g)}const G=()=>S(),X=()=>_();return n.$$.update=()=>{var J;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(J=r==null?void 0:r.backups)!=null&&J.cron&&(pi("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,l,a,u,d,h,g,i,s,_,S,C,f,T,$,O,M,D,L,N,P,F,R,q,B,G,X]}class kL extends ve{constructor(e){super(),be(this,e,yL,vL,ge,{},null,[-1,-1])}}const Wt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?us("/"):!0}],wL={"/login":jt({component:SA,conditions:Wt.concat([n=>!ce.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":jt({asyncComponent:()=>ut(()=>import("./PageAdminRequestPasswordReset-95849736.js"),[],import.meta.url),conditions:Wt.concat([n=>!ce.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":jt({asyncComponent:()=>ut(()=>import("./PageAdminConfirmPasswordReset-579fcad9.js"),[],import.meta.url),conditions:Wt.concat([n=>!ce.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":jt({component:YD,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":jt({component:nT,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":jt({component:LA,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":jt({component:_A,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":jt({component:y8,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":jt({component:V8,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":jt({component:sI,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":jt({component:pI,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":jt({component:vI,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":jt({component:qI,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":jt({component:kL,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmPasswordReset-10a23d65.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmPasswordReset-10a23d65.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmVerification-de4f1a8c.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmVerification-de4f1a8c.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmEmailChange-4d5a703c.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":jt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmEmailChange-4d5a703c.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":jt({asyncComponent:()=>ut(()=>import("./PageOAuth2Redirect-06c771f6.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"*":jt({component:Sk,userData:{showAppSidebar:!1}})};function SL(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=Ko}=i;return{delay:f,duration:Et(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const m=g*a,_=g*u,y=h+g*e.width/t.width,S=h+g*e.height/t.height;return`transform: ${l} translate(${m}px, ${_}px) scale(${y}, ${S});`}}}function d_(n,e,t){const i=n.slice();return i[2]=e[t],i}function TL(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function CL(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $L(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ML(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function p_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,h,g=x,m,_,y;function S(O,M){return O[2].type==="info"?ML:O[2].type==="success"?$L:O[2].type==="warning"?CL:TL}let C=S(e),T=C(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),T.c(),s=E(),l=v("div"),r=W(o),a=E(),u=v("button"),u.innerHTML='',f=E(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,M){w(O,t,M),b(t,i),T.m(i,null),b(t,s),b(t,l),b(l,r),b(t,a),b(t,u),b(t,f),m=!0,_||(y=Y(u,"click",Ze($)),_=!0)},p(O,M){e=O,C!==(C=S(e))&&(T.d(1),T=C(e),T&&(T.c(),T.m(i,null))),(!m||M&1)&&o!==(o=e[2].message+"")&&le(r,o),(!m||M&1)&&Q(t,"alert-info",e[2].type=="info"),(!m||M&1)&&Q(t,"alert-success",e[2].type=="success"),(!m||M&1)&&Q(t,"alert-danger",e[2].type=="error"),(!m||M&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){h=t.getBoundingClientRect()},f(){_0(t),g(),w_(t,h)},a(){g(),g=g0(t,h,SL,{duration:150})},i(O){m||(O&&xe(()=>{m&&(d&&d.end(1),c=C_(t,lt,{duration:150}),c.start())}),m=!0)},o(O){c&&c.invalidate(),O&&(d=ya(t,ml,{duration:150})),m=!1},d(O){O&&k(t),T.d(),O&&d&&d.end(),_=!1,y()}}}function OL(n){let e,t=[],i=new Map,s,l=pe(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>Ab(l)]}class DL extends ve{constructor(e){super(),be(this,e,EL,OL,ge,{})}}function AL(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=W(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){w(l,e,o),b(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&le(i,t)},d(l){l&&k(e)}}}function IL(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=E(),s=v("button"),l=v("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(s)),o=!1,$e(r)}}}function LL(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[IL],header:[AL]},$$scope:{ctx:n}};return e=new on({props:i}),n[6](e),e.$on("hide",n[7]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[6](null),V(e,s)}}}function PL(n,e,t){let i;Ge(n,su,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){te[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await sn(),t(3,o=!1),N1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class NL extends ve{constructor(e){super(),be(this,e,PL,LL,ge,{})}}function h_(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return m=new Pn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[FL]},$$scope:{ctx:n}}}),{c(){var C;e=v("aside"),t=v("a"),t.innerHTML='PocketBase logo',i=E(),s=v("nav"),l=v("a"),l.innerHTML='',o=E(),r=v("a"),r.innerHTML='',a=E(),u=v("a"),u.innerHTML='',f=E(),c=v("figure"),d=v("img"),g=E(),z(m.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),un(d.src,h="./images/avatars/avatar"+(((C=n[0])==null?void 0:C.avatar)||0)+".svg")||p(d,"src",h),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(C,T){w(C,e,T),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(e,f),b(e,c),b(c,d),b(c,g),H(m,c,null),_=!0,y||(S=[Te(dn.call(null,t)),Te(dn.call(null,l)),Te(zn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Te(Be.call(null,l,{text:"Collections",position:"right"})),Te(dn.call(null,r)),Te(zn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Te(Be.call(null,r,{text:"Logs",position:"right"})),Te(dn.call(null,u)),Te(zn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Te(Be.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p(C,T){var O;(!_||T&1&&!un(d.src,h="./images/avatars/avatar"+(((O=C[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",h);const $={};T&4096&&($.$$scope={dirty:T,ctx:C}),m.$set($)},i(C){_||(A(m.$$.fragment,C),_=!0)},o(C){I(m.$$.fragment,C),_=!1},d(C){C&&k(e),V(m),y=!1,$e(S)}}}function FL(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=' Manage admins',t=E(),i=v("hr"),s=E(),l=v("button"),l.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Te(dn.call(null,e)),Y(l,"click",n[7])],o=!0)},p:x,d(a){a&&(k(e),k(t),k(i),k(s),k(l)),o=!1,$e(r)}}}function m_(n){let e,t,i;return t=new au({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function RL(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((_=n[0])==null?void 0:_.id)&&n[1]&&h_(n);o=new A0({props:{routes:wL}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new DL({}),f=new NL({});let m=n[1]&&!n[2]&&m_(n);return{c(){t=E(),i=v("div"),g&&g.c(),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),m&&m.c(),d=ye(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),g&&g.m(i,null),b(i,s),b(i,l),H(o,l,null),b(l,r),H(a,l,null),w(y,u,S),H(f,y,S),w(y,c,S),m&&m.m(y,S),w(y,d,S),h=!0},p(y,[S]){var C;(!h||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(C=y[0])!=null&&C.id&&y[1]?g?(g.p(y,S),S&3&&A(g,1)):(g=h_(y),g.c(),A(g,1),g.m(i,s)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),y[1]&&!y[2]?m?(m.p(y,S),S&6&&A(m,1)):(m=m_(y),m.c(),A(m,1),m.m(d.parentNode,d)):m&&(re(),I(m,1,1,()=>{m=null}),ae())},i(y){h||(A(g),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(m),h=!0)},o(y){I(g),I(o.$$.fragment,y),I(a.$$.fragment,y),I(f.$$.fragment,y),I(m),h=!1},d(y){y&&(k(t),k(i),k(u),k(c),k(d)),g&&g.d(),V(o),V(a),V(f,y),m&&m.d(y)}}}function qL(n,e,t){let i,s,l,o;Ge(n,Es,m=>t(10,i=m)),Ge(n,To,m=>t(3,s=m)),Ge(n,Pa,m=>t(0,l=m)),Ge(n,Nt,m=>t(4,o=m));let r,a=!1,u=!1;function f(m){var _,y,S,C;((_=m==null?void 0:m.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(y=m==null?void 0:m.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(C=m==null?void 0:m.detail)==null?void 0:C.location,an(Nt,o="",o),ln({}),N1())}function c(){us("/")}async function d(){var m,_;if(l!=null&&l.id)try{const y=await ce.settings.getAll({$cancelKey:"initialAppSettings"});an(To,s=((m=y==null?void 0:y.meta)==null?void 0:m.appName)||"",s),an(Es,i=!!((_=y==null?void 0:y.meta)!=null&&_.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function h(){ce.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,h,g]}class jL extends ve{constructor(e){super(),be(this,e,qL,RL,ge,{})}}new jL({target:document.getElementById("app")});export{$e as A,zt as B,j as C,us as D,ye as E,Lb as F,Vo as G,ao as H,Kt as I,Ge as J,Zn as K,dt as L,te as M,L1 as N,pe as O,gt as P,Ui as Q,Rt as R,ve as S,vt as T,Vr as U,I as a,E as b,z as c,V as d,v as e,p as f,w as g,b as h,be as i,Te as j,re as k,dn as l,H as m,ae as n,k as o,ce as p,me as q,Q as r,ge as s,A as t,Y as u,Ze as v,W as w,le as x,x as y,de as z}; diff --git a/ui/dist/images/oauth2/mailcow.svg b/ui/dist/images/oauth2/mailcow.svg new file mode 100644 index 00000000..f8bc039c --- /dev/null +++ b/ui/dist/images/oauth2/mailcow.svg @@ -0,0 +1,3 @@ + + +image/svg+xml diff --git a/ui/dist/index.html b/ui/dist/index.html index 6535f598..7410494e 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -45,7 +45,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/public/images/oauth2/mailcow.svg b/ui/public/images/oauth2/mailcow.svg new file mode 100644 index 00000000..f8bc039c --- /dev/null +++ b/ui/public/images/oauth2/mailcow.svg @@ -0,0 +1,3 @@ + + +image/svg+xml diff --git a/ui/src/components/settings/AuthProviderPanel.svelte b/ui/src/components/settings/AuthProviderPanel.svelte index ec6462d0..b48e925c 100644 --- a/ui/src/components/settings/AuthProviderPanel.svelte +++ b/ui/src/components/settings/AuthProviderPanel.svelte @@ -102,7 +102,12 @@ {#if provider.optionsComponent}
    - +
    {/if} diff --git a/ui/src/components/settings/providers/OIDCOptions.svelte b/ui/src/components/settings/providers/OIDCOptions.svelte deleted file mode 100644 index 4da1d2ec..00000000 --- a/ui/src/components/settings/providers/OIDCOptions.svelte +++ /dev/null @@ -1,23 +0,0 @@ - - -
    Endpoints
    - - - -
    Eg. https://example.com/authorize/
    -
    - - - -
    Eg. https://example.com/token/
    -
    - - - -
    Eg. https://example.com/userinfo/
    -
    diff --git a/ui/src/components/settings/providers/SelfHostedOptions.svelte b/ui/src/components/settings/providers/SelfHostedOptions.svelte index c04799da..67ff88fc 100644 --- a/ui/src/components/settings/providers/SelfHostedOptions.svelte +++ b/ui/src/components/settings/providers/SelfHostedOptions.svelte @@ -3,18 +3,22 @@ export let key = ""; export let config = {}; + export let required = false; + export let title = "Provider endpoints"; + + $: isRequired = required && config?.enabled; -
    Selfhosted endpoints (optional)
    - +
    {title}
    + - + - + - + - + - + diff --git a/ui/src/providers.js b/ui/src/providers.js index 97cb0e15..3ac5322a 100644 --- a/ui/src/providers.js +++ b/ui/src/providers.js @@ -1,11 +1,10 @@ import SelfHostedOptions from "@/components/settings/providers/SelfHostedOptions.svelte"; import MicrosoftOptions from "@/components/settings/providers/MicrosoftOptions.svelte"; -import OIDCOptions from "@/components/settings/providers/OIDCOptions.svelte"; import AppleOptions from "@/components/settings/providers/AppleOptions.svelte"; // Object list with all supported OAuth2 providers in the format: // ``` -// [ { key, title, logo, optionsComponent? }, ... ] +// [ { key, title, logo, optionsComponent?, optionComponentProps? }, ... ] // ``` // // The logo images must be placed inside the /public/images/oauth2 directory. @@ -13,6 +12,7 @@ import AppleOptions from "@/components/settings/providers/AppleOptions.svel // If `optionsComponent` is provided it will receive 2 parameters: // - `key` - the provider settings key (eg. "gitlabAuth") // - `config` - the provider settings config that is currently being updated +// - any other prop from optionComponentProps export default [ { key: "appleAuth", @@ -56,6 +56,7 @@ export default [ title: "GitLab", logo: "gitlab.svg", optionsComponent: SelfHostedOptions, + optionsComponentProps: { title: "Self-hosted endpoints (optional)" }, }, { key: "giteeAuth", @@ -67,6 +68,7 @@ export default [ title: "Gitea", logo: "gitea.svg", optionsComponent: SelfHostedOptions, + optionsComponentProps: { title: "Self-hosted endpoints (optional)" }, }, { key: "discordAuth", @@ -113,22 +115,32 @@ export default [ title: "LiveChat", logo: "livechat.svg", }, + { + key: "mailcowAuth", + title: "mailcow", + logo: "mailcow.svg", + optionsComponent: SelfHostedOptions, + optionsComponentProps: { required: true }, + }, { key: "oidcAuth", title: "OpenID Connect", logo: "oidc.svg", - optionsComponent: OIDCOptions, + optionsComponent: SelfHostedOptions, + optionsComponentProps: { required: true }, }, { key: "oidc2Auth", title: "(2) OpenID Connect", logo: "oidc.svg", - optionsComponent: OIDCOptions, + optionsComponent: SelfHostedOptions, + optionsComponentProps: { required: true }, }, { key: "oidc3Auth", title: "(3) OpenID Connect", logo: "oidc.svg", - optionsComponent: OIDCOptions, + optionsComponent: SelfHostedOptions, + optionsComponentProps: { required: true }, }, ];