From b283ee2263234462ca6c3bd99281a30bfd01377d Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Wed, 29 Nov 2023 20:19:54 +0200 Subject: [PATCH] added OAuth2 displayName and pkce options --- CHANGELOG.md | 9 +- apis/record_auth.go | 58 +++++---- forms/record_oauth2_login.go | 14 ++- forms/record_oauth2_login_test.go | 4 +- models/request.go | 2 +- models/settings/settings.go | 10 ++ models/settings/settings_test.go | 13 ++ tools/auth/apple.go | 10 +- tools/auth/auth.go | 15 ++- tools/auth/base_provider.go | 24 +++- tools/auth/base_provider_test.go | 60 ++++++--- tools/auth/discord.go | 14 ++- tools/auth/facebook.go | 12 +- tools/auth/gitea.go | 12 +- tools/auth/gitee.go | 12 +- tools/auth/github.go | 12 +- tools/auth/gitlab.go | 12 +- tools/auth/google.go | 4 +- tools/auth/instagram.go | 12 +- tools/auth/kakao.go | 12 +- tools/auth/livechat.go | 12 +- tools/auth/mailcow.go | 6 +- tools/auth/microsoft.go | 12 +- tools/auth/oidc.go | 4 +- tools/auth/patreon.go | 12 +- tools/auth/spotify.go | 4 +- tools/auth/strava.go | 4 +- tools/auth/twitch.go | 12 +- tools/auth/twitter.go | 4 +- tools/auth/vk.go | 12 +- tools/auth/yandex.go | 12 +- ...5f3f0dc.js => AuthMethodsDocs-ca345469.js} | 2 +- ...08327ef.js => AuthRefreshDocs-7d5bb1ce.js} | 2 +- ...b670.js => AuthWithOAuth2Docs-8666d543.js} | 2 +- ...69.js => AuthWithPasswordDocs-0d8891cf.js} | 2 +- ...tor-80667d26.js => CodeEditor-6ddcf228.js} | 2 +- ....js => ConfirmEmailChangeDocs-1efc427e.js} | 2 +- ...s => ConfirmPasswordResetDocs-f363f429.js} | 2 +- ...js => ConfirmVerificationDocs-67d8a971.js} | 2 +- ...-8e2e6ca4.js => CreateApiDocs-e470749e.js} | 2 +- ...-98707e26.js => DeleteApiDocs-fd46ff19.js} | 2 +- ...547030.js => FieldsQueryParam-b1f57668.js} | 2 +- ...js => FilterAutocompleteInput-dec586dc.js} | 2 +- ...cs-481c529b.js => ListApiDocs-531b324b.js} | 2 +- ...5.js => ListExternalAuthsDocs-20410026.js} | 2 +- ...PageAdminConfirmPasswordReset-708df40e.js} | 2 +- ...PageAdminRequestPasswordReset-2ec1893c.js} | 2 +- ui/dist/assets/PageOAuth2Redirect-9b9788d9.js | 1 - ui/dist/assets/PageOAuth2Redirect-f3233468.js | 1 + ... PageRecordConfirmEmailChange-9b4c683c.js} | 2 +- ...ageRecordConfirmPasswordReset-b9fe5282.js} | 2 +- ...PageRecordConfirmVerification-392dea19.js} | 2 +- ...e5f186a.js => RealtimeApiDocs-45d83ff0.js} | 2 +- ....js => RequestEmailChangeDocs-0497f3ef.js} | 2 +- ...s => RequestPasswordResetDocs-0d7b5713.js} | 2 +- ...js => RequestVerificationDocs-8c75a2dc.js} | 2 +- ...dkTabs-16daad5a.js => SdkTabs-96702c72.js} | 2 +- ....js => UnlinkExternalAuthDocs-adc881c1.js} | 2 +- ...-59dd218c.js => UpdateApiDocs-ae75e9e7.js} | 2 +- ...cs-a97d2bf3.js => ViewApiDocs-b3a10802.js} | 2 +- .../{index-c4339794.js => index-7b2303b6.js} | 114 +++++++++--------- ui/dist/index.html | 2 +- .../records/PageOAuth2Redirect.svelte | 2 +- .../settings/providers/OIDCOptions.svelte | 48 ++++++++ ui/src/providers.js | 10 +- 65 files changed, 421 insertions(+), 226 deletions(-) rename ui/dist/assets/{AuthMethodsDocs-25f3f0dc.js => AuthMethodsDocs-ca345469.js} (97%) rename ui/dist/assets/{AuthRefreshDocs-208327ef.js => AuthRefreshDocs-7d5bb1ce.js} (97%) rename ui/dist/assets/{AuthWithOAuth2Docs-d0abb670.js => AuthWithOAuth2Docs-8666d543.js} (98%) rename ui/dist/assets/{AuthWithPasswordDocs-28f9fe69.js => AuthWithPasswordDocs-0d8891cf.js} (98%) rename ui/dist/assets/{CodeEditor-80667d26.js => CodeEditor-6ddcf228.js} (99%) rename ui/dist/assets/{ConfirmEmailChangeDocs-207789fe.js => ConfirmEmailChangeDocs-1efc427e.js} (97%) rename ui/dist/assets/{ConfirmPasswordResetDocs-592fbd7c.js => ConfirmPasswordResetDocs-f363f429.js} (98%) rename ui/dist/assets/{ConfirmVerificationDocs-4a55a580.js => ConfirmVerificationDocs-67d8a971.js} (97%) rename ui/dist/assets/{CreateApiDocs-8e2e6ca4.js => CreateApiDocs-e470749e.js} (98%) rename ui/dist/assets/{DeleteApiDocs-98707e26.js => DeleteApiDocs-fd46ff19.js} (97%) rename ui/dist/assets/{FieldsQueryParam-bc547030.js => FieldsQueryParam-b1f57668.js} (95%) rename ui/dist/assets/{FilterAutocompleteInput-66e3909f.js => FilterAutocompleteInput-dec586dc.js} (99%) rename ui/dist/assets/{ListApiDocs-481c529b.js => ListApiDocs-531b324b.js} (99%) rename ui/dist/assets/{ListExternalAuthsDocs-f2601f25.js => ListExternalAuthsDocs-20410026.js} (97%) rename ui/dist/assets/{PageAdminConfirmPasswordReset-b115c254.js => PageAdminConfirmPasswordReset-708df40e.js} (98%) rename ui/dist/assets/{PageAdminRequestPasswordReset-077da760.js => PageAdminRequestPasswordReset-2ec1893c.js} (98%) delete mode 100644 ui/dist/assets/PageOAuth2Redirect-9b9788d9.js create mode 100644 ui/dist/assets/PageOAuth2Redirect-f3233468.js rename ui/dist/assets/{PageRecordConfirmEmailChange-a2506d7e.js => PageRecordConfirmEmailChange-9b4c683c.js} (98%) rename ui/dist/assets/{PageRecordConfirmPasswordReset-b5c0cfd9.js => PageRecordConfirmPasswordReset-b9fe5282.js} (98%) rename ui/dist/assets/{PageRecordConfirmVerification-8a6a1ed8.js => PageRecordConfirmVerification-392dea19.js} (97%) rename ui/dist/assets/{RealtimeApiDocs-9e5f186a.js => RealtimeApiDocs-45d83ff0.js} (98%) rename ui/dist/assets/{RequestEmailChangeDocs-cd0de76f.js => RequestEmailChangeDocs-0497f3ef.js} (98%) rename ui/dist/assets/{RequestPasswordResetDocs-a22604e7.js => RequestPasswordResetDocs-0d7b5713.js} (97%) rename ui/dist/assets/{RequestVerificationDocs-6658a4af.js => RequestVerificationDocs-8c75a2dc.js} (97%) rename ui/dist/assets/{SdkTabs-16daad5a.js => SdkTabs-96702c72.js} (98%) rename ui/dist/assets/{UnlinkExternalAuthDocs-7056f391.js => UnlinkExternalAuthDocs-adc881c1.js} (98%) rename ui/dist/assets/{UpdateApiDocs-59dd218c.js => UpdateApiDocs-ae75e9e7.js} (98%) rename ui/dist/assets/{ViewApiDocs-a97d2bf3.js => ViewApiDocs-b3a10802.js} (97%) rename ui/dist/assets/{index-c4339794.js => index-7b2303b6.js} (71%) create mode 100644 ui/src/components/settings/providers/OIDCOptions.svelte diff --git a/CHANGELOG.md b/CHANGELOG.md index ecd7de54..8ca649e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ Dao.SaveRequest(...) -> Dao.SaveLog(...) ``` -- removed app.IsDebug() and the `--debug` flag +- removed `app.IsDebug()` and the `--debug` flag - (@todo docs) Implemented `slog.Logger` via `app.Logger()`. Logs db writes are debounced and batched. DB write happens on @@ -36,6 +36,13 @@ - Added new `filesystem.Copy(src, dest)` method to copy existing files from one location to another. _This is usually useful when duplicating records with file fields programmatically._ +- Added new `displayName` field for each `listAuthMethods()` OAuth2 provider item. + _The value of the `displayName` property is currently configurable from the UI only for the OIDC providers._ + +- Added new `PKCE()` and `SetPKCE(enable)` OAuth2 methods to indicate whether the PKCE flow is supported or not. + _The PKCE value is currently configurable from the UI only for the OIDC providers._ + _This was added to accommodate OIDC providers that may throw an error if unsupported PKCE params are submitted with the auth request (eg. LinkedIn; see [#3799](https://github.com/pocketbase/pocketbase/discussions/3799#discussioncomment-7640312))._ + ## v0.20.0-rc3 diff --git a/apis/record_auth.go b/apis/record_auth.go index 67fe7172..d9871e33 100644 --- a/apis/record_auth.go +++ b/apis/record_auth.go @@ -74,12 +74,15 @@ func (api *recordAuthApi) authRefresh(c echo.Context) error { } type providerInfo struct { - Name string `json:"name"` - State string `json:"state"` + Name string `json:"name"` + DisplayName string `json:"displayName"` + State string `json:"state"` + AuthUrl string `json:"authUrl"` + // technically could be omitted if the provider doesn't support PKCE, + // but to avoid breaking existing typed clients we'll return them as empty string CodeVerifier string `json:"codeVerifier"` CodeChallenge string `json:"codeChallenge"` CodeChallengeMethod string `json:"codeChallengeMethod"` - AuthUrl string `json:"authUrl"` } func (api *recordAuthApi) authMethods(c echo.Context) error { @@ -91,9 +94,9 @@ func (api *recordAuthApi) authMethods(c echo.Context) error { authOptions := collection.AuthOptions() result := struct { + AuthProviders []providerInfo `json:"authProviders"` UsernamePassword bool `json:"usernamePassword"` EmailPassword bool `json:"emailPassword"` - AuthProviders []providerInfo `json:"authProviders"` }{ UsernamePassword: authOptions.AllowUsernameAuth, EmailPassword: authOptions.AllowEmailAuth, @@ -125,36 +128,41 @@ func (api *recordAuthApi) authMethods(c echo.Context) error { continue // skip provider } - state := security.RandomString(30) - codeVerifier := security.RandomString(43) - codeChallenge := security.S256Challenge(codeVerifier) - codeChallengeMethod := "S256" - urlOpts := []oauth2.AuthCodeOption{ - oauth2.SetAuthURLParam("code_challenge", codeChallenge), - oauth2.SetAuthURLParam("code_challenge_method", codeChallengeMethod), + info := providerInfo{ + Name: name, + DisplayName: provider.DisplayName(), + State: security.RandomString(30), } + if info.DisplayName == "" { + info.DisplayName = name + } + + urlOpts := []oauth2.AuthCodeOption{} + // custom providers url options switch name { case auth.NameApple: // see https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms#3332113 urlOpts = append(urlOpts, oauth2.SetAuthURLParam("response_mode", "query")) - case auth.NameVK: - // vk currently doesn't support PKCE for server-side authorization - urlOpts = []oauth2.AuthCodeOption{} } - result.AuthProviders = append(result.AuthProviders, providerInfo{ - Name: name, - State: state, - CodeVerifier: codeVerifier, - CodeChallenge: codeChallenge, - CodeChallengeMethod: codeChallengeMethod, - AuthUrl: provider.BuildAuthUrl( - state, - urlOpts..., - ) + "&redirect_uri=", // empty redirect_uri so that users can append their redirect url - }) + if provider.PKCE() { + info.CodeVerifier = security.RandomString(43) + info.CodeChallenge = security.S256Challenge(info.CodeVerifier) + info.CodeChallengeMethod = "S256" + urlOpts = append(urlOpts, + oauth2.SetAuthURLParam("code_challenge", info.CodeChallenge), + oauth2.SetAuthURLParam("code_challenge_method", info.CodeChallengeMethod), + ) + } + + info.AuthUrl = provider.BuildAuthUrl( + info.State, + urlOpts..., + ) + "&redirect_uri=" // empty redirect_uri so that users can append their redirect url + + result.AuthProviders = append(result.AuthProviders, info) } // sort providers diff --git a/forms/record_oauth2_login.go b/forms/record_oauth2_login.go index 9c2a7e3f..5fe8ad74 100644 --- a/forms/record_oauth2_login.go +++ b/forms/record_oauth2_login.go @@ -45,7 +45,7 @@ type RecordOAuth2Login struct { // The authorization code returned from the initial request. Code string `form:"code" json:"code"` - // The code verifier sent with the initial request as part of the code_challenge. + // The optional PKCE code verifier as part of the code_challenge sent with the initial request. CodeVerifier string `form:"codeVerifier" json:"codeVerifier"` // The redirect url sent with the initial request. @@ -87,7 +87,6 @@ func (form *RecordOAuth2Login) Validate() error { return validation.ValidateStruct(form, validation.Field(&form.Provider, validation.Required, validation.By(form.checkProviderName)), validation.Field(&form.Code, validation.Required), - validation.Field(&form.CodeVerifier, validation.Required), validation.Field(&form.RedirectUrl, validation.Required), ) } @@ -142,11 +141,14 @@ func (form *RecordOAuth2Login) Submit( provider.SetRedirectUrl(form.RedirectUrl) + var opts []oauth2.AuthCodeOption + + if provider.PKCE() { + opts = append(opts, oauth2.SetAuthURLParam("code_verifier", form.CodeVerifier)) + } + // fetch token - token, err := provider.FetchToken( - form.Code, - oauth2.SetAuthURLParam("code_verifier", form.CodeVerifier), - ) + token, err := provider.FetchToken(form.Code, opts...) if err != nil { return nil, nil, err } diff --git a/forms/record_oauth2_login_test.go b/forms/record_oauth2_login_test.go index 077779eb..a1e2539f 100644 --- a/forms/record_oauth2_login_test.go +++ b/forms/record_oauth2_login_test.go @@ -23,13 +23,13 @@ func TestUserOauth2LoginValidate(t *testing.T) { "empty payload", "users", "{}", - []string{"provider", "code", "codeVerifier", "redirectUrl"}, + []string{"provider", "code", "redirectUrl"}, }, { "empty data", "users", `{"provider":"","code":"","codeVerifier":"","redirectUrl":""}`, - []string{"provider", "code", "codeVerifier", "redirectUrl"}, + []string{"provider", "code", "redirectUrl"}, }, { "missing provider", diff --git a/models/request.go b/models/request.go index dbefc91c..483eb7d8 100644 --- a/models/request.go +++ b/models/request.go @@ -8,7 +8,7 @@ var _ Model = (*Request)(nil) const ( RequestAuthGuest = "guest" RequestAuthAdmin = "admin" - RequestAuthRecord = "auth_record" + RequestAuthRecord = "authRecord" ) type Request struct { diff --git a/models/settings/settings.go b/models/settings/settings.go index 3539ba26..2b5f1e89 100644 --- a/models/settings/settings.go +++ b/models/settings/settings.go @@ -620,6 +620,8 @@ type AuthProviderConfig struct { AuthUrl string `form:"authUrl" json:"authUrl"` TokenUrl string `form:"tokenUrl" json:"tokenUrl"` UserApiUrl string `form:"userApiUrl" json:"userApiUrl"` + DisplayName string `form:"displayName" json:"displayName"` + PKCE *bool `form:"pkce" json:"pkce"` } // Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface. @@ -659,6 +661,14 @@ func (c AuthProviderConfig) SetupProvider(provider auth.Provider) error { provider.SetTokenUrl(c.TokenUrl) } + if c.DisplayName != "" { + provider.SetDisplayName(c.DisplayName) + } + + if c.PKCE != nil { + provider.SetPKCE(*c.PKCE) + } + return nil } diff --git a/models/settings/settings_test.go b/models/settings/settings_test.go index 9bbda12f..9fea9ff5 100644 --- a/models/settings/settings_test.go +++ b/models/settings/settings_test.go @@ -11,6 +11,7 @@ import ( "github.com/pocketbase/pocketbase/models/settings" "github.com/pocketbase/pocketbase/tools/auth" "github.com/pocketbase/pocketbase/tools/mailer" + "github.com/pocketbase/pocketbase/tools/types" ) func TestSettingsValidate(t *testing.T) { @@ -941,6 +942,8 @@ func TestAuthProviderConfigValidate(t *testing.T) { Enabled: true, ClientId: "test", ClientSecret: "test", + DisplayName: "test", + PKCE: types.Pointer(true), AuthUrl: "https://example.com", TokenUrl: "https://example.com", UserApiUrl: "https://example.com", @@ -978,6 +981,8 @@ func TestAuthProviderConfigSetupProvider(t *testing.T) { AuthUrl: "test_AuthUrl", UserApiUrl: "test_UserApiUrl", TokenUrl: "test_TokenUrl", + DisplayName: "test_DisplayName", + PKCE: types.Pointer(true), } if err := c2.SetupProvider(provider); err != nil { t.Error(err) @@ -1002,4 +1007,12 @@ func TestAuthProviderConfigSetupProvider(t *testing.T) { if provider.TokenUrl() != c2.TokenUrl { t.Fatalf("Expected TokenUrl %s, got %s", c2.TokenUrl, provider.TokenUrl()) } + + if provider.DisplayName() != c2.DisplayName { + t.Fatalf("Expected DisplayName %s, got %s", c2.DisplayName, provider.DisplayName()) + } + + if provider.PKCE() != *c2.PKCE { + t.Fatalf("Expected PKCE %v, got %v", *c2.PKCE, provider.PKCE()) + } } diff --git a/tools/auth/apple.go b/tools/auth/apple.go index 49fd48dc..8bc76ba3 100644 --- a/tools/auth/apple.go +++ b/tools/auth/apple.go @@ -36,10 +36,12 @@ type Apple struct { func NewAppleProvider() *Apple { return &Apple{ baseProvider: &baseProvider{ - scopes: nil, // custom scopes are currently not supported since they require a POST redirect - ctx: context.Background(), - authUrl: "https://appleid.apple.com/auth/authorize", - tokenUrl: "https://appleid.apple.com/auth/token", + ctx: context.Background(), + displayName: "Apple", + pkce: true, + scopes: nil, // custom scopes are currently not supported since they require a POST redirect + authUrl: "https://appleid.apple.com/auth/authorize", + tokenUrl: "https://appleid.apple.com/auth/token", }, jwksUrl: "https://appleid.apple.com/auth/keys", } diff --git a/tools/auth/auth.go b/tools/auth/auth.go index d69b3493..69be94c2 100644 --- a/tools/auth/auth.go +++ b/tools/auth/auth.go @@ -16,10 +16,10 @@ type AuthUser struct { Username string `json:"username"` Email string `json:"email"` AvatarUrl string `json:"avatarUrl"` - RawUser map[string]any `json:"rawUser"` AccessToken string `json:"accessToken"` RefreshToken string `json:"refreshToken"` Expiry types.DateTime `json:"expiry"` + RawUser map[string]any `json:"rawUser"` } // Provider defines a common interface for an OAuth2 client. @@ -30,6 +30,19 @@ type Provider interface { // SetContext assigns the specified context to the current provider. SetContext(ctx context.Context) + // PKCE indicates whether the provider can use the PKCE flow. + PKCE() bool + + // SetPKCE toggles the state whether the provider can use the PKCE flow or not. + SetPKCE(enable bool) + + // DisplayName usually returns provider name as it is officially written + // and it could be used directly in the UI. + DisplayName() string + + // SetDisplayName sets the provider's display name. + SetDisplayName(displayName string) + // Scopes returns the provider access permissions that will be requested. Scopes() []string diff --git a/tools/auth/base_provider.go b/tools/auth/base_provider.go index 7b250280..afda229f 100644 --- a/tools/auth/base_provider.go +++ b/tools/auth/base_provider.go @@ -12,13 +12,15 @@ import ( // baseProvider defines common fields and methods used by OAuth2 client providers. type baseProvider struct { ctx context.Context - scopes []string clientId string clientSecret string + displayName string redirectUrl string authUrl string tokenUrl string userApiUrl string + scopes []string + pkce bool } // Context implements Provider.Context() interface method. @@ -31,6 +33,26 @@ func (p *baseProvider) SetContext(ctx context.Context) { p.ctx = ctx } +// PKCE implements Provider.PKCE() interface method. +func (p *baseProvider) PKCE() bool { + return p.pkce +} + +// SetPKCE implements Provider.SetPKCE() interface method. +func (p *baseProvider) SetPKCE(enable bool) { + p.pkce = enable +} + +// DisplayName implements Provider.DisplayName() interface method. +func (p *baseProvider) DisplayName() string { + return p.displayName +} + +// SetDisplayName implements Provider.SetDisplayName() interface method. +func (p *baseProvider) SetDisplayName(displayName string) { + p.displayName = displayName +} + // Scopes implements Provider.Scopes() interface method. func (p *baseProvider) Scopes() []string { return p.scopes diff --git a/tools/auth/base_provider_test.go b/tools/auth/base_provider_test.go index 052eb8eb..d4e52c2c 100644 --- a/tools/auth/base_provider_test.go +++ b/tools/auth/base_provider_test.go @@ -23,19 +23,51 @@ func TestContext(t *testing.T) { } } +func TestDisplayName(t *testing.T) { + b := baseProvider{} + + before := b.DisplayName() + if before != "" { + t.Fatalf("Expected displayName to be empty, got %v", before) + } + + b.SetDisplayName("test") + + after := b.DisplayName() + if after != "test" { + t.Fatalf("Expected displayName to be 'test', got %v", after) + } +} + +func TestPKCE(t *testing.T) { + b := baseProvider{} + + before := b.PKCE() + if before != false { + t.Fatalf("Expected pkce to be %v, got %v", false, before) + } + + b.SetPKCE(true) + + after := b.PKCE() + if after != true { + t.Fatalf("Expected pkce to be %v, got %v", true, after) + } +} + func TestScopes(t *testing.T) { b := baseProvider{} before := b.Scopes() if len(before) != 0 { - t.Errorf("Expected 0 scopes, got %v", before) + t.Fatalf("Expected 0 scopes, got %v", before) } b.SetScopes([]string{"test1", "test2"}) after := b.Scopes() if len(after) != 2 { - t.Errorf("Expected 2 scopes, got %v", after) + t.Fatalf("Expected 2 scopes, got %v", after) } } @@ -44,14 +76,14 @@ func TestClientId(t *testing.T) { before := b.ClientId() if before != "" { - t.Errorf("Expected clientId to be empty, got %v", before) + t.Fatalf("Expected clientId to be empty, got %v", before) } b.SetClientId("test") after := b.ClientId() if after != "test" { - t.Errorf("Expected clientId to be 'test', got %v", after) + t.Fatalf("Expected clientId to be 'test', got %v", after) } } @@ -60,14 +92,14 @@ func TestClientSecret(t *testing.T) { before := b.ClientSecret() if before != "" { - t.Errorf("Expected clientSecret to be empty, got %v", before) + t.Fatalf("Expected clientSecret to be empty, got %v", before) } b.SetClientSecret("test") after := b.ClientSecret() if after != "test" { - t.Errorf("Expected clientSecret to be 'test', got %v", after) + t.Fatalf("Expected clientSecret to be 'test', got %v", after) } } @@ -76,14 +108,14 @@ func TestRedirectUrl(t *testing.T) { before := b.RedirectUrl() if before != "" { - t.Errorf("Expected RedirectUrl to be empty, got %v", before) + t.Fatalf("Expected RedirectUrl to be empty, got %v", before) } b.SetRedirectUrl("test") after := b.RedirectUrl() if after != "test" { - t.Errorf("Expected RedirectUrl to be 'test', got %v", after) + t.Fatalf("Expected RedirectUrl to be 'test', got %v", after) } } @@ -92,14 +124,14 @@ func TestAuthUrl(t *testing.T) { before := b.AuthUrl() if before != "" { - t.Errorf("Expected authUrl to be empty, got %v", before) + t.Fatalf("Expected authUrl to be empty, got %v", before) } b.SetAuthUrl("test") after := b.AuthUrl() if after != "test" { - t.Errorf("Expected authUrl to be 'test', got %v", after) + t.Fatalf("Expected authUrl to be 'test', got %v", after) } } @@ -108,14 +140,14 @@ func TestTokenUrl(t *testing.T) { before := b.TokenUrl() if before != "" { - t.Errorf("Expected tokenUrl to be empty, got %v", before) + t.Fatalf("Expected tokenUrl to be empty, got %v", before) } b.SetTokenUrl("test") after := b.TokenUrl() if after != "test" { - t.Errorf("Expected tokenUrl to be 'test', got %v", after) + t.Fatalf("Expected tokenUrl to be 'test', got %v", after) } } @@ -124,14 +156,14 @@ func TestUserApiUrl(t *testing.T) { before := b.UserApiUrl() if before != "" { - t.Errorf("Expected userApiUrl to be empty, got %v", before) + t.Fatalf("Expected userApiUrl to be empty, got %v", before) } b.SetUserApiUrl("test") after := b.UserApiUrl() if after != "test" { - t.Errorf("Expected userApiUrl to be 'test', got %v", after) + t.Fatalf("Expected userApiUrl to be 'test', got %v", after) } } diff --git a/tools/auth/discord.go b/tools/auth/discord.go index 1fc86b7c..097ff068 100644 --- a/tools/auth/discord.go +++ b/tools/auth/discord.go @@ -24,11 +24,13 @@ func NewDiscordProvider() *Discord { // https://discord.com/developers/docs/topics/oauth2 // https://discord.com/developers/docs/resources/user#get-current-user return &Discord{&baseProvider{ - ctx: context.Background(), - scopes: []string{"identify", "email"}, - authUrl: "https://discord.com/api/oauth2/authorize", - tokenUrl: "https://discord.com/api/oauth2/token", - userApiUrl: "https://discord.com/api/users/@me", + ctx: context.Background(), + displayName: "Discord", + pkce: true, + scopes: []string{"identify", "email"}, + authUrl: "https://discord.com/api/oauth2/authorize", + tokenUrl: "https://discord.com/api/oauth2/token", + userApiUrl: "https://discord.com/api/users/@me", }} } @@ -50,9 +52,9 @@ func (p *Discord) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) { Id string `json:"id"` Username string `json:"username"` Discriminator string `json:"discriminator"` + Avatar string `json:"avatar"` Email string `json:"email"` Verified bool `json:"verified"` - Avatar string `json:"avatar"` }{} if err := json.Unmarshal(data, &extracted); err != nil { return nil, err diff --git a/tools/auth/facebook.go b/tools/auth/facebook.go index fb16b059..5aa9c1cd 100644 --- a/tools/auth/facebook.go +++ b/tools/auth/facebook.go @@ -22,11 +22,13 @@ type Facebook struct { // NewFacebookProvider creates new Facebook provider instance with some defaults. func NewFacebookProvider() *Facebook { return &Facebook{&baseProvider{ - ctx: context.Background(), - scopes: []string{"email"}, - authUrl: facebook.Endpoint.AuthURL, - tokenUrl: facebook.Endpoint.TokenURL, - userApiUrl: "https://graph.facebook.com/me?fields=name,email,picture.type(large)", + ctx: context.Background(), + displayName: "Facebook", + pkce: true, + scopes: []string{"email"}, + authUrl: facebook.Endpoint.AuthURL, + tokenUrl: facebook.Endpoint.TokenURL, + userApiUrl: "https://graph.facebook.com/me?fields=name,email,picture.type(large)", }} } diff --git a/tools/auth/gitea.go b/tools/auth/gitea.go index 2643b184..b60f3c4f 100644 --- a/tools/auth/gitea.go +++ b/tools/auth/gitea.go @@ -22,11 +22,13 @@ type Gitea struct { // NewGiteaProvider creates new Gitea provider instance with some defaults. func NewGiteaProvider() *Gitea { return &Gitea{&baseProvider{ - ctx: context.Background(), - scopes: []string{"read:user", "user:email"}, - authUrl: "https://gitea.com/login/oauth/authorize", - tokenUrl: "https://gitea.com/login/oauth/access_token", - userApiUrl: "https://gitea.com/api/v1/user", + ctx: context.Background(), + displayName: "Gitea", + pkce: true, + scopes: []string{"read:user", "user:email"}, + authUrl: "https://gitea.com/login/oauth/authorize", + tokenUrl: "https://gitea.com/login/oauth/access_token", + userApiUrl: "https://gitea.com/api/v1/user", }} } diff --git a/tools/auth/gitee.go b/tools/auth/gitee.go index 64362517..fea0a34d 100644 --- a/tools/auth/gitee.go +++ b/tools/auth/gitee.go @@ -24,11 +24,13 @@ type Gitee struct { // NewGiteeProvider creates new Gitee provider instance with some defaults. func NewGiteeProvider() *Gitee { return &Gitee{&baseProvider{ - ctx: context.Background(), - scopes: []string{"user_info", "emails"}, - authUrl: "https://gitee.com/oauth/authorize", - tokenUrl: "https://gitee.com/oauth/token", - userApiUrl: "https://gitee.com/api/v5/user", + ctx: context.Background(), + displayName: "Gitee", + pkce: true, + scopes: []string{"user_info", "emails"}, + authUrl: "https://gitee.com/oauth/authorize", + tokenUrl: "https://gitee.com/oauth/token", + userApiUrl: "https://gitee.com/api/v5/user", }} } diff --git a/tools/auth/github.go b/tools/auth/github.go index b8c142a5..d3e77539 100644 --- a/tools/auth/github.go +++ b/tools/auth/github.go @@ -24,11 +24,13 @@ type Github struct { // NewGithubProvider creates new Github provider instance with some defaults. func NewGithubProvider() *Github { return &Github{&baseProvider{ - ctx: context.Background(), - scopes: []string{"read:user", "user:email"}, - authUrl: github.Endpoint.AuthURL, - tokenUrl: github.Endpoint.TokenURL, - userApiUrl: "https://api.github.com/user", + ctx: context.Background(), + displayName: "GitHub", + pkce: true, // technically is not suppoted yet but it is safe as the PKCE params are just ignored + scopes: []string{"read:user", "user:email"}, + authUrl: github.Endpoint.AuthURL, + tokenUrl: github.Endpoint.TokenURL, + userApiUrl: "https://api.github.com/user", }} } diff --git a/tools/auth/gitlab.go b/tools/auth/gitlab.go index c7a1931b..09d04b1a 100644 --- a/tools/auth/gitlab.go +++ b/tools/auth/gitlab.go @@ -22,11 +22,13 @@ type Gitlab struct { // NewGitlabProvider creates new Gitlab provider instance with some defaults. func NewGitlabProvider() *Gitlab { return &Gitlab{&baseProvider{ - ctx: context.Background(), - scopes: []string{"read_user"}, - authUrl: "https://gitlab.com/oauth/authorize", - tokenUrl: "https://gitlab.com/oauth/token", - userApiUrl: "https://gitlab.com/api/v4/user", + ctx: context.Background(), + displayName: "GitLab", + pkce: true, + scopes: []string{"read_user"}, + authUrl: "https://gitlab.com/oauth/authorize", + tokenUrl: "https://gitlab.com/oauth/token", + userApiUrl: "https://gitlab.com/api/v4/user", }} } diff --git a/tools/auth/google.go b/tools/auth/google.go index c0ff7f7a..1b7d114c 100644 --- a/tools/auth/google.go +++ b/tools/auth/google.go @@ -21,7 +21,9 @@ type Google struct { // NewGoogleProvider creates new Google provider instance with some defaults. func NewGoogleProvider() *Google { return &Google{&baseProvider{ - ctx: context.Background(), + ctx: context.Background(), + displayName: "Google", + pkce: true, scopes: []string{ "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/userinfo.email", diff --git a/tools/auth/instagram.go b/tools/auth/instagram.go index a6ef9cf8..c28c7537 100644 --- a/tools/auth/instagram.go +++ b/tools/auth/instagram.go @@ -22,11 +22,13 @@ type Instagram struct { // NewInstagramProvider creates new Instagram provider instance with some defaults. func NewInstagramProvider() *Instagram { return &Instagram{&baseProvider{ - ctx: context.Background(), - scopes: []string{"user_profile"}, - authUrl: instagram.Endpoint.AuthURL, - tokenUrl: instagram.Endpoint.TokenURL, - userApiUrl: "https://graph.instagram.com/me?fields=id,username,account_type", + ctx: context.Background(), + displayName: "Instagram", + pkce: true, + scopes: []string{"user_profile"}, + authUrl: instagram.Endpoint.AuthURL, + tokenUrl: instagram.Endpoint.TokenURL, + userApiUrl: "https://graph.instagram.com/me?fields=id,username,account_type", }} } diff --git a/tools/auth/kakao.go b/tools/auth/kakao.go index b8455d4e..ef5e7265 100644 --- a/tools/auth/kakao.go +++ b/tools/auth/kakao.go @@ -23,11 +23,13 @@ type Kakao struct { // NewKakaoProvider creates a new Kakao provider instance with some defaults. func NewKakaoProvider() *Kakao { return &Kakao{&baseProvider{ - ctx: context.Background(), - scopes: []string{"account_email", "profile_nickname", "profile_image"}, - authUrl: kakao.Endpoint.AuthURL, - tokenUrl: kakao.Endpoint.TokenURL, - userApiUrl: "https://kapi.kakao.com/v2/user/me", + ctx: context.Background(), + displayName: "Kakao", + pkce: true, + scopes: []string{"account_email", "profile_nickname", "profile_image"}, + authUrl: kakao.Endpoint.AuthURL, + tokenUrl: kakao.Endpoint.TokenURL, + userApiUrl: "https://kapi.kakao.com/v2/user/me", }} } diff --git a/tools/auth/livechat.go b/tools/auth/livechat.go index 96e30136..ee644817 100644 --- a/tools/auth/livechat.go +++ b/tools/auth/livechat.go @@ -21,11 +21,13 @@ type Livechat struct { // NewLivechatProvider creates new Livechat provider instance with some defaults. func NewLivechatProvider() *Livechat { return &Livechat{&baseProvider{ - ctx: context.Background(), - scopes: []string{}, // default scopes are specified from the provider dashboard - authUrl: "https://accounts.livechat.com/", - tokenUrl: "https://accounts.livechat.com/token", - userApiUrl: "https://accounts.livechat.com/v2/accounts/me", + ctx: context.Background(), + displayName: "LiveChat", + pkce: true, + scopes: []string{}, // default scopes are specified from the provider dashboard + authUrl: "https://accounts.livechat.com/", + tokenUrl: "https://accounts.livechat.com/token", + userApiUrl: "https://accounts.livechat.com/v2/accounts/me", }} } diff --git a/tools/auth/mailcow.go b/tools/auth/mailcow.go index ee4f19c3..8ce5f276 100644 --- a/tools/auth/mailcow.go +++ b/tools/auth/mailcow.go @@ -23,8 +23,10 @@ type Mailcow struct { // NewMailcowProvider creates a new mailcow provider instance with some defaults. func NewMailcowProvider() *Mailcow { return &Mailcow{&baseProvider{ - ctx: context.Background(), - scopes: []string{"profile"}, + ctx: context.Background(), + displayName: "mailcow", + pkce: true, + scopes: []string{"profile"}, }} } diff --git a/tools/auth/microsoft.go b/tools/auth/microsoft.go index 6152f04e..f9cc7c06 100644 --- a/tools/auth/microsoft.go +++ b/tools/auth/microsoft.go @@ -23,11 +23,13 @@ type Microsoft struct { func NewMicrosoftProvider() *Microsoft { endpoints := microsoft.AzureADEndpoint("") return &Microsoft{&baseProvider{ - ctx: context.Background(), - scopes: []string{"User.Read"}, - authUrl: endpoints.AuthURL, - tokenUrl: endpoints.TokenURL, - userApiUrl: "https://graph.microsoft.com/v1.0/me", + ctx: context.Background(), + displayName: "Microsoft", + pkce: true, + scopes: []string{"User.Read"}, + authUrl: endpoints.AuthURL, + tokenUrl: endpoints.TokenURL, + userApiUrl: "https://graph.microsoft.com/v1.0/me", }} } diff --git a/tools/auth/oidc.go b/tools/auth/oidc.go index 47c1bbfe..c5ccf2b6 100644 --- a/tools/auth/oidc.go +++ b/tools/auth/oidc.go @@ -21,7 +21,9 @@ type OIDC struct { // NewOIDCProvider creates new OpenID Connect (OIDC) provider instance with some defaults. func NewOIDCProvider() *OIDC { return &OIDC{&baseProvider{ - ctx: context.Background(), + ctx: context.Background(), + displayName: "OIDC", + pkce: true, scopes: []string{ "openid", // minimal requirement to return the id "email", diff --git a/tools/auth/patreon.go b/tools/auth/patreon.go index f06c6516..d981d2de 100644 --- a/tools/auth/patreon.go +++ b/tools/auth/patreon.go @@ -21,11 +21,13 @@ type Patreon struct { // NewPatreonProvider creates new Patreon provider instance with some defaults. func NewPatreonProvider() *Patreon { return &Patreon{&baseProvider{ - ctx: context.Background(), - scopes: []string{"identity", "identity[email]"}, - authUrl: "https://www.patreon.com/oauth2/authorize", - tokenUrl: "https://www.patreon.com/api/oauth2/token", - userApiUrl: "https://www.patreon.com/api/oauth2/v2/identity?fields%5Buser%5D=full_name,email,vanity,image_url,is_email_verified", + ctx: context.Background(), + displayName: "Patreon", + pkce: true, + scopes: []string{"identity", "identity[email]"}, + authUrl: "https://www.patreon.com/oauth2/authorize", + tokenUrl: "https://www.patreon.com/api/oauth2/token", + userApiUrl: "https://www.patreon.com/api/oauth2/v2/identity?fields%5Buser%5D=full_name,email,vanity,image_url,is_email_verified", }} } diff --git a/tools/auth/spotify.go b/tools/auth/spotify.go index 6c30adf9..0dcc19d5 100644 --- a/tools/auth/spotify.go +++ b/tools/auth/spotify.go @@ -22,7 +22,9 @@ type Spotify struct { // NewSpotifyProvider creates a new Spotify provider instance with some defaults. func NewSpotifyProvider() *Spotify { return &Spotify{&baseProvider{ - ctx: context.Background(), + ctx: context.Background(), + displayName: "Spotify", + pkce: true, scopes: []string{ "user-read-private", // currently Spotify doesn't return information whether the email is verified or not diff --git a/tools/auth/strava.go b/tools/auth/strava.go index e9f91c8e..6a860f0a 100644 --- a/tools/auth/strava.go +++ b/tools/auth/strava.go @@ -22,7 +22,9 @@ type Strava struct { // NewStravaProvider creates new Strava provider instance with some defaults. func NewStravaProvider() *Strava { return &Strava{&baseProvider{ - ctx: context.Background(), + ctx: context.Background(), + displayName: "Strava", + pkce: true, scopes: []string{ "profile:read_all", }, diff --git a/tools/auth/twitch.go b/tools/auth/twitch.go index 0d523ad6..2c211a74 100644 --- a/tools/auth/twitch.go +++ b/tools/auth/twitch.go @@ -24,11 +24,13 @@ type Twitch struct { // NewTwitchProvider creates new Twitch provider instance with some defaults. func NewTwitchProvider() *Twitch { return &Twitch{&baseProvider{ - ctx: context.Background(), - scopes: []string{"user:read:email"}, - authUrl: twitch.Endpoint.AuthURL, - tokenUrl: twitch.Endpoint.TokenURL, - userApiUrl: "https://api.twitch.tv/helix/users", + ctx: context.Background(), + displayName: "Twitch", + pkce: true, + scopes: []string{"user:read:email"}, + authUrl: twitch.Endpoint.AuthURL, + tokenUrl: twitch.Endpoint.TokenURL, + userApiUrl: "https://api.twitch.tv/helix/users", }} } diff --git a/tools/auth/twitter.go b/tools/auth/twitter.go index 7fc11a30..b7e4a7eb 100644 --- a/tools/auth/twitter.go +++ b/tools/auth/twitter.go @@ -21,7 +21,9 @@ type Twitter struct { // NewTwitterProvider creates new Twitter provider instance with some defaults. func NewTwitterProvider() *Twitter { return &Twitter{&baseProvider{ - ctx: context.Background(), + ctx: context.Background(), + displayName: "Twitter", + pkce: true, scopes: []string{ "users.read", diff --git a/tools/auth/vk.go b/tools/auth/vk.go index 0446c5da..622752d1 100644 --- a/tools/auth/vk.go +++ b/tools/auth/vk.go @@ -28,11 +28,13 @@ type VK struct { // Docs: https://dev.vk.com/api/oauth-parameters func NewVKProvider() *VK { return &VK{&baseProvider{ - ctx: context.Background(), - scopes: []string{"email"}, - authUrl: vk.Endpoint.AuthURL, - tokenUrl: vk.Endpoint.TokenURL, - userApiUrl: "https://api.vk.com/method/users.get?fields=photo_max,screen_name&v=5.131", + ctx: context.Background(), + displayName: "ВКонтакте", + pkce: false, // VK currently doesn't support PKCE and throws an error if PKCE params are send + scopes: []string{"email"}, + authUrl: vk.Endpoint.AuthURL, + tokenUrl: vk.Endpoint.TokenURL, + userApiUrl: "https://api.vk.com/method/users.get?fields=photo_max,screen_name&v=5.131", }} } diff --git a/tools/auth/yandex.go b/tools/auth/yandex.go index 8b03126a..6ec1c90e 100644 --- a/tools/auth/yandex.go +++ b/tools/auth/yandex.go @@ -24,11 +24,13 @@ 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, - userApiUrl: "https://login.yandex.ru/info", + ctx: context.Background(), + displayName: "Yandex", + pkce: true, + scopes: []string{"login:email", "login:avatar", "login:info"}, + authUrl: yandex.Endpoint.AuthURL, + tokenUrl: yandex.Endpoint.TokenURL, + userApiUrl: "https://login.yandex.ru/info", }} } diff --git a/ui/dist/assets/AuthMethodsDocs-25f3f0dc.js b/ui/dist/assets/AuthMethodsDocs-ca345469.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-25f3f0dc.js rename to ui/dist/assets/AuthMethodsDocs-ca345469.js index 1fd2ffad..b01654e2 100644 --- a/ui/dist/assets/AuthMethodsDocs-25f3f0dc.js +++ b/ui/dist/assets/AuthMethodsDocs-ca345469.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-c4339794.js";import{S as Ke}from"./SdkTabs-16daad5a.js";import{F as qe}from"./FieldsQueryParam-bc547030.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-7b2303b6.js";import{S as Ke}from"./SdkTabs-96702c72.js";import{F as qe}from"./FieldsQueryParam-b1f57668.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-208327ef.js b/ui/dist/assets/AuthRefreshDocs-7d5bb1ce.js similarity index 97% rename from ui/dist/assets/AuthRefreshDocs-208327ef.js rename to ui/dist/assets/AuthRefreshDocs-7d5bb1ce.js index db6bb1a0..2007d667 100644 --- a/ui/dist/assets/AuthRefreshDocs-208327ef.js +++ b/ui/dist/assets/AuthRefreshDocs-7d5bb1ce.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-c4339794.js";import{S as Ze}from"./SdkTabs-16daad5a.js";import{F as et}from"./FieldsQueryParam-bc547030.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-7b2303b6.js";import{S as Ze}from"./SdkTabs-96702c72.js";import{F as et}from"./FieldsQueryParam-b1f57668.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-d0abb670.js b/ui/dist/assets/AuthWithOAuth2Docs-8666d543.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-d0abb670.js rename to ui/dist/assets/AuthWithOAuth2Docs-8666d543.js index 98e338ee..916ccef3 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-d0abb670.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-8666d543.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,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 Ue,Q as Qe,k as xe,R as ze,n as Ie,t as L,a as E,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-c4339794.js";import{S as Xe}from"./SdkTabs-16daad5a.js";import{F as Ye}from"./FieldsQueryParam-bc547030.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,J,be,N,R,me,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,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 Ue,Q as Qe,k as xe,R as ze,n as Ie,t as L,a as E,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-7b2303b6.js";import{S as Xe}from"./SdkTabs-96702c72.js";import{F as Ye}from"./FieldsQueryParam-b1f57668.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,J,be,N,R,me,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-28f9fe69.js b/ui/dist/assets/AuthWithPasswordDocs-0d8891cf.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-28f9fe69.js rename to ui/dist/assets/AuthWithPasswordDocs-0d8891cf.js index d3029909..18877685 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-28f9fe69.js +++ b/ui/dist/assets/AuthWithPasswordDocs-0d8891cf.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-c4339794.js";import{S as Ue}from"./SdkTabs-16daad5a.js";import{F as Me}from"./FieldsQueryParam-bc547030.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-7b2303b6.js";import{S as Ue}from"./SdkTabs-96702c72.js";import{F as Me}from"./FieldsQueryParam-b1f57668.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-80667d26.js b/ui/dist/assets/CodeEditor-6ddcf228.js similarity index 99% rename from ui/dist/assets/CodeEditor-80667d26.js rename to ui/dist/assets/CodeEditor-6ddcf228.js index dbf64cc9..0af5105f 100644 --- a/ui/dist/assets/CodeEditor-80667d26.js +++ b/ui/dist/assets/CodeEditor-6ddcf228.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-c4339794.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 n,y as Ct,L as J,z as L,A as C,B as F,F as Te,G as M,H as V,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 jt,X as Vt,a as z,h as zt,b as Gt,c as At,d as Et,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-102ce751.js";class re{constructor(e,a,t,r,s,i,l,o,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=o,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 Ae(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)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,o)}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,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}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;so&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 o=i&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],o,!1)>=0)return l<<19|65536|o}}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.storeNode(0,this.pos,this.pos,4,!0),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 Ae{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 o=i-32;if(o>=46&&(o-=46,l=!0),s+=o,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 Ee=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=Ee,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=Ee,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 u=O[p];if(o.allows(u)&&(e.token.value==-1||e.token.value==u||sa(u,e.token.value,r,s))){e.acceptToken(u);break}}let d=e.next,c=0,S=O[i+2];if(e.next<0&&S>c&&O[Q+S*3-3]==65535){i=O[Q+S*3-1];continue e}for(;c>1,u=Q+p+(p<<1),f=O[u],g=O[u+1]||65536;if(d=g)c=p+1;else{i=O[u+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 na{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,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let S=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>S))break}}for(;this.actions.length>a;)this.actions.pop();return o&&e.setLookAhead(o),!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 o=this.tokens.getMainToken(l);s.push(o.value,o.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,o)=>o.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(o--,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 S=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(S>-1&&c.length&&(!Q||(c.prop(we.contextHash)||0)==d))return e.useNode(c,S),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>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let Q=0;Qr?a.push(u):t.push(u)}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(),S=d;for(let p=0;c.forceReduce()&&p<10&&(Z&&console.log(S+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)Z&&(S=this.stackID(c)+" -> ");for(let p of l.recoverByInsert(o))Z&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,o=0),l.recoverByDelete(o,Q),Z&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),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,o,l[Q++]);else{let c=l[Q+-d];for(let S=-d;S>0;S--)s(l[Q++],o,c);Q++}}}this.nodeSet=new _t(a.map((l,o)=>Wt.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:r[o],top:t.indexOf(o)>-1,error:o==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-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 oa(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,o=r[s++];if(l&&t)return o;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 jO=60,ne=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!=jO){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==ne&&e>=2){a>=3&&O.acceptToken(Le,-2);break}else e=0;O.advance()}});function Aa(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Ea=new x((O,e)=>{if(O.next==_e&&O.peek(1)==ne){let a=e.dialectEnabled(Ta)||Aa(e.context);O.acceptToken(a?fa:Je,2)}else O.next==ne&&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==jO||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":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.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:Va,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,o,a);if(Q==Ya)return Se(l,o,t);if(Q==ya)return Se(l,o,r);if(Q==UO&&s.length){let d=l.node,c=d.firstChild,S=c&&OO(c,o),p;if(S){for(let u of s)if(u.tag==S&&(!u.attrs||u.attrs(p||(p=VO(d,o))))){let f=d.lastChild,g=f.type.id==wa?f.from:d.to;if(g>c.to)return{parser:u.parser,overlay:[{from:c.to,to:g}]}}}}if(i&&Q==CO){let d=l.node,c;if(c=d.firstChild){let S=i[o.read(c.from,c.to)];if(S)for(let p of S){if(p.tagName&&p.tagName!=OO(d.parent,o))continue;let u=d.lastChild;if(u.type.id==Xe){let f=u.from+1,g=u.lastChild,X=u.to-(g&&g.isError?0:1);if(X>f)return{parser:p.parser,overlay:[{from:f,to:X}]}}else if(u.type.id==RO)return{parser:p.parser,overlay:[{from:u.from,to:u.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,AO=95,er=91,te=45,Or=46,tr=35,ar=37,rr=38,ir=92,sr=10;function oe(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function lr(O){return O>=48&&O<=57}const nr=new x((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(oe(s)||s==te||s==AO||a&&lr(s))!a&&(s!=te||r>0)&&(a=!0),t===r&&s==te&&t++,O.advance();else if(s==ir&&O.peek(1)!=sr)O.advance(),O.next>-1&&O.advance(),a=!0;else{a&&O.acceptToken(s==Ha?Fa:t==2&&e.canShift(aO)?aO:Ma);break}}}),or=new x(O=>{if(GO.includes(O.peek(-1))){let{next:e}=O;(oe(e)||e==AO||e==tr||e==Or||e==er||e==Ka||e==te||e==rr)&&O.acceptToken(La)}}),cr=new x(O=>{if(!GO.includes(O.peek(-1))){let{next:e}=O;if(e==ar&&(O.advance(),O.acceptToken(tO)),oe(e)){do O.advance();while(oe(O.next));O.acceptToken(tO)}}}),Qr=D({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),pr={__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},dr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},hr={__proto__:null,not:128,only:128},ur=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:[or,cr,nr,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=>pr[O]||-1},{term:56,get:O=>dr[O]||-1},{term:98,get:O=>hr[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}))),Sr=["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-]*|)$/,$r=/^-(-[\w-]*)?$/;function fr(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,gr=["Declaration"];function mr(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function EO(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 EO(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(gr)&&((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 Pr=O=>e=>{let{state:a,pos:t}=e,r=V(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)&&fr(r,a.doc))return{from:O(r)||s?r.from:t,options:EO(a.doc,mr(r),O),validFor:$r};if(r.name=="TagName"){for(let{parent:o}=r;o;o=o.parent)if(o.name=="Block")return{from:r.from,options:fe(),validFor:v};return{from:r.from,options:Sr,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},Zr=Pr(O=>O.name=="VariableName"),ce=J.define({name:"css",parser:ur.configure({props:[L.add({Declaration:C()}),F.add({"Block KeyframeList":Te})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function br(){return new M(ce,ce.data.of({autocomplete:Zr}))}const Xr=304,lO=1,xr=2,Yr=305,yr=307,kr=308,wr=3,vr=4,Tr=[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,_r=59,nO=47,Wr=42,Ur=43,Cr=45,Rr=new wO({start:!1,shift(O,e){return e==wr||e==vr||e==yr?O:e==kr},strict:!1}),qr=new x((O,e)=>{let{next:a}=O;(a==IO||a==-1||e.context)&&O.acceptToken(Yr)},{contextual:!0,fallback:!0}),jr=new x((O,e)=>{let{next:a}=O,t;Tr.indexOf(a)>-1||a==nO&&((t=O.peek(1))==nO||t==Wr)||a!=IO&&a!=_r&&a!=-1&&!e.context&&O.acceptToken(Xr)},{contextual:!0}),Vr=new x((O,e)=>{let{next:a}=O;if((a==Ur||a==Cr)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(lO);O.acceptToken(t?lO:xr)}},{contextual:!0}),zr=D({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const using function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,"LineComment Hashbang":n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),Gr={__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},Ar={__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},Er={__proto__:null,"<":139},Ir=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!AfQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AnQSO,5=sO!AsQSO,5=sO!AxQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BWQWO,5=`O!B`Q,UO,5=aO!BkQSO,5=cO!BpQ`O,5=fO!BxQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!B}QSO'#HRO9{Q,UO'#HTO!CSQSO'#HTOOQQ,5=i,5=iO!CXQSO'#HUO!CjQSO'#CmO!CoQSO,58}O!CyQSO,58}O!FOQUO,58}OOQQ,58},58}O!F`Q(C[O,58}O%[QUO,58}O!HkQUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!IRQSO,5=uO`QUO,5={O`QUO,5=}O!IWQSO,5>PO`QUO,5>RO!I]QSO,5>UO!IbQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!MlQSO,5>fOOQQ,5>h,5>hO!MlQSO,5>hOOQQ,5>j,5>jO!MqQWO'#DYO%[QUO'#JiO!N`QWO'#JiO!N}QWO'#DhO# `QWO'#DhO##qQUO'#DhO##xQSO'#JhO#$QQSO,5:RO#$VQSO'#EnO#$eQSO'#JvO#$mQSO,5;XO#$rQWO'#DhO#%PQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#%WQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%`QSO,5@TO#%eQ!LQO,5:pOOQO-E<_-E<_O#&kQ(C`O,5:{OChQWO,5:oO#&uQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#'SQ(C[O,5:{O#'_Q(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'mQ(C[O,5:{POOO'#IU'#IUP#(RO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#(mQUO'#I[OOQO-EWQ(CjO1G0yO#>_Q(CjO1G0yO#@VQ(CjO1G0yO#CVQ$IUO'#CgO#ETQ$IUO1G1[O#E[Q$IUO'#JfO!,YQSO1G1bO#ElQ(CjO,5?SOOQ(CW-EeQSO1G3kO$.fQUO1G3mO$2jQUO'#HlOOQQ1G3p1G3pO$2wQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$3PQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$7WQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$7]Q$IUO,5:SOOQO,5;Y,5;YO$7gQWO'#I]O$7}QSO,5@SOOQ(CY1G/m1G/mO$8VQWO'#IcO$8aQSO,5@bOOQ(CW1G0s1G0sO# `QWO,5:SOOQO'#I`'#I`O$8iQWO,5:nOOQ(CY,5:n,5:nO#%ZQSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8pQ(C[O1G0gO$8{Q(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$9ZQ(C[O1G0gOOQO1G0Z1G0ZO$9oQ(CjO1G0gPOOO-EvO$:]QSO1G5mO$:eQSO1G5zO$:mQbO1G5{O9TQSO,5>|O$:wQ(CjO1G5xO%[QUO1G5xO$;XQ(C[O1G5xO$;jQSO1G5wO$;jQSO1G5wO9TQSO1G5wO$;rQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$WOOQQ,5>W,5>WO%[QUO'#HmO%(vQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%({QWO1G5oO%)aQ$IUO1G0tO%)kQSO1G0tOOQO1G/n1G/nO%)vQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EjQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9oQ(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%*QQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%*]Q(C[O7+&RO%*kQ(CjO7++dO%[QUO7++dO%*{QSO7++cO%*{QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%+TQSO1G4kOOQO7+%z7+%zO#%ZQSO<xOOQO-E<[-E<[O%2yQbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%3TQSO1G5qOOQ(CY<tQ$IUO1G0yO%>{Q$IUO1G0yO%@sQ$IUO1G0yO%AWQ(CjO<XOOQQ,5>Z,5>ZO& PQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO& UQ$IUO1G5{O>jQSO7+%YOOQ(CY<jQSO<jQSO7+)dO&6mQSO<{AN>{O%[QUOAN?XOOQO<PQSO7+*ZO&>[QSO<= ZO&>dQ`O7+*]OOQ(CW<nQ`O<uQSO<= dOOQQG27kG27kO9eQ(C[OG27kO!*SQUO1G4vO&>}QSO7++uO%MbQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&?VQSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#NWQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&?_QSOANBTOOQQ<fOPZXYZXlZXzZX{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#APOP$]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#C^O#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#,sO_#{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#C^O!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#,sO!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#,sO!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$ tOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!jOz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#]O#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$$zOh.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`0gO'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$+sO#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#C^Om!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$ tO#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$!jO#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$#]O#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#,sO_#]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#C^O#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,sO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,sOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$J]Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$KOO(d$ZO~P#,sO!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#,sO!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#,sO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O`4`O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,sO!Y$|O~P#,sO!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%%QOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O`5TO'v#mO'xTO'{UO!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#C^O#Y5lO!W#bi!X#bi~O!W![i!X![i~P#C^O_%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$J]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$KOO#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#,sOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#C^OP$]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%3jO#h9zO~P%3jOP$]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%5uOl9|O~P%5uOP$]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%8QOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%8QOP$]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%:lO(k#|O~P%:lOP$]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%yP?^P?^PPP?^PAOP?^P?^P?^PASPPAXPArPFjPPPFnPPPPFnIoPPPIuJpPFnPMOPPPP! ^FnPPPFnPFnP!#lFnP!'Q!(S!(]P!)P!)T!)PPPPPP!,`!(SPP!,|!-vP!0jFnFn!0o!3y!8`!8`!}P#@^#@e#@mPPPP#D{#Gr#NZ#N^#Na$ Y$ ]$ `$ g$ oPP$ u$ y$!q$#p$#t$$YPP$$^$$d$$hP$$k$$o$$r$%h$&P$&h$&l$&o$&r$&x$&{$'P$'TR!{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,T&^Q/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5T1VQ5W1XQ5X1[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:Rr,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:[zr],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#Gr[O]||-1},{term:330,get:O=>Ar[O]||-1},{term:68,get:O=>Er[O]||-1}],tokenPrec:12868}),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-7b2303b6.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 n,y as Ct,L as J,z as L,A as C,B as F,F as Te,G as M,H as V,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 jt,X as Vt,a as z,h as zt,b as Gt,c as At,d as Et,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-102ce751.js";class re{constructor(e,a,t,r,s,i,l,o,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=o,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 Ae(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)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,o)}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,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}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;so&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 o=i&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],o,!1)>=0)return l<<19|65536|o}}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.storeNode(0,this.pos,this.pos,4,!0),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 Ae{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 o=i-32;if(o>=46&&(o-=46,l=!0),s+=o,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 Ee=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=Ee,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=Ee,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 u=O[p];if(o.allows(u)&&(e.token.value==-1||e.token.value==u||sa(u,e.token.value,r,s))){e.acceptToken(u);break}}let d=e.next,c=0,S=O[i+2];if(e.next<0&&S>c&&O[Q+S*3-3]==65535){i=O[Q+S*3-1];continue e}for(;c>1,u=Q+p+(p<<1),f=O[u],g=O[u+1]||65536;if(d=g)c=p+1;else{i=O[u+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 na{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,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let S=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>S))break}}for(;this.actions.length>a;)this.actions.pop();return o&&e.setLookAhead(o),!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 o=this.tokens.getMainToken(l);s.push(o.value,o.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,o)=>o.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(o--,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 S=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(S>-1&&c.length&&(!Q||(c.prop(we.contextHash)||0)==d))return e.useNode(c,S),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>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let Q=0;Qr?a.push(u):t.push(u)}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(),S=d;for(let p=0;c.forceReduce()&&p<10&&(Z&&console.log(S+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)Z&&(S=this.stackID(c)+" -> ");for(let p of l.recoverByInsert(o))Z&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,o=0),l.recoverByDelete(o,Q),Z&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),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,o,l[Q++]);else{let c=l[Q+-d];for(let S=-d;S>0;S--)s(l[Q++],o,c);Q++}}}this.nodeSet=new _t(a.map((l,o)=>Wt.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:r[o],top:t.indexOf(o)>-1,error:o==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-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 oa(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,o=r[s++];if(l&&t)return o;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 jO=60,ne=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!=jO){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==ne&&e>=2){a>=3&&O.acceptToken(Le,-2);break}else e=0;O.advance()}});function Aa(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Ea=new x((O,e)=>{if(O.next==_e&&O.peek(1)==ne){let a=e.dialectEnabled(Ta)||Aa(e.context);O.acceptToken(a?fa:Je,2)}else O.next==ne&&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==jO||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":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.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:Va,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,o,a);if(Q==Ya)return Se(l,o,t);if(Q==ya)return Se(l,o,r);if(Q==UO&&s.length){let d=l.node,c=d.firstChild,S=c&&OO(c,o),p;if(S){for(let u of s)if(u.tag==S&&(!u.attrs||u.attrs(p||(p=VO(d,o))))){let f=d.lastChild,g=f.type.id==wa?f.from:d.to;if(g>c.to)return{parser:u.parser,overlay:[{from:c.to,to:g}]}}}}if(i&&Q==CO){let d=l.node,c;if(c=d.firstChild){let S=i[o.read(c.from,c.to)];if(S)for(let p of S){if(p.tagName&&p.tagName!=OO(d.parent,o))continue;let u=d.lastChild;if(u.type.id==Xe){let f=u.from+1,g=u.lastChild,X=u.to-(g&&g.isError?0:1);if(X>f)return{parser:p.parser,overlay:[{from:f,to:X}]}}else if(u.type.id==RO)return{parser:p.parser,overlay:[{from:u.from,to:u.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,AO=95,er=91,te=45,Or=46,tr=35,ar=37,rr=38,ir=92,sr=10;function oe(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function lr(O){return O>=48&&O<=57}const nr=new x((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(oe(s)||s==te||s==AO||a&&lr(s))!a&&(s!=te||r>0)&&(a=!0),t===r&&s==te&&t++,O.advance();else if(s==ir&&O.peek(1)!=sr)O.advance(),O.next>-1&&O.advance(),a=!0;else{a&&O.acceptToken(s==Ha?Fa:t==2&&e.canShift(aO)?aO:Ma);break}}}),or=new x(O=>{if(GO.includes(O.peek(-1))){let{next:e}=O;(oe(e)||e==AO||e==tr||e==Or||e==er||e==Ka||e==te||e==rr)&&O.acceptToken(La)}}),cr=new x(O=>{if(!GO.includes(O.peek(-1))){let{next:e}=O;if(e==ar&&(O.advance(),O.acceptToken(tO)),oe(e)){do O.advance();while(oe(O.next));O.acceptToken(tO)}}}),Qr=D({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),pr={__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},dr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},hr={__proto__:null,not:128,only:128},ur=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:[or,cr,nr,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=>pr[O]||-1},{term:56,get:O=>dr[O]||-1},{term:98,get:O=>hr[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}))),Sr=["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-]*|)$/,$r=/^-(-[\w-]*)?$/;function fr(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,gr=["Declaration"];function mr(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function EO(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 EO(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(gr)&&((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 Pr=O=>e=>{let{state:a,pos:t}=e,r=V(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)&&fr(r,a.doc))return{from:O(r)||s?r.from:t,options:EO(a.doc,mr(r),O),validFor:$r};if(r.name=="TagName"){for(let{parent:o}=r;o;o=o.parent)if(o.name=="Block")return{from:r.from,options:fe(),validFor:v};return{from:r.from,options:Sr,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},Zr=Pr(O=>O.name=="VariableName"),ce=J.define({name:"css",parser:ur.configure({props:[L.add({Declaration:C()}),F.add({"Block KeyframeList":Te})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function br(){return new M(ce,ce.data.of({autocomplete:Zr}))}const Xr=304,lO=1,xr=2,Yr=305,yr=307,kr=308,wr=3,vr=4,Tr=[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,_r=59,nO=47,Wr=42,Ur=43,Cr=45,Rr=new wO({start:!1,shift(O,e){return e==wr||e==vr||e==yr?O:e==kr},strict:!1}),qr=new x((O,e)=>{let{next:a}=O;(a==IO||a==-1||e.context)&&O.acceptToken(Yr)},{contextual:!0,fallback:!0}),jr=new x((O,e)=>{let{next:a}=O,t;Tr.indexOf(a)>-1||a==nO&&((t=O.peek(1))==nO||t==Wr)||a!=IO&&a!=_r&&a!=-1&&!e.context&&O.acceptToken(Xr)},{contextual:!0}),Vr=new x((O,e)=>{let{next:a}=O;if((a==Ur||a==Cr)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(lO);O.acceptToken(t?lO:xr)}},{contextual:!0}),zr=D({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const using function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,"LineComment Hashbang":n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),Gr={__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},Ar={__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},Er={__proto__:null,"<":139},Ir=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!AfQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AnQSO,5=sO!AsQSO,5=sO!AxQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BWQWO,5=`O!B`Q,UO,5=aO!BkQSO,5=cO!BpQ`O,5=fO!BxQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!B}QSO'#HRO9{Q,UO'#HTO!CSQSO'#HTOOQQ,5=i,5=iO!CXQSO'#HUO!CjQSO'#CmO!CoQSO,58}O!CyQSO,58}O!FOQUO,58}OOQQ,58},58}O!F`Q(C[O,58}O%[QUO,58}O!HkQUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!IRQSO,5=uO`QUO,5={O`QUO,5=}O!IWQSO,5>PO`QUO,5>RO!I]QSO,5>UO!IbQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!MlQSO,5>fOOQQ,5>h,5>hO!MlQSO,5>hOOQQ,5>j,5>jO!MqQWO'#DYO%[QUO'#JiO!N`QWO'#JiO!N}QWO'#DhO# `QWO'#DhO##qQUO'#DhO##xQSO'#JhO#$QQSO,5:RO#$VQSO'#EnO#$eQSO'#JvO#$mQSO,5;XO#$rQWO'#DhO#%PQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#%WQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%`QSO,5@TO#%eQ!LQO,5:pOOQO-E<_-E<_O#&kQ(C`O,5:{OChQWO,5:oO#&uQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#'SQ(C[O,5:{O#'_Q(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'mQ(C[O,5:{POOO'#IU'#IUP#(RO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#(mQUO'#I[OOQO-EWQ(CjO1G0yO#>_Q(CjO1G0yO#@VQ(CjO1G0yO#CVQ$IUO'#CgO#ETQ$IUO1G1[O#E[Q$IUO'#JfO!,YQSO1G1bO#ElQ(CjO,5?SOOQ(CW-EeQSO1G3kO$.fQUO1G3mO$2jQUO'#HlOOQQ1G3p1G3pO$2wQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$3PQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$7WQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$7]Q$IUO,5:SOOQO,5;Y,5;YO$7gQWO'#I]O$7}QSO,5@SOOQ(CY1G/m1G/mO$8VQWO'#IcO$8aQSO,5@bOOQ(CW1G0s1G0sO# `QWO,5:SOOQO'#I`'#I`O$8iQWO,5:nOOQ(CY,5:n,5:nO#%ZQSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8pQ(C[O1G0gO$8{Q(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$9ZQ(C[O1G0gOOQO1G0Z1G0ZO$9oQ(CjO1G0gPOOO-EvO$:]QSO1G5mO$:eQSO1G5zO$:mQbO1G5{O9TQSO,5>|O$:wQ(CjO1G5xO%[QUO1G5xO$;XQ(C[O1G5xO$;jQSO1G5wO$;jQSO1G5wO9TQSO1G5wO$;rQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$WOOQQ,5>W,5>WO%[QUO'#HmO%(vQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%({QWO1G5oO%)aQ$IUO1G0tO%)kQSO1G0tOOQO1G/n1G/nO%)vQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EjQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9oQ(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%*QQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%*]Q(C[O7+&RO%*kQ(CjO7++dO%[QUO7++dO%*{QSO7++cO%*{QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%+TQSO1G4kOOQO7+%z7+%zO#%ZQSO<xOOQO-E<[-E<[O%2yQbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%3TQSO1G5qOOQ(CY<tQ$IUO1G0yO%>{Q$IUO1G0yO%@sQ$IUO1G0yO%AWQ(CjO<XOOQQ,5>Z,5>ZO& PQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO& UQ$IUO1G5{O>jQSO7+%YOOQ(CY<jQSO<jQSO7+)dO&6mQSO<{AN>{O%[QUOAN?XOOQO<PQSO7+*ZO&>[QSO<= ZO&>dQ`O7+*]OOQ(CW<nQ`O<uQSO<= dOOQQG27kG27kO9eQ(C[OG27kO!*SQUO1G4vO&>}QSO7++uO%MbQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&?VQSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#NWQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&?_QSOANBTOOQQ<fOPZXYZXlZXzZX{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#APOP$]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#C^O#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#,sO_#{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#C^O!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#,sO!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#,sO!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$ tOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!jOz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#]O#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$$zOh.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`0gO'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$+sO#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#C^Om!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$ tO#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$!jO#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$#]O#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#,sO_#]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#C^O#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,sO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,sOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$J]Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$KOO(d$ZO~P#,sO!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#,sO!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#,sO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O`4`O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,sO!Y$|O~P#,sO!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%%QOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O`5TO'v#mO'xTO'{UO!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#C^O#Y5lO!W#bi!X#bi~O!W![i!X![i~P#C^O_%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$J]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$KOO#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#,sOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#C^OP$]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%3jO#h9zO~P%3jOP$]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%5uOl9|O~P%5uOP$]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%8QOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%8QOP$]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%:lO(k#|O~P%:lOP$]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%yP?^P?^PPP?^PAOP?^P?^P?^PASPPAXPArPFjPPPFnPPPPFnIoPPPIuJpPFnPMOPPPP! ^FnPPPFnPFnP!#lFnP!'Q!(S!(]P!)P!)T!)PPPPPP!,`!(SPP!,|!-vP!0jFnFn!0o!3y!8`!8`!}P#@^#@e#@mPPPP#D{#Gr#NZ#N^#Na$ Y$ ]$ `$ g$ oPP$ u$ y$!q$#p$#t$$YPP$$^$$d$$hP$$k$$o$$r$%h$&P$&h$&l$&o$&r$&x$&{$'P$'TR!{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,T&^Q/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5T1VQ5W1XQ5X1[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:Rr,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:[zr],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#Gr[O]||-1},{term:330,get:O=>Ar[O]||-1},{term:68,get:O=>Er[O]||-1}],tokenPrec:12868}),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-207789fe.js b/ui/dist/assets/ConfirmEmailChangeDocs-1efc427e.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-207789fe.js rename to ui/dist/assets/ConfirmEmailChangeDocs-1efc427e.js index cbac42f0..5be3b2f9 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-207789fe.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-1efc427e.js @@ -1,4 +1,4 @@ -import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as $e,x as j,P as _e,Q as ye,k as Re,R as Te,n as Ee,t as ee,a as te,o as m,d as we,C as qe,p as Ae,r as H,u as Be,N as Ue}from"./index-c4339794.js";import{S as De}from"./SdkTabs-16daad5a.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,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,$),n(s,_),n(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 ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(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),$e(a,s,null),n(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||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,E,Z,q,x,S,A,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` +import{S as Pe,i as Se,s as Oe,O as Y,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as $e,x as j,P as _e,Q as ye,k as Re,R as Te,n as Ee,t as ee,a as te,o as m,d as we,C as qe,p as Ae,r as H,u as Be,N as Ue}from"./index-7b2303b6.js";import{S as De}from"./SdkTabs-96702c72.js";function he(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:o,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,$),n(s,_),n(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 ve(o,l){let s,a,_,u;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Ce(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),$e(a,s,null),n(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||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&m(s),we(a)}}}function Ne(o){var pe,fe;let l,s,a=o[0].name+"",_,u,i,p,f,C,$,D=o[0].name+"",F,le,se,I,L,w,Q,y,z,P,N,ae,K,R,ne,G,M=o[0].name+"",J,oe,V,T,X,E,Z,q,x,S,A,g=[],ie=new Map,ce,B,h=[],re=new Map,O;w=new De({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-592fbd7c.js b/ui/dist/assets/ConfirmPasswordResetDocs-f363f429.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-592fbd7c.js rename to ui/dist/assets/ConfirmPasswordResetDocs-f363f429.js index 19b9fa21..0023cbec 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-592fbd7c.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-f363f429.js @@ -1,4 +1,4 @@ -import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as n,m as Ae,x as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,p as Be,r as j,u as Me,N as Fe}from"./index-c4339794.js";import{S as Ie}from"./SdkTabs-16daad5a.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Re(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Ae(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,R,y,v=[],ie=new Map,de,D,h=[],ce=new Map,A;W=new Ie({props:{js:` +import{S as Ne,i as $e,s as Ce,O as K,e as c,w,b as k,c as Re,f as b,g as r,h as n,m as Ae,x as U,P as we,Q as Ee,k as ye,R as De,n as Te,t as ee,a as te,o as p,d as Oe,C as qe,p as Be,r as j,u as Me,N as Fe}from"./index-7b2303b6.js";import{S as Ie}from"./SdkTabs-96702c72.js";function Se(o,l,s){const a=o.slice();return a[5]=l[s],a}function Pe(o,l,s){const a=o.slice();return a[5]=l[s],a}function We(o,l){let s,a=l[5].code+"",_,m,i,u;function f(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=w(a),m=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(S,P){r(S,s,P),n(s,_),n(s,m),i||(u=Me(s,"click",f),i=!0)},p(S,P){l=S,P&4&&a!==(a=l[5].code+"")&&U(_,a),P&6&&j(s,"active",l[1]===l[5].code)},d(S){S&&p(s),i=!1,u()}}}function ge(o,l){let s,a,_,m;return a=new Fe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Re(a.$$.fragment),_=k(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,u){r(i,s,u),Ae(a,s,null),n(s,_),m=!0},p(i,u){l=i;const f={};u&4&&(f.content=l[5].body),a.$set(f),(!m||u&6)&&j(s,"active",l[1]===l[5].code)},i(i){m||(ee(a.$$.fragment,i),m=!0)},o(i){te(a.$$.fragment,i),m=!1},d(i){i&&p(s),Oe(a)}}}function Ke(o){var ue,fe,me,be;let l,s,a=o[0].name+"",_,m,i,u,f,S,P,q=o[0].name+"",H,le,se,L,Q,W,z,O,G,g,B,ae,M,N,oe,J,F=o[0].name+"",V,ne,X,$,Y,C,Z,E,x,R,y,v=[],ie=new Map,de,D,h=[],ce=new Map,A;W=new Ie({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmVerificationDocs-4a55a580.js b/ui/dist/assets/ConfirmVerificationDocs-67d8a971.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-4a55a580.js rename to ui/dist/assets/ConfirmVerificationDocs-67d8a971.js index f437bf9e..3b36a9ae 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-4a55a580.js +++ b/ui/dist/assets/ConfirmVerificationDocs-67d8a971.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-c4339794.js";import{S as Ae}from"./SdkTabs-16daad5a.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-7b2303b6.js";import{S as Ae}from"./SdkTabs-96702c72.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-8e2e6ca4.js b/ui/dist/assets/CreateApiDocs-e470749e.js similarity index 98% rename from ui/dist/assets/CreateApiDocs-8e2e6ca4.js rename to ui/dist/assets/CreateApiDocs-e470749e.js index 9af4f091..0f491693 100644 --- a/ui/dist/assets/CreateApiDocs-8e2e6ca4.js +++ b/ui/dist/assets/CreateApiDocs-e470749e.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-c4339794.js";import{S as At}from"./SdkTabs-16daad5a.js";import{F as Bt}from"./FieldsQueryParam-bc547030.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-7b2303b6.js";import{S as At}from"./SdkTabs-96702c72.js";import{F as Bt}from"./FieldsQueryParam-b1f57668.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-98707e26.js b/ui/dist/assets/DeleteApiDocs-fd46ff19.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-98707e26.js rename to ui/dist/assets/DeleteApiDocs-fd46ff19.js index 670b18d6..7ad9ad53 100644 --- a/ui/dist/assets/DeleteApiDocs-98707e26.js +++ b/ui/dist/assets/DeleteApiDocs-fd46ff19.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-c4339794.js";import{S as He}from"./SdkTabs-16daad5a.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-7b2303b6.js";import{S as He}from"./SdkTabs-96702c72.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-bc547030.js b/ui/dist/assets/FieldsQueryParam-b1f57668.js similarity index 95% rename from ui/dist/assets/FieldsQueryParam-bc547030.js rename to ui/dist/assets/FieldsQueryParam-b1f57668.js index edfc317c..61c95ff4 100644 --- a/ui/dist/assets/FieldsQueryParam-bc547030.js +++ b/ui/dist/assets/FieldsQueryParam-b1f57668.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-c4339794.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-7b2303b6.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-66e3909f.js b/ui/dist/assets/FilterAutocompleteInput-dec586dc.js similarity index 99% rename from ui/dist/assets/FilterAutocompleteInput-66e3909f.js rename to ui/dist/assets/FilterAutocompleteInput-dec586dc.js index 6f8197ed..ae616b61 100644 --- a/ui/dist/assets/FilterAutocompleteInput-66e3909f.js +++ b/ui/dist/assets/FilterAutocompleteInput-dec586dc.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-c4339794.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-102ce751.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-7b2303b6.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-102ce751.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-481c529b.js b/ui/dist/assets/ListApiDocs-531b324b.js similarity index 99% rename from ui/dist/assets/ListApiDocs-481c529b.js rename to ui/dist/assets/ListApiDocs-531b324b.js index 3cd54d33..0d9be41a 100644 --- a/ui/dist/assets/ListApiDocs-481c529b.js +++ b/ui/dist/assets/ListApiDocs-531b324b.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-c4339794.js";import{S as dl}from"./SdkTabs-16daad5a.js";import{F as pl}from"./FieldsQueryParam-bc547030.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-7b2303b6.js";import{S as dl}from"./SdkTabs-96702c72.js";import{F as pl}from"./FieldsQueryParam-b1f57668.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-f2601f25.js b/ui/dist/assets/ListExternalAuthsDocs-20410026.js similarity index 97% rename from ui/dist/assets/ListExternalAuthsDocs-f2601f25.js rename to ui/dist/assets/ListExternalAuthsDocs-20410026.js index a79d305e..746f7a41 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-f2601f25.js +++ b/ui/dist/assets/ListExternalAuthsDocs-20410026.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-c4339794.js";import{S as Ye}from"./SdkTabs-16daad5a.js";import{F as Ze}from"./FieldsQueryParam-bc547030.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-7b2303b6.js";import{S as Ye}from"./SdkTabs-96702c72.js";import{F as Ze}from"./FieldsQueryParam-b1f57668.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-b115c254.js b/ui/dist/assets/PageAdminConfirmPasswordReset-708df40e.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-b115c254.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-708df40e.js index a7472330..95ba7fd9 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-b115c254.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-708df40e.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-c4339794.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-7b2303b6.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-077da760.js b/ui/dist/assets/PageAdminRequestPasswordReset-2ec1893c.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-077da760.js rename to ui/dist/assets/PageAdminRequestPasswordReset-2ec1893c.js index 6af4a06d..63509a2f 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-077da760.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-2ec1893c.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-c4339794.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-7b2303b6.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-9b9788d9.js b/ui/dist/assets/PageOAuth2Redirect-9b9788d9.js deleted file mode 100644 index 280b2cc4..00000000 --- a/ui/dist/assets/PageOAuth2Redirect-9b9788d9.js +++ /dev/null @@ -1 +0,0 @@ -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-c4339794.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/PageOAuth2Redirect-f3233468.js b/ui/dist/assets/PageOAuth2Redirect-f3233468.js new file mode 100644 index 00000000..5eb1fc44 --- /dev/null +++ b/ui/dist/assets/PageOAuth2Redirect-f3233468.js @@ -0,0 +1 @@ +import{S as o,i as c,s as i,e as r,f as l,g as u,y as n,o as d,I as h}from"./index-7b2303b6.js";function p(s){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',l(t,"class","content txt-hint txt-center p-base")},m(e,a){u(e,t,a)},p:n,i:n,o:n,d(e){e&&d(t)}}}function f(s){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),c(this,t,f,p,i,{})}}export{x as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-a2506d7e.js b/ui/dist/assets/PageRecordConfirmEmailChange-9b4c683c.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-a2506d7e.js rename to ui/dist/assets/PageRecordConfirmEmailChange-9b4c683c.js index b4979556..967de6e4 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-a2506d7e.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-9b4c683c.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-c4339794.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-7b2303b6.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-b5c0cfd9.js b/ui/dist/assets/PageRecordConfirmPasswordReset-b9fe5282.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-b5c0cfd9.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-b9fe5282.js index 40001840..bdad2da3 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-b5c0cfd9.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-b9fe5282.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-c4339794.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-7b2303b6.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-8a6a1ed8.js b/ui/dist/assets/PageRecordConfirmVerification-392dea19.js similarity index 97% rename from ui/dist/assets/PageRecordConfirmVerification-8a6a1ed8.js rename to ui/dist/assets/PageRecordConfirmVerification-392dea19.js index 05493db1..b188f403 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-8a6a1ed8.js +++ b/ui/dist/assets/PageRecordConfirmVerification-392dea19.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-c4339794.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-7b2303b6.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-9e5f186a.js b/ui/dist/assets/RealtimeApiDocs-45d83ff0.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-9e5f186a.js rename to ui/dist/assets/RealtimeApiDocs-45d83ff0.js index 71b091fc..575b05ce 100644 --- a/ui/dist/assets/RealtimeApiDocs-9e5f186a.js +++ b/ui/dist/assets/RealtimeApiDocs-45d83ff0.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-c4339794.js";import{S as de}from"./SdkTabs-16daad5a.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-7b2303b6.js";import{S as de}from"./SdkTabs-96702c72.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-cd0de76f.js b/ui/dist/assets/RequestEmailChangeDocs-0497f3ef.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-cd0de76f.js rename to ui/dist/assets/RequestEmailChangeDocs-0497f3ef.js index d07fd24e..8dd0d067 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-cd0de76f.js +++ b/ui/dist/assets/RequestEmailChangeDocs-0497f3ef.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-c4339794.js";import{S as je}from"./SdkTabs-16daad5a.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-7b2303b6.js";import{S as je}from"./SdkTabs-96702c72.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-a22604e7.js b/ui/dist/assets/RequestPasswordResetDocs-0d7b5713.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-a22604e7.js rename to ui/dist/assets/RequestPasswordResetDocs-0d7b5713.js index 6514c713..a1ac4315 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-a22604e7.js +++ b/ui/dist/assets/RequestPasswordResetDocs-0d7b5713.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-c4339794.js";import{S as Ue}from"./SdkTabs-16daad5a.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-7b2303b6.js";import{S as Ue}from"./SdkTabs-96702c72.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-6658a4af.js b/ui/dist/assets/RequestVerificationDocs-8c75a2dc.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-6658a4af.js rename to ui/dist/assets/RequestVerificationDocs-8c75a2dc.js index d26ed3e2..adbf0980 100644 --- a/ui/dist/assets/RequestVerificationDocs-6658a4af.js +++ b/ui/dist/assets/RequestVerificationDocs-8c75a2dc.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-c4339794.js";import{S as Ae}from"./SdkTabs-16daad5a.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-7b2303b6.js";import{S as Ae}from"./SdkTabs-96702c72.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-16daad5a.js b/ui/dist/assets/SdkTabs-96702c72.js similarity index 98% rename from ui/dist/assets/SdkTabs-16daad5a.js rename to ui/dist/assets/SdkTabs-96702c72.js index 42f350c2..4b74b063 100644 --- a/ui/dist/assets/SdkTabs-16daad5a.js +++ b/ui/dist/assets/SdkTabs-96702c72.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-c4339794.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-7b2303b6.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-7056f391.js b/ui/dist/assets/UnlinkExternalAuthDocs-adc881c1.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-7056f391.js rename to ui/dist/assets/UnlinkExternalAuthDocs-adc881c1.js index 72a9e554..a325f09c 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-7056f391.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-adc881c1.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-c4339794.js";import{S as Ke}from"./SdkTabs-16daad5a.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-7b2303b6.js";import{S as Ke}from"./SdkTabs-96702c72.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-59dd218c.js b/ui/dist/assets/UpdateApiDocs-ae75e9e7.js similarity index 98% rename from ui/dist/assets/UpdateApiDocs-59dd218c.js rename to ui/dist/assets/UpdateApiDocs-ae75e9e7.js index 58f061e6..200a8807 100644 --- a/ui/dist/assets/UpdateApiDocs-59dd218c.js +++ b/ui/dist/assets/UpdateApiDocs-ae75e9e7.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-c4339794.js";import{S as Ft}from"./SdkTabs-16daad5a.js";import{F as Nt}from"./FieldsQueryParam-bc547030.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-7b2303b6.js";import{S as Ft}from"./SdkTabs-96702c72.js";import{F as Nt}from"./FieldsQueryParam-b1f57668.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-a97d2bf3.js b/ui/dist/assets/ViewApiDocs-b3a10802.js similarity index 97% rename from ui/dist/assets/ViewApiDocs-a97d2bf3.js rename to ui/dist/assets/ViewApiDocs-b3a10802.js index 8931aa30..dad266a8 100644 --- a/ui/dist/assets/ViewApiDocs-a97d2bf3.js +++ b/ui/dist/assets/ViewApiDocs-b3a10802.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-c4339794.js";import{S as pt}from"./SdkTabs-16daad5a.js";import{F as ut}from"./FieldsQueryParam-bc547030.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-7b2303b6.js";import{S as pt}from"./SdkTabs-96702c72.js";import{F as ut}from"./FieldsQueryParam-b1f57668.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-c4339794.js b/ui/dist/assets/index-7b2303b6.js similarity index 71% rename from ui/dist/assets/index-c4339794.js rename to ui/dist/assets/index-7b2303b6.js index 194067e7..512a596e 100644 --- a/ui/dist/assets/index-c4339794.js +++ b/ui/dist/assets/index-7b2303b6.js @@ -1,132 +1,132 @@ -var p0=Object.defineProperty;var m0=(n,e,t)=>e in n?p0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ue=(n,e,t)=>(m0(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 l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const ws=n=>n;function Pe(n,e){for(const t in e)n[t]=e[t];return n}function h0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function E_(n){return n()}function iu(){return Object.create(null)}function we(n){n.forEach(E_)}function $t(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ps;function nn(n,e){return n===e?!0:(Ps||(Ps=document.createElement("a")),Ps.href=e,n===Ps.href)}function g0(n){return Object.keys(n).length===0}function ma(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function _0(n){let e;return ma(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(ma(e,t))}function vt(n,e,t,i){if(n){const l=A_(n,e,t,i);return n[0](l)}}function A_(n,e,t,i){return n[1]&&i?Pe(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ha=I_?n=>requestAnimationFrame(n):Q;const yl=new Set;function L_(n){yl.forEach(e=>{e.c(n)||(yl.delete(e),e.f())}),yl.size!==0&&ha(L_)}function Vo(n){let e;return yl.size===0&&ha(L_),{promise:new Promise(t=>{yl.add(e={c:n,f:t})}),abort(){yl.delete(e)}}}function y(n,e){n.appendChild(e)}function P_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function b0(n){const e=b("style");return e.textContent="/* empty */",y0(P_(n),e),e.sheet}function y0(n,e){return y(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function at(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Ye(n){return function(e){return e.preventDefault(),n.call(this,e)}}function fn(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 k0=["width","height"];function ni(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&&k0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function v0(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 ut(n){return n===""?null:+n}function w0(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function S0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList.toggle(e,!!t)}function F_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const ko=new Map;let vo=0;function T0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function $0(n,e){const t={stylesheet:b0(e),rules:{}};return ko.set(n,t),t}function us(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{ +var m0=Object.defineProperty;var h0=(n,e,t)=>e in n?m0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ue=(n,e,t)=>(h0(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 l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const vs=n=>n;function Fe(n,e){for(const t in e)n[t]=e[t];return n}function g0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function A_(n){return n()}function lu(){return Object.create(null)}function we(n){n.forEach(A_)}function $t(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ls;function nn(n,e){return n===e?!0:(Ls||(Ls=document.createElement("a")),Ls.href=e,n===Ls.href)}function _0(n){return Object.keys(n).length===0}function ha(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function b0(n){let e;return ha(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(ha(e,t))}function vt(n,e,t,i){if(n){const l=I_(n,e,t,i);return n[0](l)}}function I_(n,e,t,i){return n[1]&&i?Fe(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ga=L_?n=>requestAnimationFrame(n):Q;const bl=new Set;function P_(n){bl.forEach(e=>{e.c(n)||(bl.delete(e),e.f())}),bl.size!==0&&ga(P_)}function zo(n){let e;return bl.size===0&&ga(P_),{promise:new Promise(t=>{bl.add(e={c:n,f:t})}),abort(){bl.delete(e)}}}function y(n,e){n.appendChild(e)}function F_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function y0(n){const e=b("style");return e.textContent="/* empty */",k0(F_(n),e),e.sheet}function k0(n,e){return y(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function at(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Ye(n){return function(e){return e.preventDefault(),n.call(this,e)}}function fn(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 v0=["width","height"];function ni(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&&v0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function w0(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 ut(n){return n===""?null:+n}function S0(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function ue(n,e){n.value=e??""}function T0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList.toggle(e,!!t)}function N_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const yo=new Map;let ko=0;function $0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function C0(n,e){const t={stylesheet:y0(e),rules:{}};return yo.set(n,t),t}function as(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{ `;for(let _=0;_<=1;_+=a){const k=e+(t-e)*s(_);u+=_*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${T0(f)}_${r}`,d=P_(n),{stylesheet:m,rules:g}=ko.get(d)||$0(d,n);g[c]||(g[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const h=n.style.animation||"";return n.style.animation=`${h?`${h}, `:""}${c} ${i}ms linear ${l}ms 1 both`,vo+=1,c}function fs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),vo-=l,vo||C0())}function C0(){ha(()=>{vo||(ko.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),ko.clear())})}function M0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=ws,start:a=zo()+s,end:u=a+o,tick:f=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,g;function h(){c&&(g=us(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&fs(n,g),d=!1}return Vo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),h(),f(0,1),_}function O0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,N_(n,l)}}function N_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let cs;function di(n){cs=n}function Ss(){if(!cs)throw new Error("Function called outside component initialization");return cs}function Vt(n){Ss().$$.on_mount.push(n)}function D0(n){Ss().$$.after_update.push(n)}function Ts(n){Ss().$$.on_destroy.push(n)}function rt(){const n=Ss();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=F_(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ee(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bl=[],te=[];let kl=[];const Vr=[],R_=Promise.resolve();let Br=!1;function q_(){Br||(Br=!0,R_.then(ga))}function Qt(){return q_(),R_}function Ke(n){kl.push(n)}function ye(n){Vr.push(n)}const sr=new Set;let pl=0;function ga(){if(pl!==0)return;const n=cs;do{try{for(;pln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),kl=e}let jl;function _a(){return jl||(jl=Promise.resolve(),jl.then(()=>{jl=null})),jl}function Xi(n,e,t){n.dispatchEvent(F_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let ei;function re(){ei={r:0,c:[],p:ei}}function ae(){ei.r||we(ei.c),ei=ei.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),ei.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function j_(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&fs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:g=ws,tick:h=Q,css:_}=l||ba;_&&(o=us(n,0,1,m,d,g,_,a++)),h(0,1);const k=zo()+d,S=k+m;r&&r.abort(),s=!0,Ke(()=>Xi(n,!0,"start")),r=Vo($=>{if(s){if($>=S)return h(1,0),Xi(n,!0,"end"),u(),s=!1;if($>=k){const T=g(($-k)/m);h(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,fs(n),$t(l)?(l=l(i),_a().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function ya(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=ei;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=ws,tick:m=Q,css:g}=l||ba;g&&(o=us(n,1,0,c,f,d,g));const h=zo()+f,_=h+c;Ke(()=>Xi(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Vo(k=>{if(s){if(k>=_)return m(0,1),Xi(n,!1,"end"),--r.r||we(r.c),!1;if(k>=h){const S=d((k-h)/c);m(1-S,S)}}return s})}return $t(l)?_a().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&fs(n,o),s=!1)}}}function Le(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&fs(n,u)}function d(g,h){const _=g.b-o;return h*=Math.abs(_),{a:o,b:g.b,d:_,duration:h,start:g.start,end:g.start+h,group:g.group}}function m(g){const{delay:h=0,duration:_=300,easing:k=ws,tick:S=Q,css:$}=s||ba,T={start:zo()+h,b:g};g||(T.group=ei,ei.r+=1),"inert"in n&&(g?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=us(n,o,g,_,h,k,$)),g&&S(0,1),r=d(T,_),Ke(()=>Xi(n,g,"start")),Vo(C=>{if(a&&C>a.start&&(r=d(a,_),a=null,Xi(n,r.b,"start"),$&&(c(),u=us(n,o,r.b,r.duration,0,k,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Xi(n,r.b,"end"),a||(r.b?c():--r.group.r||we(r.group.c)),r=null;else if(C>=r.start){const D=C-r.start;o=r.a+r.d*k(D/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(g){$t(s)?_a().then(()=>{s=s({direction:g?"in":"out"}),m(g)}):m(g)},end(){c(),r=a=null}}}function su(n,e){const t=e.token={};function i(l,s,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=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&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[s]=u),f&&ga()}if(h0(n)){const l=Ss();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),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 I0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function pe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Pi(n,e){n.d(1),e.delete(n.key)}function Lt(n,e){I(n,1,1,()=>{e.delete(n.key)})}function L0(n,e){n.f(),Lt(n,e)}function dt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,g=d;const h={};for(;g--;)h[n[g].key]=g;const _=[],k=new Map,S=new Map,$=[];for(g=m;g--;){const O=c(l,s,g),E=t(O);let L=o.get(E);L?i&&$.push(()=>L.p(O,e)):(L=u(E,O),L.c()),k.set(E,_[g]=L),E in h&&S.set(E,Math.abs(g-h[E]))}const T=new Set,C=new Set;function D(O){A(O,1),O.m(r,f),o.set(O.key,O),f=O.first,m--}for(;d&&m;){const O=_[m-1],E=n[d-1],L=O.key,R=E.key;O===E?(f=O.first,d--,m--):k.has(R)?!o.has(L)||T.has(L)?D(O):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),D(O)):(T.add(R),d--):(a(E,o),d--)}for(;d--;){const O=n[d];k.has(O.key)||a(O,o)}for(;m;)D(_[m-1]);return we($),_}function pt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ct(n){return typeof n=="object"&&n!==null?n:{}}function ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(E_).filter($t);n.$$.on_destroy?n.$$.on_destroy.push(...s):we(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(A0(t.after_update),we(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function P0(n,e){n.$$.dirty[0]===-1&&(bl.push(n),q_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=m.length?m[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&P0(n,c)),d}):[],u.update(),f=!0,we(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=w0(e.target);u.fragment&&u.fragment.l(c),c.forEach(v)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),z(n,e.target,e.anchor),ga()}di(a)}class be{constructor(){Ue(this,"$$");Ue(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!$t(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!g0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const F0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(F0);function Nt(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:l,update:s,subscribe:o}}function z_(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return H_(t,(o,r)=>{let a=!1;const u=[];let f=0,c=Q;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,o,r);s?o(g):c=$t(g)?g:Q},m=l.map((g,h)=>ma(g,_=>{u[h]=_,f&=~(1<{f|=1<{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a&4?pt(l,[Ct(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&&v(t),e&&V(e,r)}}}function R0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};if(a!==void 0&&a&6)u=pt(l,[a&2&&{params:r[1]},a&4&&Ct(r[2])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a&6?pt(l,[a&2&&{params:r[1]},a&4&&Ct(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&&v(t),e&&V(e,r)}}}function q0(n){let e,t,i,l;const s=[R0,N0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function ou(){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 Bo=H_(null,function(e){e(ou());const t=()=>{e(ou())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});z_(Bo,n=>n.location);const Uo=z_(Bo,n=>n.querystring),ru=Dn(void 0);async function il(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();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 ln(n,e){if(e=uu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return au(n,e),{update(t){t=uu(t),au(n,t)}}}function j0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function au(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||H0(i.currentTarget.getAttribute("href"))})}function uu(n){return n&&typeof n=="string"?{href:n}:n||{}}function H0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function z0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,D){if(!D||typeof D!="function"&&(typeof D!="object"||D._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:E}=V_(C);this.path=C,typeof D=="object"&&D._sveltesparouter===!0?(this.component=D.component,this.conditions=D.conditions||[],this.userData=D.userData,this.props=D.props||{}):(this.component=()=>Promise.resolve(D),this.conditions=[],this.props={}),this._pattern=O,this._keys=E}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const D=this._pattern.exec(C);if(D===null)return null;if(this._keys===!1)return D;const O={};let E=0;for(;E{r.push(new o(C,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=rt();async function d(T,C){await Qt(),c(T,C)}let m=null,g=null;s&&(g=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",g),D0(()=>{j0(m)}));let h=null,_=null;const k=Bo.subscribe(async T=>{h=T;let C=0;for(;C{ru.set(u)});return}t(0,a=null),_=null,ru.set(void 0)});Ts(()=>{k(),g&&window.removeEventListener("popstate",g)});function S(T){Ee.call(this,n,T)}function $(T){Ee.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class V0 extends be{constructor(e){super(),_e(this,e,z0,q0,me,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let B_;function U_(n){const e=n.pattern.test(B_);fu(n,n.className,e),fu(n,n.inactiveClassName,!e)}function fu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Bo.subscribe(n=>{B_=n.location+(n.querystring?"?"+n.querystring:""),ao.map(U_)});function Pn(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"?V_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),U_(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const B0="modulepreload",U0=function(n,e){return new URL(n,e).href},cu={},st=function(e,t,i){if(!t||t.length===0)return e();const l=document.getElementsByTagName("link");return Promise.all(t.map(s=>{if(s=U0(s,i),s in cu)return;cu[s]=!0;const o=s.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=l.length-1;f>=0;f--){const c=l[f];if(c.href===s&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":B0,o||(u.as="script",u.crossOrigin=""),u.href=s,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 ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};class qn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,qn.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 qn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?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.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.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{...this}}}const Fs=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function W0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||Y0;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}W_=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,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const pu="pb_auth";class J0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ka(this.token)}get isAdmin(){return uo(this.token).type==="admin"}get isAuthRecord(){return uo(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=pu){const i=W0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=pu){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=uo(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=du(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(u=s==null?void 0:s.model)==null?void 0:u.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(s.model[c]=this.model[c]);o=du(t,JSON.stringify(s),e)}return o}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 Y_ extends J0{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.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 ll{constructor(e){this.client=e}}class Z0 extends ll{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,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class va extends ll{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(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}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 l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new qn({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(l=>this.decode(l))}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=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(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;(e=n._resetAutoRefresh)==null||e.call(n)}class G0 extends va{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.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})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||or(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(u,f,c,d){or(u);const m=u.beforeSend,g=u.authStore.model,h=u.authStore.onChange((_,k)=>{(!_||(k==null?void 0:k.id)!=(g==null?void 0:g.id)||(k!=null&&k.collectionId||g!=null&&g.collectionId)&&(k==null?void 0:k.collectionId)!=(g==null?void 0:g.collectionId))&&or(u)});u._resetAutoRefresh=function(){h(),u.beforeSend=m,delete u._resetAutoRefresh},u.beforeSend=async(_,k)=>{var C;const S=u.authStore.token;if((C=k.query)!=null&&C.autoRefresh)return m?m(_,k):{url:_,sendOptions:k};let $=u.authStore.isValid;if($&&ka(u.authStore.token,f))try{await c()}catch{$=!1}$||await d();const T=k.headers||{};for(let D in T)if(D.toLowerCase()=="authorization"&&S==T[D]&&u.authStore.token){T[D]=u.authStore.token;break}return k.headers=T,m?m(_,k):{url:_,sendOptions:k}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}authRefresh(e,t){let i={method:"POST"};return i=wn("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 l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const X0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function K_(n){if(n){n.query=n.query||{};for(let e in n)X0.includes(e)||(n.query[e]=n[e],delete n[e])}}class J_ extends ll{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],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}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){K_(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){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)}async connect(){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(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await 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.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.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 qn(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.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class Q0 extends va{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return 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(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?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,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("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))}async authWithOAuth2(...e){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=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new qn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new J_(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=mu(void 0)),new Promise(async(a,u)=>{var f;try{await s.subscribe("@oauth2",async g=>{const h=s.clientId;try{if(!g.state||h!==g.state)throw new Error("State parameters don't match.");const _=Object.assign({},t);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback;const k=await this.authWithOAuth2Code(i.name,g.code,i.codeVerifier,l,t.createData,_);a(k)}catch(_){u(new qn(_))}r()});const c={state:s.clientId};(f=t.scopes)!=null&&f.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(g){o?o.location.href=g:o=mu(g)})(d)}catch(c){r(),u(new qn(c))}})}authRefresh(e,t){let i={method:"POST"};return i=wn("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(l=>this.authResponse(l))}requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).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,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function mu(n){if(typeof window>"u"||!(window!=null&&window.open))throw new qn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class x0 extends va{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class ey extends ll{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("/api/logs",i)}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class ty extends ll{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class ny extends ll{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}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 iy extends ll{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)}`)}}class Wo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Y_,this.admins=new G0(this),this.collections=new x0(this),this.files=new ny(this),this.logs=new ey(this),this.settings=new Z0(this),this.realtime=new J_(this),this.health=new ty(this),this.backups=new iy(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Q0(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}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,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 l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),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(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new qn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new qn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),K_(t),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 l=new AbortController;this.cancelControllers[i]=l,t.signal=l.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 l=Array.isArray(e[i])?e[i]:[e[i]];for(let s of l)t.append(i,s)}return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l 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 l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class sl extends Error{}class ly extends sl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class sy extends sl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class oy extends sl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Gl extends sl{}class Z_ extends sl{constructor(e){super(`Invalid unit ${e}`)}}class Nn extends sl{}class vi extends sl{constructor(){super("Zone is an abstract class")}}const Oe="numeric",Zn="short",Mn="long",Ur={year:Oe,month:Oe,day:Oe},G_={year:Oe,month:Zn,day:Oe},ry={year:Oe,month:Zn,day:Oe,weekday:Zn},X_={year:Oe,month:Mn,day:Oe},Q_={year:Oe,month:Mn,day:Oe,weekday:Mn},x_={hour:Oe,minute:Oe},e1={hour:Oe,minute:Oe,second:Oe},t1={hour:Oe,minute:Oe,second:Oe,timeZoneName:Zn},n1={hour:Oe,minute:Oe,second:Oe,timeZoneName:Mn},i1={hour:Oe,minute:Oe,hourCycle:"h23"},l1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23"},s1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Zn},o1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Mn},r1={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe},a1={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe,second:Oe},u1={year:Oe,month:Zn,day:Oe,hour:Oe,minute:Oe},f1={year:Oe,month:Zn,day:Oe,hour:Oe,minute:Oe,second:Oe},ay={year:Oe,month:Zn,day:Oe,weekday:Zn,hour:Oe,minute:Oe},c1={year:Oe,month:Mn,day:Oe,hour:Oe,minute:Oe,timeZoneName:Zn},d1={year:Oe,month:Mn,day:Oe,hour:Oe,minute:Oe,second:Oe,timeZoneName:Zn},p1={year:Oe,month:Mn,day:Oe,weekday:Mn,hour:Oe,minute:Oe,timeZoneName:Mn},m1={year:Oe,month:Mn,day:Oe,weekday:Mn,hour:Oe,minute:Oe,second:Oe,timeZoneName:Mn};function lt(n){return typeof n>"u"}function Qi(n){return typeof n=="number"}function Yo(n){return typeof n=="number"&&n%1===0}function uy(n){return typeof n=="string"}function fy(n){return Object.prototype.toString.call(n)==="[object Date]"}function h1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function cy(n){return Array.isArray(n)?n:[n]}function hu(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function dy(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Cl(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function pi(n,e,t){return Yo(n)&&n>=e&&n<=t}function py(n,e){return n-e*Math.floor(n/e)}function Ut(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function wi(n){if(!(lt(n)||n===null||n===""))return parseInt(n,10)}function qi(n){if(!(lt(n)||n===null||n===""))return parseFloat(n)}function wa(n){if(!(lt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Sa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function $s(n){return n%4===0&&(n%100!==0||n%400===0)}function ts(n){return $s(n)?366:365}function wo(n,e){const t=py(e-1,12)+1,i=n+(e-t)/12;return t===2?$s(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ta(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 So(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 g1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Ko(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function _1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Nn(`Invalid unit value ${n}`);return e}function To(n,e){const t={};for(const i in n)if(Cl(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=_1(l)}return t}function ns(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Ut(t,2)}:${Ut(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Ut(t,2)}${Ut(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Jo(n){return dy(n,["hour","minute","second","millisecond"])}const b1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,my=["January","February","March","April","May","June","July","August","September","October","November","December"],y1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hy=["J","F","M","A","M","J","J","A","S","O","N","D"];function k1(n){switch(n){case"narrow":return[...hy];case"short":return[...y1];case"long":return[...my];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 v1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],w1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],gy=["M","T","W","T","F","S","S"];function S1(n){switch(n){case"narrow":return[...gy];case"short":return[...w1];case"long":return[...v1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const T1=["AM","PM"],_y=["Before Christ","Anno Domini"],by=["BC","AD"],yy=["B","A"];function $1(n){switch(n){case"narrow":return[...yy];case"short":return[...by];case"long":return[..._y];default:return null}}function ky(n){return T1[n.hour<12?0:1]}function vy(n,e){return S1(e)[n.weekday-1]}function wy(n,e){return k1(e)[n.month-1]}function Sy(n,e){return $1(e)[n.year<0?0:1]}function Ty(n,e,t="always",i=!1){const l={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."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=l[n],f=i?a?u[1]:u[2]||u[1]:a?l[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function gu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const $y={D:Ur,DD:G_,DDD:X_,DDDD:Q_,t:x_,tt:e1,ttt:t1,tttt:n1,T:i1,TT:l1,TTT:s1,TTTT:o1,f:r1,ff:u1,fff:c1,ffff:p1,F:a1,FF:f1,FFF:d1,FFFF:m1};class gn{static create(e,t={}){return new gn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l,val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l,val:i}),s}static macroTokenToFormatOpts(e){return $y[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 Ut(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",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,g)=>this.loc.extract(e,m,g),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?ky(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,g)=>i?wy(e,m):s(g?{month:m}:{month:m,day:"numeric"},"month"),u=(m,g)=>i?vy(e,m):s(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const g=gn.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(e,g):m},c=m=>i?Sy(e,m):s({era:m},"era"),d=m=>{switch(m){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 l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({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 l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({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 l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({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 l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({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(m)}};return gu(gn.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}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=gn.parseFormat(t),o=s.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return gu(s,l(r))}}class Yn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Cs{get type(){throw new vi}get name(){throw new vi}get ianaName(){return this.name}get isUniversal(){throw new vi}offsetName(e,t){throw new vi}formatOffset(e,t){throw new vi}offset(e){throw new vi}equals(e){throw new vi}get isValid(){throw new vi}}let rr=null;class $a extends Cs{static get instance(){return rr===null&&(rr=new $a),rr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return g1(e,t,i)}formatOffset(e,t){return ns(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let fo={};function Cy(n){return fo[n]||(fo[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"})),fo[n]}const My={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Oy(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,u,f]=i;return[o,l,s,r,a,u,f]}function Dy(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?g:1e3+g,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ar=null;class un extends Cs{static get utcInstance(){return ar===null&&(ar=new un(0)),ar}static instance(e){return e===0?un.utcInstance:new un(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new un(Ko(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ns(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ns(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ns(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 Ey extends Cs{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 Ti(n,e){if(lt(n)||n===null)return e;if(n instanceof Cs)return n;if(uy(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?un.utcInstance:un.parseSpecifier(t)||mi.create(n)}else return Qi(n)?un.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new Ey(n)}let _u=()=>Date.now(),bu="system",yu=null,ku=null,vu=null,wu;class Zt{static get now(){return _u}static set now(e){_u=e}static set defaultZone(e){bu=e}static get defaultZone(){return Ti(bu,$a.instance)}static get defaultLocale(){return yu}static set defaultLocale(e){yu=e}static get defaultNumberingSystem(){return ku}static set defaultNumberingSystem(e){ku=e}static get defaultOutputCalendar(){return vu}static set defaultOutputCalendar(e){vu=e}static get throwOnInvalid(){return wu}static set throwOnInvalid(e){wu=e}static resetCaches(){At.resetCache(),mi.resetCache()}}let Su={};function Ay(n,e={}){const t=JSON.stringify([n,e]);let i=Su[t];return i||(i=new Intl.ListFormat(n,e),Su[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 Iy(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 Zr={};function Ly(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Zr[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Zr[l]=s),s}let Xl=null;function Py(){return Xl||(Xl=new Intl.DateTimeFormat().resolvedOptions().locale,Xl)}function Fy(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:l,calendar:s}=t;return[i,l,s]}}function Ny(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Ry(n){const e=[];for(let t=1;t<=12;t++){const i=He.utc(2016,t,1);e.push(n(i))}return e}function qy(n){const e=[];for(let t=1;t<=7;t++){const i=He.utc(2016,11,13+t);e.push(n(i))}return e}function Rs(n,e,t,i,l){const s=n.listingMode(t);return s==="error"?null:s==="en"?i(e):l(e)}function jy(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 Hy{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Iy(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):Sa(e,3);return Ut(t,this.padTo)}}}class zy{constructor(e,t,i){this.opts=i;let l;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&mi.create(r).valid?(l=r,this.dt=e):(l="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:He.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,l=e.zone.name);const s={...this.opts};l&&(s.timeZone=l),this.dtf=Kr(t,s)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Vy{constructor(e,t,i){this.opts={style:"long",...i},!t&&h1()&&(this.rtf=Ly(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Ty(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class At{static fromOpts(e){return At.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,l=!1){const s=e||Zt.defaultLocale,o=s||(l?"en-US":Py()),r=t||Zt.defaultNumberingSystem,a=i||Zt.defaultOutputCalendar;return new At(o,r,a,s)}static resetCache(){Xl=null,Yr={},Jr={},Zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return At.create(e,t,i)}constructor(e,t,i,l){const[s,o,r]=Fy(e);this.locale=s,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=Ny(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=l,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=jy(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:At.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 Rs(this,e,i,k1,()=>{const l=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=Ry(o=>this.extract(o,l,"month"))),this.monthsCache[s][e]})}weekdays(e,t=!1,i=!0){return Rs(this,e,i,S1,()=>{const l=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=qy(o=>this.extract(o,l,"weekday"))),this.weekdaysCache[s][e]})}meridiems(e=!0){return Rs(this,void 0,e,()=>T1,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[He.utc(2016,11,13,9),He.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Rs(this,e,t,$1,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[He.utc(-40,1,1),He.utc(2017,1,1)].map(l=>this.extract(l,i,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new Hy(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new zy(e,this.intl,t)}relFormatter(e={}){return new Vy(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Ay(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 Il(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ll(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Pl(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function C1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(g||m&&f)?-m:m;return[{years:d(qi(t)),months:d(qi(i)),weeks:d(qi(l)),days:d(qi(s)),hours:d(qi(o)),minutes:d(qi(r)),seconds:d(qi(a),a==="-0"),milliseconds:d(wa(u),c)}]}const tk={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 Oa(n,e,t,i,l,s,o){const r={year:e.length===2?Wr(wi(e)):wi(e),month:y1.indexOf(t)+1,day:wi(i),hour:wi(l),minute:wi(s)};return o&&(r.second=wi(o)),n&&(r.weekday=n.length>3?v1.indexOf(n)+1:w1.indexOf(n)+1),r}const nk=/^(?:(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 ik(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=Oa(e,l,i,t,s,o,r);let m;return a?m=tk[a]:u?m=0:m=Ko(f,c),[d,new un(m)]}function lk(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const sk=/^(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$/,ok=/^(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$/,rk=/^(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 Tu(n){const[,e,t,i,l,s,o,r]=n;return[Oa(e,l,i,t,s,o,r),un.utcInstance]}function ak(n){const[,e,t,i,l,s,o,r]=n;return[Oa(e,r,t,i,l,s,o),un.utcInstance]}const uk=Il(Uy,Ma),fk=Il(Wy,Ma),ck=Il(Yy,Ma),dk=Il(O1),E1=Ll(Xy,Fl,Ms,Os),pk=Ll(Ky,Fl,Ms,Os),mk=Ll(Jy,Fl,Ms,Os),hk=Ll(Fl,Ms,Os);function gk(n){return Pl(n,[uk,E1],[fk,pk],[ck,mk],[dk,hk])}function _k(n){return Pl(lk(n),[nk,ik])}function bk(n){return Pl(n,[sk,Tu],[ok,Tu],[rk,ak])}function yk(n){return Pl(n,[xy,ek])}const kk=Ll(Fl);function vk(n){return Pl(n,[Qy,kk])}const wk=Il(Zy,Gy),Sk=Il(D1),Tk=Ll(Fl,Ms,Os);function $k(n){return Pl(n,[wk,E1],[Sk,Tk])}const Ck="Invalid Duration",A1={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}},Mk={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},...A1},An=146097/400,hl=146097/4800,Ok={years:{quarters:4,months:12,weeks:An/7,days:An,hours:An*24,minutes:An*24*60,seconds:An*24*60*60,milliseconds:An*24*60*60*1e3},quarters:{months:3,weeks:An/28,days:An/4,hours:An*24/4,minutes:An*24*60/4,seconds:An*24*60*60/4,milliseconds:An*24*60*60*1e3/4},months:{weeks:hl/7,days:hl,hours:hl*24,minutes:hl*24*60,seconds:hl*24*60*60,milliseconds:hl*24*60*60*1e3},...A1},Yi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Dk=Yi.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 ot(i)}function Ek(n){return n<0?Math.floor(n):Math.ceil(n)}function I1(n,e,t,i,l){const s=n[l][t],o=e[t]/s,r=Math.sign(o)===Math.sign(i[l]),a=!r&&i[l]!==0&&Math.abs(o)<=1?Ek(o):Math.trunc(o);i[l]+=a,e[t]-=a*s}function Ak(n,e){Dk.reduce((t,i)=>lt(e[i])?t:(t&&I1(n,e,t,e,i),i),null)}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||At.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Ok:Mk,this.isLuxonDuration=!0}static fromMillis(e,t){return ot.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Nn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:To(e,ot.normalizeUnit),loc:At.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Qi(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new Nn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=yk(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=vk(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the Duration is invalid");const i=e instanceof Yn?e:new Yn(e,t);if(Zt.throwOnInvalid)throw new oy(i);return new ot({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 Z_(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?gn.create(this.loc,i).formatDurationFromString(this,e):Ck}toHuman(e={}){const t=Yi.map(i=>{const l=this.values[i];return lt(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).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+=Sa(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 l=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(l+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(l+=".SSS"));let s=i.toFormat(l);return e.includePrefix&&(s="T"+s),s}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=ot.fromDurationLike(e),i={};for(const l of Yi)(Cl(t.values,l)||Cl(this.values,l))&&(i[l]=t.get(l)+this.get(l));return ji(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ot.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]=_1(e(this.values[i],i));return ji(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...To(e,ot.normalizeUnit)};return ji(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t}),s={loc:l};return i&&(s.conversionAccuracy=i),ji(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ak(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=>ot.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Yi)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;Qi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in l)Yi.indexOf(u)>Yi.indexOf(o)&&I1(this.matrix,l,u,t,o)}else Qi(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][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,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Yi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Hl="Invalid Interval";function Ik(n,e){return!n||!n.isValid?Rt.invalid("missing or invalid start"):!e||!e.isValid?Rt.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?Rt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Bl).filter(o=>this.contains(o)).sort(),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Rt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=ot.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Rt.fromDateTimes(i,s)),i=s,l+=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:Rt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Rt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),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&&l.push(Rt.fromDateTimes(t,a.time)),t=null);return Rt.merge(l)}difference(...e){return Rt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Hl}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Hl}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Hl}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Hl}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Hl}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Rt.fromDateTimes(e(this.s),e(this.e))}}class qs{static hasDST(e=Zt.defaultZone){const t=He.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return mi.isValidZone(e)}static normalizeZone(e){return Ti(e,Zt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||At.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||At.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||At.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||At.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return At.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return At.create(t,null,"gregory").eras(e)}static features(){return{relative:h1()}}}function $u(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function Lk(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=$u(r,a);return(u-u%7)/7}],["days",$u]],l={};let s,o;for(const[r,a]of i)if(t.indexOf(r)>=0){s=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,l[r]=u}return[n,l,o,s]}function Pk(n,e,t,i){let[l,s,o,r]=Lk(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...u).plus(f):f}const Da={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Cu={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]},Fk=Da.hanidec.replace(/[\[|\]]/g,"").split("");function Nk(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}function Un({numberingSystem:n},e=""){return new RegExp(`${Da[n||"latn"]}${e}`)}const Rk="missing Intl.DateTimeFormat.formatToParts support";function ft(n,e=t=>t){return{regex:n,deser:([t])=>e(Nk(t))}}const qk=String.fromCharCode(160),L1=`[ ${qk}]`,P1=new RegExp(L1,"g");function jk(n){return n.replace(/\./g,"\\.?").replace(P1,L1)}function Mu(n){return n.replace(/\./g,"").replace(P1," ").toLowerCase()}function Wn(n,e){return n===null?null:{regex:RegExp(n.map(jk).join("|")),deser:([t])=>n.findIndex(i=>Mu(t)===Mu(i))+e}}function Ou(n,e){return{regex:n,deser:([,t,i])=>Ko(t,i),groups:e}}function ur(n){return{regex:n,deser:([e])=>e}}function Hk(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function zk(n,e){const t=Un(e),i=Un(e,"{2}"),l=Un(e,"{3}"),s=Un(e,"{4}"),o=Un(e,"{6}"),r=Un(e,"{1,2}"),a=Un(e,"{1,3}"),u=Un(e,"{1,6}"),f=Un(e,"{1,9}"),c=Un(e,"{2,4}"),d=Un(e,"{4,6}"),m=_=>({regex:RegExp(Hk(_.val)),deser:([k])=>k,literal:!0}),h=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return Wn(e.eras("short",!1),0);case"GG":return Wn(e.eras("long",!1),0);case"y":return ft(u);case"yy":return ft(c,Wr);case"yyyy":return ft(s);case"yyyyy":return ft(d);case"yyyyyy":return ft(o);case"M":return ft(r);case"MM":return ft(i);case"MMM":return Wn(e.months("short",!0,!1),1);case"MMMM":return Wn(e.months("long",!0,!1),1);case"L":return ft(r);case"LL":return ft(i);case"LLL":return Wn(e.months("short",!1,!1),1);case"LLLL":return Wn(e.months("long",!1,!1),1);case"d":return ft(r);case"dd":return ft(i);case"o":return ft(a);case"ooo":return ft(l);case"HH":return ft(i);case"H":return ft(r);case"hh":return ft(i);case"h":return ft(r);case"mm":return ft(i);case"m":return ft(r);case"q":return ft(r);case"qq":return ft(i);case"s":return ft(r);case"ss":return ft(i);case"S":return ft(a);case"SSS":return ft(l);case"u":return ur(f);case"uu":return ur(r);case"uuu":return ft(t);case"a":return Wn(e.meridiems(),0);case"kkkk":return ft(s);case"kk":return ft(c,Wr);case"W":return ft(r);case"WW":return ft(i);case"E":case"c":return ft(t);case"EEE":return Wn(e.weekdays("short",!1,!1),1);case"EEEE":return Wn(e.weekdays("long",!1,!1),1);case"ccc":return Wn(e.weekdays("short",!0,!1),1);case"cccc":return Wn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Ou(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ou(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ur(/[a-z_+-/]{1,256}?/i);default:return m(_)}})(n)||{invalidReason:Rk};return h.token=n,h}const Vk={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 Bk(n,e,t){const{type:i,value:l}=n;if(i==="literal")return{literal:!0,val:l};const s=t[i];let o=Vk[i];if(typeof o=="object"&&(o=o[s]),o)return{literal:!1,val:o}}function Uk(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Wk(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Cl(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Yk(n){const e=s=>{switch(s){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 lt(n.z)||(t=mi.create(n.z)),lt(n.Z)||(t||(t=new un(n.Z)),i=n.Z),lt(n.q)||(n.M=(n.q-1)*3+1),lt(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),lt(n.u)||(n.S=wa(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let fr=null;function Kk(){return fr||(fr=He.fromMillis(1555555555555)),fr}function Jk(n,e){if(n.literal)return n;const t=gn.macroTokenToFormatOpts(n.val);if(!t)return n;const s=gn.create(e,t).formatDateTimeParts(Kk()).map(o=>Bk(o,e,t));return s.includes(void 0)?n:s}function Zk(n,e){return Array.prototype.concat(...n.map(t=>Jk(t,e)))}function F1(n,e,t){const i=Zk(gn.parseFormat(t),n),l=i.map(o=>zk(o,n)),s=l.find(o=>o.invalidReason);if(s)return{input:e,tokens:i,invalidReason:s.invalidReason};{const[o,r]=Uk(l),a=RegExp(o,"i"),[u,f]=Wk(e,a,r),[c,d,m]=f?Yk(f):[null,null,void 0];if(Cl(f,"a")&&Cl(f,"H"))throw new Gl("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:m}}}function Gk(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=F1(n,e,t);return[i,l,s,o]}const N1=[0,31,59,90,120,151,181,212,243,273,304,334],R1=[0,31,60,91,121,152,182,213,244,274,305,335];function Rn(n,e){return new Yn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function q1(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function j1(n,e,t){return t+($s(n)?R1:N1)[e-1]}function H1(n,e){const t=$s(n)?R1:N1,i=t.findIndex(s=>sSo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:s,...Jo(n)}}function Du(n){const{weekYear:e,weekNumber:t,weekday:i}=n,l=q1(e,1,4),s=ts(e);let o=t*7+i-l-3,r;o<1?(r=e-1,o+=ts(r)):o>s?(r=e+1,o-=ts(e)):r=e;const{month:a,day:u}=H1(r,o);return{year:r,month:a,day:u,...Jo(n)}}function cr(n){const{year:e,month:t,day:i}=n,l=j1(e,t,i);return{year:e,ordinal:l,...Jo(n)}}function Eu(n){const{year:e,ordinal:t}=n,{month:i,day:l}=H1(e,t);return{year:e,month:i,day:l,...Jo(n)}}function Xk(n){const e=Yo(n.weekYear),t=pi(n.weekNumber,1,So(n.weekYear)),i=pi(n.weekday,1,7);return e?t?i?!1:Rn("weekday",n.weekday):Rn("week",n.week):Rn("weekYear",n.weekYear)}function Qk(n){const e=Yo(n.year),t=pi(n.ordinal,1,ts(n.year));return e?t?!1:Rn("ordinal",n.ordinal):Rn("year",n.year)}function z1(n){const e=Yo(n.year),t=pi(n.month,1,12),i=pi(n.day,1,wo(n.year,n.month));return e?t?i?!1:Rn("day",n.day):Rn("month",n.month):Rn("year",n.year)}function V1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=pi(e,0,23)||e===24&&t===0&&i===0&&l===0,o=pi(t,0,59),r=pi(i,0,59),a=pi(l,0,999);return s?o?r?a?!1:Rn("millisecond",l):Rn("second",i):Rn("minute",t):Rn("hour",e)}const dr="Invalid DateTime",Au=864e13;function js(n){return new Yn("unsupported zone",`the zone "${n.name}" is not supported`)}function pr(n){return n.weekData===null&&(n.weekData=Gr(n.c)),n.weekData}function zl(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new He({...t,...e,old:t})}function B1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Iu(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 co(n,e,t){return B1(Ta(n),e,t)}function Lu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,wo(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ot.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=Ta(s);let[a,u]=B1(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=He.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return He.invalid(new Yn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Hs(n,e,t=!0){return n.isValid?gn.create(At.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function mr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Ut(n.c.year,t?6:4),e?(i+="-",i+=Ut(n.c.month),i+="-",i+=Ut(n.c.day)):(i+=Ut(n.c.month),i+=Ut(n.c.day)),i}function Pu(n,e,t,i,l,s){let o=Ut(n.c.hour);return e?(o+=":",o+=Ut(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Ut(n.c.minute),(n.c.second!==0||!t)&&(o+=Ut(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Ut(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Ut(Math.trunc(-n.o/60)),o+=":",o+=Ut(Math.trunc(-n.o%60))):(o+="+",o+=Ut(Math.trunc(n.o/60)),o+=":",o+=Ut(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const U1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},xk={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ev={ordinal:1,hour:0,minute:0,second:0,millisecond:0},W1=["year","month","day","hour","minute","second","millisecond"],tv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],nv=["year","ordinal","hour","minute","second","millisecond"];function Fu(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 Z_(n);return e}function Nu(n,e){const t=Ti(e.zone,Zt.defaultZone),i=At.fromObject(e),l=Zt.now();let s,o;if(lt(n.year))s=l;else{for(const u of W1)lt(n[u])&&(n[u]=U1[u]);const r=z1(n)||V1(n);if(r)return He.invalid(r);const a=t.offset(l);[s,o]=co(n,a,t)}return new He({ts:s,zone:t,loc:i,o})}function Ru(n,e,t){const i=lt(t.round)?!0:t.round,l=(o,r)=>(o=Sa(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=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 l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function qu(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 He{constructor(e){const t=e.zone||Zt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Yn("invalid input"):null)||(t.isValid?null:js(t));this.ts=lt(e.ts)?Zt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);l=Iu(this.ts,r),i=Number.isNaN(l.year)?new Yn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||At.create(),this.invalid=i,this.weekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new He({})}static local(){const[e,t]=qu(arguments),[i,l,s,o,r,a,u]=t;return Nu({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=qu(arguments),[i,l,s,o,r,a,u]=t;return e.zone=un.utcInstance,Nu({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=fy(e)?e.valueOf():NaN;if(Number.isNaN(i))return He.invalid("invalid input");const l=Ti(t.zone,Zt.defaultZone);return l.isValid?new He({ts:i,zone:l,loc:At.fromObject(t)}):He.invalid(js(l))}static fromMillis(e,t={}){if(Qi(e))return e<-Au||e>Au?He.invalid("Timestamp out of range"):new He({ts:e,zone:Ti(t.zone,Zt.defaultZone),loc:At.fromObject(t)});throw new Nn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Qi(e))return new He({ts:e*1e3,zone:Ti(t.zone,Zt.defaultZone),loc:At.fromObject(t)});throw new Nn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ti(t.zone,Zt.defaultZone);if(!i.isValid)return He.invalid(js(i));const l=Zt.now(),s=lt(t.specificOffset)?i.offset(l):t.specificOffset,o=To(e,Fu),r=!lt(o.ordinal),a=!lt(o.year),u=!lt(o.month)||!lt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=At.fromObject(t);if((f||r)&&c)throw new Gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Gl("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!f;let g,h,_=Iu(l,s);m?(g=tv,h=xk,_=Gr(_)):r?(g=nv,h=ev,_=cr(_)):(g=W1,h=U1);let k=!1;for(const E of g){const L=o[E];lt(L)?k?o[E]=h[E]:o[E]=_[E]:k=!0}const S=m?Xk(o):r?Qk(o):z1(o),$=S||V1(o);if($)return He.invalid($);const T=m?Du(o):r?Eu(o):o,[C,D]=co(T,s,i),O=new He({ts:C,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?He.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,l]=gk(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=_k(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=bk(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(lt(e)||lt(t))throw new Nn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=At.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,u,f]=Gk(o,e,t);return f?He.invalid(f):Vl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return He.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=$k(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the DateTime is invalid");const i=e instanceof Yn?e:new Yn(e,t);if(Zt.throwOnInvalid)throw new ly(i);return new He({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?qs.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qs.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qs.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qs.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 $s(this.year)}get daysInMonth(){return wo(this.year,this.month)}get daysInYear(){return this.isValid?ts(this.year):NaN}get weeksInWeekYear(){return this.isValid?So(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=gn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(un.instance(e),t)}toLocal(){return this.setZone(Zt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ti(e,Zt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=co(o,s,e)}return zl(this,{ts:l,zone:e})}else return He.invalid(js(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return zl(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=To(e,Fu),i=!lt(t.weekYear)||!lt(t.weekNumber)||!lt(t.weekday),l=!lt(t.ordinal),s=!lt(t.year),o=!lt(t.month)||!lt(t.day),r=s||o,a=t.weekYear||t.weekNumber;if((r||l)&&a)throw new Gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&l)throw new Gl("Can't mix ordinal dates with month/day");let u;i?u=Du({...Gr(this.c),...t}):lt(t.ordinal)?(u={...this.toObject(),...t},lt(t.day)&&(u.day=Math.min(wo(u.year,u.month),u.day))):u=Eu({...cr(this.c),...t});const[f,c]=co(u,this.o,this.zone);return zl(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return zl(this,Lu(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return zl(this,Lu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ot.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 l=Math.ceil(this.month/3);t.month=(l-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?gn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):dr}toLocaleString(e=Ur,t={}){return this.isValid?gn.create(this.loc.clone(t),e).formatDateTime(this):dr}toLocaleParts(e={}){return this.isValid?gn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:l=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=mr(this,o);return r+="T",r+=Pu(this,o,t,i,l,s),r}toISODate({format:e="extended"}={}){return this.isValid?mr(this,e==="extended"):null}toISOWeekDate(){return Hs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:l=!1,extendedZone:s=!1,format:o="extended"}={}){return this.isValid?(l?"T":"")+Pu(this,o==="extended",t,e,i,s):null}toRFC2822(){return Hs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Hs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?mr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let l="HH:mm:ss.SSS";return(t||e)&&(i&&(l+=" "),t?l+="z":e&&(l+="ZZ")),Hs(this,l,!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 ot.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=cy(t).map(ot.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Pk(r,a,s,l);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(He.now(),e,t)}until(e){return this.isValid?Rt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),l=this.setZone(e.zone,{keepLocalTime:!0});return l.startOf(t)<=i&&i<=l.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||He.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(He.isDateTime))throw new Nn("max requires all arguments be DateTimes");return hu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=At.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return F1(o,e,t)}static fromStringExplain(e,t,i={}){return He.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ur}static get DATE_MED(){return G_}static get DATE_MED_WITH_WEEKDAY(){return ry}static get DATE_FULL(){return X_}static get DATE_HUGE(){return Q_}static get TIME_SIMPLE(){return x_}static get TIME_WITH_SECONDS(){return e1}static get TIME_WITH_SHORT_OFFSET(){return t1}static get TIME_WITH_LONG_OFFSET(){return n1}static get TIME_24_SIMPLE(){return i1}static get TIME_24_WITH_SECONDS(){return l1}static get TIME_24_WITH_SHORT_OFFSET(){return s1}static get TIME_24_WITH_LONG_OFFSET(){return o1}static get DATETIME_SHORT(){return r1}static get DATETIME_SHORT_WITH_SECONDS(){return a1}static get DATETIME_MED(){return u1}static get DATETIME_MED_WITH_SECONDS(){return f1}static get DATETIME_MED_WITH_WEEKDAY(){return ay}static get DATETIME_FULL(){return c1}static get DATETIME_FULL_WITH_SECONDS(){return d1}static get DATETIME_HUGE(){return p1}static get DATETIME_HUGE_WITH_SECONDS(){return m1}}function Bl(n){if(He.isDateTime(n))return n;if(n&&n.valueOf&&Qi(n.valueOf()))return He.fromJSDate(n);if(n&&typeof n=="object")return He.fromObject(n);throw new Nn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const iv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],lv=[".mp4",".avi",".mov",".3gp",".wmv"],sv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],ov=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],Y1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];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==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0: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 l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));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 He.fromFormat(e,i,{zone:"UTC"})}return He.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.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,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||"",!!iv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!lv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!sv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!ov.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(l=>{let s=new FileReader;s.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),l(a.toDataURL(e.type))},r.src=o.target.result},s.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 l of i)j.addValueToFormData(e,t,l);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,m,g;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const h of t){let _=null;h.type==="number"?_=123:h.type==="date"?_="2022-01-01 10:00:00.123Z":h.type==="bool"?_=!0:h.type==="email"?_="test@example.com":h.type==="url"?_="https://example.com":h.type==="json"?_="JSON":h.type==="file"?(_="filename.jpg",((f=h.options)==null?void 0:f.maxSelect)!==1&&(_=[_])):h.type==="select"?(_=(d=(c=h.options)==null?void 0:c.values)==null?void 0:d[0],((m=h.options)==null?void 0:m.maxSelect)!==1&&(_=[_])):h.type==="relation"?(_="RELATION_RECORD_ID",((g=h.options)==null?void 0:g.maxSelect)!==1&&(_=[_])):_="test",s[h.name]=_}return s}static dummyCollectionSchemaData(e){var l,s,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=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[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 l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=j.isObject(u)&&j.findByKey(l,"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=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(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(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}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:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,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,m=f.result.split(",")[1],g=d.create(c,u,m);d.add(g),l(g.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.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(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){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/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);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 l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/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((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=l[2])==null?void 0:u.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const h=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((h==null?void 0:h.length)!=4)continue;const _=(c=(f=h[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");_&&t.columns.push({name:_,collate:h[2]||"",sort:((d=h[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[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(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` +}`,c=`__svelte_${$0(f)}_${r}`,d=F_(n),{stylesheet:m,rules:g}=yo.get(d)||C0(d,n);g[c]||(g[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const h=n.style.animation||"";return n.style.animation=`${h?`${h}, `:""}${c} ${i}ms linear ${l}ms 1 both`,ko+=1,c}function us(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),ko-=l,ko||M0())}function M0(){ga(()=>{ko||(yo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),yo.clear())})}function O0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=vs,start:a=Ho()+s,end:u=a+o,tick:f=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,g;function h(){c&&(g=as(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&us(n,g),d=!1}return zo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),h(),f(0,1),_}function D0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,R_(n,l)}}function R_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let fs;function di(n){fs=n}function ws(){if(!fs)throw new Error("Function called outside component initialization");return fs}function Vt(n){ws().$$.on_mount.push(n)}function E0(n){ws().$$.after_update.push(n)}function Ss(n){ws().$$.on_destroy.push(n)}function rt(){const n=ws();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=N_(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ee(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _l=[],te=[];let yl=[];const Br=[],q_=Promise.resolve();let Ur=!1;function j_(){Ur||(Ur=!0,q_.then(_a))}function Qt(){return j_(),q_}function Ke(n){yl.push(n)}function ye(n){Br.push(n)}const lr=new Set;let pl=0;function _a(){if(pl!==0)return;const n=fs;do{try{for(;pl<_l.length;){const e=_l[pl];pl++,di(e),A0(e.$$)}}catch(e){throw _l.length=0,pl=0,e}for(di(null),_l.length=0,pl=0;te.length;)te.pop()();for(let e=0;en.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),yl=e}let ql;function ba(){return ql||(ql=Promise.resolve(),ql.then(()=>{ql=null})),ql}function Xi(n,e,t){n.dispatchEvent(N_(`${e?"intro":"outro"}${t}`))}const oo=new Set;let ei;function re(){ei={r:0,c:[],p:ei}}function ae(){ei.r||we(ei.c),ei=ei.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),ei.c.push(()=>{oo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ya={duration:0};function H_(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&us(n,o)}function f(){const{delay:d=0,duration:m=300,easing:g=vs,tick:h=Q,css:_}=l||ya;_&&(o=as(n,0,1,m,d,g,_,a++)),h(0,1);const k=Ho()+d,S=k+m;r&&r.abort(),s=!0,Ke(()=>Xi(n,!0,"start")),r=zo($=>{if(s){if($>=S)return h(1,0),Xi(n,!0,"end"),u(),s=!1;if($>=k){const T=g(($-k)/m);h(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,us(n),$t(l)?(l=l(i),ba().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function ka(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=ei;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=vs,tick:m=Q,css:g}=l||ya;g&&(o=as(n,1,0,c,f,d,g));const h=Ho()+f,_=h+c;Ke(()=>Xi(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),zo(k=>{if(s){if(k>=_)return m(0,1),Xi(n,!1,"end"),--r.r||we(r.c),!1;if(k>=h){const S=d((k-h)/c);m(1-S,S)}}return s})}return $t(l)?ba().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&us(n,o),s=!1)}}}function Le(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&us(n,u)}function d(g,h){const _=g.b-o;return h*=Math.abs(_),{a:o,b:g.b,d:_,duration:h,start:g.start,end:g.start+h,group:g.group}}function m(g){const{delay:h=0,duration:_=300,easing:k=vs,tick:S=Q,css:$}=s||ya,T={start:Ho()+h,b:g};g||(T.group=ei,ei.r+=1),"inert"in n&&(g?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=as(n,o,g,_,h,k,$)),g&&S(0,1),r=d(T,_),Ke(()=>Xi(n,g,"start")),zo(C=>{if(a&&C>a.start&&(r=d(a,_),a=null,Xi(n,r.b,"start"),$&&(c(),u=as(n,o,r.b,r.duration,0,k,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Xi(n,r.b,"end"),a||(r.b?c():--r.group.r||we(r.group.c)),r=null;else if(C>=r.start){const D=C-r.start;o=r.a+r.d*k(D/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(g){$t(s)?ba().then(()=>{s=s({direction:g?"in":"out"}),m(g)}):m(g)},end(){c(),r=a=null}}}function ou(n,e){const t=e.token={};function i(l,s,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=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&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[s]=u),f&&_a()}if(g0(n)){const l=ws();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),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 L0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function pe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Pi(n,e){n.d(1),e.delete(n.key)}function Lt(n,e){I(n,1,1,()=>{e.delete(n.key)})}function P0(n,e){n.f(),Lt(n,e)}function dt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,g=d;const h={};for(;g--;)h[n[g].key]=g;const _=[],k=new Map,S=new Map,$=[];for(g=m;g--;){const O=c(l,s,g),E=t(O);let L=o.get(E);L?i&&$.push(()=>L.p(O,e)):(L=u(E,O),L.c()),k.set(E,_[g]=L),E in h&&S.set(E,Math.abs(g-h[E]))}const T=new Set,C=new Set;function D(O){A(O,1),O.m(r,f),o.set(O.key,O),f=O.first,m--}for(;d&&m;){const O=_[m-1],E=n[d-1],L=O.key,R=E.key;O===E?(f=O.first,d--,m--):k.has(R)?!o.has(L)||T.has(L)?D(O):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),D(O)):(T.add(R),d--):(a(E,o),d--)}for(;d--;){const O=n[d];k.has(O.key)||a(O,o)}for(;m;)D(_[m-1]);return we($),_}function pt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ct(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(A_).filter($t);n.$$.on_destroy?n.$$.on_destroy.push(...s):we(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(I0(t.after_update),we(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function F0(n,e){n.$$.dirty[0]===-1&&(_l.push(n),j_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=m.length?m[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&F0(n,c)),d}):[],u.update(),f=!0,we(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=S0(e.target);u.fragment&&u.fragment.l(c),c.forEach(v)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),z(n,e.target,e.anchor),_a()}di(a)}class _e{constructor(){Ue(this,"$$");Ue(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!$t(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!_0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const N0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(N0);function Nt(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:l,update:s,subscribe:o}}function V_(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return z_(t,(o,r)=>{let a=!1;const u=[];let f=0,c=Q;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,o,r);s?o(g):c=$t(g)?g:Q},m=l.map((g,h)=>ha(g,_=>{u[h]=_,f&=~(1<{f|=1<{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a&4?pt(l,[Ct(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&&v(t),e&&V(e,r)}}}function q0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};if(a!==void 0&&a&6)u=pt(l,[a&2&&{params:r[1]},a&4&&Ct(r[2])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a&6?pt(l,[a&2&&{params:r[1]},a&4&&Ct(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&&v(t),e&&V(e,r)}}}function j0(n){let e,t,i,l;const s=[q0,R0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function ru(){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 Vo=z_(null,function(e){e(ru());const t=()=>{e(ru())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});V_(Vo,n=>n.location);const Bo=V_(Vo,n=>n.querystring),au=Dn(void 0);async function il(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();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 ln(n,e){if(e=fu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return uu(n,e),{update(t){t=fu(t),uu(n,t)}}}function H0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uu(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||z0(i.currentTarget.getAttribute("href"))})}function fu(n){return n&&typeof n=="string"?{href:n}:n||{}}function z0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function V0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,D){if(!D||typeof D!="function"&&(typeof D!="object"||D._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:E}=B_(C);this.path=C,typeof D=="object"&&D._sveltesparouter===!0?(this.component=D.component,this.conditions=D.conditions||[],this.userData=D.userData,this.props=D.props||{}):(this.component=()=>Promise.resolve(D),this.conditions=[],this.props={}),this._pattern=O,this._keys=E}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const D=this._pattern.exec(C);if(D===null)return null;if(this._keys===!1)return D;const O={};let E=0;for(;E{r.push(new o(C,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=rt();async function d(T,C){await Qt(),c(T,C)}let m=null,g=null;s&&(g=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",g),E0(()=>{H0(m)}));let h=null,_=null;const k=Vo.subscribe(async T=>{h=T;let C=0;for(;C{au.set(u)});return}t(0,a=null),_=null,au.set(void 0)});Ss(()=>{k(),g&&window.removeEventListener("popstate",g)});function S(T){Ee.call(this,n,T)}function $(T){Ee.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class B0 extends _e{constructor(e){super(),ge(this,e,V0,j0,he,{routes:3,prefix:4,restoreScrollState:5})}}const ro=[];let U_;function W_(n){const e=n.pattern.test(U_);cu(n,n.className,e),cu(n,n.inactiveClassName,!e)}function cu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Vo.subscribe(n=>{U_=n.location+(n.querystring?"?"+n.querystring:""),ro.map(W_)});function Pn(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"?B_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ro.push(i),W_(i),{destroy(){ro.splice(ro.indexOf(i),1)}}}const U0="modulepreload",W0=function(n,e){return new URL(n,e).href},du={},st=function(e,t,i){if(!t||t.length===0)return e();const l=document.getElementsByTagName("link");return Promise.all(t.map(s=>{if(s=W0(s,i),s in du)return;du[s]=!0;const o=s.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=l.length-1;f>=0;f--){const c=l[f];if(c.href===s&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":U0,o||(u.as="script",u.crossOrigin=""),u.href=s,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 ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};class qn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,qn.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 qn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?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.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.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{...this}}}const Ps=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Y0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||K0;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}Y_=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,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const mu="pb_auth";class Z0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!va(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=mu){const i=Y0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=mu){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=ao(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=pu(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(u=s==null?void 0:s.model)==null?void 0:u.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(s.model[c]=this.model[c]);o=pu(t,JSON.stringify(s),e)}return o}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 K_ extends Z0{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.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 ll{constructor(e){this.client=e}}class G0 extends ll{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,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class wa extends ll{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(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}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 l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new qn({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(l=>this.decode(l))}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=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function sr(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class X0 extends wa{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.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})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||sr(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(u,f,c,d){sr(u);const m=u.beforeSend,g=u.authStore.model,h=u.authStore.onChange((_,k)=>{(!_||(k==null?void 0:k.id)!=(g==null?void 0:g.id)||(k!=null&&k.collectionId||g!=null&&g.collectionId)&&(k==null?void 0:k.collectionId)!=(g==null?void 0:g.collectionId))&&sr(u)});u._resetAutoRefresh=function(){h(),u.beforeSend=m,delete u._resetAutoRefresh},u.beforeSend=async(_,k)=>{var C;const S=u.authStore.token;if((C=k.query)!=null&&C.autoRefresh)return m?m(_,k):{url:_,sendOptions:k};let $=u.authStore.isValid;if($&&va(u.authStore.token,f))try{await c()}catch{$=!1}$||await d();const T=k.headers||{};for(let D in T)if(D.toLowerCase()=="authorization"&&S==T[D]&&u.authStore.token){T[D]=u.authStore.token;break}return k.headers=T,m?m(_,k):{url:_,sendOptions:k}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}authRefresh(e,t){let i={method:"POST"};return i=wn("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 l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const Q0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function J_(n){if(n){n.query=n.query||{};for(let e in n)Q0.includes(e)||(n.query[e]=n[e],delete n[e])}}class Z_ extends ll{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],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}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){J_(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){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)}async connect(){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(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await 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.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.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 qn(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.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class x0 extends wa{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return 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(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?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,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("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))}async authWithOAuth2(...e){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=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new qn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new Z_(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=hu(void 0)),new Promise(async(a,u)=>{var f;try{await s.subscribe("@oauth2",async g=>{const h=s.clientId;try{if(!g.state||h!==g.state)throw new Error("State parameters don't match.");const _=Object.assign({},t);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback;const k=await this.authWithOAuth2Code(i.name,g.code,i.codeVerifier,l,t.createData,_);a(k)}catch(_){u(new qn(_))}r()});const c={state:s.clientId};(f=t.scopes)!=null&&f.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(g){o?o.location.href=g:o=hu(g)})(d)}catch(c){r(),u(new qn(c))}})}authRefresh(e,t){let i={method:"POST"};return i=wn("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(l=>this.authResponse(l))}requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).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,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function hu(n){if(typeof window>"u"||!(window!=null&&window.open))throw new qn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class ey extends wa{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class ty extends ll{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("/api/logs",i)}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class ny extends ll{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class iy extends ll{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}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 ly extends ll{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)}`)}}class Uo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new K_,this.admins=new X0(this),this.collections=new ey(this),this.files=new iy(this),this.logs=new ty(this),this.settings=new G0(this),this.realtime=new Z_(this),this.health=new ny(this),this.backups=new ly(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new x0(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}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,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 l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),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(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new qn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new qn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),J_(t),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 l=new AbortController;this.cancelControllers[i]=l,t.signal=l.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 l=Array.isArray(e[i])?e[i]:[e[i]];for(let s of l)t.append(i,s)}return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l 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 l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class sl extends Error{}class sy extends sl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class oy extends sl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ry extends sl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Zl extends sl{}class G_ extends sl{constructor(e){super(`Invalid unit ${e}`)}}class Nn extends sl{}class vi extends sl{constructor(){super("Zone is an abstract class")}}const Oe="numeric",Zn="short",Mn="long",Wr={year:Oe,month:Oe,day:Oe},X_={year:Oe,month:Zn,day:Oe},ay={year:Oe,month:Zn,day:Oe,weekday:Zn},Q_={year:Oe,month:Mn,day:Oe},x_={year:Oe,month:Mn,day:Oe,weekday:Mn},e1={hour:Oe,minute:Oe},t1={hour:Oe,minute:Oe,second:Oe},n1={hour:Oe,minute:Oe,second:Oe,timeZoneName:Zn},i1={hour:Oe,minute:Oe,second:Oe,timeZoneName:Mn},l1={hour:Oe,minute:Oe,hourCycle:"h23"},s1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23"},o1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Zn},r1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Mn},a1={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe},u1={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe,second:Oe},f1={year:Oe,month:Zn,day:Oe,hour:Oe,minute:Oe},c1={year:Oe,month:Zn,day:Oe,hour:Oe,minute:Oe,second:Oe},uy={year:Oe,month:Zn,day:Oe,weekday:Zn,hour:Oe,minute:Oe},d1={year:Oe,month:Mn,day:Oe,hour:Oe,minute:Oe,timeZoneName:Zn},p1={year:Oe,month:Mn,day:Oe,hour:Oe,minute:Oe,second:Oe,timeZoneName:Zn},m1={year:Oe,month:Mn,day:Oe,weekday:Mn,hour:Oe,minute:Oe,timeZoneName:Mn},h1={year:Oe,month:Mn,day:Oe,weekday:Mn,hour:Oe,minute:Oe,second:Oe,timeZoneName:Mn};function lt(n){return typeof n>"u"}function Qi(n){return typeof n=="number"}function Wo(n){return typeof n=="number"&&n%1===0}function fy(n){return typeof n=="string"}function cy(n){return Object.prototype.toString.call(n)==="[object Date]"}function g1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function dy(n){return Array.isArray(n)?n:[n]}function gu(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function py(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function $l(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function pi(n,e,t){return Wo(n)&&n>=e&&n<=t}function my(n,e){return n-e*Math.floor(n/e)}function Ut(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function wi(n){if(!(lt(n)||n===null||n===""))return parseInt(n,10)}function qi(n){if(!(lt(n)||n===null||n===""))return parseFloat(n)}function Sa(n){if(!(lt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Ta(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ts(n){return n%4===0&&(n%100!==0||n%400===0)}function es(n){return Ts(n)?366:365}function vo(n,e){const t=my(e-1,12)+1,i=n+(e-t)/12;return t===2?Ts(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 wo(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 Yr(n){return n>99?n:n>60?1900+n:2e3+n}function _1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Yo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function b1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Nn(`Invalid unit value ${n}`);return e}function So(n,e){const t={};for(const i in n)if($l(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=b1(l)}return t}function ts(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Ut(t,2)}:${Ut(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Ut(t,2)}${Ut(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ko(n){return py(n,["hour","minute","second","millisecond"])}const y1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,hy=["January","February","March","April","May","June","July","August","September","October","November","December"],k1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gy=["J","F","M","A","M","J","J","A","S","O","N","D"];function v1(n){switch(n){case"narrow":return[...gy];case"short":return[...k1];case"long":return[...hy];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 w1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],S1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],_y=["M","T","W","T","F","S","S"];function T1(n){switch(n){case"narrow":return[..._y];case"short":return[...S1];case"long":return[...w1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const $1=["AM","PM"],by=["Before Christ","Anno Domini"],yy=["BC","AD"],ky=["B","A"];function C1(n){switch(n){case"narrow":return[...ky];case"short":return[...yy];case"long":return[...by];default:return null}}function vy(n){return $1[n.hour<12?0:1]}function wy(n,e){return T1(e)[n.weekday-1]}function Sy(n,e){return v1(e)[n.month-1]}function Ty(n,e){return C1(e)[n.year<0?0:1]}function $y(n,e,t="always",i=!1){const l={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."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=l[n],f=i?a?u[1]:u[2]||u[1]:a?l[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function _u(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Cy={D:Wr,DD:X_,DDD:Q_,DDDD:x_,t:e1,tt:t1,ttt:n1,tttt:i1,T:l1,TT:s1,TTT:o1,TTTT:r1,f:a1,ff:f1,fff:d1,ffff:m1,F:u1,FF:c1,FFF:p1,FFFF:h1};class gn{static create(e,t={}){return new gn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l,val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l,val:i}),s}static macroTokenToFormatOpts(e){return Cy[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 Ut(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",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,g)=>this.loc.extract(e,m,g),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?vy(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,g)=>i?Sy(e,m):s(g?{month:m}:{month:m,day:"numeric"},"month"),u=(m,g)=>i?wy(e,m):s(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const g=gn.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(e,g):m},c=m=>i?Ty(e,m):s({era:m},"era"),d=m=>{switch(m){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 l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({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 l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({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 l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({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 l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({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(m)}};return _u(gn.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}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=gn.parseFormat(t),o=s.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return _u(s,l(r))}}class Yn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class $s{get type(){throw new vi}get name(){throw new vi}get ianaName(){return this.name}get isUniversal(){throw new vi}offsetName(e,t){throw new vi}formatOffset(e,t){throw new vi}offset(e){throw new vi}equals(e){throw new vi}get isValid(){throw new vi}}let or=null;class Ca extends $s{static get instance(){return or===null&&(or=new Ca),or}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return _1(e,t,i)}formatOffset(e,t){return ts(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function My(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 Oy={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Dy(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,u,f]=i;return[o,l,s,r,a,u,f]}function Ey(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?g:1e3+g,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let rr=null;class un extends $s{static get utcInstance(){return rr===null&&(rr=new un(0)),rr}static instance(e){return e===0?un.utcInstance:new un(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new un(Yo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ts(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ts(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ts(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 Ay extends $s{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 Ti(n,e){if(lt(n)||n===null)return e;if(n instanceof $s)return n;if(fy(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?un.utcInstance:un.parseSpecifier(t)||mi.create(n)}else return Qi(n)?un.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new Ay(n)}let bu=()=>Date.now(),yu="system",ku=null,vu=null,wu=null,Su;class Zt{static get now(){return bu}static set now(e){bu=e}static set defaultZone(e){yu=e}static get defaultZone(){return Ti(yu,Ca.instance)}static get defaultLocale(){return ku}static set defaultLocale(e){ku=e}static get defaultNumberingSystem(){return vu}static set defaultNumberingSystem(e){vu=e}static get defaultOutputCalendar(){return wu}static set defaultOutputCalendar(e){wu=e}static get throwOnInvalid(){return Su}static set throwOnInvalid(e){Su=e}static resetCaches(){At.resetCache(),mi.resetCache()}}let Tu={};function Iy(n,e={}){const t=JSON.stringify([n,e]);let i=Tu[t];return i||(i=new Intl.ListFormat(n,e),Tu[t]=i),i}let Kr={};function Jr(n,e={}){const t=JSON.stringify([n,e]);let i=Kr[t];return i||(i=new Intl.DateTimeFormat(n,e),Kr[t]=i),i}let Zr={};function Ly(n,e={}){const t=JSON.stringify([n,e]);let i=Zr[t];return i||(i=new Intl.NumberFormat(n,e),Zr[t]=i),i}let Gr={};function Py(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Gr[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Gr[l]=s),s}let Gl=null;function Fy(){return Gl||(Gl=new Intl.DateTimeFormat().resolvedOptions().locale,Gl)}function Ny(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Jr(n).resolvedOptions()}catch{t=Jr(i).resolvedOptions()}const{numberingSystem:l,calendar:s}=t;return[i,l,s]}}function Ry(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function qy(n){const e=[];for(let t=1;t<=12;t++){const i=He.utc(2016,t,1);e.push(n(i))}return e}function jy(n){const e=[];for(let t=1;t<=7;t++){const i=He.utc(2016,11,13+t);e.push(n(i))}return e}function Ns(n,e,t,i,l){const s=n.listingMode(t);return s==="error"?null:s==="en"?i(e):l(e)}function Hy(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 zy{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Ly(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):Ta(e,3);return Ut(t,this.padTo)}}}class Vy{constructor(e,t,i){this.opts=i;let l;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&mi.create(r).valid?(l=r,this.dt=e):(l="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:He.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,l=e.zone.name);const s={...this.opts};l&&(s.timeZone=l),this.dtf=Jr(t,s)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class By{constructor(e,t,i){this.opts={style:"long",...i},!t&&g1()&&(this.rtf=Py(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):$y(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class At{static fromOpts(e){return At.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,l=!1){const s=e||Zt.defaultLocale,o=s||(l?"en-US":Fy()),r=t||Zt.defaultNumberingSystem,a=i||Zt.defaultOutputCalendar;return new At(o,r,a,s)}static resetCache(){Gl=null,Kr={},Zr={},Gr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return At.create(e,t,i)}constructor(e,t,i,l){const[s,o,r]=Ny(e);this.locale=s,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=Ry(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=l,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Hy(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:At.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 Ns(this,e,i,v1,()=>{const l=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=qy(o=>this.extract(o,l,"month"))),this.monthsCache[s][e]})}weekdays(e,t=!1,i=!0){return Ns(this,e,i,T1,()=>{const l=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=jy(o=>this.extract(o,l,"weekday"))),this.weekdaysCache[s][e]})}meridiems(e=!0){return Ns(this,void 0,e,()=>$1,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[He.utc(2016,11,13,9),He.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Ns(this,e,t,C1,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[He.utc(-40,1,1),He.utc(2017,1,1)].map(l=>this.extract(l,i,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new zy(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Vy(e,this.intl,t)}relFormatter(e={}){return new By(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Iy(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 Al(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Il(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Ll(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function M1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(g||m&&f)?-m:m;return[{years:d(qi(t)),months:d(qi(i)),weeks:d(qi(l)),days:d(qi(s)),hours:d(qi(o)),minutes:d(qi(r)),seconds:d(qi(a),a==="-0"),milliseconds:d(Sa(u),c)}]}const nk={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,l,s,o){const r={year:e.length===2?Yr(wi(e)):wi(e),month:k1.indexOf(t)+1,day:wi(i),hour:wi(l),minute:wi(s)};return o&&(r.second=wi(o)),n&&(r.weekday=n.length>3?w1.indexOf(n)+1:S1.indexOf(n)+1),r}const ik=/^(?:(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 lk(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=Da(e,l,i,t,s,o,r);let m;return a?m=nk[a]:u?m=0:m=Yo(f,c),[d,new un(m)]}function sk(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ok=/^(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$/,rk=/^(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$/,ak=/^(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 $u(n){const[,e,t,i,l,s,o,r]=n;return[Da(e,l,i,t,s,o,r),un.utcInstance]}function uk(n){const[,e,t,i,l,s,o,r]=n;return[Da(e,r,t,i,l,s,o),un.utcInstance]}const fk=Al(Wy,Oa),ck=Al(Yy,Oa),dk=Al(Ky,Oa),pk=Al(D1),A1=Il(Qy,Pl,Cs,Ms),mk=Il(Jy,Pl,Cs,Ms),hk=Il(Zy,Pl,Cs,Ms),gk=Il(Pl,Cs,Ms);function _k(n){return Ll(n,[fk,A1],[ck,mk],[dk,hk],[pk,gk])}function bk(n){return Ll(sk(n),[ik,lk])}function yk(n){return Ll(n,[ok,$u],[rk,$u],[ak,uk])}function kk(n){return Ll(n,[ek,tk])}const vk=Il(Pl);function wk(n){return Ll(n,[xy,vk])}const Sk=Al(Gy,Xy),Tk=Al(E1),$k=Il(Pl,Cs,Ms);function Ck(n){return Ll(n,[Sk,A1],[Tk,$k])}const Mk="Invalid Duration",I1={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}},Ok={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},...I1},An=146097/400,hl=146097/4800,Dk={years:{quarters:4,months:12,weeks:An/7,days:An,hours:An*24,minutes:An*24*60,seconds:An*24*60*60,milliseconds:An*24*60*60*1e3},quarters:{months:3,weeks:An/28,days:An/4,hours:An*24/4,minutes:An*24*60/4,seconds:An*24*60*60/4,milliseconds:An*24*60*60*1e3/4},months:{weeks:hl/7,days:hl,hours:hl*24,minutes:hl*24*60,seconds:hl*24*60*60,milliseconds:hl*24*60*60*1e3},...I1},Yi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ek=Yi.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 ot(i)}function Ak(n){return n<0?Math.floor(n):Math.ceil(n)}function L1(n,e,t,i,l){const s=n[l][t],o=e[t]/s,r=Math.sign(o)===Math.sign(i[l]),a=!r&&i[l]!==0&&Math.abs(o)<=1?Ak(o):Math.trunc(o);i[l]+=a,e[t]-=a*s}function Ik(n,e){Ek.reduce((t,i)=>lt(e[i])?t:(t&&L1(n,e,t,e,i),i),null)}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||At.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Dk:Ok,this.isLuxonDuration=!0}static fromMillis(e,t){return ot.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Nn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:So(e,ot.normalizeUnit),loc:At.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Qi(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new Nn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=kk(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=wk(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the Duration is invalid");const i=e instanceof Yn?e:new Yn(e,t);if(Zt.throwOnInvalid)throw new ry(i);return new ot({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 G_(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?gn.create(this.loc,i).formatDurationFromString(this,e):Mk}toHuman(e={}){const t=Yi.map(i=>{const l=this.values[i];return lt(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).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+=Ta(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 l=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(l+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(l+=".SSS"));let s=i.toFormat(l);return e.includePrefix&&(s="T"+s),s}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=ot.fromDurationLike(e),i={};for(const l of Yi)($l(t.values,l)||$l(this.values,l))&&(i[l]=t.get(l)+this.get(l));return ji(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ot.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]=b1(e(this.values[i],i));return ji(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...So(e,ot.normalizeUnit)};return ji(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t}),s={loc:l};return i&&(s.conversionAccuracy=i),ji(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ik(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=>ot.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Yi)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;Qi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in l)Yi.indexOf(u)>Yi.indexOf(o)&&L1(this.matrix,l,u,t,o)}else Qi(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][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,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Yi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const jl="Invalid Interval";function Lk(n,e){return!n||!n.isValid?Rt.invalid("missing or invalid start"):!e||!e.isValid?Rt.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?Rt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Vl).filter(o=>this.contains(o)).sort(),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Rt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=ot.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Rt.fromDateTimes(i,s)),i=s,l+=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:Rt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Rt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),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&&l.push(Rt.fromDateTimes(t,a.time)),t=null);return Rt.merge(l)}difference(...e){return Rt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:jl}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:jl}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:jl}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:jl}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:jl}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Rt.fromDateTimes(e(this.s),e(this.e))}}class Rs{static hasDST(e=Zt.defaultZone){const t=He.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return mi.isValidZone(e)}static normalizeZone(e){return Ti(e,Zt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||At.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||At.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||At.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||At.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return At.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return At.create(t,null,"gregory").eras(e)}static features(){return{relative:g1()}}}function Cu(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function Pk(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=Cu(r,a);return(u-u%7)/7}],["days",Cu]],l={};let s,o;for(const[r,a]of i)if(t.indexOf(r)>=0){s=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,l[r]=u}return[n,l,o,s]}function Fk(n,e,t,i){let[l,s,o,r]=Pk(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...u).plus(f):f}const Ea={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mu={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]},Nk=Ea.hanidec.replace(/[\[|\]]/g,"").split("");function Rk(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}function Un({numberingSystem:n},e=""){return new RegExp(`${Ea[n||"latn"]}${e}`)}const qk="missing Intl.DateTimeFormat.formatToParts support";function ft(n,e=t=>t){return{regex:n,deser:([t])=>e(Rk(t))}}const jk=String.fromCharCode(160),P1=`[ ${jk}]`,F1=new RegExp(P1,"g");function Hk(n){return n.replace(/\./g,"\\.?").replace(F1,P1)}function Ou(n){return n.replace(/\./g,"").replace(F1," ").toLowerCase()}function Wn(n,e){return n===null?null:{regex:RegExp(n.map(Hk).join("|")),deser:([t])=>n.findIndex(i=>Ou(t)===Ou(i))+e}}function Du(n,e){return{regex:n,deser:([,t,i])=>Yo(t,i),groups:e}}function ar(n){return{regex:n,deser:([e])=>e}}function zk(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Vk(n,e){const t=Un(e),i=Un(e,"{2}"),l=Un(e,"{3}"),s=Un(e,"{4}"),o=Un(e,"{6}"),r=Un(e,"{1,2}"),a=Un(e,"{1,3}"),u=Un(e,"{1,6}"),f=Un(e,"{1,9}"),c=Un(e,"{2,4}"),d=Un(e,"{4,6}"),m=_=>({regex:RegExp(zk(_.val)),deser:([k])=>k,literal:!0}),h=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return Wn(e.eras("short",!1),0);case"GG":return Wn(e.eras("long",!1),0);case"y":return ft(u);case"yy":return ft(c,Yr);case"yyyy":return ft(s);case"yyyyy":return ft(d);case"yyyyyy":return ft(o);case"M":return ft(r);case"MM":return ft(i);case"MMM":return Wn(e.months("short",!0,!1),1);case"MMMM":return Wn(e.months("long",!0,!1),1);case"L":return ft(r);case"LL":return ft(i);case"LLL":return Wn(e.months("short",!1,!1),1);case"LLLL":return Wn(e.months("long",!1,!1),1);case"d":return ft(r);case"dd":return ft(i);case"o":return ft(a);case"ooo":return ft(l);case"HH":return ft(i);case"H":return ft(r);case"hh":return ft(i);case"h":return ft(r);case"mm":return ft(i);case"m":return ft(r);case"q":return ft(r);case"qq":return ft(i);case"s":return ft(r);case"ss":return ft(i);case"S":return ft(a);case"SSS":return ft(l);case"u":return ar(f);case"uu":return ar(r);case"uuu":return ft(t);case"a":return Wn(e.meridiems(),0);case"kkkk":return ft(s);case"kk":return ft(c,Yr);case"W":return ft(r);case"WW":return ft(i);case"E":case"c":return ft(t);case"EEE":return Wn(e.weekdays("short",!1,!1),1);case"EEEE":return Wn(e.weekdays("long",!1,!1),1);case"ccc":return Wn(e.weekdays("short",!0,!1),1);case"cccc":return Wn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Du(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Du(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ar(/[a-z_+-/]{1,256}?/i);default:return m(_)}})(n)||{invalidReason:qk};return h.token=n,h}const Bk={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 Uk(n,e,t){const{type:i,value:l}=n;if(i==="literal")return{literal:!0,val:l};const s=t[i];let o=Bk[i];if(typeof o=="object"&&(o=o[s]),o)return{literal:!1,val:o}}function Wk(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Yk(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if($l(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Kk(n){const e=s=>{switch(s){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 lt(n.z)||(t=mi.create(n.z)),lt(n.Z)||(t||(t=new un(n.Z)),i=n.Z),lt(n.q)||(n.M=(n.q-1)*3+1),lt(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),lt(n.u)||(n.S=Sa(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let ur=null;function Jk(){return ur||(ur=He.fromMillis(1555555555555)),ur}function Zk(n,e){if(n.literal)return n;const t=gn.macroTokenToFormatOpts(n.val);if(!t)return n;const s=gn.create(e,t).formatDateTimeParts(Jk()).map(o=>Uk(o,e,t));return s.includes(void 0)?n:s}function Gk(n,e){return Array.prototype.concat(...n.map(t=>Zk(t,e)))}function N1(n,e,t){const i=Gk(gn.parseFormat(t),n),l=i.map(o=>Vk(o,n)),s=l.find(o=>o.invalidReason);if(s)return{input:e,tokens:i,invalidReason:s.invalidReason};{const[o,r]=Wk(l),a=RegExp(o,"i"),[u,f]=Yk(e,a,r),[c,d,m]=f?Kk(f):[null,null,void 0];if($l(f,"a")&&$l(f,"H"))throw new Zl("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:m}}}function Xk(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=N1(n,e,t);return[i,l,s,o]}const R1=[0,31,59,90,120,151,181,212,243,273,304,334],q1=[0,31,60,91,121,152,182,213,244,274,305,335];function Rn(n,e){return new Yn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function j1(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function H1(n,e,t){return t+(Ts(n)?q1:R1)[e-1]}function z1(n,e){const t=Ts(n)?q1:R1,i=t.findIndex(s=>swo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:s,...Ko(n)}}function Eu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,l=j1(e,1,4),s=es(e);let o=t*7+i-l-3,r;o<1?(r=e-1,o+=es(r)):o>s?(r=e+1,o-=es(e)):r=e;const{month:a,day:u}=z1(r,o);return{year:r,month:a,day:u,...Ko(n)}}function fr(n){const{year:e,month:t,day:i}=n,l=H1(e,t,i);return{year:e,ordinal:l,...Ko(n)}}function Au(n){const{year:e,ordinal:t}=n,{month:i,day:l}=z1(e,t);return{year:e,month:i,day:l,...Ko(n)}}function Qk(n){const e=Wo(n.weekYear),t=pi(n.weekNumber,1,wo(n.weekYear)),i=pi(n.weekday,1,7);return e?t?i?!1:Rn("weekday",n.weekday):Rn("week",n.week):Rn("weekYear",n.weekYear)}function xk(n){const e=Wo(n.year),t=pi(n.ordinal,1,es(n.year));return e?t?!1:Rn("ordinal",n.ordinal):Rn("year",n.year)}function V1(n){const e=Wo(n.year),t=pi(n.month,1,12),i=pi(n.day,1,vo(n.year,n.month));return e?t?i?!1:Rn("day",n.day):Rn("month",n.month):Rn("year",n.year)}function B1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=pi(e,0,23)||e===24&&t===0&&i===0&&l===0,o=pi(t,0,59),r=pi(i,0,59),a=pi(l,0,999);return s?o?r?a?!1:Rn("millisecond",l):Rn("second",i):Rn("minute",t):Rn("hour",e)}const cr="Invalid DateTime",Iu=864e13;function qs(n){return new Yn("unsupported zone",`the zone "${n.name}" is not supported`)}function dr(n){return n.weekData===null&&(n.weekData=Xr(n.c)),n.weekData}function Hl(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new He({...t,...e,old:t})}function U1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Lu(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 U1($a(n),e,t)}function Pu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,vo(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ot.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(s);let[a,u]=U1(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function zl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=He.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return He.invalid(new Yn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function js(n,e,t=!0){return n.isValid?gn.create(At.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+=Ut(n.c.year,t?6:4),e?(i+="-",i+=Ut(n.c.month),i+="-",i+=Ut(n.c.day)):(i+=Ut(n.c.month),i+=Ut(n.c.day)),i}function Fu(n,e,t,i,l,s){let o=Ut(n.c.hour);return e?(o+=":",o+=Ut(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Ut(n.c.minute),(n.c.second!==0||!t)&&(o+=Ut(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Ut(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Ut(Math.trunc(-n.o/60)),o+=":",o+=Ut(Math.trunc(-n.o%60))):(o+="+",o+=Ut(Math.trunc(n.o/60)),o+=":",o+=Ut(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const W1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ev={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},tv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Y1=["year","month","day","hour","minute","second","millisecond"],nv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],iv=["year","ordinal","hour","minute","second","millisecond"];function Nu(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 G_(n);return e}function Ru(n,e){const t=Ti(e.zone,Zt.defaultZone),i=At.fromObject(e),l=Zt.now();let s,o;if(lt(n.year))s=l;else{for(const u of Y1)lt(n[u])&&(n[u]=W1[u]);const r=V1(n)||B1(n);if(r)return He.invalid(r);const a=t.offset(l);[s,o]=fo(n,a,t)}return new He({ts:s,zone:t,loc:i,o})}function qu(n,e,t){const i=lt(t.round)?!0:t.round,l=(o,r)=>(o=Ta(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=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 l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function ju(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 He{constructor(e){const t=e.zone||Zt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Yn("invalid input"):null)||(t.isValid?null:qs(t));this.ts=lt(e.ts)?Zt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);l=Lu(this.ts,r),i=Number.isNaN(l.year)?new Yn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||At.create(),this.invalid=i,this.weekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new He({})}static local(){const[e,t]=ju(arguments),[i,l,s,o,r,a,u]=t;return Ru({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=ju(arguments),[i,l,s,o,r,a,u]=t;return e.zone=un.utcInstance,Ru({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=cy(e)?e.valueOf():NaN;if(Number.isNaN(i))return He.invalid("invalid input");const l=Ti(t.zone,Zt.defaultZone);return l.isValid?new He({ts:i,zone:l,loc:At.fromObject(t)}):He.invalid(qs(l))}static fromMillis(e,t={}){if(Qi(e))return e<-Iu||e>Iu?He.invalid("Timestamp out of range"):new He({ts:e,zone:Ti(t.zone,Zt.defaultZone),loc:At.fromObject(t)});throw new Nn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Qi(e))return new He({ts:e*1e3,zone:Ti(t.zone,Zt.defaultZone),loc:At.fromObject(t)});throw new Nn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ti(t.zone,Zt.defaultZone);if(!i.isValid)return He.invalid(qs(i));const l=Zt.now(),s=lt(t.specificOffset)?i.offset(l):t.specificOffset,o=So(e,Nu),r=!lt(o.ordinal),a=!lt(o.year),u=!lt(o.month)||!lt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=At.fromObject(t);if((f||r)&&c)throw new Zl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Zl("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!f;let g,h,_=Lu(l,s);m?(g=nv,h=ev,_=Xr(_)):r?(g=iv,h=tv,_=fr(_)):(g=Y1,h=W1);let k=!1;for(const E of g){const L=o[E];lt(L)?k?o[E]=h[E]:o[E]=_[E]:k=!0}const S=m?Qk(o):r?xk(o):V1(o),$=S||B1(o);if($)return He.invalid($);const T=m?Eu(o):r?Au(o):o,[C,D]=fo(T,s,i),O=new He({ts:C,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?He.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,l]=_k(e);return zl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=bk(e);return zl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=yk(e);return zl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(lt(e)||lt(t))throw new Nn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=At.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,u,f]=Xk(o,e,t);return f?He.invalid(f):zl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return He.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=Ck(e);return zl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the DateTime is invalid");const i=e instanceof Yn?e:new Yn(e,t);if(Zt.throwOnInvalid)throw new sy(i);return new He({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?Rs.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Rs.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Rs.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Rs.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 Ts(this.year)}get daysInMonth(){return vo(this.year,this.month)}get daysInYear(){return this.isValid?es(this.year):NaN}get weeksInWeekYear(){return this.isValid?wo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=gn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(un.instance(e),t)}toLocal(){return this.setZone(Zt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ti(e,Zt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=fo(o,s,e)}return Hl(this,{ts:l,zone:e})}else return He.invalid(qs(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Hl(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=So(e,Nu),i=!lt(t.weekYear)||!lt(t.weekNumber)||!lt(t.weekday),l=!lt(t.ordinal),s=!lt(t.year),o=!lt(t.month)||!lt(t.day),r=s||o,a=t.weekYear||t.weekNumber;if((r||l)&&a)throw new Zl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&l)throw new Zl("Can't mix ordinal dates with month/day");let u;i?u=Eu({...Xr(this.c),...t}):lt(t.ordinal)?(u={...this.toObject(),...t},lt(t.day)&&(u.day=Math.min(vo(u.year,u.month),u.day))):u=Au({...fr(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return Hl(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return Hl(this,Pu(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return Hl(this,Pu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ot.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 l=Math.ceil(this.month/3);t.month=(l-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?gn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):cr}toLocaleString(e=Wr,t={}){return this.isValid?gn.create(this.loc.clone(t),e).formatDateTime(this):cr}toLocaleParts(e={}){return this.isValid?gn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:l=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=pr(this,o);return r+="T",r+=Fu(this,o,t,i,l,s),r}toISODate({format:e="extended"}={}){return this.isValid?pr(this,e==="extended"):null}toISOWeekDate(){return js(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:l=!1,extendedZone:s=!1,format:o="extended"}={}){return this.isValid?(l?"T":"")+Fu(this,o==="extended",t,e,i,s):null}toRFC2822(){return js(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return js(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 l="HH:mm:ss.SSS";return(t||e)&&(i&&(l+=" "),t?l+="z":e&&(l+="ZZ")),js(this,l,!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 ot.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=dy(t).map(ot.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Fk(r,a,s,l);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(He.now(),e,t)}until(e){return this.isValid?Rt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),l=this.setZone(e.zone,{keepLocalTime:!0});return l.startOf(t)<=i&&i<=l.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||He.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(He.isDateTime))throw new Nn("max requires all arguments be DateTimes");return gu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=At.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return N1(o,e,t)}static fromStringExplain(e,t,i={}){return He.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Wr}static get DATE_MED(){return X_}static get DATE_MED_WITH_WEEKDAY(){return ay}static get DATE_FULL(){return Q_}static get DATE_HUGE(){return x_}static get TIME_SIMPLE(){return e1}static get TIME_WITH_SECONDS(){return t1}static get TIME_WITH_SHORT_OFFSET(){return n1}static get TIME_WITH_LONG_OFFSET(){return i1}static get TIME_24_SIMPLE(){return l1}static get TIME_24_WITH_SECONDS(){return s1}static get TIME_24_WITH_SHORT_OFFSET(){return o1}static get TIME_24_WITH_LONG_OFFSET(){return r1}static get DATETIME_SHORT(){return a1}static get DATETIME_SHORT_WITH_SECONDS(){return u1}static get DATETIME_MED(){return f1}static get DATETIME_MED_WITH_SECONDS(){return c1}static get DATETIME_MED_WITH_WEEKDAY(){return uy}static get DATETIME_FULL(){return d1}static get DATETIME_FULL_WITH_SECONDS(){return p1}static get DATETIME_HUGE(){return m1}static get DATETIME_HUGE_WITH_SECONDS(){return h1}}function Vl(n){if(He.isDateTime(n))return n;if(n&&n.valueOf&&Qi(n.valueOf()))return He.fromJSDate(n);if(n&&typeof n=="object")return He.fromObject(n);throw new Nn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const lv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],sv=[".mp4",".avi",".mov",".3gp",".wmv"],ov=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],rv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],K1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];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==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0: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 l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));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 He.fromFormat(e,i,{zone:"UTC"})}return He.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.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,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||"",!!lv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!sv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!ov.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!rv.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(l=>{let s=new FileReader;s.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),l(a.toDataURL(e.type))},r.src=o.target.result},s.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 l of i)j.addValueToFormData(e,t,l);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,m,g;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const h of t){let _=null;h.type==="number"?_=123:h.type==="date"?_="2022-01-01 10:00:00.123Z":h.type==="bool"?_=!0:h.type==="email"?_="test@example.com":h.type==="url"?_="https://example.com":h.type==="json"?_="JSON":h.type==="file"?(_="filename.jpg",((f=h.options)==null?void 0:f.maxSelect)!==1&&(_=[_])):h.type==="select"?(_=(d=(c=h.options)==null?void 0:c.values)==null?void 0:d[0],((m=h.options)==null?void 0:m.maxSelect)!==1&&(_=[_])):h.type==="relation"?(_="RELATION_RECORD_ID",((g=h.options)==null?void 0:g.maxSelect)!==1&&(_=[_])):_="test",s[h.name]=_}return s}static dummyCollectionSchemaData(e){var l,s,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=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[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 l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=j.isObject(u)&&j.findByKey(l,"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=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(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(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}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:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,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,m=f.result.split(",")[1],g=d.create(c,u,m);d.add(g),l(g.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.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(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){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/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);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 l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/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((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=l[2])==null?void 0:u.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const h=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((h==null?void 0:h.length)!=4)continue;const _=(c=(f=h[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");_&&t.columns.push({name:_,collate:h[2]||"",sort:((d=h[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[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(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).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 l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}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 getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Zo=Dn([]);function $o(n,e=4e3){return Go(n,"info",e)}function It(n,e=3e3){return Go(n,"success",e)}function hi(n,e=4500){return Go(n,"error",e)}function rv(n,e=4500){return Go(n,"warning",e)}function Go(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{K1(i)},t)};Zo.update(l=>(Aa(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function K1(n){Zo.update(e=>(Aa(e,n),e))}function Ea(){Zo.update(n=>{for(let e of n)Aa(n,e);return[]})}function Aa(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 gi=Dn({});function Gt(n){gi.set(n||{})}function ii(n){gi.update(e=>(j.deleteByPath(e,n),e))}const Ia=Dn({});function Xr(n){Ia.set(n||{})}const zn=Dn([]),li=Dn({}),Co=Dn(!1),J1=Dn({});function av(n){zn.update(e=>{const t=j.findByKey(e,"id",n);return t?li.set(t):e.length&&li.set(e[0]),e})}function uv(n){li.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),zn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),La(),j.sortCollections(e)))}function fv(n){zn.update(e=>(j.removeByKey(e,"id",n.id),li.update(t=>t.id===n.id?e[0]:t),La(),e))}async function cv(n=null){Co.set(!0);try{let e=await ue.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),zn.set(e);const t=n&&j.findByKey(e,"id",n);t?li.set(t):e.length&&li.set(e[0]),La()}catch(e){ue.error(e)}Co.set(!1)}function La(){J1.update(n=>(zn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const hr="pb_admin_file_token";Wo.prototype.logout=function(n=!0){this.authStore.clear(),n&&il("/login")};Wo.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,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&hi(s),j.isEmpty(l.data)||Gt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),il("/")};Wo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=_0(J1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(hr)||"";return(!t||ka(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 dv extends Y_{save(e,t){super.save(e,t),t&&!t.collectionId&&Xr(t)}clear(){super.clear(),Xr(null)}}const ue=new Wo("../",new dv("pb_admin_auth"));ue.authStore.model&&!ue.authStore.model.collectionId&&Xr(ue.authStore.model);const pv=n=>({}),ju=n=>({});function mv(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;const g=n[3].default,h=vt(g,n,n[2],null),_=n[3].footer,k=vt(_,n,n[2],ju);return{c(){e=b("div"),t=b("main"),h&&h.c(),i=M(),l=b("footer"),k&&k.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",u=M(),f=b("a"),c=b("span"),c.textContent="PocketBase v0.20.0-rc4",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(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,$){w(S,e,$),y(e,t),h&&h.m(t,null),y(e,i),y(e,l),k&&k.m(l,null),y(l,s),y(l,o),y(l,r),y(l,a),y(l,u),y(l,f),y(f,c),m=!0},p(S,[$]){h&&h.p&&(!m||$&4)&&St(h,g,S,S[2],m?wt(g,S[2],$,null):Tt(S[2]),null),k&&k.p&&(!m||$&4)&&St(k,_,S,S[2],m?wt(_,S[2],$,pv):Tt(S[2]),ju),(!m||$&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||$&3)&&x(e,"center-content",S[0])},i(S){m||(A(h,S),A(k,S),m=!0)},o(S){I(h,S),I(k,S),m=!1},d(S){S&&v(e),h&&h.d(S),k&&k.d(S)}}}function hv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class _n extends be{constructor(e){super(),_e(this,e,hv,mv,me,{center:0,class:1})}}function Hu(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function gv(n){let e,t,i,l=!n[0]&&Hu();const s=n[1].default,o=vt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),y(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Hu(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&St(o,s,r,r[2],i?wt(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function _v(n){let e,t;return e=new _n({props:{class:"full-page",center:!0,$$slots:{default:[gv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function bv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Z1 extends be{constructor(e){super(),_e(this,e,bv,_v,me,{nobranding:0})}}function Xo(n){const e=n-1;return e*e*e+1}function ds(n,{delay:e=0,duration:t=400,easing:i=ws}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function jn(n,{delay:e=0,duration:t=400,easing:i=Xo,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=lu(l),[m,g]=lu(s);return{delay:e,duration:t,easing:i,css:(h,_)=>` +`),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 l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}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 getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Jo=Dn([]);function To(n,e=4e3){return Zo(n,"info",e)}function It(n,e=3e3){return Zo(n,"success",e)}function hi(n,e=4500){return Zo(n,"error",e)}function av(n,e=4500){return Zo(n,"warning",e)}function Zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{J1(i)},t)};Jo.update(l=>(Ia(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function J1(n){Jo.update(e=>(Ia(e,n),e))}function Aa(){Jo.update(n=>{for(let e of n)Ia(n,e);return[]})}function Ia(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 gi=Dn({});function Gt(n){gi.set(n||{})}function ii(n){gi.update(e=>(j.deleteByPath(e,n),e))}const La=Dn({});function Qr(n){La.set(n||{})}const zn=Dn([]),li=Dn({}),$o=Dn(!1),Z1=Dn({});function uv(n){zn.update(e=>{const t=j.findByKey(e,"id",n);return t?li.set(t):e.length&&li.set(e[0]),e})}function fv(n){li.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),zn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Pa(),j.sortCollections(e)))}function cv(n){zn.update(e=>(j.removeByKey(e,"id",n.id),li.update(t=>t.id===n.id?e[0]:t),Pa(),e))}async function dv(n=null){$o.set(!0);try{let e=await fe.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),zn.set(e);const t=n&&j.findByKey(e,"id",n);t?li.set(t):e.length&&li.set(e[0]),Pa()}catch(e){fe.error(e)}$o.set(!1)}function Pa(){Z1.update(n=>(zn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const mr="pb_admin_file_token";Uo.prototype.logout=function(n=!0){this.authStore.clear(),n&&il("/login")};Uo.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,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&hi(s),j.isEmpty(l.data)||Gt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),il("/")};Uo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=b0(Z1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(mr)||"";return(!t||va(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 pv extends K_{save(e,t){super.save(e,t),t&&!t.collectionId&&Qr(t)}clear(){super.clear(),Qr(null)}}const fe=new Uo("../",new pv("pb_admin_auth"));fe.authStore.model&&!fe.authStore.model.collectionId&&Qr(fe.authStore.model);const mv=n=>({}),Hu=n=>({});function hv(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;const g=n[3].default,h=vt(g,n,n[2],null),_=n[3].footer,k=vt(_,n,n[2],Hu);return{c(){e=b("div"),t=b("main"),h&&h.c(),i=M(),l=b("footer"),k&&k.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",u=M(),f=b("a"),c=b("span"),c.textContent="PocketBase v0.20.0-rc4",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(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,$){w(S,e,$),y(e,t),h&&h.m(t,null),y(e,i),y(e,l),k&&k.m(l,null),y(l,s),y(l,o),y(l,r),y(l,a),y(l,u),y(l,f),y(f,c),m=!0},p(S,[$]){h&&h.p&&(!m||$&4)&&St(h,g,S,S[2],m?wt(g,S[2],$,null):Tt(S[2]),null),k&&k.p&&(!m||$&4)&&St(k,_,S,S[2],m?wt(_,S[2],$,mv):Tt(S[2]),Hu),(!m||$&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||$&3)&&x(e,"center-content",S[0])},i(S){m||(A(h,S),A(k,S),m=!0)},o(S){I(h,S),I(k,S),m=!1},d(S){S&&v(e),h&&h.d(S),k&&k.d(S)}}}function gv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class _n extends _e{constructor(e){super(),ge(this,e,gv,hv,he,{center:0,class:1})}}function zu(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function _v(n){let e,t,i,l=!n[0]&&zu();const s=n[1].default,o=vt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),y(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=zu(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&St(o,s,r,r[2],i?wt(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function bv(n){let e,t;return e=new _n({props:{class:"full-page",center:!0,$$slots:{default:[_v]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function yv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class G1 extends _e{constructor(e){super(),ge(this,e,yv,bv,he,{nobranding:0})}}function Go(n){const e=n-1;return e*e*e+1}function cs(n,{delay:e=0,duration:t=400,easing:i=vs}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function jn(n,{delay:e=0,duration:t=400,easing:i=Go,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=su(l),[m,g]=su(s);return{delay:e,duration:t,easing:i,css:(h,_)=>` transform: ${u} translate(${(1-h)*c}${d}, ${(1-h)*m}${g}); - opacity: ${a-f*_}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Xo,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),g=parseFloat(s[`margin${f[1]}`]),h=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*g}px;border-${u[0]}-width: ${k*h}px;border-${u[1]}-width: ${k*_}px;`}}function Yt(n,{delay:e=0,duration:t=400,easing:i=Xo,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` + opacity: ${a-f*_}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Go,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),g=parseFloat(s[`margin${f[1]}`]),h=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*g}px;border-${u[0]}-width: ${k*h}px;border-${u[1]}-width: ${k*_}px;`}}function Yt(n,{delay:e=0,duration:t=400,easing:i=Go,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} - `}}let Qr,Hi;const xr="app-tooltip";function zu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ai(){return Hi=Hi||document.querySelector("."+xr),Hi||(Hi=document.createElement("div"),Hi.classList.add(xr),document.body.appendChild(Hi)),Hi}function G1(n,e){let t=Ai();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,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),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),Ai().classList.remove("active"),Ai().activeNode=void 0}function yv(n,e){Ai().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Ai().classList.add("active"),G1(n,e)},isNaN(e.delay)?0:e.delay)}function Fe(n,e){let t=zu(e);function i(){yv(n,t)}function l(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Ai(),{update(s){var o,r;t=zu(s),(r=(o=Ai())==null?void 0:o.activeNode)!=null&&r.contains(n)&&G1(n,t)},destroy(){var s,o;(o=(s=Ai())==null?void 0:s.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Vu(n,e,t){const i=n.slice();return i[12]=e[t],i}const kv=n=>({}),Bu=n=>({uniqueId:n[4]});function vv(n){let e,t,i=pe(n[3]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Le(t,Yt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Le(t,Yt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Uu(n){let e,t,i=Mo(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=Y(i),s=M(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),y(e,t),y(t,l),y(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=Mo(a[12])+"")&&se(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Le(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Le(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function Sv(n){let e,t,i,l,s,o,r;const a=n[9].default,u=vt(a,n,n[8],Bu),f=[wv,vv],c=[];function d(m,g){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,g){w(m,e,g),u&&u.m(e,null),y(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[g]){u&&u.p&&(!s||g&256)&&St(u,a,m,m[8],s?wt(a,m[8],g,kv):Tt(m[8]),Bu);let h=i;i=d(m),i===h?c[i].p(m,g):(re(),I(c[h],1,1,()=>{c[h]=null}),ae(),l=c[i],l?l.p(m,g):(l=c[i]=f[i](m),l.c()),A(l,1),l.m(e,null)),(!s||g&2)&&p(e,"class",m[1]),(!s||g&10)&&x(e,"error",m[3].length)},i(m){s||(A(u,m),A(l),s=!0)},o(m){I(u,m),I(l),s=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Wu="Invalid value";function Mo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Wu:n||Wu}function Tv(n,e,t){let i;We(n,gi,h=>t(7,i=h));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ii(r)}Vt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(h){Ee.call(this,n,h)}function g(h){te[h?"unshift":"push"](()=>{f=h,t(2,f)})}return n.$$set=h=>{"name"in h&&t(5,r=h.name),"inlineError"in h&&t(0,a=h.inlineError),"class"in h&&t(1,u=h.class),"$$scope"in h&&t(8,s=h.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,g]}class he extends be{constructor(e){super(),_e(this,e,Tv,Sv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function $v(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0]),s.focus(),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0]&&ce(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Cv(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[1]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&2&&s.value!==c[1]&&ce(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function Mv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Ov(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return l=new he({props:{class:"form-field required",name:"email",$$slots:{default:[$v,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:"password",$$slots:{default:[Cv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new he({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Mv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first admin account in order to continue

",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("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"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,h){w(g,e,h),y(e,t),y(e,i),z(l,e,null),y(e,s),z(o,e,null),y(e,r),z(a,e,null),y(e,u),y(e,f),c=!0,d||(m=K(e,"submit",Ye(n[4])),d=!0)},p(g,[h]){const _={};h&1537&&(_.$$scope={dirty:h,ctx:g}),l.$set(_);const k={};h&1538&&(k.$$scope={dirty:h,ctx:g}),o.$set(k);const S={};h&1540&&(S.$$scope={dirty:h,ctx:g}),a.$set(S),(!c||h&8)&&x(f,"btn-disabled",g[3]),(!c||h&8)&&x(f,"btn-loading",g[3])},i(g){c||(A(l.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){I(l.$$.fragment,g),I(o.$$.fragment,g),I(a.$$.fragment,g),c=!1},d(g){g&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Dv(n,e,t){const i=rt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ue.admins.create({email:l,password:s,passwordConfirm:o}),await ue.admins.authWithPassword(l,s),i("submit")}catch(d){ue.error(d)}t(3,r=!1)}}function u(){l=this.value,t(0,l)}function f(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,u,f,c]}class Ev extends be{constructor(e){super(),_e(this,e,Dv,Ov,me,{})}}function Yu(n){let e,t;return e=new Z1({props:{$$slots:{default:[Av]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Av(n){let e,t;return e=new Ev({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Iv(n){let e,t,i=n[0]&&Yu(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&A(i,1)):(i=Yu(l),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Lv(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ue.logout(!1),t(0,i=!0);return}ue.authStore.isValid?il("/collections"):ue.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Pv extends be{constructor(e){super(),_e(this,e,Lv,Iv,me,{})}}const Et=Dn(""),Oo=Dn(""),Ml=Dn(!1);function Fv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),ce(e,n[7]),i||(l=K(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&ce(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Nv(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>ge(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!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=Dt(o,r(a)),te.push(()=>ge(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),z(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],ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Ku(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,jn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Ju(n){let e,t,i,l,s;return{c(){e=b("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,l||(s=K(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,jn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Rv(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[Nv,Fv],m=[];function g(k,S){return k[4]&&!k[5]?0:1}s=g(n),o=m[s]=d[s](n);let h=(n[0].length||n[7].length)&&n[7]!=n[0]&&Ku(),_=(n[0].length||n[7].length)&&Ju(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),h&&h.c(),a=M(),_&&_.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(k,S){w(k,e,S),y(e,t),y(t,i),y(e,l),m[s].m(e,null),y(e,r),h&&h.m(e,null),y(e,a),_&&_.m(e,null),u=!0,f||(c=[K(e,"click",fn(n[11])),K(e,"submit",Ye(n[10]))],f=!0)},p(k,[S]){let $=s;s=g(k),s===$?m[s].p(k,S):(re(),I(m[$],1,1,()=>{m[$]=null}),ae(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),A(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?h?S&129&&A(h,1):(h=Ku(),h.c(),A(h,1),h.m(e,a)):h&&(re(),I(h,1,1,()=>{h=null}),ae()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&A(_,1)):(_=Ju(k),_.c(),A(_,1),_.m(e,null)):_&&(re(),I(_,1,1,()=>{_=null}),ae())},i(k){u||(A(o),A(h),A(_),u=!0)},o(k){I(o),I(h),I(_),u=!1},d(k){k&&v(e),m[s].d(),h&&h.d(),_&&_.d(),f=!1,we(c)}}}function qv(n,e,t){const i=rt(),l="search_"+j.randomString(7);let{value:s=""}=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 m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function g(){t(0,s=d),i("submit",s)}async function h(){u||f||(t(5,f=!0),t(4,u=(await st(()=>import("./FilterAutocompleteInput-66e3909f.js"),["./FilterAutocompleteInput-66e3909f.js","./index-102ce751.js"],import.meta.url)).default),t(5,f=!1))}Vt(()=>{h()});function _(C){Ee.call(this,n,C)}function k(C){d=C,t(7,d),t(0,s)}function S(C){te[C?"unshift":"push"](()=>{c=C,t(6,c)})}function $(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),g()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,g,_,k,S,$,T]}class Ds extends be{constructor(e){super(),_e(this,e,qv,Rv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function jv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("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"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),y(e,t),s||(o=[ve(l=Fe.call(null,e,n[0])),K(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&$t(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,we(o)}}}function Hv(n,e,t){const i=rt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Vt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Qo extends be{constructor(e){super(),_e(this,e,Hv,jv,me,{tooltip:0,class:1})}}function zv(n){let e,t,i,l,s;const o=n[6].default,r=vt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"click",n[7]),K(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&St(r,o,a,a[5],i?wt(o,a[5],u,null):Tt(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)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(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&&v(e),r&&r.d(a),l=!1,we(s)}}}function Vv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=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,s=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,l=d.$$scope)},[r,s,o,a,u,l,i,f,c]}class Tn extends be{constructor(e){super(),_e(this,e,Vv,zv,me,{class:1,name:2,sort:0,disable:3})}}const Bv=n=>({}),Zu=n=>({}),Uv=n=>({}),Gu=n=>({});function Wv(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=vt(u,n,n[10],Gu),c=n[11].default,d=vt(c,n,n[10],null),m=n[11].after,g=vt(m,n,n[10],Zu);return{c(){e=b("div"),f&&f.c(),t=M(),i=b("div"),d&&d.c(),s=M(),g&&g.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(h,_){w(h,e,_),f&&f.m(e,null),y(e,t),y(e,i),d&&d.m(i,null),n[12](i),y(e,s),g&&g.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(h,[_]){f&&f.p&&(!o||_&1024)&&St(f,u,h,h[10],o?wt(u,h[10],_,Uv):Tt(h[10]),Gu),d&&d.p&&(!o||_&1024)&&St(d,c,h,h[10],o?wt(c,h[10],_,null):Tt(h[10]),null),(!o||_&9&&l!==(l="scroller "+h[0]+" "+h[3]+" svelte-3a0gfs"))&&p(i,"class",l),g&&g.p&&(!o||_&1024)&&St(g,m,h,h[10],o?wt(m,h[10],_,Bv):Tt(h[10]),Zu)},i(h){o||(A(f,h),A(d,h),A(g,h),o=!0)},o(h){I(f,h),I(d,h),I(g,h),o=!1},d(h){h&&v(e),f&&f.d(h),d&&d.d(h),n[12](null),g&&g.d(h),r=!1,we(a)}}}function Yv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,g,h,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),h=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-h,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"),s("vScrollStart")),f.scrollTop+r>=g&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=h&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{T(),d=null},150))}Vt(()=>(C(),k=new MutationObserver(C),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function D(O){te[O?"unshift":"push"](()=>{f=O,t(2,f)})}return n.$$set=O=>{"class"in O&&t(0,o=O.class),"vThreshold"in O&&t(4,r=O.vThreshold),"hThreshold"in O&&t(5,a=O.hThreshold),"dispatchOnNoScroll"in O&&t(6,u=O.dispatchOnNoScroll),"$$scope"in O&&t(10,l=O.$$scope)},[o,C,f,c,r,a,u,S,$,T,l,i,D]}class xo extends be{constructor(e){super(),_e(this,e,Yv,Wv,me,{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 Kv(n){let e,t,i=(n[1]||"N/A")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=Y(i),s=Y(" ("),o=Y(n[0]),r=Y(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){w(u,e,f),y(e,t),y(t,l),y(t,s),y(t,o),y(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"N/A")+"")&&se(l,i),f&1&&se(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(u){u&&v(e)}}}function Jv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=Y1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class X1 extends be{constructor(e){super(),_e(this,e,Jv,Kv,me,{level:0})}}function Zv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),y(e,i),l||(s=ve(Fe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&se(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Gv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class Q1 extends be{constructor(e){super(),_e(this,e,Gv,Zv,me,{date:0})}}function Xu(n,e,t){const i=n.slice();i[31]=e[t];const l=i[31].data&&j.isObject(i[31].data);return i[32]=l,i}function Xv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),o||(r=K(t,"change",n[18]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Qv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function e2(n){let e;return{c(){e=b("div"),e.innerHTML=' data',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function t2(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qu(n){let e;function t(s,o){return s[7]?i2:n2}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function n2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&xu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),o&&o.m(t,null),y(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=xu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function i2(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function ef(n){let e,t=n[31].message+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-ellipsis")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].message+"")&&se(i,t)},d(l){l&&v(e)}}}function tf(n){let e,t,i,l,s,o=n[31].data.status&&nf(n),r=n[31].data.execTime&&lf(n),a=n[31].data.auth&&sf(n),u=n[31].data.userIp&&of(n),f=n[31].data.error&&rf(n);return{c(){o&&o.c(),e=M(),r&&r.c(),t=M(),a&&a.c(),i=M(),u&&u.c(),l=M(),f&&f.c(),s=ke()},m(c,d){o&&o.m(c,d),w(c,e,d),r&&r.m(c,d),w(c,t,d),a&&a.m(c,d),w(c,i,d),u&&u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,s,d)},p(c,d){c[31].data.status?o?o.p(c,d):(o=nf(c),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[31].data.execTime?r?r.p(c,d):(r=lf(c),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),c[31].data.auth?a?a.p(c,d):(a=sf(c),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null),c[31].data.userIp?u?u.p(c,d):(u=of(c),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null),c[31].data.error?f?f.p(c,d):(f=rf(c),f.c(),f.m(s.parentNode,s)):f&&(f.d(1),f=null)},d(c){c&&(v(e),v(t),v(i),v(l),v(s)),o&&o.d(c),r&&r.d(c),a&&a.d(c),u&&u.d(c),f&&f.d(c)}}}function nf(n){let e,t=n[31].data.status+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.status+"")&&se(i,t)},d(l){l&&v(e)}}}function lf(n){let e,t=n[31].data.execTime+"",i,l;return{c(){e=b("span"),i=Y(t),l=Y("ms"),p(e,"class","label label-sm")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o[0]&8&&t!==(t=s[31].data.execTime+"")&&se(i,t)},d(s){s&&v(e)}}}function sf(n){let e,t=n[31].data.auth+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.auth+"")&&se(i,t)},d(l){l&&v(e)}}}function of(n){let e,t=n[31].data.userIp+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.userIp+"")&&se(i,t)},d(l){l&&v(e)}}}function rf(n){let e,t=j.truncate(typeof n[31].data.error=="string"?n[31].data.error:JSON.stringify(n[31].data.error),200)+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm label-danger")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=j.truncate(typeof l[31].data.error=="string"?l[31].data.error:JSON.stringify(l[31].data.error),200)+"")&&se(i,t)},d(l){l&&v(e)}}}function af(n){let e,t=j.truncate(JSON.stringify(n[31].data),350)+"",i;return{c(){e=b("div"),i=Y(t),p(e,"class","block txt-mono txt-xs txt-hint txt-ellipsis m-t-5")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=j.truncate(JSON.stringify(l[31].data),350)+"")&&se(i,t)},d(l){l&&v(e)}}}function uf(n,e){let t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;function F(){return e[22](e[31])}m=new X1({props:{level:e[31].level}});let N=e[31].message&&ef(e),q=e[32]&&tf(e),W=e[32]&&af(e);C=new Q1({props:{date:e[31].created}});function G(){return e[23](e[31])}function J(...H){return e[24](e[31],...H)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("div"),s=b("input"),a=M(),u=b("label"),c=M(),d=b("td"),B(m.$$.fragment),g=M(),h=b("td"),_=b("div"),N&&N.c(),k=M(),q&&q.c(),S=M(),W&&W.c(),$=M(),T=b("td"),B(C.$$.fragment),D=M(),O=b("td"),O.innerHTML='',E=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(u,"for",f="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width"),p(_,"class","flex flex-gap-10"),p(h,"class","col-type-text col-field-data"),p(T,"class","col-type-date col-field-created"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(H,U){w(H,t,U),y(t,i),y(i,l),y(l,s),y(l,a),y(l,u),y(t,c),y(t,d),z(m,d,null),y(t,g),y(t,h),y(h,_),N&&N.m(_,null),y(_,k),q&&q.m(_,null),y(h,S),W&&W.m(h,null),y(t,$),y(t,T),z(C,T,null),y(t,D),y(t,O),y(t,E),L=!0,R||(P=[K(s,"change",F),K(l,"click",fn(e[17])),K(t,"click",G),K(t,"keydown",J)],R=!0)},p(H,U){e=H,(!L||U[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!L||U[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!L||U[0]&8&&f!==(f="checkbox_"+e[31].id))&&p(u,"for",f);const le={};U[0]&8&&(le.level=e[31].level),m.$set(le),e[31].message?N?N.p(e,U):(N=ef(e),N.c(),N.m(_,k)):N&&(N.d(1),N=null),e[32]?q?q.p(e,U):(q=tf(e),q.c(),q.m(_,null)):q&&(q.d(1),q=null),e[32]?W?W.p(e,U):(W=af(e),W.c(),W.m(h,null)):W&&(W.d(1),W=null);const ee={};U[0]&8&&(ee.date=e[31].created),C.$set(ee)},i(H){L||(A(m.$$.fragment,H),A(C.$$.fragment,H),L=!0)},o(H){I(m.$$.fragment,H),I(C.$$.fragment,H),L=!1},d(H){H&&v(t),V(m),N&&N.d(),q&&q.d(),W&&W.d(),V(C),R=!1,we(P)}}}function l2(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S=[],$=new Map,T;function C(J,H){return J[7]?Qv:Xv}let D=C(n),O=D(n);function E(J){n[19](J)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[xv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Tn({props:L}),te.push(()=>ge(o,"sort",E));function R(J){n[20](J)}let P={disable:!0,class:"col-type-text col-field-data",name:"data",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),u=new Tn({props:P}),te.push(()=>ge(u,"sort",R));function F(J){n[21](J)}let N={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[t2]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),d=new Tn({props:N}),te.push(()=>ge(d,"sort",F));let q=pe(n[3]);const W=J=>J[31].id;for(let J=0;Jr=!1)),o.$set(U);const le={};H[1]&16&&(le.$$scope={dirty:H,ctx:J}),!f&&H[0]&2&&(f=!0,le.sort=J[1],ye(()=>f=!1)),u.$set(le);const ee={};H[1]&16&&(ee.$$scope={dirty:H,ctx:J}),!m&&H[0]&2&&(m=!0,ee.sort=J[1],ye(()=>m=!1)),d.$set(ee),H[0]&9369&&(q=pe(J[3]),re(),S=dt(S,H,W,1,J,q,$,k,Lt,uf,null,Xu),ae(),!q.length&&G?G.p(J,H):q.length?G&&(G.d(1),G=null):(G=Qu(J),G.c(),G.m(k,null))),(!T||H[0]&128)&&x(e,"table-loading",J[7])},i(J){if(!T){A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J);for(let H=0;HLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function cf(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,g,h,_,k,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[5]),o=M(),a=Y(r),u=M(),f=b("button"),f.innerHTML='Reset',c=M(),d=b("div"),m=M(),g=b("button"),g.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm"),p(e,"class","bulkbar svelte-pk7op9")},m($,T){w($,e,T),y(e,t),y(t,i),y(t,l),y(l,s),y(t,o),y(t,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),_=!0,k||(S=[K(f,"click",n[27]),K(g,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&se(s,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&se(a,r)},i($){_||($&&Ke(()=>{_&&(h||(h=Le(e,jn,{duration:150,y:5},!0)),h.run(1))}),_=!0)},o($){$&&(h||(h=Le(e,jn,{duration:150,y:5},!1)),h.run(0)),_=!1},d($){$&&v(e),$&&h&&h.end(),k=!1,we(S)}}}function s2(n){let e,t,i,l,s;e=new xo({props:{class:"table-wrapper",$$slots:{default:[l2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&ff(n),r=n[5]&&cf(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ke()},m(a,u){z(e,a,u),w(a,t,u),o&&o.m(a,u),w(a,i,u),r&&r.m(a,u),w(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=ff(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=cf(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){s||(A(e.$$.fragment,a),A(r),s=!0)},o(a){I(e.$$.fragment,a),I(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const df=50,gr=/[-:\. ]/gi;function o2(n,e,t){let i,l,s;const o=rt();let{filter:r=""}=e,{presets:a=""}=e,{sort:u="-rowid"}=e,f=[],c=1,d=0,m=!1,g=0,h={};async function _(H=1,U=!0){return t(7,m=!0),ue.logs.getList(H,df,{sort:u,skipTotal:1,filter:[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&")}).then(async le=>{if(H<=1&&k(),t(7,m=!1),t(6,c=le.page),t(16,d=le.items.length),o("load",f.concat(le.items)),U){const ee=++g;for(;le.items.length&&g==ee;){const oe=le.items.splice(0,10);for(let Te of oe)j.pushOrReplaceByKey(f,Te);t(3,f),await j.yieldToMain()}}else{for(let ee of le.items)j.pushOrReplaceByKey(f,ee);t(3,f)}}).catch(le=>{le!=null&&le.isAbort||(t(7,m=!1),console.warn(le),k(),ue.error(le,(le==null?void 0:le.status)!=400))})}function k(){t(3,f=[]),t(4,h={}),t(6,c=1),t(16,d=0)}function S(){s?$():T()}function $(){t(4,h={})}function T(){for(const H of f)t(4,h[H.id]=H,h);t(4,h)}function C(H){h[H.id]?delete h[H.id]:t(4,h[H.id]=H,h),t(4,h)}function D(){const H=Object.values(h).sort((ee,oe)=>ee.createdoe.created?-1:0);if(!H.length)return;if(H.length==1)return j.downloadJson(H[0],"log_"+H[0].created.replaceAll(gr,"")+".json");const U=H[0].created.replaceAll(gr,""),le=H[H.length-1].created.replaceAll(gr,"");return j.downloadJson(H,`${H.length}_logs_${le}_to_${U}.json`)}function O(H){Ee.call(this,n,H)}const E=()=>S();function L(H){u=H,t(1,u)}function R(H){u=H,t(1,u)}function P(H){u=H,t(1,u)}const F=H=>C(H),N=H=>o("select",H),q=(H,U)=>{U.code==="Enter"&&(U.preventDefault(),o("select",H))},W=()=>t(0,r=""),G=()=>_(c+1),J=()=>$();return n.$$set=H=>{"filter"in H&&t(0,r=H.filter),"presets"in H&&t(15,a=H.presets),"sort"in H&&t(1,u=H.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof u<"u"||typeof r<"u"||typeof a<"u")&&(k(),_(1)),n.$$.dirty[0]&65536&&t(9,i=d>=df),n.$$.dirty[0]&16&&t(5,l=Object.keys(h).length),n.$$.dirty[0]&40&&t(8,s=f.length&&l===f.length)},[r,u,_,f,h,l,c,m,s,i,o,S,$,C,D,a,d,O,E,L,R,P,F,N,q,W,G,J]}class r2 extends be{constructor(e){super(),_e(this,e,o2,s2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! + `}}let xr,Hi;const ea="app-tooltip";function Vu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ai(){return Hi=Hi||document.querySelector("."+ea),Hi||(Hi=document.createElement("div"),Hi.classList.add(ea),document.body.appendChild(Hi)),Hi}function X1(n,e){let t=Ai();if(!t.classList.contains("active")||!(e!=null&&e.text)){ta();return}t.textContent=e.text,t.className=ea+" 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,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),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 ta(){clearTimeout(xr),Ai().classList.remove("active"),Ai().activeNode=void 0}function kv(n,e){Ai().activeNode=n,clearTimeout(xr),xr=setTimeout(()=>{Ai().classList.add("active"),X1(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Vu(e);function i(){kv(n,t)}function l(){ta()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Ai(),{update(s){var o,r;t=Vu(s),(r=(o=Ai())==null?void 0:o.activeNode)!=null&&r.contains(n)&&X1(n,t)},destroy(){var s,o;(o=(s=Ai())==null?void 0:s.activeNode)!=null&&o.contains(n)&&ta(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Bu(n,e,t){const i=n.slice();return i[12]=e[t],i}const vv=n=>({}),Uu=n=>({uniqueId:n[4]});function wv(n){let e,t,i=pe(n[3]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Le(t,Yt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Le(t,Yt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Wu(n){let e,t,i=Co(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=Y(i),s=M(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),y(e,t),y(t,l),y(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=Co(a[12])+"")&&se(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Le(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Le(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function Tv(n){let e,t,i,l,s,o,r;const a=n[9].default,u=vt(a,n,n[8],Uu),f=[Sv,wv],c=[];function d(m,g){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,g){w(m,e,g),u&&u.m(e,null),y(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[g]){u&&u.p&&(!s||g&256)&&St(u,a,m,m[8],s?wt(a,m[8],g,vv):Tt(m[8]),Uu);let h=i;i=d(m),i===h?c[i].p(m,g):(re(),I(c[h],1,1,()=>{c[h]=null}),ae(),l=c[i],l?l.p(m,g):(l=c[i]=f[i](m),l.c()),A(l,1),l.m(e,null)),(!s||g&2)&&p(e,"class",m[1]),(!s||g&10)&&x(e,"error",m[3].length)},i(m){s||(A(u,m),A(l),s=!0)},o(m){I(u,m),I(l),s=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Yu="Invalid value";function Co(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Yu:n||Yu}function $v(n,e,t){let i;We(n,gi,h=>t(7,i=h));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ii(r)}Vt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(h){Ee.call(this,n,h)}function g(h){te[h?"unshift":"push"](()=>{f=h,t(2,f)})}return n.$$set=h=>{"name"in h&&t(5,r=h.name),"inlineError"in h&&t(0,a=h.inlineError),"class"in h&&t(1,u=h.class),"$$scope"in h&&t(8,s=h.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,g]}class me extends _e{constructor(e){super(),ge(this,e,$v,Tv,he,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Cv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0]),s.focus(),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0]&&ue(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Mv(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[1]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&2&&s.value!==c[1]&&ue(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function Ov(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ue(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Dv(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return l=new me({props:{class:"form-field required",name:"email",$$slots:{default:[Cv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[Mv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Ov,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first admin account in order to continue

",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("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"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,h){w(g,e,h),y(e,t),y(e,i),z(l,e,null),y(e,s),z(o,e,null),y(e,r),z(a,e,null),y(e,u),y(e,f),c=!0,d||(m=K(e,"submit",Ye(n[4])),d=!0)},p(g,[h]){const _={};h&1537&&(_.$$scope={dirty:h,ctx:g}),l.$set(_);const k={};h&1538&&(k.$$scope={dirty:h,ctx:g}),o.$set(k);const S={};h&1540&&(S.$$scope={dirty:h,ctx:g}),a.$set(S),(!c||h&8)&&x(f,"btn-disabled",g[3]),(!c||h&8)&&x(f,"btn-loading",g[3])},i(g){c||(A(l.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){I(l.$$.fragment,g),I(o.$$.fragment,g),I(a.$$.fragment,g),c=!1},d(g){g&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Ev(n,e,t){const i=rt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await fe.admins.create({email:l,password:s,passwordConfirm:o}),await fe.admins.authWithPassword(l,s),i("submit")}catch(d){fe.error(d)}t(3,r=!1)}}function u(){l=this.value,t(0,l)}function f(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,u,f,c]}class Av extends _e{constructor(e){super(),ge(this,e,Ev,Dv,he,{})}}function Ku(n){let e,t;return e=new G1({props:{$$slots:{default:[Iv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Iv(n){let e,t;return e=new Av({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Lv(n){let e,t,i=n[0]&&Ku(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&A(i,1)):(i=Ku(l),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Pv(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){fe.logout(!1),t(0,i=!0);return}fe.authStore.isValid?il("/collections"):fe.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Fv extends _e{constructor(e){super(),ge(this,e,Pv,Lv,he,{})}}const Et=Dn(""),Mo=Dn(""),Cl=Dn(!1);function Nv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),ue(e,n[7]),i||(l=K(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&ue(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Rv(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!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=Dt(o,r(a)),te.push(()=>be(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),z(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],ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Ju(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,jn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Zu(n){let e,t,i,l,s;return{c(){e=b("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,l||(s=K(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,jn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function qv(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[Rv,Nv],m=[];function g(k,S){return k[4]&&!k[5]?0:1}s=g(n),o=m[s]=d[s](n);let h=(n[0].length||n[7].length)&&n[7]!=n[0]&&Ju(),_=(n[0].length||n[7].length)&&Zu(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),h&&h.c(),a=M(),_&&_.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(k,S){w(k,e,S),y(e,t),y(t,i),y(e,l),m[s].m(e,null),y(e,r),h&&h.m(e,null),y(e,a),_&&_.m(e,null),u=!0,f||(c=[K(e,"click",fn(n[11])),K(e,"submit",Ye(n[10]))],f=!0)},p(k,[S]){let $=s;s=g(k),s===$?m[s].p(k,S):(re(),I(m[$],1,1,()=>{m[$]=null}),ae(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),A(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?h?S&129&&A(h,1):(h=Ju(),h.c(),A(h,1),h.m(e,a)):h&&(re(),I(h,1,1,()=>{h=null}),ae()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&A(_,1)):(_=Zu(k),_.c(),A(_,1),_.m(e,null)):_&&(re(),I(_,1,1,()=>{_=null}),ae())},i(k){u||(A(o),A(h),A(_),u=!0)},o(k){I(o),I(h),I(_),u=!1},d(k){k&&v(e),m[s].d(),h&&h.d(),_&&_.d(),f=!1,we(c)}}}function jv(n,e,t){const i=rt(),l="search_"+j.randomString(7);let{value:s=""}=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 m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function g(){t(0,s=d),i("submit",s)}async function h(){u||f||(t(5,f=!0),t(4,u=(await st(()=>import("./FilterAutocompleteInput-dec586dc.js"),["./FilterAutocompleteInput-dec586dc.js","./index-102ce751.js"],import.meta.url)).default),t(5,f=!1))}Vt(()=>{h()});function _(C){Ee.call(this,n,C)}function k(C){d=C,t(7,d),t(0,s)}function S(C){te[C?"unshift":"push"](()=>{c=C,t(6,c)})}function $(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),g()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,g,_,k,S,$,T]}class Os extends _e{constructor(e){super(),ge(this,e,jv,qv,he,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Hv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("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"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),y(e,t),s||(o=[ve(l=Pe.call(null,e,n[0])),K(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&$t(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,we(o)}}}function zv(n,e,t){const i=rt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Vt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Xo extends _e{constructor(e){super(),ge(this,e,zv,Hv,he,{tooltip:0,class:1})}}function Vv(n){let e,t,i,l,s;const o=n[6].default,r=vt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"click",n[7]),K(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&St(r,o,a,a[5],i?wt(o,a[5],u,null):Tt(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)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(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&&v(e),r&&r.d(a),l=!1,we(s)}}}function Bv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=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,s=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,l=d.$$scope)},[r,s,o,a,u,l,i,f,c]}class Tn extends _e{constructor(e){super(),ge(this,e,Bv,Vv,he,{class:1,name:2,sort:0,disable:3})}}const Uv=n=>({}),Gu=n=>({}),Wv=n=>({}),Xu=n=>({});function Yv(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=vt(u,n,n[10],Xu),c=n[11].default,d=vt(c,n,n[10],null),m=n[11].after,g=vt(m,n,n[10],Gu);return{c(){e=b("div"),f&&f.c(),t=M(),i=b("div"),d&&d.c(),s=M(),g&&g.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(h,_){w(h,e,_),f&&f.m(e,null),y(e,t),y(e,i),d&&d.m(i,null),n[12](i),y(e,s),g&&g.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(h,[_]){f&&f.p&&(!o||_&1024)&&St(f,u,h,h[10],o?wt(u,h[10],_,Wv):Tt(h[10]),Xu),d&&d.p&&(!o||_&1024)&&St(d,c,h,h[10],o?wt(c,h[10],_,null):Tt(h[10]),null),(!o||_&9&&l!==(l="scroller "+h[0]+" "+h[3]+" svelte-3a0gfs"))&&p(i,"class",l),g&&g.p&&(!o||_&1024)&&St(g,m,h,h[10],o?wt(m,h[10],_,Uv):Tt(h[10]),Gu)},i(h){o||(A(f,h),A(d,h),A(g,h),o=!0)},o(h){I(f,h),I(d,h),I(g,h),o=!1},d(h){h&&v(e),f&&f.d(h),d&&d.d(h),n[12](null),g&&g.d(h),r=!1,we(a)}}}function Kv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,g,h,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),h=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-h,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"),s("vScrollStart")),f.scrollTop+r>=g&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=h&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{T(),d=null},150))}Vt(()=>(C(),k=new MutationObserver(C),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function D(O){te[O?"unshift":"push"](()=>{f=O,t(2,f)})}return n.$$set=O=>{"class"in O&&t(0,o=O.class),"vThreshold"in O&&t(4,r=O.vThreshold),"hThreshold"in O&&t(5,a=O.hThreshold),"dispatchOnNoScroll"in O&&t(6,u=O.dispatchOnNoScroll),"$$scope"in O&&t(10,l=O.$$scope)},[o,C,f,c,r,a,u,S,$,T,l,i,D]}class Qo extends _e{constructor(e){super(),ge(this,e,Kv,Yv,he,{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 Jv(n){let e,t,i=(n[1]||"N/A")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=Y(i),s=Y(" ("),o=Y(n[0]),r=Y(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){w(u,e,f),y(e,t),y(t,l),y(t,s),y(t,o),y(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"N/A")+"")&&se(l,i),f&1&&se(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(u){u&&v(e)}}}function Zv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=K1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class Q1 extends _e{constructor(e){super(),ge(this,e,Zv,Jv,he,{level:0})}}function Gv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),y(e,i),l||(s=ve(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&se(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Xv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class x1 extends _e{constructor(e){super(),ge(this,e,Xv,Gv,he,{date:0})}}function Qu(n,e,t){const i=n.slice();i[31]=e[t];const l=i[31].data&&j.isObject(i[31].data);return i[32]=l,i}function Qv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),o||(r=K(t,"change",n[18]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function xv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function e2(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function t2(n){let e;return{c(){e=b("div"),e.innerHTML=' data',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function n2(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xu(n){let e;function t(s,o){return s[7]?l2:i2}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function i2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&ef(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),o&&o.m(t,null),y(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=ef(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function l2(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ef(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function tf(n){let e,t=n[31].message+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-ellipsis")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].message+"")&&se(i,t)},d(l){l&&v(e)}}}function nf(n){let e,t,i,l,s,o=n[31].data.status&&lf(n),r=n[31].data.execTime&&sf(n),a=n[31].data.auth&&of(n),u=n[31].data.userIp&&rf(n),f=n[31].data.error&&af(n);return{c(){o&&o.c(),e=M(),r&&r.c(),t=M(),a&&a.c(),i=M(),u&&u.c(),l=M(),f&&f.c(),s=ke()},m(c,d){o&&o.m(c,d),w(c,e,d),r&&r.m(c,d),w(c,t,d),a&&a.m(c,d),w(c,i,d),u&&u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,s,d)},p(c,d){c[31].data.status?o?o.p(c,d):(o=lf(c),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[31].data.execTime?r?r.p(c,d):(r=sf(c),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),c[31].data.auth?a?a.p(c,d):(a=of(c),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null),c[31].data.userIp?u?u.p(c,d):(u=rf(c),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null),c[31].data.error?f?f.p(c,d):(f=af(c),f.c(),f.m(s.parentNode,s)):f&&(f.d(1),f=null)},d(c){c&&(v(e),v(t),v(i),v(l),v(s)),o&&o.d(c),r&&r.d(c),a&&a.d(c),u&&u.d(c),f&&f.d(c)}}}function lf(n){let e,t=n[31].data.status+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.status+"")&&se(i,t)},d(l){l&&v(e)}}}function sf(n){let e,t=n[31].data.execTime+"",i,l;return{c(){e=b("span"),i=Y(t),l=Y("ms"),p(e,"class","label label-sm")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o[0]&8&&t!==(t=s[31].data.execTime+"")&&se(i,t)},d(s){s&&v(e)}}}function of(n){let e,t=n[31].data.auth+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.auth+"")&&se(i,t)},d(l){l&&v(e)}}}function rf(n){let e,t=n[31].data.userIp+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.userIp+"")&&se(i,t)},d(l){l&&v(e)}}}function af(n){let e,t=j.truncate(typeof n[31].data.error=="string"?n[31].data.error:JSON.stringify(n[31].data.error),200)+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm label-danger")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=j.truncate(typeof l[31].data.error=="string"?l[31].data.error:JSON.stringify(l[31].data.error),200)+"")&&se(i,t)},d(l){l&&v(e)}}}function uf(n){let e,t=j.truncate(JSON.stringify(n[31].data),350)+"",i;return{c(){e=b("div"),i=Y(t),p(e,"class","block txt-mono txt-xs txt-hint txt-ellipsis m-t-5")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=j.truncate(JSON.stringify(l[31].data),350)+"")&&se(i,t)},d(l){l&&v(e)}}}function ff(n,e){let t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;function F(){return e[22](e[31])}m=new Q1({props:{level:e[31].level}});let N=e[31].message&&tf(e),q=e[32]&&nf(e),W=e[32]&&uf(e);C=new x1({props:{date:e[31].created}});function G(){return e[23](e[31])}function J(...H){return e[24](e[31],...H)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("div"),s=b("input"),a=M(),u=b("label"),c=M(),d=b("td"),B(m.$$.fragment),g=M(),h=b("td"),_=b("div"),N&&N.c(),k=M(),q&&q.c(),S=M(),W&&W.c(),$=M(),T=b("td"),B(C.$$.fragment),D=M(),O=b("td"),O.innerHTML='',E=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(u,"for",f="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width"),p(_,"class","flex flex-gap-10"),p(h,"class","col-type-text col-field-data"),p(T,"class","col-type-date col-field-created"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(H,U){w(H,t,U),y(t,i),y(i,l),y(l,s),y(l,a),y(l,u),y(t,c),y(t,d),z(m,d,null),y(t,g),y(t,h),y(h,_),N&&N.m(_,null),y(_,k),q&&q.m(_,null),y(h,S),W&&W.m(h,null),y(t,$),y(t,T),z(C,T,null),y(t,D),y(t,O),y(t,E),L=!0,R||(P=[K(s,"change",F),K(l,"click",fn(e[17])),K(t,"click",G),K(t,"keydown",J)],R=!0)},p(H,U){e=H,(!L||U[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!L||U[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!L||U[0]&8&&f!==(f="checkbox_"+e[31].id))&&p(u,"for",f);const le={};U[0]&8&&(le.level=e[31].level),m.$set(le),e[31].message?N?N.p(e,U):(N=tf(e),N.c(),N.m(_,k)):N&&(N.d(1),N=null),e[32]?q?q.p(e,U):(q=nf(e),q.c(),q.m(_,null)):q&&(q.d(1),q=null),e[32]?W?W.p(e,U):(W=uf(e),W.c(),W.m(h,null)):W&&(W.d(1),W=null);const ee={};U[0]&8&&(ee.date=e[31].created),C.$set(ee)},i(H){L||(A(m.$$.fragment,H),A(C.$$.fragment,H),L=!0)},o(H){I(m.$$.fragment,H),I(C.$$.fragment,H),L=!1},d(H){H&&v(t),V(m),N&&N.d(),q&&q.d(),W&&W.d(),V(C),R=!1,we(P)}}}function s2(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S=[],$=new Map,T;function C(J,H){return J[7]?xv:Qv}let D=C(n),O=D(n);function E(J){n[19](J)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Tn({props:L}),te.push(()=>be(o,"sort",E));function R(J){n[20](J)}let P={disable:!0,class:"col-type-text col-field-data",name:"data",$$slots:{default:[t2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),u=new Tn({props:P}),te.push(()=>be(u,"sort",R));function F(J){n[21](J)}let N={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[n2]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),d=new Tn({props:N}),te.push(()=>be(d,"sort",F));let q=pe(n[3]);const W=J=>J[31].id;for(let J=0;Jr=!1)),o.$set(U);const le={};H[1]&16&&(le.$$scope={dirty:H,ctx:J}),!f&&H[0]&2&&(f=!0,le.sort=J[1],ye(()=>f=!1)),u.$set(le);const ee={};H[1]&16&&(ee.$$scope={dirty:H,ctx:J}),!m&&H[0]&2&&(m=!0,ee.sort=J[1],ye(()=>m=!1)),d.$set(ee),H[0]&9369&&(q=pe(J[3]),re(),S=dt(S,H,W,1,J,q,$,k,Lt,ff,null,Qu),ae(),!q.length&&G?G.p(J,H):q.length?G&&(G.d(1),G=null):(G=xu(J),G.c(),G.m(k,null))),(!T||H[0]&128)&&x(e,"table-loading",J[7])},i(J){if(!T){A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J);for(let H=0;HLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function df(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,g,h,_,k,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[5]),o=M(),a=Y(r),u=M(),f=b("button"),f.innerHTML='Reset',c=M(),d=b("div"),m=M(),g=b("button"),g.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm"),p(e,"class","bulkbar svelte-pk7op9")},m($,T){w($,e,T),y(e,t),y(t,i),y(t,l),y(l,s),y(t,o),y(t,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),_=!0,k||(S=[K(f,"click",n[27]),K(g,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&se(s,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&se(a,r)},i($){_||($&&Ke(()=>{_&&(h||(h=Le(e,jn,{duration:150,y:5},!0)),h.run(1))}),_=!0)},o($){$&&(h||(h=Le(e,jn,{duration:150,y:5},!1)),h.run(0)),_=!1},d($){$&&v(e),$&&h&&h.end(),k=!1,we(S)}}}function o2(n){let e,t,i,l,s;e=new Qo({props:{class:"table-wrapper",$$slots:{default:[s2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&cf(n),r=n[5]&&df(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ke()},m(a,u){z(e,a,u),w(a,t,u),o&&o.m(a,u),w(a,i,u),r&&r.m(a,u),w(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=cf(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=df(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){s||(A(e.$$.fragment,a),A(r),s=!0)},o(a){I(e.$$.fragment,a),I(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const pf=50,hr=/[-:\. ]/gi;function r2(n,e,t){let i,l,s;const o=rt();let{filter:r=""}=e,{presets:a=""}=e,{sort:u="-rowid"}=e,f=[],c=1,d=0,m=!1,g=0,h={};async function _(H=1,U=!0){return t(7,m=!0),fe.logs.getList(H,pf,{sort:u,skipTotal:1,filter:[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&")}).then(async le=>{if(H<=1&&k(),t(7,m=!1),t(6,c=le.page),t(16,d=le.items.length),o("load",f.concat(le.items)),U){const ee=++g;for(;le.items.length&&g==ee;){const oe=le.items.splice(0,10);for(let Te of oe)j.pushOrReplaceByKey(f,Te);t(3,f),await j.yieldToMain()}}else{for(let ee of le.items)j.pushOrReplaceByKey(f,ee);t(3,f)}}).catch(le=>{le!=null&&le.isAbort||(t(7,m=!1),console.warn(le),k(),fe.error(le,(le==null?void 0:le.status)!=400))})}function k(){t(3,f=[]),t(4,h={}),t(6,c=1),t(16,d=0)}function S(){s?$():T()}function $(){t(4,h={})}function T(){for(const H of f)t(4,h[H.id]=H,h);t(4,h)}function C(H){h[H.id]?delete h[H.id]:t(4,h[H.id]=H,h),t(4,h)}function D(){const H=Object.values(h).sort((ee,oe)=>ee.createdoe.created?-1:0);if(!H.length)return;if(H.length==1)return j.downloadJson(H[0],"log_"+H[0].created.replaceAll(hr,"")+".json");const U=H[0].created.replaceAll(hr,""),le=H[H.length-1].created.replaceAll(hr,"");return j.downloadJson(H,`${H.length}_logs_${le}_to_${U}.json`)}function O(H){Ee.call(this,n,H)}const E=()=>S();function L(H){u=H,t(1,u)}function R(H){u=H,t(1,u)}function P(H){u=H,t(1,u)}const F=H=>C(H),N=H=>o("select",H),q=(H,U)=>{U.code==="Enter"&&(U.preventDefault(),o("select",H))},W=()=>t(0,r=""),G=()=>_(c+1),J=()=>$();return n.$$set=H=>{"filter"in H&&t(0,r=H.filter),"presets"in H&&t(15,a=H.presets),"sort"in H&&t(1,u=H.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof u<"u"||typeof r<"u"||typeof a<"u")&&(k(),_(1)),n.$$.dirty[0]&65536&&t(9,i=d>=pf),n.$$.dirty[0]&16&&t(5,l=Object.keys(h).length),n.$$.dirty[0]&40&&t(8,s=f.length&&l===f.length)},[r,u,_,f,h,l,c,m,s,i,o,S,$,C,D,a,d,O,E,L,R,P,F,N,q,W,G,J]}class a2 extends _e{constructor(e){super(),ge(this,e,r2,o2,he,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function Es(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Ql(n){return $i(Es(n*2.55),0,255)}function Ii(n){return $i(Es(n*255),0,255)}function fi(n){return $i(Es(n/2.55)/100,0,1)}function pf(n){return $i(Es(n*100),0,100)}const In={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},ta=[..."0123456789ABCDEF"],a2=n=>ta[n&15],u2=n=>ta[(n&240)>>4]+ta[n&15],zs=n=>(n&240)>>4===(n&15),f2=n=>zs(n.r)&&zs(n.g)&&zs(n.b)&&zs(n.a);function c2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[n[8]]:255})),t}const d2=(n,e)=>n<255?e(n):"";function p2(n){var e=f2(n)?a2:u2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+d2(n.a,e):void 0}const m2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x1(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function h2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function g2(n,e,t){const i=x1(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function _2(n,e,t,i,l){return n===l?(e-t)/i+(e.5?f/(2-s-o):f/(s+o),a=_2(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Fa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ii)}function Na(n,e,t){return Fa(x1,n,e,t)}function b2(n,e,t){return Fa(g2,n,e,t)}function y2(n,e,t){return Fa(h2,n,e,t)}function eb(n){return(n%360+360)%360}function k2(n){const e=m2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ql(+e[5]):Ii(+e[5]));const l=eb(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=b2(l,s,o):e[1]==="hsv"?i=y2(l,s,o):i=Na(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function v2(n,e){var t=Pa(n);t[0]=eb(t[0]+e),t=Na(t),n.r=t[0],n.g=t[1],n.b=t[2]}function w2(n){if(!n)return;const e=Pa(n),t=e[0],i=pf(e[1]),l=pf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${fi(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const mf={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"},hf={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 S2(){const n={},e=Object.keys(hf),t=Object.keys(mf);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let Vs;function T2(n){Vs||(Vs=S2(),Vs.transparent=[0,0,0,0]);const e=Vs[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const $2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function C2(n){const e=$2.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Ql(o):$i(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Ql(i):$i(i,0,255)),l=255&(e[4]?Ql(l):$i(l,0,255)),s=255&(e[6]?Ql(s):$i(s,0,255)),{r:i,g:l,b:s,a:t}}}function M2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${fi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const _r=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,gl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function O2(n,e,t){const i=gl(fi(n.r)),l=gl(fi(n.g)),s=gl(fi(n.b));return{r:Ii(_r(i+t*(gl(fi(e.r))-i))),g:Ii(_r(l+t*(gl(fi(e.g))-l))),b:Ii(_r(s+t*(gl(fi(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Bs(n,e,t){if(n){let i=Pa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Na(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function tb(n,e){return n&&Object.assign(e||{},n)}function gf(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=Ii(n[3]))):(e=tb(n,{r:0,g:0,b:0,a:1}),e.a=Ii(e.a)),e}function D2(n){return n.charAt(0)==="r"?C2(n):k2(n)}class ps{constructor(e){if(e instanceof ps)return e;const t=typeof e;let i;t==="object"?i=gf(e):t==="string"&&(i=c2(e)||T2(e)||D2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=tb(this._rgb);return e&&(e.a=fi(e.a)),e}set rgb(e){this._rgb=gf(e)}rgbString(){return this._valid?M2(this._rgb):void 0}hexString(){return this._valid?p2(this._rgb):void 0}hslString(){return this._valid?w2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-u,i.r=255&u*i.r+s*l.r+.5,i.g=255&u*i.g+s*l.g+.5,i.b=255&u*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=O2(this._rgb,e._rgb,t)),this}clone(){return new ps(this.rgb)}alpha(e){return this._rgb.a=Ii(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Es(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 Bs(this._rgb,2,e),this}darken(e){return Bs(this._rgb,2,-e),this}saturate(e){return Bs(this._rgb,1,e),this}desaturate(e){return Bs(this._rgb,1,-e),this}rotate(e){return v2(this._rgb,e),this}}/*! + */function Ds(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Xl(n){return $i(Ds(n*2.55),0,255)}function Ii(n){return $i(Ds(n*255),0,255)}function fi(n){return $i(Ds(n/2.55)/100,0,1)}function mf(n){return $i(Ds(n*100),0,100)}const In={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"],u2=n=>na[n&15],f2=n=>na[(n&240)>>4]+na[n&15],Hs=n=>(n&240)>>4===(n&15),c2=n=>Hs(n.r)&&Hs(n.g)&&Hs(n.b)&&Hs(n.a);function d2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[n[8]]:255})),t}const p2=(n,e)=>n<255?e(n):"";function m2(n){var e=c2(n)?u2:f2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+p2(n.a,e):void 0}const h2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function eb(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function g2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function _2(n,e,t){const i=eb(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function b2(n,e,t,i,l){return n===l?(e-t)/i+(e.5?f/(2-s-o):f/(s+o),a=b2(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Na(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ii)}function Ra(n,e,t){return Na(eb,n,e,t)}function y2(n,e,t){return Na(_2,n,e,t)}function k2(n,e,t){return Na(g2,n,e,t)}function tb(n){return(n%360+360)%360}function v2(n){const e=h2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xl(+e[5]):Ii(+e[5]));const l=tb(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=y2(l,s,o):e[1]==="hsv"?i=k2(l,s,o):i=Ra(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function w2(n,e){var t=Fa(n);t[0]=tb(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function S2(n){if(!n)return;const e=Fa(n),t=e[0],i=mf(e[1]),l=mf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${fi(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const hf={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"},gf={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 T2(){const n={},e=Object.keys(gf),t=Object.keys(hf);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let zs;function $2(n){zs||(zs=T2(),zs.transparent=[0,0,0,0]);const e=zs[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const C2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function M2(n){const e=C2.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Xl(o):$i(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Xl(i):$i(i,0,255)),l=255&(e[4]?Xl(l):$i(l,0,255)),s=255&(e[6]?Xl(s):$i(s,0,255)),{r:i,g:l,b:s,a:t}}}function O2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${fi(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,gl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function D2(n,e,t){const i=gl(fi(n.r)),l=gl(fi(n.g)),s=gl(fi(n.b));return{r:Ii(gr(i+t*(gl(fi(e.r))-i))),g:Ii(gr(l+t*(gl(fi(e.g))-l))),b:Ii(gr(s+t*(gl(fi(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Vs(n,e,t){if(n){let i=Fa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ra(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function nb(n,e){return n&&Object.assign(e||{},n)}function _f(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=Ii(n[3]))):(e=nb(n,{r:0,g:0,b:0,a:1}),e.a=Ii(e.a)),e}function E2(n){return n.charAt(0)==="r"?M2(n):v2(n)}class ds{constructor(e){if(e instanceof ds)return e;const t=typeof e;let i;t==="object"?i=_f(e):t==="string"&&(i=d2(e)||$2(e)||E2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=nb(this._rgb);return e&&(e.a=fi(e.a)),e}set rgb(e){this._rgb=_f(e)}rgbString(){return this._valid?O2(this._rgb):void 0}hexString(){return this._valid?m2(this._rgb):void 0}hslString(){return this._valid?S2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-u,i.r=255&u*i.r+s*l.r+.5,i.g=255&u*i.g+s*l.g+.5,i.b=255&u*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=D2(this._rgb,e._rgb,t)),this}clone(){return new ds(this.rgb)}alpha(e){return this._rgb.a=Ii(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Ds(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 Vs(this._rgb,2,e),this}darken(e){return Vs(this._rgb,2,-e),this}saturate(e){return Vs(this._rgb,1,e),this}desaturate(e){return Vs(this._rgb,1,-e),this}rotate(e){return w2(this._rgb,e),this}}/*! * Chart.js v4.4.0 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License - */function ri(){}const E2=(()=>{let n=0;return()=>n++})();function yt(n){return n===null||typeof n>"u"}function Ot(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 it(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function jt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function vn(n,e){return jt(n)?n:e}function ht(n,e){return typeof n>"u"?e:n}const A2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function qt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let l,s,o;if(Ot(n))if(s=n.length,i)for(l=s-1;l>=0;l--)e.call(t,n[l],l);else for(l=0;ln,x:n=>n.x,y:n=>n.y};function P2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function F2(n){const e=P2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ol(n,e){return(_f[e]||(_f[e]=F2(e)))(n)}function Ra(n){return n.charAt(0).toUpperCase()+n.slice(1)}const hs=n=>typeof n<"u",Li=n=>typeof n=="function",bf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function N2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const xt=Math.PI,On=2*xt,R2=On+xt,Ao=Number.POSITIVE_INFINITY,q2=xt/180,$n=xt/2,zi=xt/4,yf=xt*2/3,Ci=Math.log10,ti=Math.sign;function ls(n,e,t){return Math.abs(n-e)l-s).pop(),e}function Io(n){return!isNaN(parseFloat(n))&&isFinite(n)}function H2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function ib(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ja(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const ia=(n,e,t,i)=>ja(n,t,i?l=>{const s=n[l][e];return sn[l][e]ja(n,t,i=>n[i][e]>=t);function W2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Ra(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function wf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(sb.forEach(s=>{delete n[s]}),delete n._chartjs)}function ob(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const rb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function ab(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,rb.call(window,()=>{i=!1,n.apply(e,t)}))}}function K2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const J2=n=>n==="start"?"left":n==="end"?"right":"center",Sf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,Us=n=>n===0||n===1,Tf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*On/t)),$f=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*On/t)+1,ss={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*$n)+1,easeOutSine:n=>Math.sin(n*$n),easeInOutSine:n=>-.5*(Math.cos(xt*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=>Us(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=>Us(n)?n:Tf(n,.075,.3),easeOutElastic:n=>Us(n)?n:$f(n,.075,.3),easeInOutElastic(n){return Us(n)?n:n<.5?.5*Tf(n*2,.1125,.45):.5+.5*$f(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-ss.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?ss.easeInBounce(n*2)*.5:ss.easeOutBounce(n*2-1)*.5+.5};function Ha(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Cf(n){return Ha(n)?n:new ps(n)}function br(n){return Ha(n)?n:new ps(n).saturate(.5).darken(.1).hexString()}const Z2=["x","y","borderWidth","radius","tension"],G2=["color","borderColor","backgroundColor"];function X2(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:G2},numbers:{type:"number",properties:Z2}}),n.describe("animations",{_fallback:"animation"}),n.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:e=>e|0}}}})}function Q2(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Mf=new Map;function x2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Mf.get(t);return i||(i=new Intl.NumberFormat(n,e),Mf.set(t,i)),i}function za(n,e,t){return x2(e,t).format(n)}const ub={values(n){return Ot(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=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)&&(l="scientific"),s=ew(n,t)}const o=Ci(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),za(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Ci(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?ub.numeric.call(this,n,e,t):""}};function ew(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 er={formatters:ub};function tw(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width: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:er.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const tl=Object.create(null),la=Object.create(null);function os(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.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=(i,l)=>br(l.backgroundColor),this.hoverBorderColor=(i,l)=>br(l.borderColor),this.hoverColor=(i,l)=>br(l.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),this.apply(t)}set(e,t){return yr(this,e,t)}get(e){return os(this,e)}describe(e,t){return yr(la,e,t)}override(e,t){return yr(tl,e,t)}route(e,t,i,l){const s=os(this,e),o=os(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return it(a)?Object.assign({},u,a):ht(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var zt=new nw({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[X2,Q2,tw]);function iw(n){return!n||yt(n.size)||yt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Po(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function lw(n,e,t,i){i=i||{};let l=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(l=i.data={},s=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 Oi(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,aw(n,s),a=0;a+n||0;function fb(n,e){const t={},i=it(e),l=i?Object.keys(e):e,s=it(n)?i?o=>ht(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=mw(s(o));return t}function cb(n){return fb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function wl(n){return fb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Hn(n){const e=cb(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Cn(n,e){n=n||{},e=e||zt.font;let t=ht(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=ht(n.style,e.style);i&&!(""+i).match(dw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:ht(n.family,e.family),lineHeight:pw(ht(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:ht(n.weight,e.weight),string:""};return l.string=iw(l),l}function Ws(n,e,t,i){let l=!0,s,o,r;for(s=0,o=n.length;st&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function Fi(n,e){return Object.assign(Object.create(n),e)}function Ua(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=hb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Ua([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return pb(r,a,()=>Sw(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Af(r).includes(a)},ownKeys(r){return Af(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function Dl(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:db(n,i),setContext:s=>Dl(n,s,t,i),override:s=>Dl(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return pb(s,o,()=>_w(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function db(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Li(t)?t:()=>t,isIndexable:Li(i)?i:()=>i}}const gw=(n,e)=>n?n+Ra(e):e,Wa=(n,e)=>it(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function pb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function _w(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Li(r)&&o.isScriptable(e)&&(r=bw(e,r,n,t)),Ot(r)&&r.length&&(r=yw(e,r,n,o.isIndexable)),Wa(e,r)&&(r=Dl(r,l,s&&s[e],o)),r}function bw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Wa(n,a)&&(a=Ya(l._scopes,l,n,a)),a}function yw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(it(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ya(u,l,n,f);e.push(Dl(c,s,o&&o[n],r))}}return e}function mb(n,e,t){return Li(n)?n(e,t):n}const kw=(n,e)=>n===!0?e:typeof n=="string"?Ol(e,n):void 0;function vw(n,e,t,i,l){for(const s of e){const o=kw(t,s);if(o){n.add(o);const r=mb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Ya(n,e,t,i){const l=e._rootScopes,s=mb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Ef(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Ef(r,o,s,a,i),a===null)?!1:Ua(Array.from(r),[""],l,s,()=>ww(e,t,i))}function Ef(n,e,t,i,l){for(;t;)t=vw(n,e,t,i,l);return t}function ww(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Ot(l)&&it(t)?t:l||{}}function Sw(n,e,t,i){let l;for(const s of e)if(l=hb(gw(s,n),t),typeof l<"u")return Wa(n,l)?Ya(t,i,n,l):l}function hb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Af(n){let e=n._keys;return e||(e=n._keys=Tw(n._scopes)),e}function Tw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const $w=Number.EPSILON||1e-14,El=(n,e)=>en==="x"?"y":"x";function Cw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=na(s,l),a=na(o,s);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:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Mw(n,e,t){const i=n.length;let l,s,o,r,a,u=El(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")Dw(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function Iw(n,e){return tr(n).getPropertyValue(e)}const Lw=["top","right","bottom","left"];function xi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Lw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Pw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Fw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(Pw(l,s,n.target))r=l,a=s;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 Ki(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=tr(t),s=l.boxSizing==="border-box",o=xi(l,"padding"),r=xi(l,"border","width"),{x:a,y:u,box:f}=Fw(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:g}=e;return s&&(m-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function Nw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=Ka(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=tr(s),a=xi(r,"border","width"),u=xi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Ro(r.maxWidth,s,"clientWidth"),l=Ro(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Ao,maxHeight:l||Ao}}const Ks=n=>Math.round(n*10)/10;function Rw(n,e,t,i){const l=tr(n),s=xi(l,"margin"),o=Ro(l.maxWidth,n,"clientWidth")||Ao,r=Ro(l.maxHeight,n,"clientHeight")||Ao,a=Nw(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=xi(l,"border","width"),m=xi(l,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-s.width),f=Math.max(0,i?u/i:f-s.height),u=Ks(Math.min(u,o,a.maxWidth)),f=Ks(Math.min(f,r,a.maxHeight)),u&&!f&&(f=Ks(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=Ks(Math.floor(f*i))),{width:u,height:f}}function If(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);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!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const qw=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 Lf(n,e){const t=Iw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ji(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function jw(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 Hw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Ji(n,l,t),r=Ji(l,s,t),a=Ji(s,e,t),u=Ji(o,r,t),f=Ji(r,a,t);return Ji(u,f,t)}const zw=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}}},Vw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function kr(n,e,t){return n?zw(e,t):Vw()}function Bw(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 Uw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function bb(n){return n==="angle"?{between:lb,compare:V2,normalize:Sn}:{between:Lo,compare:(e,t)=>e-t,normalize:e=>e}}function Pf({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Ww(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=bb(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(l,$,k)&&r(l,$)!==0,C=()=>r(s,k)===0||a(s,$,k),D=()=>h||T(),O=()=>!h||C();for(let E=f,L=f;E<=c;++E)S=e[E%o],!S.skip&&(k=u(S[i]),k!==$&&(h=a(k,l,s),_===null&&D()&&(_=r(k,l)===0?E:L),_!==null&&O()&&(g.push(Pf({start:_,end:E,loop:d,count:o,style:m})),_=null),L=E,$=k));return _!==null&&g.push(Pf({start:_,end:c,loop:d,count:o,style:m})),g}function kb(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function Kw(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%l];u.skip||u.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function Jw(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=Yw(t,l,s,i);if(i===!0)return Ff(n,[{start:o,end:r,loop:s}],t,e);const a=r{let n=0;return()=>n++})();function yt(n){return n===null||typeof n>"u"}function Ot(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 it(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function jt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function vn(n,e){return jt(n)?n:e}function ht(n,e){return typeof n>"u"?e:n}const I2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function qt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let l,s,o;if(Ot(n))if(s=n.length,i)for(l=s-1;l>=0;l--)e.call(t,n[l],l);else for(l=0;ln,x:n=>n.x,y:n=>n.y};function F2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function N2(n){const e=F2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ml(n,e){return(bf[e]||(bf[e]=N2(e)))(n)}function qa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ms=n=>typeof n<"u",Li=n=>typeof n=="function",yf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function R2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const xt=Math.PI,On=2*xt,q2=On+xt,Eo=Number.POSITIVE_INFINITY,j2=xt/180,$n=xt/2,zi=xt/4,kf=xt*2/3,Ci=Math.log10,ti=Math.sign;function is(n,e,t){return Math.abs(n-e)l-s).pop(),e}function Ao(n){return!isNaN(parseFloat(n))&&isFinite(n)}function z2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function lb(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ha(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const la=(n,e,t,i)=>Ha(n,t,i?l=>{const s=n[l][e];return sn[l][e]Ha(n,t,i=>n[i][e]>=t);function Y2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+qa(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function Sf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(ob.forEach(s=>{delete n[s]}),delete n._chartjs)}function rb(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const ab=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function ub(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,ab.call(window,()=>{i=!1,n.apply(e,t)}))}}function J2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Z2=n=>n==="start"?"left":n==="end"?"right":"center",Tf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,Bs=n=>n===0||n===1,$f=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*On/t)),Cf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*On/t)+1,ls={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*$n)+1,easeOutSine:n=>Math.sin(n*$n),easeInOutSine:n=>-.5*(Math.cos(xt*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=>Bs(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=>Bs(n)?n:$f(n,.075,.3),easeOutElastic:n=>Bs(n)?n:Cf(n,.075,.3),easeInOutElastic(n){return Bs(n)?n:n<.5?.5*$f(n*2,.1125,.45):.5+.5*Cf(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-ls.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?ls.easeInBounce(n*2)*.5:ls.easeOutBounce(n*2-1)*.5+.5};function za(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Mf(n){return za(n)?n:new ds(n)}function _r(n){return za(n)?n:new ds(n).saturate(.5).darken(.1).hexString()}const G2=["x","y","borderWidth","radius","tension"],X2=["color","borderColor","backgroundColor"];function Q2(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:X2},numbers:{type:"number",properties:G2}}),n.describe("animations",{_fallback:"animation"}),n.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:e=>e|0}}}})}function x2(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Of=new Map;function ew(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Of.get(t);return i||(i=new Intl.NumberFormat(n,e),Of.set(t,i)),i}function Va(n,e,t){return ew(e,t).format(n)}const fb={values(n){return Ot(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=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)&&(l="scientific"),s=tw(n,t)}const o=Ci(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Va(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Ci(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?fb.numeric.call(this,n,e,t):""}};function tw(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:fb};function nw(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width: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}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const tl=Object.create(null),sa=Object.create(null);function ss(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.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=(i,l)=>_r(l.backgroundColor),this.hoverBorderColor=(i,l)=>_r(l.borderColor),this.hoverColor=(i,l)=>_r(l.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),this.apply(t)}set(e,t){return br(this,e,t)}get(e){return ss(this,e)}describe(e,t){return br(sa,e,t)}override(e,t){return br(tl,e,t)}route(e,t,i,l){const s=ss(this,e),o=ss(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return it(a)?Object.assign({},u,a):ht(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var zt=new iw({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Q2,x2,nw]);function lw(n){return!n||yt(n.size)||yt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Lo(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function sw(n,e,t,i){i=i||{};let l=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(l=i.data={},s=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 Oi(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,uw(n,s),a=0;a+n||0;function cb(n,e){const t={},i=it(e),l=i?Object.keys(e):e,s=it(n)?i?o=>ht(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=hw(s(o));return t}function db(n){return cb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vl(n){return cb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Hn(n){const e=db(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Cn(n,e){n=n||{},e=e||zt.font;let t=ht(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=ht(n.style,e.style);i&&!(""+i).match(pw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:ht(n.family,e.family),lineHeight:mw(ht(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:ht(n.weight,e.weight),string:""};return l.string=lw(l),l}function Us(n,e,t,i){let l=!0,s,o,r;for(s=0,o=n.length;st&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function Fi(n,e){return Object.assign(Object.create(n),e)}function Wa(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=gb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Wa([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return mb(r,a,()=>Tw(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return If(r).includes(a)},ownKeys(r){return If(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function Ol(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:pb(n,i),setContext:s=>Ol(n,s,t,i),override:s=>Ol(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return mb(s,o,()=>bw(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function pb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Li(t)?t:()=>t,isIndexable:Li(i)?i:()=>i}}const _w=(n,e)=>n?n+qa(e):e,Ya=(n,e)=>it(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function mb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function bw(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Li(r)&&o.isScriptable(e)&&(r=yw(e,r,n,t)),Ot(r)&&r.length&&(r=kw(e,r,n,o.isIndexable)),Ya(e,r)&&(r=Ol(r,l,s&&s[e],o)),r}function yw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Ya(n,a)&&(a=Ka(l._scopes,l,n,a)),a}function kw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(it(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ka(u,l,n,f);e.push(Ol(c,s,o&&o[n],r))}}return e}function hb(n,e,t){return Li(n)?n(e,t):n}const vw=(n,e)=>n===!0?e:typeof n=="string"?Ml(e,n):void 0;function ww(n,e,t,i,l){for(const s of e){const o=vw(t,s);if(o){n.add(o);const r=hb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Ka(n,e,t,i){const l=e._rootScopes,s=hb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Af(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Af(r,o,s,a,i),a===null)?!1:Wa(Array.from(r),[""],l,s,()=>Sw(e,t,i))}function Af(n,e,t,i,l){for(;t;)t=ww(n,e,t,i,l);return t}function Sw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Ot(l)&&it(t)?t:l||{}}function Tw(n,e,t,i){let l;for(const s of e)if(l=gb(_w(s,n),t),typeof l<"u")return Ya(n,l)?Ka(t,i,n,l):l}function gb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function If(n){let e=n._keys;return e||(e=n._keys=$w(n._scopes)),e}function $w(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const Cw=Number.EPSILON||1e-14,Dl=(n,e)=>en==="x"?"y":"x";function Mw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=ia(s,l),a=ia(o,s);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:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Ow(n,e,t){const i=n.length;let l,s,o,r,a,u=Dl(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")Ew(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function Lw(n,e){return er(n).getPropertyValue(e)}const Pw=["top","right","bottom","left"];function xi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Pw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Fw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Nw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(Fw(l,s,n.target))r=l,a=s;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 Ki(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=er(t),s=l.boxSizing==="border-box",o=xi(l,"padding"),r=xi(l,"border","width"),{x:a,y:u,box:f}=Nw(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:g}=e;return s&&(m-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function Rw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=Ja(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=er(s),a=xi(r,"border","width"),u=xi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=No(r.maxWidth,s,"clientWidth"),l=No(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Eo,maxHeight:l||Eo}}const Ys=n=>Math.round(n*10)/10;function qw(n,e,t,i){const l=er(n),s=xi(l,"margin"),o=No(l.maxWidth,n,"clientWidth")||Eo,r=No(l.maxHeight,n,"clientHeight")||Eo,a=Rw(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=xi(l,"border","width"),m=xi(l,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-s.width),f=Math.max(0,i?u/i:f-s.height),u=Ys(Math.min(u,o,a.maxWidth)),f=Ys(Math.min(f,r,a.maxHeight)),u&&!f&&(f=Ys(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=Ys(Math.floor(f*i))),{width:u,height:f}}function Lf(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);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!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const jw=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 Pf(n,e){const t=Lw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ji(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Hw(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 zw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Ji(n,l,t),r=Ji(l,s,t),a=Ji(s,e,t),u=Ji(o,r,t),f=Ji(r,a,t);return Ji(u,f,t)}const Vw=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}}},Bw=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?Vw(e,t):Bw()}function Uw(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 Ww(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function yb(n){return n==="angle"?{between:sb,compare:B2,normalize:Sn}:{between:Io,compare:(e,t)=>e-t,normalize:e=>e}}function Ff({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Yw(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=yb(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(l,$,k)&&r(l,$)!==0,C=()=>r(s,k)===0||a(s,$,k),D=()=>h||T(),O=()=>!h||C();for(let E=f,L=f;E<=c;++E)S=e[E%o],!S.skip&&(k=u(S[i]),k!==$&&(h=a(k,l,s),_===null&&D()&&(_=r(k,l)===0?E:L),_!==null&&O()&&(g.push(Ff({start:_,end:E,loop:d,count:o,style:m})),_=null),L=E,$=k));return _!==null&&g.push(Ff({start:_,end:c,loop:d,count:o,style:m})),g}function vb(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function Jw(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%l];u.skip||u.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function Zw(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=Kw(t,l,s,i);if(i===!0)return Nf(n,[{start:o,end:r,loop:s}],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=rb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.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,l)=>Math.max(i,l._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 l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new Xw;const Rf="transparent",Qw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Cf(n||Rf),l=i.valid&&Cf(e||Rf);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class xw{constructor(e,t,i,l){const s=t[i];l=Ws([e.to,l,s,e.from]);const o=Ws([e.from,s,l]);this._active=!0,this._fn=e.fn||Qw[e.type||typeof o],this._easing=ss[e.easing]||ss.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=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Ws([e.to,t,l,e.from]),this._from=Ws([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,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 l=0;l{const s=e[l];if(!it(s))return;const o={};for(const r of t)o[r]=s[r];(Ot(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=t3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&e3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=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"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[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}s[u]=c=new xw(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function e3(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function Vf(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,u=o.axis,f=s3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function a3(n,e){return Fi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function u3(n,e,t){return Fi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ul(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const wr=n=>n==="reset"||n==="none",Bf=(n,e)=>e?n:Object.assign({},n),f3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:wb(t,!0),values:null};class rs{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.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Hf(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Ul(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,g)=>c==="x"?d:c==="r"?g:m,s=t.xAxisID=ht(i.xAxisID,vr(e,"x")),o=t.yAxisID=ht(i.yAxisID,vr(e,"y")),r=t.rAxisID=ht(i.rAxisID,vr(e,"r")),a=t.indexAxis,u=t.iAxisID=l(a,s,o,r),f=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),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&&wf(this._data,this),e._stacked&&Ul(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(it(t))this._data=l3(t);else if(i!==t){if(i){wf(i,this);const l=this._cachedMeta;Ul(l),l._parsed=[]}t&&Object.isExtensible(t)&&Y2(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 l=!1;this._dataCheck();const s=t._stacked;t._stacked=Hf(t.vScale,t),t.stack!==i.stack&&(l=!0,Ul(t),t.stack=i.stack),this._resyncElements(e),(l||s!==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:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Ot(l[e])?d=this.parseArrayData(i,l,e,t):it(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]h||c=0;--d)if(!g()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),h=u.resolveNamedOptions(d,m,g,c);return h.$shared&&(h.$shared=a,s[o]=Object.freeze(Bf(h,a))),h}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.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 vb(l,a&&a.animations);return a&&a._cacheable&&(s[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),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){wr(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!wr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}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 l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;rl-s))}return n._cache.$bar}function d3(n){const e=n.iScale,t=c3(e,n.type);let i=e._length,l,s,o,r;const a=()=>{o===32767||o===-32768||(hs(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(l=0,s=t.length;l0?l[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:l,end:s,min:o,max:r}}function Sb(n,e,t,i){return Ot(n)?h3(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Uf(n,e,t,i){const l=n.iScale,s=n.vScale,o=l.getLabels(),r=l===s,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function _3(n){let e,t,i,l,s;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),s=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(yt(f)||isNaN(f))return!0};for(const a of l)if(!(t!==void 0&&r(a))&&((s===!1||o.indexOf(a.stack)===-1||s===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 l=this._getStacks(e,i),s=t!==void 0?l.indexOf(t):-1;return s===-1?l.length-1:s}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,l=[];let s,o;for(s=0,o=t.data.length;s{a[o](e[t],l)&&(s.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var $3={evaluateInteractionItems:As,modes:{index(n,e,t,i){const l=Ki(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?Tr(n,l,s,i,o):$r(n,l,s,!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 l=Ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?Tr(n,l,s,i,o):$r(n,l,s,!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 Jf(n,e){return n.filter(t=>$b.indexOf(t.pos)===-1&&t.box.axis===e)}function Yl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function C3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Yl(Wl(e,"left"),!0),l=Yl(Wl(e,"right")),s=Yl(Wl(e,"top"),!0),o=Yl(Wl(e,"bottom")),r=Jf(e,"x"),a=Jf(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:Wl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Zf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Cb(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 E3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!it(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Cb(o,s.getPadding());const r=Math.max(0,e.outerWidth-Zf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Zf(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 A3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function I3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function xl(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s{typeof h.beforeLayout=="function"&&h.beforeLayout()});const f=a.reduce((h,_)=>_.box.options&&_.box.options.display===!1?h:h+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},l);Cb(d,Hn(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),g=O3(a.concat(u),c);xl(r.fullSize,m,c,g),xl(a,m,c,g),xl(u,m,c,g)&&xl(a,m,c,g),A3(m),Gf(r.leftAndTop,m,c,g),m.x+=m.w,m.y+=m.h,Gf(r.rightAndBottom,m,c,g),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},gt(r.chartArea,h=>{const _=h.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Mb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class L3 extends Mb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const mo="$chartjs",P3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xf=n=>n===null||n==="";function F3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[mo]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Xf(l)){const s=Lf(n,"width");s!==void 0&&(n.width=s)}if(Xf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Lf(n,"height");s!==void 0&&(n.height=s)}return n}const Ob=qw?{passive:!0}:!1;function N3(n,e,t){n.addEventListener(e,t,Ob)}function R3(n,e,t){n.canvas.removeEventListener(e,t,Ob)}function q3(n,e){const t=P3[n.type]||n.type,{x:i,y:l}=Ki(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function qo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function j3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||qo(r.addedNodes,i),o=o&&!qo(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function H3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||qo(r.removedNodes,i),o=o&&!qo(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const gs=new Map;let Qf=0;function Db(){const n=window.devicePixelRatio;n!==Qf&&(Qf=n,gs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function z3(n,e){gs.size||window.addEventListener("resize",Db),gs.set(n,e)}function V3(n){gs.delete(n),gs.size||window.removeEventListener("resize",Db)}function B3(n,e,t){const i=n.canvas,l=i&&Ka(i);if(!l)return;const s=ab((r,a)=>{const u=l.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),z3(n,s),o}function Cr(n,e,t){t&&t.disconnect(),e==="resize"&&V3(n)}function U3(n,e,t){const i=n.canvas,l=ab(s=>{n.ctx!==null&&t(q3(s,n))},n);return N3(i,e,l),l}class W3 extends Mb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(F3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[mo])return!1;const i=t[mo].initial;["height","width"].forEach(s=>{const o=i[s];yt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[mo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:j3,detach:H3,resize:B3}[t]||U3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:Cr,detach:Cr,resize:Cr}[t]||R3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return Rw(e,t,i,l)}isAttached(e){const t=Ka(e);return!!(t&&t.isConnected)}}function Y3(n){return!_b()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?L3:W3}var oo;let Is=(oo=class{constructor(){Ue(this,"x");Ue(this,"y");Ue(this,"active",!1);Ue(this,"options");Ue(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Io(this.x)&&Io(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}},Ue(oo,"defaults",{}),Ue(oo,"defaultRoutes"),oo);function K3(n,e){const t=n.options.ticks,i=J3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?G3(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return X3(e,u,s,o/l),u;const f=Z3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Gs(e,u,f,yt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function G3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,xf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,ec=(n,e)=>Math.min(e||n,n);function tc(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function t4(n,e){gt(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:vn(t,vn(i,t)),max:vn(i,vn(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||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){qt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,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=hw(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=Kn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Kl(e.grid)-t.padding-nc(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=qa(Math.min(Math.asin(Kn((f.highest.height+6)/r,-1,1)),Math.asin(Kn(a/u,-1,1))-Math.asin(Kn(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){qt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=nc(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Kl(s)+a):(e.height=this.maxHeight,e.width=Kl(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,g=Mi(this.labelRotation),h=Math.cos(g),_=Math.sin(g);if(r){const k=i.mirror?0:_*c.width+h*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:h*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,_,h)}}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,l){const{ticks:{align:s,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,m=0;a?u?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;s==="start"?(f=0,c=e.height):s==="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(){qt(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:o[L]||0,height:r[L]||0});return{first:E(0),last:E(t-1),widest:E(D),highest:E(O),widths:o,heights:r}}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 B2(this._alignToPixels?Vi(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*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Kl(s),m=[],g=r.setContext(this.getContext()),h=g.display?g.width:0,_=h/2,k=function(G){return Vi(i,G,h)};let S,$,T,C,D,O,E,L,R,P,F,N;if(o==="top")S=k(this.bottom),O=this.bottom-d,L=S-_,P=k(e.top)+_,N=e.bottom;else if(o==="bottom")S=k(this.top),P=e.top,N=k(e.bottom)-_,O=S+_,L=this.top+d;else if(o==="left")S=k(this.right),D=this.right-d,E=S-_,R=k(e.left)+_,F=e.right;else if(o==="right")S=k(this.left),R=e.left,F=k(e.right)-_,D=S+_,E=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(it(o)){const G=Object.keys(o)[0],J=o[G];S=k(this.chart.scales[G].getPixelForValue(J))}P=e.top,N=e.bottom,O=S+_,L=O+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(it(o)){const G=Object.keys(o)[0],J=o[G];S=k(this.chart.scales[G].getPixelForValue(J))}D=S-_,E=D-d,R=e.left,F=e.right}const q=ht(l.ticks.maxTicksLimit,c),W=Math.max(1,Math.ceil(c/q));for($=0;$s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,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(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");zt.route(s,l,a,r)})}function a4(n){return"id"in n&&"defaults"in n}class u4{constructor(){this.controllers=new Xs(rs,"datasets",!0),this.elements=new Xs(Is,"elements"),this.plugins=new Xs(Object,"plugins"),this.scales=new Xs(ol,"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(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):gt(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Ra(e);qt(i["before"+l],[],i),t[e](i),qt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function c4(n){const e={},t=[],i=Object.keys(xn.plugins.items);for(let s=0;s1&&ic(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function lc(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function b4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return lc(n,"x",t[0])||lc(n,"y",t[0])}return{}}function y4(n,e){const t=tl[n.type]||{scales:{}},i=e.scales||{},l=sa(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!it(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=oa(o,r,b4(o,n),zt.scales[r.type]),u=g4(a,l),f=t.scales||{};s[o]=is(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||sa(r,e),f=(tl[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=h4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),is(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];is(r,[zt.scales[r.type],zt.scale])}),s}function Eb(n){const e=n.options||(n.options={});e.plugins=ht(e.plugins,{}),e.scales=y4(n,e)}function Ab(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function k4(n){return n=n||{},n.data=Ab(n.data),Eb(n),n}const sc=new Map,Ib=new Set;function Qs(n,e){let t=sc.get(n);return t||(t=e(),sc.set(n,t),Ib.add(t)),t}const Jl=(n,e,t)=>{const i=Ol(e,t);i!==void 0&&n.add(i)};class v4{constructor(e){this._config=k4(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=Ab(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(),Eb(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Qs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Qs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Qs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Qs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=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=>Jl(a,e,c))),f.forEach(c=>Jl(a,l,c)),f.forEach(c=>Jl(a,tl[s]||{},c)),f.forEach(c=>Jl(a,zt,c)),f.forEach(c=>Jl(a,la,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Ib.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,tl[t]||{},zt.datasets[t]||{},{type:t},zt,la]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=oc(this._resolverCache,e,l);let a=o;if(S4(o,t)){s.$shared=!1,i=Li(i)?i():i;const u=this.createResolver(e,i,r);a=Dl(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=oc(this._resolverCache,e,i);return it(t)?Dl(s,t,void 0,l):s}}function oc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Ua(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const w4=n=>it(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Li(n[t]),!1);function S4(n,e){const{isScriptable:t,isIndexable:i}=db(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Li(r)||w4(r))||o&&Ot(r))return!0}return!1}var T4="4.4.0";const $4=["top","bottom","left","right","chartArea"];function rc(n,e){return n==="top"||n==="bottom"||$4.indexOf(n)===-1&&e==="x"}function ac(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function uc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),qt(t&&t.onComplete,[n],e)}function C4(n){const e=n.chart,t=e.options.animation;qt(t&&t.onProgress,[n],e)}function Lb(n){return _b()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ho={},fc=n=>{const e=Lb(n);return Object.values(ho).filter(t=>t.canvas===e).pop()};function M4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function O4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function xs(n,e,t){return n.options.clip?n[t]:e[t]}function D4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:xs(t,e,"left"),right:xs(t,e,"right"),top:xs(i,e,"top"),bottom:xs(i,e,"bottom")}:e}class ci{static register(...e){xn.add(...e),cc()}static unregister(...e){xn.remove(...e),cc()}constructor(e,t){const i=this.config=new v4(t),l=Lb(e),s=fc(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Y3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=E2(),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 f4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=K2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],ho[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",uc),ai.listen(this,"progress",C4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return yt(e)?t&&s?s:l?i/l: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}get registry(){return xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():If(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Of(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,If(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),qt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};gt(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=oa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),gt(s,o=>{const r=o.options,a=r.id,u=oa(a,r),f=ht(r.type,o.dtype);(r.position===void 0||rc(r.position,u)!==rc(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=xn.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),gt(l,(o,r)=>{o||delete i[r]}),gt(i,o=>{Zs.configure(this,o,o.options),Zs.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=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()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=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(ac("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){gt(this.scales,e=>{Zs.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!bf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;M4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Zs.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],gt(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),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,l=!i.disabled,s=D4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Va(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Ba(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return Oi(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=$3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={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(l)),l}getContext(){return this.$context||(this.$context=Fi(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 l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);hs(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l: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(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};gt(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){gt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},gt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Do(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=N2(e),u=O4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,qt(s.onHover,[e,r,this],this),a&&qt(s.onClick,[e,r,this],this));const f=!Do(r,l);return(f||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ue(ci,"defaults",zt),Ue(ci,"instances",ho),Ue(ci,"overrides",tl),Ue(ci,"registry",xn),Ue(ci,"version",T4),Ue(ci,"getChart",fc);function cc(){return gt(ci.instances,n=>n._plugins.invalidate())}function Pb(n,e,t=e){n.lineCap=ht(t.borderCapStyle,e.borderCapStyle),n.setLineDash(ht(t.borderDash,e.borderDash)),n.lineDashOffset=ht(t.borderDashOffset,e.borderDashOffset),n.lineJoin=ht(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=ht(t.borderWidth,e.borderWidth),n.strokeStyle=ht(t.borderColor,e.borderColor)}function E4(n,e,t){n.lineTo(t.x,t.y)}function A4(n){return n.stepped?ow:n.tension||n.cubicInterpolationMode==="monotone"?rw:E4}function Fb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),u=Math.min(s,r),f=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%s,$=()=>{h!==_&&(n.lineTo(f,_),n.lineTo(f,h),n.lineTo(f,k))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const T=m.x,C=m.y,D=T|0;D===g?(C_&&(_=C),f=(c*f+T)/++c):($(),n.lineTo(T,C),g=D,c=0,h=_=C),k=C}$()}function ra(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?L4:I4}function P4(n){return n.stepped?jw:n.tension||n.cubicInterpolationMode==="monotone"?Hw:Ji}function F4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Pb(n,e.options),n.stroke(l)}function N4(n,e,t,i){const{segments:l,options:s}=e,o=ra(e);for(const r of l)Pb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const R4=typeof Path2D=="function";function q4(n,e,t,i){R4&&!e.options.segment?F4(n,e,t,i):N4(n,e,t,i)}class Gi extends Is{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 l=i.spanGaps?this._loop:this._fullLoop;Aw(this._points,i,e,l,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=Jw(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,l=e[t],s=this.points,o=kb(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=P4(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Nb(n,e){const{x:t,y:i,base:l,width:s,height:o}=n.getProps(["x","y","base","width","height"],e);let r,a,u,f,c;return n.horizontal?(c=o/2,r=Math.min(t,l),a=Math.max(t,l),u=i-c,f=i+c):(c=s/2,r=t-c,a=t+c,u=Math.min(i,l),f=Math.max(i,l)),{left:r,top:u,right:a,bottom:f}}function Di(n,e,t,i){return n?0:Kn(e,t,i)}function j4(n,e,t){const i=n.options.borderWidth,l=n.borderSkipped,s=cb(i);return{t:Di(l.top,s.top,0,t),r:Di(l.right,s.right,0,e),b:Di(l.bottom,s.bottom,0,t),l:Di(l.left,s.left,0,e)}}function H4(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),l=n.options.borderRadius,s=wl(l),o=Math.min(e,t),r=n.borderSkipped,a=i||it(l);return{topLeft:Di(!a||r.top||r.left,s.topLeft,0,o),topRight:Di(!a||r.top||r.right,s.topRight,0,o),bottomLeft:Di(!a||r.bottom||r.left,s.bottomLeft,0,o),bottomRight:Di(!a||r.bottom||r.right,s.bottomRight,0,o)}}function z4(n){const e=Nb(n),t=e.right-e.left,i=e.bottom-e.top,l=j4(n,t/2,i/2),s=H4(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:s},inner:{x:e.left+l.l,y:e.top+l.t,w:t-l.l-l.r,h:i-l.t-l.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(l.t,l.l)),topRight:Math.max(0,s.topRight-Math.max(l.t,l.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(l.b,l.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(l.b,l.r))}}}}function Mr(n,e,t,i){const l=e===null,s=t===null,r=n&&!(l&&s)&&Nb(n,i);return r&&(l||Lo(e,r.left,r.right))&&(s||Lo(t,r.top,r.bottom))}function V4(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function B4(n,e){n.rect(e.x,e.y,e.w,e.h)}function Or(n,e,t={}){const i=n.x!==t.x?-e:0,l=n.y!==t.y?-e:0,s=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-l;return{x:n.x+i,y:n.y+l,w:n.w+s,h:n.h+o,radius:n.radius}}class go extends Is{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:l}}=this,{inner:s,outer:o}=z4(this),r=V4(o.radius)?No:B4;e.save(),(o.w!==s.w||o.h!==s.h)&&(e.beginPath(),r(e,Or(o,t,s)),e.clip(),r(e,Or(s,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,Or(s,t)),e.fillStyle=l,e.fill(),e.restore()}inRange(e,t,i){return Mr(this,e,t,i)}inXRange(e,t){return Mr(this,e,null,t)}inYRange(e,t){return Mr(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:l,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(t+l)/2:t,y:s?i:(i+l)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Ue(go,"id","bar"),Ue(go,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ue(go,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function U4(n,e,t){const i=n.segments,l=n.points,s=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=Za(a,u,l);const f=aa(t,l[a],l[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:l[a],end:l[u]});continue}const c=kb(e,f);for(const d of c){const m=aa(t,s[d.start],s[d.end],d.loop),g=yb(r,l,m);for(const h of g)o.push({source:h,target:d,start:{[t]:dc(f,m,"start",Math.max)},end:{[t]:dc(f,m,"end",Math.min)}})}}return o}function aa(n,e,t,i){if(i)return;let l=e[n],s=t[n];return n==="angle"&&(l=Sn(l),s=Sn(s)),{property:n,start:l,end:s}}function W4(n,e){const{x:t=null,y:i=null}=n||{},l=e.points,s=[];return e.segments.forEach(({start:o,end:r})=>{r=Za(o,r,l);const a=l[o],u=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:u.y}))}),s}function Za(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function dc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Rb(n,e){let t=[],i=!1;return Ot(n)?(i=!0,t=n):t=W4(n,e),t.length?new Gi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function pc(n){return n&&n.fill!==!1}function Y4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!jt(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function K4(n,e,t){const i=X4(n);if(it(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return jt(l)&&Math.floor(l)===l?J4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function J4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function Z4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:it(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function G4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:it(n)?i=n.value:i=e.getBaseValue(),i}function X4(n){const e=n.options,t=e.fill;let i=ht(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Q4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=x4(e,t);r.push(Rb({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&Dr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;pc(s)&&Dr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!pc(i)||t.drawTime!=="beforeDatasetDraw"||Dr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const es={average(n){if(!n.length)return!1;let e,t,i=0,l=0,s=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=ab.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.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,l)=>Math.max(i,l._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 l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new Qw;const qf="transparent",xw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Mf(n||qf),l=i.valid&&Mf(e||qf);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class e3{constructor(e,t,i,l){const s=t[i];l=Us([e.to,l,s,e.from]);const o=Us([e.from,s,l]);this._active=!0,this._fn=e.fn||xw[e.type||typeof o],this._easing=ls[e.easing]||ls.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=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Us([e.to,t,l,e.from]),this._from=Us([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,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 l=0;l{const s=e[l];if(!it(s))return;const o={};for(const r of t)o[r]=s[r];(Ot(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=n3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&t3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=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"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[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}s[u]=c=new e3(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function t3(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function Bf(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,u=o.axis,f=o3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function u3(n,e){return Fi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function f3(n,e,t){return Fi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Bl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const vr=n=>n==="reset"||n==="none",Uf=(n,e)=>e?n:Object.assign({},n),c3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Sb(t,!0),values:null};class os{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.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=zf(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Bl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,g)=>c==="x"?d:c==="r"?g:m,s=t.xAxisID=ht(i.xAxisID,kr(e,"x")),o=t.yAxisID=ht(i.yAxisID,kr(e,"y")),r=t.rAxisID=ht(i.rAxisID,kr(e,"r")),a=t.indexAxis,u=t.iAxisID=l(a,s,o,r),f=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),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&&Sf(this._data,this),e._stacked&&Bl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(it(t))this._data=s3(t);else if(i!==t){if(i){Sf(i,this);const l=this._cachedMeta;Bl(l),l._parsed=[]}t&&Object.isExtensible(t)&&K2(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 l=!1;this._dataCheck();const s=t._stacked;t._stacked=zf(t.vScale,t),t.stack!==i.stack&&(l=!0,Bl(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&Bf(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:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Ot(l[e])?d=this.parseArrayData(i,l,e,t):it(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]h||c=0;--d)if(!g()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),h=u.resolveNamedOptions(d,m,g,c);return h.$shared&&(h.$shared=a,s[o]=Object.freeze(Uf(h,a))),h}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.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 wb(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||vr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){vr(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!vr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}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 l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;rl-s))}return n._cache.$bar}function p3(n){const e=n.iScale,t=d3(e,n.type);let i=e._length,l,s,o,r;const a=()=>{o===32767||o===-32768||(ms(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(l=0,s=t.length;l0?l[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:l,end:s,min:o,max:r}}function Tb(n,e,t,i){return Ot(n)?g3(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Wf(n,e,t,i){const l=n.iScale,s=n.vScale,o=l.getLabels(),r=l===s,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function b3(n){let e,t,i,l,s;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),s=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(yt(f)||isNaN(f))return!0};for(const a of l)if(!(t!==void 0&&r(a))&&((s===!1||o.indexOf(a.stack)===-1||s===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 l=this._getStacks(e,i),s=t!==void 0?l.indexOf(t):-1;return s===-1?l.length-1:s}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,l=[];let s,o;for(s=0,o=t.data.length;s{a[o](e[t],l)&&(s.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var C3={evaluateInteractionItems:Es,modes:{index(n,e,t,i){const l=Ki(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?Sr(n,l,s,i,o):Tr(n,l,s,!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 l=Ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?Sr(n,l,s,i,o):Tr(n,l,s,!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=>Cb.indexOf(t.pos)===-1&&t.box.axis===e)}function Wl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function M3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Wl(Ul(e,"left"),!0),l=Wl(Ul(e,"right")),s=Wl(Ul(e,"top"),!0),o=Wl(Ul(e,"bottom")),r=Zf(e,"x"),a=Zf(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:Ul(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Gf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Mb(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 A3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!it(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Mb(o,s.getPadding());const r=Math.max(0,e.outerWidth-Gf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Gf(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 I3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function L3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Ql(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s{typeof h.beforeLayout=="function"&&h.beforeLayout()});const f=a.reduce((h,_)=>_.box.options&&_.box.options.display===!1?h:h+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},l);Mb(d,Hn(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),g=D3(a.concat(u),c);Ql(r.fullSize,m,c,g),Ql(a,m,c,g),Ql(u,m,c,g)&&Ql(a,m,c,g),I3(m),Xf(r.leftAndTop,m,c,g),m.x+=m.w,m.y+=m.h,Xf(r.rightAndBottom,m,c,g),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},gt(r.chartArea,h=>{const _=h.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Ob{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class P3 extends Ob{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const po="$chartjs",F3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Qf=n=>n===null||n==="";function N3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[po]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Qf(l)){const s=Pf(n,"width");s!==void 0&&(n.width=s)}if(Qf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Pf(n,"height");s!==void 0&&(n.height=s)}return n}const Db=jw?{passive:!0}:!1;function R3(n,e,t){n.addEventListener(e,t,Db)}function q3(n,e,t){n.canvas.removeEventListener(e,t,Db)}function j3(n,e){const t=F3[n.type]||n.type,{x:i,y:l}=Ki(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function Ro(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function H3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Ro(r.addedNodes,i),o=o&&!Ro(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function z3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Ro(r.removedNodes,i),o=o&&!Ro(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const hs=new Map;let xf=0;function Eb(){const n=window.devicePixelRatio;n!==xf&&(xf=n,hs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function V3(n,e){hs.size||window.addEventListener("resize",Eb),hs.set(n,e)}function B3(n){hs.delete(n),hs.size||window.removeEventListener("resize",Eb)}function U3(n,e,t){const i=n.canvas,l=i&&Ja(i);if(!l)return;const s=ub((r,a)=>{const u=l.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),V3(n,s),o}function $r(n,e,t){t&&t.disconnect(),e==="resize"&&B3(n)}function W3(n,e,t){const i=n.canvas,l=ub(s=>{n.ctx!==null&&t(j3(s,n))},n);return R3(i,e,l),l}class Y3 extends Ob{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(N3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[po])return!1;const i=t[po].initial;["height","width"].forEach(s=>{const o=i[s];yt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[po],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:H3,detach:z3,resize:U3}[t]||W3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:$r,detach:$r,resize:$r}[t]||q3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return qw(e,t,i,l)}isAttached(e){const t=Ja(e);return!!(t&&t.isConnected)}}function K3(n){return!bb()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?P3:Y3}var so;let As=(so=class{constructor(){Ue(this,"x");Ue(this,"y");Ue(this,"active",!1);Ue(this,"options");Ue(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Ao(this.x)&&Ao(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}},Ue(so,"defaults",{}),Ue(so,"defaultRoutes"),so);function J3(n,e){const t=n.options.ticks,i=Z3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?X3(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return Q3(e,u,s,o/l),u;const f=G3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Zs(e,u,f,yt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function X3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,ec=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,tc=(n,e)=>Math.min(e||n,n);function nc(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function n4(n,e){gt(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:vn(t,vn(i,t)),max:vn(i,vn(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||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){qt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,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=gw(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=Kn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Yl(e.grid)-t.padding-ic(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=ja(Math.min(Math.asin(Kn((f.highest.height+6)/r,-1,1)),Math.asin(Kn(a/u,-1,1))-Math.asin(Kn(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){qt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=ic(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Yl(s)+a):(e.height=this.maxHeight,e.width=Yl(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,g=Mi(this.labelRotation),h=Math.cos(g),_=Math.sin(g);if(r){const k=i.mirror?0:_*c.width+h*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:h*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,_,h)}}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,l){const{ticks:{align:s,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,m=0;a?u?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;s==="start"?(f=0,c=e.height):s==="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(){qt(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:o[L]||0,height:r[L]||0});return{first:E(0),last:E(t-1),widest:E(D),highest:E(O),widths:o,heights:r}}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 U2(this._alignToPixels?Vi(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*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Yl(s),m=[],g=r.setContext(this.getContext()),h=g.display?g.width:0,_=h/2,k=function(G){return Vi(i,G,h)};let S,$,T,C,D,O,E,L,R,P,F,N;if(o==="top")S=k(this.bottom),O=this.bottom-d,L=S-_,P=k(e.top)+_,N=e.bottom;else if(o==="bottom")S=k(this.top),P=e.top,N=k(e.bottom)-_,O=S+_,L=this.top+d;else if(o==="left")S=k(this.right),D=this.right-d,E=S-_,R=k(e.left)+_,F=e.right;else if(o==="right")S=k(this.left),R=e.left,F=k(e.right)-_,D=S+_,E=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(it(o)){const G=Object.keys(o)[0],J=o[G];S=k(this.chart.scales[G].getPixelForValue(J))}P=e.top,N=e.bottom,O=S+_,L=O+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(it(o)){const G=Object.keys(o)[0],J=o[G];S=k(this.chart.scales[G].getPixelForValue(J))}D=S-_,E=D-d,R=e.left,F=e.right}const q=ht(l.ticks.maxTicksLimit,c),W=Math.max(1,Math.ceil(c/q));for($=0;$s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,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(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");zt.route(s,l,a,r)})}function u4(n){return"id"in n&&"defaults"in n}class f4{constructor(){this.controllers=new Gs(os,"datasets",!0),this.elements=new Gs(As,"elements"),this.plugins=new Gs(Object,"plugins"),this.scales=new Gs(ol,"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(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):gt(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=qa(e);qt(i["before"+l],[],i),t[e](i),qt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function d4(n){const e={},t=[],i=Object.keys(xn.plugins.items);for(let s=0;s1&&lc(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function sc(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function y4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return sc(n,"x",t[0])||sc(n,"y",t[0])}return{}}function k4(n,e){const t=tl[n.type]||{scales:{}},i=e.scales||{},l=oa(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!it(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=ra(o,r,y4(o,n),zt.scales[r.type]),u=_4(a,l),f=t.scales||{};s[o]=ns(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||oa(r,e),f=(tl[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=g4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),ns(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];ns(r,[zt.scales[r.type],zt.scale])}),s}function Ab(n){const e=n.options||(n.options={});e.plugins=ht(e.plugins,{}),e.scales=k4(n,e)}function Ib(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function v4(n){return n=n||{},n.data=Ib(n.data),Ab(n),n}const oc=new Map,Lb=new Set;function Xs(n,e){let t=oc.get(n);return t||(t=e(),oc.set(n,t),Lb.add(t)),t}const Kl=(n,e,t)=>{const i=Ml(e,t);i!==void 0&&n.add(i)};class w4{constructor(e){this._config=v4(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=Ib(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(),Ab(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Xs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Xs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Xs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Xs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=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=>Kl(a,e,c))),f.forEach(c=>Kl(a,l,c)),f.forEach(c=>Kl(a,tl[s]||{},c)),f.forEach(c=>Kl(a,zt,c)),f.forEach(c=>Kl(a,sa,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Lb.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,tl[t]||{},zt.datasets[t]||{},{type:t},zt,sa]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=rc(this._resolverCache,e,l);let a=o;if(T4(o,t)){s.$shared=!1,i=Li(i)?i():i;const u=this.createResolver(e,i,r);a=Ol(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=rc(this._resolverCache,e,i);return it(t)?Ol(s,t,void 0,l):s}}function rc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Wa(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const S4=n=>it(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Li(n[t]),!1);function T4(n,e){const{isScriptable:t,isIndexable:i}=pb(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Li(r)||S4(r))||o&&Ot(r))return!0}return!1}var $4="4.4.0";const C4=["top","bottom","left","right","chartArea"];function ac(n,e){return n==="top"||n==="bottom"||C4.indexOf(n)===-1&&e==="x"}function uc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function fc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),qt(t&&t.onComplete,[n],e)}function M4(n){const e=n.chart,t=e.options.animation;qt(t&&t.onProgress,[n],e)}function Pb(n){return bb()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const mo={},cc=n=>{const e=Pb(n);return Object.values(mo).filter(t=>t.canvas===e).pop()};function O4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function D4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function Qs(n,e,t){return n.options.clip?n[t]:e[t]}function E4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Qs(t,e,"left"),right:Qs(t,e,"right"),top:Qs(i,e,"top"),bottom:Qs(i,e,"bottom")}:e}class ci{static register(...e){xn.add(...e),dc()}static unregister(...e){xn.remove(...e),dc()}constructor(e,t){const i=this.config=new w4(t),l=Pb(e),s=cc(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||K3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=A2(),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 c4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=J2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],mo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",fc),ai.listen(this,"progress",M4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return yt(e)?t&&s?s:l?i/l: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}get registry(){return xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Lf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Df(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Lf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),qt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};gt(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.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"}}))),gt(s,o=>{const r=o.options,a=r.id,u=ra(a,r),f=ht(r.type,o.dtype);(r.position===void 0||ac(r.position,u)!==ac(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=xn.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),gt(l,(o,r)=>{o||delete i[r]}),gt(i,o=>{Js.configure(this,o,o.options),Js.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=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()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=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(uc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){gt(this.scales,e=>{Js.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!yf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;O4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Js.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],gt(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),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,l=!i.disabled,s=E4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Ba(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Ua(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return Oi(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=C3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={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(l)),l}getContext(){return this.$context||(this.$context=Fi(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 l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);ms(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l: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(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};gt(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){gt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},gt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Oo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=R2(e),u=D4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,qt(s.onHover,[e,r,this],this),a&&qt(s.onClick,[e,r,this],this));const f=!Oo(r,l);return(f||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ue(ci,"defaults",zt),Ue(ci,"instances",mo),Ue(ci,"overrides",tl),Ue(ci,"registry",xn),Ue(ci,"version",$4),Ue(ci,"getChart",cc);function dc(){return gt(ci.instances,n=>n._plugins.invalidate())}function Fb(n,e,t=e){n.lineCap=ht(t.borderCapStyle,e.borderCapStyle),n.setLineDash(ht(t.borderDash,e.borderDash)),n.lineDashOffset=ht(t.borderDashOffset,e.borderDashOffset),n.lineJoin=ht(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=ht(t.borderWidth,e.borderWidth),n.strokeStyle=ht(t.borderColor,e.borderColor)}function A4(n,e,t){n.lineTo(t.x,t.y)}function I4(n){return n.stepped?rw:n.tension||n.cubicInterpolationMode==="monotone"?aw:A4}function Nb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),u=Math.min(s,r),f=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%s,$=()=>{h!==_&&(n.lineTo(f,_),n.lineTo(f,h),n.lineTo(f,k))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const T=m.x,C=m.y,D=T|0;D===g?(C_&&(_=C),f=(c*f+T)/++c):($(),n.lineTo(T,C),g=D,c=0,h=_=C),k=C}$()}function aa(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?P4:L4}function F4(n){return n.stepped?Hw:n.tension||n.cubicInterpolationMode==="monotone"?zw:Ji}function N4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Fb(n,e.options),n.stroke(l)}function R4(n,e,t,i){const{segments:l,options:s}=e,o=aa(e);for(const r of l)Fb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const q4=typeof Path2D=="function";function j4(n,e,t,i){q4&&!e.options.segment?N4(n,e,t,i):R4(n,e,t,i)}class Gi extends As{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 l=i.spanGaps?this._loop:this._fullLoop;Iw(this._points,i,e,l,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=Zw(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,l=e[t],s=this.points,o=vb(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=F4(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Rb(n,e){const{x:t,y:i,base:l,width:s,height:o}=n.getProps(["x","y","base","width","height"],e);let r,a,u,f,c;return n.horizontal?(c=o/2,r=Math.min(t,l),a=Math.max(t,l),u=i-c,f=i+c):(c=s/2,r=t-c,a=t+c,u=Math.min(i,l),f=Math.max(i,l)),{left:r,top:u,right:a,bottom:f}}function Di(n,e,t,i){return n?0:Kn(e,t,i)}function H4(n,e,t){const i=n.options.borderWidth,l=n.borderSkipped,s=db(i);return{t:Di(l.top,s.top,0,t),r:Di(l.right,s.right,0,e),b:Di(l.bottom,s.bottom,0,t),l:Di(l.left,s.left,0,e)}}function z4(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),l=n.options.borderRadius,s=vl(l),o=Math.min(e,t),r=n.borderSkipped,a=i||it(l);return{topLeft:Di(!a||r.top||r.left,s.topLeft,0,o),topRight:Di(!a||r.top||r.right,s.topRight,0,o),bottomLeft:Di(!a||r.bottom||r.left,s.bottomLeft,0,o),bottomRight:Di(!a||r.bottom||r.right,s.bottomRight,0,o)}}function V4(n){const e=Rb(n),t=e.right-e.left,i=e.bottom-e.top,l=H4(n,t/2,i/2),s=z4(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:s},inner:{x:e.left+l.l,y:e.top+l.t,w:t-l.l-l.r,h:i-l.t-l.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(l.t,l.l)),topRight:Math.max(0,s.topRight-Math.max(l.t,l.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(l.b,l.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(l.b,l.r))}}}}function Cr(n,e,t,i){const l=e===null,s=t===null,r=n&&!(l&&s)&&Rb(n,i);return r&&(l||Io(e,r.left,r.right))&&(s||Io(t,r.top,r.bottom))}function B4(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function U4(n,e){n.rect(e.x,e.y,e.w,e.h)}function Mr(n,e,t={}){const i=n.x!==t.x?-e:0,l=n.y!==t.y?-e:0,s=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-l;return{x:n.x+i,y:n.y+l,w:n.w+s,h:n.h+o,radius:n.radius}}class ho extends As{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:l}}=this,{inner:s,outer:o}=V4(this),r=B4(o.radius)?Fo:U4;e.save(),(o.w!==s.w||o.h!==s.h)&&(e.beginPath(),r(e,Mr(o,t,s)),e.clip(),r(e,Mr(s,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,Mr(s,t)),e.fillStyle=l,e.fill(),e.restore()}inRange(e,t,i){return Cr(this,e,t,i)}inXRange(e,t){return Cr(this,e,null,t)}inYRange(e,t){return Cr(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:l,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(t+l)/2:t,y:s?i:(i+l)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Ue(ho,"id","bar"),Ue(ho,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ue(ho,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function W4(n,e,t){const i=n.segments,l=n.points,s=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=Ga(a,u,l);const f=ua(t,l[a],l[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:l[a],end:l[u]});continue}const c=vb(e,f);for(const d of c){const m=ua(t,s[d.start],s[d.end],d.loop),g=kb(r,l,m);for(const h of g)o.push({source:h,target:d,start:{[t]:pc(f,m,"start",Math.max)},end:{[t]:pc(f,m,"end",Math.min)}})}}return o}function ua(n,e,t,i){if(i)return;let l=e[n],s=t[n];return n==="angle"&&(l=Sn(l),s=Sn(s)),{property:n,start:l,end:s}}function Y4(n,e){const{x:t=null,y:i=null}=n||{},l=e.points,s=[];return e.segments.forEach(({start:o,end:r})=>{r=Ga(o,r,l);const a=l[o],u=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:u.y}))}),s}function Ga(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function pc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function qb(n,e){let t=[],i=!1;return Ot(n)?(i=!0,t=n):t=Y4(n,e),t.length?new Gi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function mc(n){return n&&n.fill!==!1}function K4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!jt(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function J4(n,e,t){const i=Q4(n);if(it(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return jt(l)&&Math.floor(l)===l?Z4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Z4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function G4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:it(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function X4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:it(n)?i=n.value:i=e.getBaseValue(),i}function Q4(n){const e=n.options,t=e.fill;let i=ht(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function x4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=eS(e,t);r.push(qb({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&Or(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;mc(s)&&Or(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!mc(i)||t.drawTime!=="beforeDatasetDraw"||Or(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xl={average(n){if(!n.length)return!1;let e,t,i=0,l=0,s=0;for(e=0,t=n.length;e-1?n.split(` -`):n}function fS(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function _c(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Cn(e.bodyFont),u=Cn(e.titleFont),f=Cn(e.footerFont),c=s.length,d=l.length,m=i.length,g=Hn(e.padding);let h=g.height,_=0,k=i.reduce((T,C)=>T+C.before.length+C.lines.length+C.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(h+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;h+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(h+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,gt(n.title,$),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,gt(i,T=>{gt(T.before,$),gt(T.lines,$),gt(T.after,$)}),S=0,t.font=f.string,gt(n.footer,$),t.restore(),_+=g.width,{width:_,height:h}}function cS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function dS(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function pS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),dS(u,n,e,t)&&(u="center"),u}function bc(n,e,t){const i=t.yAlign||e.yAlign||cS(n,t);return{xAlign:t.xAlign||e.xAlign||pS(n,e,t,i),yAlign:i}}function mS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function hS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function yc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=wl(o);let g=mS(e,r);const h=hS(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+l:r==="right"&&(g+=Math.max(c,m)+l),{x:Kn(g,0,i.width-e.width),y:Kn(h,0,i.height-e.height)}}function eo(n,e,t){const i=Hn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function kc(n){return Qn([],ui(n))}function gS(n,e,t){return Fi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function vc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const jb={beforeTitle:ri,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.dataIndex"u"?jb[e].call(t,i):l}class ua extends Is{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,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()),l=i.enabled&&t.options.animation&&i.animations,s=new vb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=gS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=dn(i,"beforeTitle",this,e),s=dn(i,"title",this,e),o=dn(i,"afterTitle",this,e);let r=[];return r=Qn(r,ui(l)),r=Qn(r,ui(s)),r=Qn(r,ui(o)),r}getBeforeBody(e,t){return kc(dn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return gt(e,s=>{const o={before:[],lines:[],after:[]},r=vc(i,s);Qn(o.before,ui(dn(r,"beforeLabel",this,s))),Qn(o.lines,dn(r,"label",this,s)),Qn(o.after,ui(dn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return kc(dn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=dn(i,"beforeFooter",this,e),s=dn(i,"footer",this,e),o=dn(i,"afterFooter",this,e);let r=[];return r=Qn(r,ui(l)),r=Qn(r,ui(s)),r=Qn(r,ui(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],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))),gt(r,f=>{const c=vc(e.callbacks,f);l.push(dn(c,"labelColor",this,f)),s.push(dn(c,"labelPointStyle",this,f)),o.push(dn(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=es[i.position].call(this,l,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=_c(this,i),u=Object.assign({},r,a),f=bc(this.chart,i,u),c=yc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={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,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=wl(r),{x:d,y:m}=e,{width:g,height:h}=t;let _,k,S,$,T,C;return s==="center"?(T=m+h/2,l==="left"?(_=d,k=_-o,$=T+o,C=T-o):(_=d+g,k=_+o,$=T-o,C=T+o),S=_):(l==="left"?k=d+Math.max(a,f)+o:l==="right"?k=d+g-Math.max(u,c)-o:k=this.caretX,s==="top"?($=m,T=$-o,_=k-o,S=k+o):($=m+h,T=$+o,_=k+o,S=k-o),C=$),{x1:_,x2:k,x3:S,y1:$,y2:T,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=kr(i.rtl,this.x,this.width);for(e.x=eo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Cn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,No(e,{x:h,y:g,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),No(e,{x:_,y:g+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(h,g,u,a),e.strokeRect(h,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(_,g+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Cn(i.bodyFont);let d=c.lineHeight,m=0;const g=kr(i.rtl,this.x,this.width),h=function(E){t.fillText(E,g.x(e.x+m),e.y+d/2),e.y+=d+s},_=g.textAlign(o);let k,S,$,T,C,D,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=eo(this,_,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,h),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,D=l.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=es[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=_c(this,e),a=Object.assign({},o,this._size),u=bc(t,e,a),f=yc(e,a,u,t);(l._to!==f.x||s._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 l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Hn(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(s,e,l,t),Bw(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Uw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=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}}),s=!Do(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Do(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t;const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=es[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ue(ua,"positioners",es);var _S={id:"tooltip",_element:ua,positioners:es,afterInit(n,e,t){t&&(n.tooltip=new ua({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,cancelable:!0})===!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:jb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const bS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function yS(n,e,t,i){const l=n.indexOf(e);if(l===-1)return bS(n,e,t,i);const s=n.lastIndexOf(e);return l!==s?t:l}const kS=(n,e)=>n===null?null:Kn(Math.round(n),0,e);function wc(n){const e=this.getLabels();return n>=0&&nt.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Ue(fa,"id","category"),Ue(fa,"defaults",{ticks:{callback:wc}});function vS(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=s||1,g=f-1,{min:h,max:_}=e,k=!yt(o),S=!yt(r),$=!yt(u),T=(_-h)/(c+1);let C=kf((_-h)/g/m)*m,D,O,E,L;if(C<1e-14&&!k&&!S)return[{value:h},{value:_}];L=Math.ceil(_/C)-Math.floor(h/C),L>g&&(C=kf(L*C/g/m)*m),yt(a)||(D=Math.pow(10,a),C=Math.ceil(C*D)/D),l==="ticks"?(O=Math.floor(h/C)*C,E=Math.ceil(_/C)*C):(O=h,E=_),k&&S&&s&&H2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,f)),C=(r-o)/L,O=o,E=r):$?(O=k?o:O,E=S?r:E,L=u-1,C=(E-O)/L):(L=(E-O)/C,ls(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(vf(C),vf(O));D=Math.pow(10,yt(a)?R:a),O=Math.round(O*D)/D,E=Math.round(E*D)/D;let P=0;for(k&&(d&&O!==o?(t.push({value:o}),Or)break;t.push({value:F})}return S&&d&&E!==r?t.length&&ls(t[t.length-1].value,r,Sc(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||E===r)&&t.push({value:E}),t}function Sc(n,e,{horizontal:t,minRotation:i}){const l=Mi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class jo extends ol{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return yt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=ti(l),u=ti(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={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},s=this._range||this,o=vS(l,s);return e.bounds==="ticks"&&ib(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 l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return za(e,this.chart.options.locale,this.options.ticks.format)}}class ca extends jo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=jt(e)?e:0,this.max=jt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Mi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ue(ca,"id","linear"),Ue(ca,"defaults",{ticks:{callback:er.formatters.numeric}});const _s=n=>Math.floor(Ci(n)),Ui=(n,e)=>Math.pow(10,_s(n)+e);function Tc(n){return n/Math.pow(10,_s(n))===1}function $c(n,e,t){const i=Math.pow(10,t),l=Math.floor(n/i);return Math.ceil(e/i)-l}function wS(n,e){const t=e-n;let i=_s(t);for(;$c(n,e,i)>10;)i++;for(;$c(n,e,i)<10;)i--;return Math.min(i,_s(n))}function SS(n,{min:e,max:t}){e=vn(n.min,e);const i=[],l=_s(e);let s=wS(e,t),o=s<0?Math.pow(10,Math.abs(s)):1;const r=Math.pow(10,s),a=l>s?Math.pow(10,l):0,u=Math.round((e-a)*o)/o,f=Math.floor((e-a)/r/10)*r*10;let c=Math.floor((u-f)/Math.pow(10,s)),d=vn(n.min,Math.round((a+f+c*Math.pow(10,s))*o)/o);for(;d=10?c=c<15?15:20:c++,c>=20&&(s++,c=2,o=s>=0?1:o),d=Math.round((a+f+c*Math.pow(10,s))*o)/o;const m=vn(n.max,d);return i.push({value:m,major:Tc(m),significand:c}),i}class Cc extends ol{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=jo.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return jt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=jt(e)?Math.max(0,e):null,this.max=jt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!jt(this._userMin)&&(this.min=e===Ui(this.min,0)?Ui(this.min,-1):Ui(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,l=this.max;const s=r=>i=e?i:r,o=r=>l=t?l:r;i===l&&(i<=0?(s(1),o(10)):(s(Ui(i,-1)),o(Ui(l,1)))),i<=0&&s(Ui(l,-1)),l<=0&&o(Ui(i,1)),this.min=i,this.max=l}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=SS(t,this);return e.bounds==="ticks"&&ib(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":za(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Ci(e),this._valueRange=Ci(this.max)-Ci(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ci(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}Ue(Cc,"id","logarithmic"),Ue(Cc,"defaults",{ticks:{callback:er.formatters.logarithmic,major:{enabled:!0}}});function da(n){const e=n.ticks;if(e.display&&n.display){const t=Hn(e.backdropPadding);return ht(e.font&&e.font.size,zt.font.size)+t.height}return 0}function TS(n,e,t){return t=Ot(t)?t:[t],{w:lw(n,e.string,t),h:t.length*e.lineHeight}}function Mc(n,e,t,i,l){return n===i||n===l?{start:e-t/2,end:e+t/2}:nl?{start:e-t,end:e}:{start:e,end:e+t}}function $S(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=[],l=[],s=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?xt/s:0;for(let a=0;ae.r&&(r=(i.end-e.r)/s,n.r=Math.max(n.r,e.r+r)),l.starte.b&&(a=(l.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function MS(n,e,t){const i=n.drawingArea,{extra:l,additionalAngle:s,padding:o,size:r}=t,a=n.getPointPosition(e,i+l+o,s),u=Math.round(qa(Sn(a.angle+$n))),f=IS(a.y,r.h,u),c=ES(u),d=AS(a.x,r.w,c);return{visible:!0,x:a.x,y:f,textAlign:c,left:d,top:f,right:d+r.w,bottom:f+r.h}}function OS(n,e){if(!e)return!0;const{left:t,top:i,right:l,bottom:s}=n;return!(Oi({x:t,y:i},e)||Oi({x:t,y:s},e)||Oi({x:l,y:i},e)||Oi({x:l,y:s},e))}function DS(n,e,t){const i=[],l=n._pointLabels.length,s=n.options,{centerPointLabels:o,display:r}=s.pointLabels,a={extra:da(s)/2,additionalAngle:o?xt/l:0};let u;for(let f=0;f270||t<90)&&(n-=e),n}function LS(n,e,t){const{left:i,top:l,right:s,bottom:o}=t,{backdropColor:r}=e;if(!yt(r)){const a=wl(e.borderRadius),u=Hn(e.backdropPadding);n.fillStyle=r;const f=i-u.left,c=l-u.top,d=s-i+u.width,m=o-l+u.height;Object.values(a).some(g=>g!==0)?(n.beginPath(),No(n,{x:f,y:c,w:d,h:m,radius:a}),n.fill()):n.fillRect(f,c,d,m)}}function PS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let l=e-1;l>=0;l--){const s=n._pointLabelItems[l];if(!s.visible)continue;const o=i.setContext(n.getPointLabelContext(l));LS(t,o,s);const r=Cn(o.font),{x:a,y:u,textAlign:f}=s;Fo(t,n._pointLabels[l],a,u+r.lineHeight/2,r,{color:o.color,textAlign:f,textBaseline:"middle"})}}function Hb(n,e,t,i){const{ctx:l}=n;if(t)l.arc(n.xCenter,n.yCenter,e,0,On);else{let s=n.getPointPosition(0,e);l.moveTo(s.x,s.y);for(let o=1;o{const l=qt(this.options.pointLabels.callback,[t,i],this);return l||l===0?l:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?$S(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,l){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-l)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,l))}getIndexAngle(e){const t=On/(this._pointLabels.length||1),i=this.options.startAngle||0;return Sn(e*t+Mi(i))}getDistanceFromCenterForValue(e){if(yt(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(yt(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(c!==0){a=this.getDistanceFromCenterForValue(f.value);const d=this.getContext(c),m=l.setContext(d),g=s.setContext(d);FS(this,m,a,o,g)}}),i.display){for(e.save(),r=o-1;r>=0;r--){const f=i.setContext(this.getPointLabelContext(r)),{color:c,lineWidth:d}=f;!d||!c||(e.lineWidth=d,e.strokeStyle=c,e.setLineDash(f.borderDash),e.lineDashOffset=f.borderDashOffset,a=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),u=this.getPointPosition(r,a),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const l=this.getIndexAngle(0);let s,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(l),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=Cn(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Hn(u.backdropPadding);e.fillRect(-o/2-c.left,-s-f.size/2-c.top,o+c.width,f.size+c.height)}Fo(e,r.label,0,-s,f,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}Ue(to,"id","radialLinear"),Ue(to,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:er.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),Ue(to,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ue(to,"descriptors",{angleLines:{_fallback:"grid"}});const nr={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}},hn=Object.keys(nr);function Oc(n,e){return n-e}function Dc(n,e){if(yt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),jt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Io(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Ec(n,e,t,i){const l=hn.length;for(let s=hn.indexOf(n);s=hn.indexOf(t);s--){const o=hn[s];if(nr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return hn[t?hn.indexOf(t):0]}function qS(n){for(let e=hn.indexOf(n)+1,t=hn.length;e=e?t[i]:t[l];n[s]=!0}}function jS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Ic(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Kn(t,0,o),i=Kn(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,l=this.options,s=l.time,o=s.unit||Ec(s.minUnit,t,i,this._getLabelCapacity(t)),r=ht(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Io(a)||a===!0,f={};let c=t,d,m;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=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+h)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return qt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:f))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=ia(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=ia(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const u=o-s;return u?r+(a-r)*(e-s)/u:r}class Lc extends bs{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,l=[],s=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&l.push(u);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(no(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return no(this._table,i*this._tableRange+this._minPos,!0)}}Ue(Lc,"id","timeseries"),Ue(Lc,"defaults",bs.defaults);/*! +`):n}function cS(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function bc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Cn(e.bodyFont),u=Cn(e.titleFont),f=Cn(e.footerFont),c=s.length,d=l.length,m=i.length,g=Hn(e.padding);let h=g.height,_=0,k=i.reduce((T,C)=>T+C.before.length+C.lines.length+C.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(h+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;h+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(h+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,gt(n.title,$),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,gt(i,T=>{gt(T.before,$),gt(T.lines,$),gt(T.after,$)}),S=0,t.font=f.string,gt(n.footer,$),t.restore(),_+=g.width,{width:_,height:h}}function dS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function pS(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function mS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),pS(u,n,e,t)&&(u="center"),u}function yc(n,e,t){const i=t.yAlign||e.yAlign||dS(n,t);return{xAlign:t.xAlign||e.xAlign||mS(n,e,t,i),yAlign:i}}function hS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function gS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function kc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=vl(o);let g=hS(e,r);const h=gS(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+l:r==="right"&&(g+=Math.max(c,m)+l),{x:Kn(g,0,i.width-e.width),y:Kn(h,0,i.height-e.height)}}function xs(n,e,t){const i=Hn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function vc(n){return Qn([],ui(n))}function _S(n,e,t){return Fi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function wc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Hb={beforeTitle:ri,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.dataIndex"u"?Hb[e].call(t,i):l}class fa extends As{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,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()),l=i.enabled&&t.options.animation&&i.animations,s=new wb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=_S(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=dn(i,"beforeTitle",this,e),s=dn(i,"title",this,e),o=dn(i,"afterTitle",this,e);let r=[];return r=Qn(r,ui(l)),r=Qn(r,ui(s)),r=Qn(r,ui(o)),r}getBeforeBody(e,t){return vc(dn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return gt(e,s=>{const o={before:[],lines:[],after:[]},r=wc(i,s);Qn(o.before,ui(dn(r,"beforeLabel",this,s))),Qn(o.lines,dn(r,"label",this,s)),Qn(o.after,ui(dn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return vc(dn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=dn(i,"beforeFooter",this,e),s=dn(i,"footer",this,e),o=dn(i,"afterFooter",this,e);let r=[];return r=Qn(r,ui(l)),r=Qn(r,ui(s)),r=Qn(r,ui(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],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))),gt(r,f=>{const c=wc(e.callbacks,f);l.push(dn(c,"labelColor",this,f)),s.push(dn(c,"labelPointStyle",this,f)),o.push(dn(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=xl[i.position].call(this,l,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=bc(this,i),u=Object.assign({},r,a),f=yc(this.chart,i,u),c=kc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={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,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=vl(r),{x:d,y:m}=e,{width:g,height:h}=t;let _,k,S,$,T,C;return s==="center"?(T=m+h/2,l==="left"?(_=d,k=_-o,$=T+o,C=T-o):(_=d+g,k=_+o,$=T-o,C=T+o),S=_):(l==="left"?k=d+Math.max(a,f)+o:l==="right"?k=d+g-Math.max(u,c)-o:k=this.caretX,s==="top"?($=m,T=$-o,_=k-o,S=k+o):($=m+h,T=$+o,_=k+o,S=k-o),C=$),{x1:_,x2:k,x3:S,y1:$,y2:T,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=yr(i.rtl,this.x,this.width);for(e.x=xs(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Cn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Fo(e,{x:h,y:g,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Fo(e,{x:_,y:g+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(h,g,u,a),e.strokeRect(h,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(_,g+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Cn(i.bodyFont);let d=c.lineHeight,m=0;const g=yr(i.rtl,this.x,this.width),h=function(E){t.fillText(E,g.x(e.x+m),e.y+d/2),e.y+=d+s},_=g.textAlign(o);let k,S,$,T,C,D,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=xs(this,_,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,h),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,D=l.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=xl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=bc(this,e),a=Object.assign({},o,this._size),u=yc(t,e,a),f=kc(e,a,u,t);(l._to!==f.x||s._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 l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Hn(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(s,e,l,t),Uw(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Ww(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=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}}),s=!Oo(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Oo(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t;const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=xl[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ue(fa,"positioners",xl);var bS={id:"tooltip",_element:fa,positioners:xl,afterInit(n,e,t){t&&(n.tooltip=new fa({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,cancelable:!0})===!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:Hb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const yS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function kS(n,e,t,i){const l=n.indexOf(e);if(l===-1)return yS(n,e,t,i);const s=n.lastIndexOf(e);return l!==s?t:l}const vS=(n,e)=>n===null?null:Kn(Math.round(n),0,e);function Sc(n){const e=this.getLabels();return n>=0&&nt.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Ue(ca,"id","category"),Ue(ca,"defaults",{ticks:{callback:Sc}});function wS(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=s||1,g=f-1,{min:h,max:_}=e,k=!yt(o),S=!yt(r),$=!yt(u),T=(_-h)/(c+1);let C=vf((_-h)/g/m)*m,D,O,E,L;if(C<1e-14&&!k&&!S)return[{value:h},{value:_}];L=Math.ceil(_/C)-Math.floor(h/C),L>g&&(C=vf(L*C/g/m)*m),yt(a)||(D=Math.pow(10,a),C=Math.ceil(C*D)/D),l==="ticks"?(O=Math.floor(h/C)*C,E=Math.ceil(_/C)*C):(O=h,E=_),k&&S&&s&&z2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,f)),C=(r-o)/L,O=o,E=r):$?(O=k?o:O,E=S?r:E,L=u-1,C=(E-O)/L):(L=(E-O)/C,is(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(wf(C),wf(O));D=Math.pow(10,yt(a)?R:a),O=Math.round(O*D)/D,E=Math.round(E*D)/D;let P=0;for(k&&(d&&O!==o?(t.push({value:o}),Or)break;t.push({value:F})}return S&&d&&E!==r?t.length&&is(t[t.length-1].value,r,Tc(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||E===r)&&t.push({value:E}),t}function Tc(n,e,{horizontal:t,minRotation:i}){const l=Mi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class qo extends ol{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return yt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=ti(l),u=ti(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={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},s=this._range||this,o=wS(l,s);return e.bounds==="ticks"&&lb(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 l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Va(e,this.chart.options.locale,this.options.ticks.format)}}class da extends qo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=jt(e)?e:0,this.max=jt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Mi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ue(da,"id","linear"),Ue(da,"defaults",{ticks:{callback:xo.formatters.numeric}});const gs=n=>Math.floor(Ci(n)),Ui=(n,e)=>Math.pow(10,gs(n)+e);function $c(n){return n/Math.pow(10,gs(n))===1}function Cc(n,e,t){const i=Math.pow(10,t),l=Math.floor(n/i);return Math.ceil(e/i)-l}function SS(n,e){const t=e-n;let i=gs(t);for(;Cc(n,e,i)>10;)i++;for(;Cc(n,e,i)<10;)i--;return Math.min(i,gs(n))}function TS(n,{min:e,max:t}){e=vn(n.min,e);const i=[],l=gs(e);let s=SS(e,t),o=s<0?Math.pow(10,Math.abs(s)):1;const r=Math.pow(10,s),a=l>s?Math.pow(10,l):0,u=Math.round((e-a)*o)/o,f=Math.floor((e-a)/r/10)*r*10;let c=Math.floor((u-f)/Math.pow(10,s)),d=vn(n.min,Math.round((a+f+c*Math.pow(10,s))*o)/o);for(;d=10?c=c<15?15:20:c++,c>=20&&(s++,c=2,o=s>=0?1:o),d=Math.round((a+f+c*Math.pow(10,s))*o)/o;const m=vn(n.max,d);return i.push({value:m,major:$c(m),significand:c}),i}class Mc extends ol{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=qo.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return jt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=jt(e)?Math.max(0,e):null,this.max=jt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!jt(this._userMin)&&(this.min=e===Ui(this.min,0)?Ui(this.min,-1):Ui(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,l=this.max;const s=r=>i=e?i:r,o=r=>l=t?l:r;i===l&&(i<=0?(s(1),o(10)):(s(Ui(i,-1)),o(Ui(l,1)))),i<=0&&s(Ui(l,-1)),l<=0&&o(Ui(i,1)),this.min=i,this.max=l}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=TS(t,this);return e.bounds==="ticks"&&lb(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":Va(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Ci(e),this._valueRange=Ci(this.max)-Ci(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ci(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}Ue(Mc,"id","logarithmic"),Ue(Mc,"defaults",{ticks:{callback:xo.formatters.logarithmic,major:{enabled:!0}}});function pa(n){const e=n.ticks;if(e.display&&n.display){const t=Hn(e.backdropPadding);return ht(e.font&&e.font.size,zt.font.size)+t.height}return 0}function $S(n,e,t){return t=Ot(t)?t:[t],{w:sw(n,e.string,t),h:t.length*e.lineHeight}}function Oc(n,e,t,i,l){return n===i||n===l?{start:e-t/2,end:e+t/2}:nl?{start:e-t,end:e}:{start:e,end:e+t}}function CS(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=[],l=[],s=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?xt/s:0;for(let a=0;ae.r&&(r=(i.end-e.r)/s,n.r=Math.max(n.r,e.r+r)),l.starte.b&&(a=(l.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function OS(n,e,t){const i=n.drawingArea,{extra:l,additionalAngle:s,padding:o,size:r}=t,a=n.getPointPosition(e,i+l+o,s),u=Math.round(ja(Sn(a.angle+$n))),f=LS(a.y,r.h,u),c=AS(u),d=IS(a.x,r.w,c);return{visible:!0,x:a.x,y:f,textAlign:c,left:d,top:f,right:d+r.w,bottom:f+r.h}}function DS(n,e){if(!e)return!0;const{left:t,top:i,right:l,bottom:s}=n;return!(Oi({x:t,y:i},e)||Oi({x:t,y:s},e)||Oi({x:l,y:i},e)||Oi({x:l,y:s},e))}function ES(n,e,t){const i=[],l=n._pointLabels.length,s=n.options,{centerPointLabels:o,display:r}=s.pointLabels,a={extra:pa(s)/2,additionalAngle:o?xt/l:0};let u;for(let f=0;f270||t<90)&&(n-=e),n}function PS(n,e,t){const{left:i,top:l,right:s,bottom:o}=t,{backdropColor:r}=e;if(!yt(r)){const a=vl(e.borderRadius),u=Hn(e.backdropPadding);n.fillStyle=r;const f=i-u.left,c=l-u.top,d=s-i+u.width,m=o-l+u.height;Object.values(a).some(g=>g!==0)?(n.beginPath(),Fo(n,{x:f,y:c,w:d,h:m,radius:a}),n.fill()):n.fillRect(f,c,d,m)}}function FS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let l=e-1;l>=0;l--){const s=n._pointLabelItems[l];if(!s.visible)continue;const o=i.setContext(n.getPointLabelContext(l));PS(t,o,s);const r=Cn(o.font),{x:a,y:u,textAlign:f}=s;Po(t,n._pointLabels[l],a,u+r.lineHeight/2,r,{color:o.color,textAlign:f,textBaseline:"middle"})}}function zb(n,e,t,i){const{ctx:l}=n;if(t)l.arc(n.xCenter,n.yCenter,e,0,On);else{let s=n.getPointPosition(0,e);l.moveTo(s.x,s.y);for(let o=1;o{const l=qt(this.options.pointLabels.callback,[t,i],this);return l||l===0?l:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?CS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,l){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-l)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,l))}getIndexAngle(e){const t=On/(this._pointLabels.length||1),i=this.options.startAngle||0;return Sn(e*t+Mi(i))}getDistanceFromCenterForValue(e){if(yt(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(yt(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(c!==0){a=this.getDistanceFromCenterForValue(f.value);const d=this.getContext(c),m=l.setContext(d),g=s.setContext(d);NS(this,m,a,o,g)}}),i.display){for(e.save(),r=o-1;r>=0;r--){const f=i.setContext(this.getPointLabelContext(r)),{color:c,lineWidth:d}=f;!d||!c||(e.lineWidth=d,e.strokeStyle=c,e.setLineDash(f.borderDash),e.lineDashOffset=f.borderDashOffset,a=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),u=this.getPointPosition(r,a),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const l=this.getIndexAngle(0);let s,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(l),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=Cn(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Hn(u.backdropPadding);e.fillRect(-o/2-c.left,-s-f.size/2-c.top,o+c.width,f.size+c.height)}Po(e,r.label,0,-s,f,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}Ue(eo,"id","radialLinear"),Ue(eo,"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(e){return e},padding:5,centerPointLabels:!1}}),Ue(eo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ue(eo,"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}},hn=Object.keys(tr);function Dc(n,e){return n-e}function Ec(n,e){if(yt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),jt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Ao(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Ac(n,e,t,i){const l=hn.length;for(let s=hn.indexOf(n);s=hn.indexOf(t);s--){const o=hn[s];if(tr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return hn[t?hn.indexOf(t):0]}function jS(n){for(let e=hn.indexOf(n)+1,t=hn.length;e=e?t[i]:t[l];n[s]=!0}}function HS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Lc(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Kn(t,0,o),i=Kn(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,l=this.options,s=l.time,o=s.unit||Ac(s.minUnit,t,i,this._getLabelCapacity(t)),r=ht(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Ao(a)||a===!0,f={};let c=t,d,m;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=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+h)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return qt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:f))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=la(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=la(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const u=o-s;return u?r+(a-r)*(e-s)/u:r}class Pc extends _s{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,l=[],s=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&l.push(u);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(to(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return to(this._table,i*this._tableRange+this._minPos,!0)}}Ue(Pc,"id","timeseries"),Ue(Pc,"defaults",_s.defaults);/*! * chartjs-adapter-luxon v1.3.1 * https://www.chartjs.org * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license - */const HS={datetime:He.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:He.TIME_WITH_SECONDS,minute:He.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Tb._date.override({_id:"luxon",_create:function(n){return He.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return HS},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=He.fromFormat(n,e,t):n=He.fromISO(n,t):n instanceof Date?n=He.fromJSDate(n,t):i==="object"&&!(n instanceof He)&&(n=He.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 Pc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,Yt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function zS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c=n[2]&&Pc();return{c(){e=b("div"),t=b("div"),i=Y("Found "),l=Y(n[1]),s=M(),r=Y(o),a=M(),c&&c.c(),u=M(),f=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),y(e,t),y(t,i),y(t,l),y(t,s),y(t,r),y(e,a),c&&c.m(e,null),y(e,u),y(e,f),n[8](f)},p(d,[m]){m&2&&se(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&se(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&A(c,1):(c=Pc(),c.c(),A(c,1),c.m(e,u)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),m&4&&x(e,"loading",d[2])},i(d){A(c)},o(d){I(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function VS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),ue.logs.getStats({filter:[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&")}).then(m=>{c();for(let g of m)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total)}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),ue.error(m,(m==null?void 0:m.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(7,r=[]),t(1,a=0)}Vt(()=>(ci.register(po,go,fa,ca,bs,uS,_S),t(6,o=new ci(s,{type:"bar",data:{datasets:[{label:"Total requests",data:r,backgroundColor:"#e34562",maxBarThickness:40,borderRadius:2,minBarLength:7,hoverBackgroundColor:"#e34562"}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var g;return(g=m.tick)!=null&&g.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var g;return(g=m.tick)!=null&&g.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,u,i,l,f,o,r,d]}class BS extends be{constructor(e){super(),_e(this,e,VS,zS,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Fc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function US(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zb={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + */const zS={datetime:He.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:He.TIME_WITH_SECONDS,minute:He.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};$b._date.override({_id:"luxon",_create:function(n){return He.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return zS},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=He.fromFormat(n,e,t):n=He.fromISO(n,t):n instanceof Date?n=He.fromJSDate(n,t):i==="object"&&!(n instanceof He)&&(n=He.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 Fc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,Yt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function VS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c=n[2]&&Fc();return{c(){e=b("div"),t=b("div"),i=Y("Found "),l=Y(n[1]),s=M(),r=Y(o),a=M(),c&&c.c(),u=M(),f=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),y(e,t),y(t,i),y(t,l),y(t,s),y(t,r),y(e,a),c&&c.m(e,null),y(e,u),y(e,f),n[8](f)},p(d,[m]){m&2&&se(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&se(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&A(c,1):(c=Fc(),c.c(),A(c,1),c.m(e,u)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),m&4&&x(e,"loading",d[2])},i(d){A(c)},o(d){I(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function BS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),fe.logs.getStats({filter:[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&")}).then(m=>{c();for(let g of m)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total)}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),fe.error(m,(m==null?void 0:m.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(7,r=[]),t(1,a=0)}Vt(()=>(ci.register(co,ho,ca,da,_s,fS,bS),t(6,o=new ci(s,{type:"bar",data:{datasets:[{label:"Total requests",data:r,backgroundColor:"#e34562",maxBarThickness:40,borderRadius:2,minBarLength:7,hoverBackgroundColor:"#e34562"}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var g;return(g=m.tick)!=null&&g.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var g;return(g=m.tick)!=null&&g.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,u,i,l,f,o,r,d]}class US extends _e{constructor(e){super(),ge(this,e,BS,VS,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Nc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function WS(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vb={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 l=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S($){return $ instanceof a?new a($.type,S($.content),$.alias):Array.isArray($)?$.map(S):$.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(C){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(S){var $=document.getElementsByTagName("script");for(var T in $)if($[T].src==S)return $[T]}return null}},isActive:function(S,$,T){for(var C="no-"+$;S;){var D=S.classList;if(D.contains($))return!0;if(D.contains(C))return!1;S=S.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,$){var T=r.util.clone(r.languages[S]);for(var C in $)T[C]=$[C];return T},insertBefore:function(S,$,T,C){C=C||r.languages;var D=C[S],O={};for(var E in D)if(D.hasOwnProperty(E)){if(E==$)for(var L in T)T.hasOwnProperty(L)&&(O[L]=T[L]);T.hasOwnProperty(E)||(O[E]=D[E])}var R=C[S];return C[S]=O,r.languages.DFS(r.languages,function(P,F){F===R&&P!=S&&(this[P]=O)}),O},DFS:function S($,T,C,D){D=D||{};var O=r.util.objId;for(var E in $)if($.hasOwnProperty(E)){T.call($,E,$[E],C||E);var L=$[E],R=r.util.type(L);R==="Object"&&!D[O(L)]?(D[O(L)]=!0,S(L,T,null,D)):R==="Array"&&!D[O(L)]&&(D[O(L)]=!0,S(L,T,E,D))}}},plugins:{},highlightAll:function(S,$){r.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,T){var C={callback:T,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),r.hooks.run("before-all-elements-highlight",C);for(var D=0,O;O=C.elements[D++];)r.highlightElement(O,$===!0,C.callback)},highlightElement:function(S,$,T){var C=r.util.getLanguage(S),D=r.languages[C];r.util.setLanguage(S,C);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,C);var E=S.textContent,L={element:S,language:C,grammar:D,code:E};function R(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),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.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){R(r.util.encode(L.code));return}if($&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(F){R(F.data)},P.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else R(r.highlight(L.code,L.grammar,L.language))},highlight:function(S,$,T){var C={code:S,grammar:$,language:T};if(r.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=r.tokenize(C.code,C.grammar),r.hooks.run("after-tokenize",C),a.stringify(r.util.encode(C.tokens),C.language)},tokenize:function(S,$){var T=$.rest;if(T){for(var C in T)$[C]=T[C];delete $.rest}var D=new c;return d(D,D.head,S),f(S,D,$,D.head,0),g(D)},hooks:{all:{},add:function(S,$){var T=r.hooks.all;T[S]=T[S]||[],T[S].push($)},run:function(S,$){var T=r.hooks.all[S];if(!(!T||!T.length))for(var C=0,D;D=T[C++];)D($)}},Token:a};i.Prism=r;function a(S,$,T,C){this.type=S,this.content=$,this.alias=T,this.length=(C||"").length|0}a.stringify=function S($,T){if(typeof $=="string")return $;if(Array.isArray($)){var C="";return $.forEach(function(R){C+=S(R,T)}),C}var D={type:$.type,content:S($.content,T),tag:"span",classes:["token",$.type],attributes:{},language:T},O=$.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(D.classes,O):D.classes.push(O)),r.hooks.run("wrap",D);var E="";for(var L in D.attributes)E+=" "+L+'="'+(D.attributes[L]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+E+">"+D.content+""};function u(S,$,T,C){S.lastIndex=$;var D=S.exec(T);if(D&&C&&D[1]){var O=D[1].length;D.index+=O,D[0]=D[0].slice(O)}return D}function f(S,$,T,C,D,O){for(var E in T)if(!(!T.hasOwnProperty(E)||!T[E])){var L=T[E];L=Array.isArray(L)?L:[L];for(var R=0;R=O.reach);U+=H.value.length,H=H.next){var le=H.value;if($.length>S.length)return;if(!(le instanceof a)){var ee=1,oe;if(q){if(oe=u(J,U,S,N),!oe||oe.index>=S.length)break;var Qe=oe.index,Te=oe.index+oe[0].length,je=U;for(je+=H.value.length;Qe>=je;)H=H.next,je+=H.value.length;if(je-=H.value.length,U=je,H.value instanceof a)continue;for(var Ve=H;Ve!==$.tail&&(jeO.reach&&(O.reach=Pt);var Ce=H.prev;Ge&&(Ce=d($,Ce,Ge),U+=Ge.length),m($,Ce,ee);var De=new a(E,F?r.tokenize(tt,F):tt,W,tt);if(H=d($,Ce,De),Mt&&d($,H,Mt),ee>1){var ze={cause:E+","+R,reach:Pt};f(S,$,T,H.prev,U,ze),O&&ze.reach>O.reach&&(O.reach=ze.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},$={value:null,prev:S,next:null};S.next=$,this.head=S,this.tail=$,this.length=0}function d(S,$,T){var C=$.next,D={value:T,prev:$,next:C};return $.next=D,C.prev=D,S.length++,D}function m(S,$,T){for(var C=$.next,D=0;D/,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(l,s){var o={};o["language-"+s]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[s]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var a={};a[l]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,l){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:[l,"language-"+l],inside:t.languages[l]},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 l=/(?:"(?:\\(?:\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+"|"+l.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\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,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 s=i.languages.markup;s&&(s.tag.addInlined("style","css"),s.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…",l=function(h,_){return"✖ Error "+h+" while fetching file: "+_},s="✖ 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(h,_,k){var S=new XMLHttpRequest;S.open("GET",h,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?_(S.responseText):S.status>=400?k(l(S.status,S.statusText)):k(s))},S.send(null)}function m(h){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h||"");if(_){var k=Number(_[1]),S=_[2],$=_[3];return S?$?[k,Number($)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(h){h.selector+=", "+c}),t.hooks.add("before-sanity-check",function(h){var _=h.element;if(_.matches(c)){h.code="",_.setAttribute(r,a);var k=_.appendChild(document.createElement("CODE"));k.textContent=i;var S=_.getAttribute("data-src"),$=h.language;if($==="none"){var T=(/\.(\w+)$/.exec(S)||[,"none"])[1];$=o[T]||T}t.util.setLanguage(k,$),t.util.setLanguage(_,$);var C=t.plugins.autoloader;C&&C.loadLanguages($),d(S,function(D){_.setAttribute(r,u);var O=m(_.getAttribute("data-range"));if(O){var E=D.split(/\r\n?|\n/g),L=O[0],R=O[1]==null?E.length:O[1];L<0&&(L+=E.length),L=Math.max(0,Math.min(L-1,E.length)),R<0&&(R+=E.length),R=Math.max(0,Math.min(R,E.length)),D=E.slice(L,R).join(` -`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(L+1))}k.textContent=D,t.highlightElement(k)},function(D){_.setAttribute(r,f),k.textContent=D})}}),t.plugins.fileHighlight={highlight:function(_){for(var k=(_||document).querySelectorAll(c),S=0,$;$=k[S++];)t.highlightElement($)}};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)}}()})(zb);var WS=zb.exports;const Zl=US(WS);var YS={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 l(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(C){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(S){var $=document.getElementsByTagName("script");for(var T in $)if($[T].src==S)return $[T]}return null}},isActive:function(S,$,T){for(var C="no-"+$;S;){var D=S.classList;if(D.contains($))return!0;if(D.contains(C))return!1;S=S.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,$){var T=r.util.clone(r.languages[S]);for(var C in $)T[C]=$[C];return T},insertBefore:function(S,$,T,C){C=C||r.languages;var D=C[S],O={};for(var E in D)if(D.hasOwnProperty(E)){if(E==$)for(var L in T)T.hasOwnProperty(L)&&(O[L]=T[L]);T.hasOwnProperty(E)||(O[E]=D[E])}var R=C[S];return C[S]=O,r.languages.DFS(r.languages,function(P,F){F===R&&P!=S&&(this[P]=O)}),O},DFS:function S($,T,C,D){D=D||{};var O=r.util.objId;for(var E in $)if($.hasOwnProperty(E)){T.call($,E,$[E],C||E);var L=$[E],R=r.util.type(L);R==="Object"&&!D[O(L)]?(D[O(L)]=!0,S(L,T,null,D)):R==="Array"&&!D[O(L)]&&(D[O(L)]=!0,S(L,T,E,D))}}},plugins:{},highlightAll:function(S,$){r.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,T){var C={callback:T,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),r.hooks.run("before-all-elements-highlight",C);for(var D=0,O;O=C.elements[D++];)r.highlightElement(O,$===!0,C.callback)},highlightElement:function(S,$,T){var C=r.util.getLanguage(S),D=r.languages[C];r.util.setLanguage(S,C);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,C);var E=S.textContent,L={element:S,language:C,grammar:D,code:E};function R(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),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.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){R(r.util.encode(L.code));return}if($&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(F){R(F.data)},P.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else R(r.highlight(L.code,L.grammar,L.language))},highlight:function(S,$,T){var C={code:S,grammar:$,language:T};if(r.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=r.tokenize(C.code,C.grammar),r.hooks.run("after-tokenize",C),a.stringify(r.util.encode(C.tokens),C.language)},tokenize:function(S,$){var T=$.rest;if(T){for(var C in T)$[C]=T[C];delete $.rest}var D=new c;return d(D,D.head,S),f(S,D,$,D.head,0),g(D)},hooks:{all:{},add:function(S,$){var T=r.hooks.all;T[S]=T[S]||[],T[S].push($)},run:function(S,$){var T=r.hooks.all[S];if(!(!T||!T.length))for(var C=0,D;D=T[C++];)D($)}},Token:a};i.Prism=r;function a(S,$,T,C){this.type=S,this.content=$,this.alias=T,this.length=(C||"").length|0}a.stringify=function S($,T){if(typeof $=="string")return $;if(Array.isArray($)){var C="";return $.forEach(function(R){C+=S(R,T)}),C}var D={type:$.type,content:S($.content,T),tag:"span",classes:["token",$.type],attributes:{},language:T},O=$.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(D.classes,O):D.classes.push(O)),r.hooks.run("wrap",D);var E="";for(var L in D.attributes)E+=" "+L+'="'+(D.attributes[L]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+E+">"+D.content+""};function u(S,$,T,C){S.lastIndex=$;var D=S.exec(T);if(D&&C&&D[1]){var O=D[1].length;D.index+=O,D[0]=D[0].slice(O)}return D}function f(S,$,T,C,D,O){for(var E in T)if(!(!T.hasOwnProperty(E)||!T[E])){var L=T[E];L=Array.isArray(L)?L:[L];for(var R=0;R=O.reach);U+=H.value.length,H=H.next){var le=H.value;if($.length>S.length)return;if(!(le instanceof a)){var ee=1,oe;if(q){if(oe=u(J,U,S,N),!oe||oe.index>=S.length)break;var Qe=oe.index,Te=oe.index+oe[0].length,je=U;for(je+=H.value.length;Qe>=je;)H=H.next,je+=H.value.length;if(je-=H.value.length,U=je,H.value instanceof a)continue;for(var Ve=H;Ve!==$.tail&&(jeO.reach&&(O.reach=Pt);var Ce=H.prev;Ge&&(Ce=d($,Ce,Ge),U+=Ge.length),m($,Ce,ee);var De=new a(E,F?r.tokenize(tt,F):tt,W,tt);if(H=d($,Ce,De),Mt&&d($,H,Mt),ee>1){var ze={cause:E+","+R,reach:Pt};f(S,$,T,H.prev,U,ze),O&&ze.reach>O.reach&&(O.reach=ze.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},$={value:null,prev:S,next:null};S.next=$,this.head=S,this.tail=$,this.length=0}function d(S,$,T){var C=$.next,D={value:T,prev:$,next:C};return $.next=D,C.prev=D,S.length++,D}function m(S,$,T){for(var C=$.next,D=0;D/,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(l,s){var o={};o["language-"+s]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[s]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var a={};a[l]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,l){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:[l,"language-"+l],inside:t.languages[l]},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 l=/(?:"(?:\\(?:\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+"|"+l.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\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,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 s=i.languages.markup;s&&(s.tag.addInlined("style","css"),s.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…",l=function(h,_){return"✖ Error "+h+" while fetching file: "+_},s="✖ 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(h,_,k){var S=new XMLHttpRequest;S.open("GET",h,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?_(S.responseText):S.status>=400?k(l(S.status,S.statusText)):k(s))},S.send(null)}function m(h){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h||"");if(_){var k=Number(_[1]),S=_[2],$=_[3];return S?$?[k,Number($)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(h){h.selector+=", "+c}),t.hooks.add("before-sanity-check",function(h){var _=h.element;if(_.matches(c)){h.code="",_.setAttribute(r,a);var k=_.appendChild(document.createElement("CODE"));k.textContent=i;var S=_.getAttribute("data-src"),$=h.language;if($==="none"){var T=(/\.(\w+)$/.exec(S)||[,"none"])[1];$=o[T]||T}t.util.setLanguage(k,$),t.util.setLanguage(_,$);var C=t.plugins.autoloader;C&&C.loadLanguages($),d(S,function(D){_.setAttribute(r,u);var O=m(_.getAttribute("data-range"));if(O){var E=D.split(/\r\n?|\n/g),L=O[0],R=O[1]==null?E.length:O[1];L<0&&(L+=E.length),L=Math.max(0,Math.min(L-1,E.length)),R<0&&(R+=E.length),R=Math.max(0,Math.min(R,E.length)),D=E.slice(L,R).join(` +`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(L+1))}k.textContent=D,t.highlightElement(k)},function(D){_.setAttribute(r,f),k.textContent=D})}}),t.plugins.fileHighlight={highlight:function(_){for(var k=(_||document).querySelectorAll(c),S=0,$;$=k[S++];)t.highlightElement($)}};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)}}()})(Vb);var YS=Vb.exports;const Jl=WS(YS);var KS={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 l(o){for(var r=0,a=0;ar&&(f[d]=` `+f[d],c=m)}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 s)if(Object.hasOwnProperty.call(s,u)){var f=s[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,m="",g="",h=!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 KS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(l,s){w(l,e,s),y(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function JS(n,e,t){let{class:i=""}=e,{content:l=""}=e,{language:s="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zl.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zl.highlight(a,Zl.languages[s]||Zl.languages.javascript,s)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,l=a.content),"language"in a&&t(3,s=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zl<"u"&&l&&t(1,o=r(l))},[i,o,l,s]}class Vb extends be{constructor(e){super(),_e(this,e,JS,KS,me,{class:0,content:2,language:3})}}const ZS=n=>({}),Nc=n=>({}),GS=n=>({}),Rc=n=>({});function qc(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$=n[4]&&!n[2]&&jc(n);const T=n[19].header,C=vt(T,n,n[18],Rc);let D=n[4]&&n[2]&&Hc(n);const O=n[19].default,E=vt(O,n,n[18],null),L=n[19].footer,R=vt(L,n,n[18],Nc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),$&&$.c(),r=M(),C&&C.c(),a=M(),D&&D.c(),u=M(),f=b("div"),E&&E.c(),c=M(),d=b("div"),R&&R.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(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(P,F){w(P,e,F),y(e,t),y(e,l),y(e,s),y(s,o),$&&$.m(o,null),y(o,r),C&&C.m(o,null),y(o,a),D&&D.m(o,null),y(s,u),y(s,f),E&&E.m(f,null),n[21](f),y(s,c),y(s,d),R&&R.m(d,null),_=!0,k||(S=[K(t,"click",Ye(n[20])),K(f,"scroll",n[22])],k=!0)},p(P,F){n=P,n[4]&&!n[2]?$?($.p(n,F),F[0]&20&&A($,1)):($=jc(n),$.c(),A($,1),$.m(o,r)):$&&(re(),I($,1,1,()=>{$=null}),ae()),C&&C.p&&(!_||F[0]&262144)&&St(C,T,n,n[18],_?wt(T,n[18],F,GS):Tt(n[18]),Rc),n[4]&&n[2]?D?D.p(n,F):(D=Hc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),E&&E.p&&(!_||F[0]&262144)&&St(E,O,n,n[18],_?wt(O,n[18],F,null):Tt(n[18]),null),R&&R.p&&(!_||F[0]&262144)&&St(R,L,n,n[18],_?wt(L,n[18],F,ZS):Tt(n[18]),Nc),(!_||F[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||F[0]&262)&&x(s,"popup",n[2]),(!_||F[0]&4)&&x(e,"padded",n[2]),(!_||F[0]&1)&&x(e,"active",n[0])},i(P){_||(P&&Ke(()=>{_&&(i||(i=Le(t,ds,{duration:Si,opacity:0},!0)),i.run(1))}),A($),A(C,P),A(E,P),A(R,P),P&&Ke(()=>{_&&(h&&h.end(1),g=j_(s,jn,n[2]?{duration:Si,y:-10}:{duration:Si,x:50}),g.start())}),_=!0)},o(P){P&&(i||(i=Le(t,ds,{duration:Si,opacity:0},!1)),i.run(0)),I($),I(C,P),I(E,P),I(R,P),g&&g.invalidate(),P&&(h=ya(s,jn,n[2]?{duration:Si,y:10}:{duration:Si,x:50})),_=!1},d(P){P&&v(e),P&&i&&i.end(),$&&$.d(),C&&C.d(P),D&&D.d(),E&&E.d(P),n[21](null),R&&R.d(P),P&&h&&h.end(),k=!1,we(S)}}}function jc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",Ye(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,ds,{duration:Si},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,ds,{duration:Si},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Hc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function XS(n){let e,t,i,l,s=n[0]&&qc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&A(s,1)):(s=qc(o),s.c(),A(s,1),s.m(e,null)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){t||(A(s),t=!0)},o(o){I(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,we(l)}}}let Wi,Er=[];function Bb(){return Wi=Wi||document.querySelector(".overlays"),Wi||(Wi=document.createElement("div"),Wi.classList.add("overlays"),document.body.appendChild(Wi)),Wi}let Si=150;function zc(){return 1e3+Bb().querySelectorAll(".overlay-panel-container.active").length}function QS(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=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 m=rt(),g="op_"+j.randomString(10);let h,_,k,S,$="",T=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function D(){typeof d=="function"&&d()===!1||t(0,o=!1)}function O(){return o}async function E(U){t(17,T=U),U?(k=document.activeElement,m("show"),h==null||h.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await Qt(),L()}function L(){h&&(o?t(6,h.style.zIndex=zc(),h):t(6,h.style="",h))}function R(){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(U){o&&f&&U.code=="Escape"&&!j.isInput(U.target)&&h&&h.style.zIndex==zc()&&(U.preventDefault(),D())}function N(U){o&&q(_)}function q(U,le){le&&t(8,$=""),!(!U||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!U)return;if(U.scrollHeight-U.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}U.scrollTop==0?t(8,$+=" scroll-top-reached"):U.scrollTop+U.offsetHeight==U.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Vt(()=>(Bb().appendChild(h),()=>{var U;clearTimeout(S),P(),(U=h==null?void 0:h.classList)==null||U.add("hidden"),setTimeout(()=>{h==null||h.remove()},0)}));const W=()=>a?D():!0;function G(U){te[U?"unshift":"push"](()=>{_=U,t(7,_)})}const J=U=>q(U.target);function H(U){te[U?"unshift":"push"](()=>{h=U,t(6,h)})}return n.$$set=U=>{"class"in U&&t(1,s=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,l=U.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&E(o),n.$$.dirty[0]&128&&q(_,!0),n.$$.dirty[0]&64&&h&&L(),n.$$.dirty[0]&1&&(o?R():P())},[o,s,r,a,u,D,h,_,$,F,N,q,f,c,d,C,O,T,l,i,W,G,J,H]}class Xt extends be{constructor(e){super(),_e(this,e,QS,XS,me,{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 xS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),l||(s=[ve(i=Fe.call(null,e,n[2]?"":"Copy")),K(e,"click",fn(n[3]))],l=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&$t(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:Q,o:Q,d(o){o&&v(e),l=!1,we(s)}}}function eT(n,e,t){let{value:i=""}=e,{idleClasses:l="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:s="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 Vt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,l=u.idleClasses),"successClasses"in u&&t(1,s=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[l,s,r,a,i,o]}class rl extends be{constructor(e){super(),_e(this,e,eT,xS,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function Vc(n,e,t){const i=n.slice();i[13]=e[t];const l=i[1].data[i[13]];return i[14]=l,i}function Bc(n){let e,t,i,l;function s(a,u){return a[1].message?nT:tT}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,u){w(a,e,u),y(e,t),y(e,i),y(e,l),r.m(l,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function tT(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nT(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&se(i,t)},d(l){l&&v(e)}}}function iT(n){let e,t=n[14]+"",i,l=n[13]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=Y(t),s=Y(l),p(e,"class","txt")},m(o,r){w(o,e,r),y(e,i),y(e,s)},p(o,r){r&2&&t!==(t=o[14]+"")&&se(i,t),r&2&&l!==(l=o[13]=="execTime"?"ms":"")&&se(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function lT(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function sT(n){let e,t;return e=new Vb({props:{content:JSON.stringify(n[14],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[14],null,2)),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Uc(n){let e,t,i,l=n[13]+"",s,o,r,a,u,f,c,d;const m=[sT,lT,iT],g=[];function h(_,k){return k&2&&(a=null),_[14]!==null&&typeof _[14]=="object"?0:(a==null&&(a=!!j.isEmpty(_[14])),a?1:2)}return u=h(n,-1),f=g[u]=m[u](n),{c(){e=b("tr"),t=b("td"),i=Y("data."),s=Y(l),o=M(),r=b("td"),f.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[3])},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,s),y(e,o),y(e,r),g[u].m(r,null),y(e,c),d=!0},p(_,k){(!d||k&2)&&l!==(l=_[13]+"")&&se(s,l),(!d||k&8)&&x(t,"v-align-top",_[3]);let S=u;u=h(_,k),u===S?g[u].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),f=g[u],f?f.p(_,k):(f=g[u]=m[u](_),f.c()),A(f,1),f.m(r,null))},i(_){d||(A(f),d=!0)},o(_){I(f),d=!1},d(_){_&&v(e),g[u].d()}}}function oT(n){var G;let e,t,i,l,s,o,r,a,u,f,c=n[1].id+"",d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;a=new rl({props:{value:n[1].id}}),S=new X1({props:{level:n[1].level}}),E=new Q1({props:{date:n[1].created}});let F=((G=n[1].data)==null?void 0:G.type)!="request"&&Bc(n),N=pe(n[4](n[1].data)),q=[];for(let J=0;JI(q[J],1,1,()=>{q[J]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),u=M(),f=b("div"),d=Y(c),m=M(),g=b("tr"),h=b("td"),h.textContent="level",_=M(),k=b("td"),B(S.$$.fragment),$=M(),T=b("tr"),C=b("td"),C.textContent="created",D=M(),O=b("td"),B(E.$$.fragment),L=M(),F&&F.c(),R=M();for(let J=0;JClose',t=M(),i=b("button"),i.innerHTML=' Download as JSON',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-primary")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[7]),K(i,"click",n[8])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function uT(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[aT],header:[rT],default:[oT]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[9](e),e.$on("hide",n[10]),e.$on("show",n[11]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&131082&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[9](null),V(e,l)}}}function fT(n,e,t){let i,l,s={};function o(_){if(!j.isEmpty(_))return t(1,s=_),l==null?void 0:l.show()}function r(){return l==null?void 0:l.hide()}const a=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","error","details"];function u(_){if(!_)return[];let k=[];for(let $ of a)typeof _[$]<"u"&&k.push($);const S=Object.keys(_);for(let $ of S)k.includes($)||k.push($);return k}function f(){j.downloadJson(s,"log_"+s.created.replaceAll(/[-:\. ]/gi,"")+".json")}const c=()=>r(),d=()=>f();function m(_){te[_?"unshift":"push"](()=>{l=_,t(2,l)})}function g(_){Ee.call(this,n,_)}function h(_){Ee.call(this,n,_)}return n.$$.update=()=>{n.$$.dirty&2&&t(3,i=!j.isEmpty(s.data))},[r,s,l,i,u,f,o,c,d,m,g,h]}class cT extends be{constructor(e){super(),_e(this,e,fT,uT,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function dT(n,e,t){const i=n.slice();return i[1]=e[t],i}function pT(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mT(n){let e,t,i,l=pe(Y1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Ub extends be{constructor(e){super(),_e(this,e,hT,mT,me,{class:0})}}function gT(n){let e,t,i,l,s,o,r,a,u;return t=new he({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[bT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),l=new he({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[yT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[kT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(f,c){w(f,e,c),z(t,e,null),y(e,i),z(l,e,null),y(e,s),z(o,e,null),r=!0,a||(u=K(e,"submit",Ye(n[7])),a=!0)},p(f,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:f}),l.$set(m);const g={};c&12582914&&(g.$$scope={dirty:c,ctx:f}),o.$set(g)},i(f){r||(A(t.$$.fragment,f),A(l.$$.fragment,f),A(o.$$.fragment,f),r=!0)},o(f){I(t.$$.fragment,f),I(l.$$.fragment,f),I(o.$$.fragment,f),r=!1},d(f){f&&v(e),V(t),V(l),V(o),a=!1,u()}}}function _T(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function bT(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&ut(s.value)!==c[1].logs.maxDays&&ce(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function yT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new Ub({}),{c(){e=b("label"),t=Y("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=M(),B(f.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(g,h){w(g,e,h),y(e,t),w(g,l,h),w(g,s,h),ce(s,n[1].logs.minLevel),w(g,o,h),w(g,r,h),y(r,a),y(r,u),z(f,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(g,h){(!c||h&4194304&&i!==(i=g[22]))&&p(e,"for",i),h&2&&ut(s.value)!==g[1].logs.minLevel&&ce(s,g[1].logs.minLevel)},i(g){c||(A(f.$$.fragment,g),c=!0)},o(g){I(f.$$.fragment,g),c=!1},d(g){g&&(v(e),v(l),v(s),v(o),v(r)),V(f),d=!1,m()}}}function kT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIp,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[13]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIp),f&4194304&&o!==(o=u[22])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function vT(n){let e,t,i,l;const s=[_T,gT],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function wT(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ST(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function TT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[ST],header:[wT],default:[vT]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function $T(n,e,t){let i,l;const s=rt(),o="logs_settings_"+j.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return g(),h(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function g(){Gt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function h(){t(4,u=!0);try{const L=await ue.settings.getAll()||{};k(L)}catch(L){ue.error(L)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const L=await ue.settings.update(j.filterRedactedProps(c));k(L),t(3,a=!1),m(),It("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ue.error(L)}}}function k(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=ut(this.value),t(1,c)}function $(){c.logs.minLevel=ut(this.value),t(1,c)}function T(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function D(L){te[L?"unshift":"push"](()=>{r=L,t(2,r)})}function O(L){Ee.call(this,n,L)}function E(L){Ee.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,_,d,f,i,S,$,T,C,D,O,E]}class CT extends be{constructor(e){super(),_e(this,e,$T,TT,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function MT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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]),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function Wc(n){let e,t;return e=new BS({props:{filter:n[0],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.filter=i[0]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Yc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[0]!==void 0&&(s.filter=n[0]),e=new r2({props:s}),te.push(()=>ge(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&1&&(t=!0,a.filter=o[0],ye(()=>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 OT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T=n[4],C,D=n[4],O,E,L,R;u=new Qo({}),u.$on("refresh",n[10]),g=new he({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[MT,({uniqueId:N})=>({20:N}),({uniqueId:N})=>N?1048576:0]},$$scope:{ctx:n}}}),_=new Ds({props:{value:n[0],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[12]),S=new Ub({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let P=Wc(n),F=Yc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=Y(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(u.$$.fragment),f=M(),c=b("div"),d=M(),m=b("div"),B(g.$$.fragment),h=M(),B(_.$$.fragment),k=M(),B(S.$$.fragment),$=M(),P.c(),C=M(),F.c(),O=ke(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(N,q){w(N,e,q),y(e,t),y(t,i),y(i,l),y(l,s),y(t,o),y(t,r),y(t,a),z(u,t,null),y(t,f),y(t,c),y(t,d),y(t,m),z(g,m,null),y(e,h),z(_,e,null),y(e,k),z(S,e,null),y(e,$),P.m(e,null),w(N,C,q),F.m(N,q),w(N,O,q),E=!0,L||(R=[ve(Fe.call(null,r,{text:"Logs settings",position:"right"})),K(r,"click",n[9])],L=!0)},p(N,q){(!E||q&64)&&se(s,N[6]);const W={};q&3145730&&(W.$$scope={dirty:q,ctx:N}),g.$set(W);const G={};q&1&&(G.value=N[0]),_.$set(G),q&16&&me(T,T=N[4])?(re(),I(P,1,1,Q),ae(),P=Wc(N),P.c(),A(P,1),P.m(e,null)):P.p(N,q),q&16&&me(D,D=N[4])?(re(),I(F,1,1,Q),ae(),F=Yc(N),F.c(),A(F,1),F.m(O.parentNode,O)):F.p(N,q)},i(N){E||(A(u.$$.fragment,N),A(g.$$.fragment,N),A(_.$$.fragment,N),A(S.$$.fragment,N),A(P),A(F),E=!0)},o(N){I(u.$$.fragment,N),I(g.$$.fragment,N),I(_.$$.fragment,N),I(S.$$.fragment,N),I(P),I(F),E=!1},d(N){N&&(v(e),v(C),v(O)),V(u),V(g),V(_),V(S),P.d(N),F.d(N),L=!1,we(R)}}}function DT(n){let e,t,i,l,s,o;e=new _n({props:{$$slots:{default:[OT]},$$scope:{ctx:n}}});let r={};i=new cT({props:r}),n[15](i);let a={};return s=new CT({props:a}),n[16](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(u,f){z(e,u,f),w(u,t,f),z(i,u,f),w(u,l,f),z(s,u,f),o=!0},p(u,[f]){const c={};f&2097279&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(A(e.$$.fragment,u),A(i.$$.fragment,u),A(s.$$.fragment,u),o=!0)},o(u){I(e.$$.fragment,u),I(i.$$.fragment,u),I(s.$$.fragment,u),o=!1},d(u){u&&(v(t),v(l)),V(e,u),n[15](null),V(i,u),n[16](null),V(s,u)}}}const Kc="adminRequests",Jc="adminLogRequests";function ET(n,e,t){var O;let i,l,s;We(n,Uo,E=>t(17,l=E)),We(n,Et,E=>t(6,s=E)),tn(Et,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c=(o.get(Kc)||((O=window.localStorage)==null?void 0:O.getItem(Jc)))<<0,d=c;function m(){t(4,u++,u)}function g(E={}){let L={};L.filter=f||null,L[Kc]=c<<0||null,j.replaceHashQueryParams(Object.assign(L,E))}const h=()=>a==null?void 0:a.show(),_=()=>m();function k(){c=this.checked,t(1,c)}const S=E=>t(0,f=E.detail);function $(E){f=E,t(0,f)}const T=E=>r==null?void 0:r.show(E==null?void 0:E.detail);function C(E){te[E?"unshift":"push"](()=>{r=E,t(2,r)})}function D(E){te[E?"unshift":"push"](()=>{a=E,t(3,a)})}return n.$$.update=()=>{var E;n.$$.dirty&2&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&258&&d!=c&&(t(8,d=c),(E=window.localStorage)==null||E.setItem(Jc,c<<0),g()),n.$$.dirty&1&&typeof f<"u"&&g()},[f,c,r,a,u,i,s,m,d,h,_,k,S,$,T,C,D]}class AT extends be{constructor(e){super(),_e(this,e,ET,DT,me,{})}}function IT(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-1g2t3dj"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[K(e,"mousedown",n[5]),K(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,we(i)}}}function LT(n,e,t){const i=rt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-s.offsetLeft,u=_.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(_){let k=_.clientX-o,S=_.clientY-r,$=_.clientX-a,T=_.clientY-u;!f&&Math.abs($-s.offsetLeft){s=_,t(0,s)})}const h=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,l=_.tolerance)},[s,f,c,l,g,h]}class PT extends be{constructor(e){super(),_e(this,e,LT,IT,me,{tolerance:3})}}function FT(n){let e,t,i,l,s;const o=n[5].default,r=vt(o,n,n[4],null);return l=new PT({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){w(a,e,u),r&&r.m(e,null),n[6](e),w(a,i,u),z(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&St(r,o,a,a[4],s?wt(o,a[4],u,null):Tt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(A(r,a),A(l.$$.fragment,a),s=!0)},o(a){I(r,a),I(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const Zc="@adminSidebarWidth";function NT(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Zc)||null;function u(m){te[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Zc,a))},[s,o,a,r,l,i,u,f,c,d]}class Wb extends be{constructor(e){super(),_e(this,e,NT,FT,me,{class:0})}}const Ga=Dn({});function an(n,e,t){Ga.set({text:n,yesCallback:e,noCallback:t})}function Yb(){Ga.set({})}function Gc(n){let e,t,i;const l=n[17].default,s=vt(l,n,n[16],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[18](e),i=!0},p(o,r){s&&s.p&&(!i||r&65536)&&St(s,l,o,o[16],i?wt(l,o[16],r,null):Tt(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(A(s,o),o&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){I(s,o),o&&(t||(t=Le(e,jn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[18](null),o&&t&&t.end()}}}function RT(n){let e,t,i,l,s=n[0]&&Gc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),t=!0,i||(l=[K(window,"mousedown",n[5]),K(window,"click",n[6]),K(window,"keydown",n[4]),K(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?s?(s.p(o,r),r&1&&A(s,1)):(s=Gc(o),s.c(),A(s,1),s.m(e,null)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){t||(A(s),t=!0)},o(o){I(s),t=!1},d(o){o&&v(e),s&&s.d(),n[19](null),i=!1,we(l)}}}function qT(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,g,h=!1;const _=rt();function k(){t(0,o=!1),h=!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 $(){o?k():S()}function T(W){return!c||W.classList.contains(u)||(m==null?void 0:m.contains(W))&&!c.contains(W)||c.contains(W)&&W.closest&&W.closest("."+u)}function C(W){(!o||T(W.target))&&(W.preventDefault(),W.stopPropagation(),$())}function D(W){(W.code==="Enter"||W.code==="Space")&&(!o||T(W.target))&&(W.preventDefault(),W.stopPropagation(),$())}function O(W){o&&r&&W.code==="Escape"&&(W.preventDefault(),k())}function E(W){o&&!(c!=null&&c.contains(W.target))?h=!0:h&&(h=!1)}function L(W){var G;o&&h&&!(c!=null&&c.contains(W.target))&&!(m!=null&&m.contains(W.target))&&!((G=W.target)!=null&&G.closest(".flatpickr-calendar"))&&k()}function R(W){E(W),L(W)}function P(W){F(),c==null||c.addEventListener("click",C),t(15,m=W||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",C),m==null||m.addEventListener("keydown",D)}function F(){clearTimeout(g),c==null||c.removeEventListener("click",C),m==null||m.removeEventListener("click",C),m==null||m.removeEventListener("keydown",D)}Vt(()=>(P(),()=>F()));function N(W){te[W?"unshift":"push"](()=>{d=W,t(3,d)})}function q(W){te[W?"unshift":"push"](()=>{c=W,t(2,c)})}return n.$$set=W=>{"trigger"in W&&t(8,s=W.trigger),"active"in W&&t(0,o=W.active),"escClose"in W&&t(9,r=W.escClose),"autoScroll"in W&&t(10,a=W.autoScroll),"closableClass"in W&&t(11,u=W.closableClass),"class"in W&&t(1,f=W.class),"$$scope"in W&&t(16,l=W.$$scope)},n.$$.update=()=>{var W,G;n.$$.dirty&260&&c&&P(s),n.$$.dirty&32769&&(o?((W=m==null?void 0:m.classList)==null||W.add("active"),_("show")):((G=m==null?void 0:m.classList)==null||G.remove("active"),_("hide")))},[o,f,c,d,O,E,L,R,s,r,a,u,k,S,$,m,l,i,N,q]}class En extends be{constructor(e){super(),_e(this,e,qT,RT,me,{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 Xc(n,e,t){const i=n.slice();return i[27]=e[t],i}function jT(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=M(),s=b("label"),o=Y("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){w(f,e,c),w(f,l,c),w(f,s,c),y(s,o),a||(u=K(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(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function HT(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>ge(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!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=Dt(o,r(a)),te.push(()=>ge(e,"value",s)),B(e.$$.fragment),A(e.$$.fragment,1),z(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],ye(()=>t=!1)),e.$set(c)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function zT(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function VT(n){let e,t,i,l;const s=[zT,HT],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Qc(n){let e,t,i,l=pe(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new he({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[VT,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Qc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ke()},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),r&&r.m(a,u),w(a,s,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(s.parentNode,s)):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&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function UT(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=Y(t),l=Y(" index")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&se(i,t)},d(s){s&&v(e)}}}function ed(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[ve(Fe.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function WT(n){let e,t,i,l,s,o,r=n[5]!=""&&ed(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"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,l,u),s||(o=[K(t,"click",n[17]),K(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=ed(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,we(o)}}}function YT(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[WT],header:[UT],default:[BT]},$$scope:{ctx:n}};for(let s=0;sH.name==W);J?j.removeByValue(G.columns,J):j.pushUnique(G.columns,{name:W}),t(2,d=j.buildIndex(G))}Vt(async()=>{t(8,h=!0);try{t(7,g=(await st(()=>import("./CodeEditor-80667d26.js"),["./CodeEditor-80667d26.js","./index-102ce751.js"],import.meta.url)).default)}catch(W){console.warn(W)}t(8,h=!1)});const D=()=>$(),O=()=>k(),E=()=>T(),L=W=>{t(3,l.unique=W.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=j.buildIndex(l))};function R(W){d=W,t(2,d)}const P=W=>C(W);function F(W){te[W?"unshift":"push"](()=>{f=W,t(4,f)})}function N(W){Ee.call(this,n,W)}function q(W){Ee.call(this,n,W)}return n.$$set=W=>{e=Pe(Pe({},e),Kt(W)),t(14,r=Ze(e,o)),"collection"in W&&t(0,u=W.collection)},n.$$.update=()=>{var W,G,J;n.$$.dirty[0]&1&&t(10,i=(((G=(W=u==null?void 0:u.schema)==null?void 0:W.filter(H=>!H.toDelete))==null?void 0:G.map(H=>H.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((J=l.columns)==null?void 0:J.map(H=>H.name))||[])},[u,k,d,l,f,c,m,g,h,s,i,$,T,C,r,_,D,O,E,L,R,P,F,N,q]}class JT extends be{constructor(e){super(),_e(this,e,KT,YT,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function td(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function nd(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function id(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(ld).join(", "))+"",s,o,r,a,u,f=n[11].unique&&nd();function c(){return n[4](n[10],n[13])}return{c(){var m,g;e=b("button"),f&&f.c(),t=M(),i=b("span"),s=Y(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((g=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&g.message?"label-danger":"")+" svelte-167lbwu")},m(m,g){var h,_;w(m,e,g),f&&f.m(e,null),y(e,t),y(e,i),y(i,s),a||(u=[ve(r=Fe.call(null,e,((_=(h=n[2].indexes)==null?void 0:h[n[13]])==null?void 0:_.message)||"")),K(e,"click",c)],a=!0)},p(m,g){var h,_,k,S,$;n=m,n[11].unique?f||(f=nd(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),g&1&&l!==(l=((h=n[11].columns)==null?void 0:h.map(ld).join(", "))+"")&&se(s,l),g&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&$t(r.update)&&g&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&v(e),f&&f.d(),a=!1,we(u)}}}function ZT(n){var T,C,D;let e,t,i=(((C=(T=n[0])==null?void 0:T.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,u,f,c,d,m,g,h,_=pe(((D=n[0])==null?void 0:D.indexes)||[]),k=[];for(let O=0;O<_.length;O+=1)k[O]=id(td(n,_,O));function S(O){n[7](O)}let $={};return n[0]!==void 0&&($.collection=n[0]),c=new JT({props:$}),n[6](c),te.push(()=>ge(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=Y("Unique constraints and indexes ("),l=Y(i),s=Y(")"),o=M(),r=b("div");for(let O=0;O+ New index',f=M(),B(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(O,E){w(O,e,E),y(e,t),y(e,l),y(e,s),w(O,o,E),w(O,r,E);for(let L=0;Ld=!1)),c.$set(L)},i(O){m||(A(c.$$.fragment,O),m=!0)},o(O){I(c.$$.fragment,O),m=!1},d(O){O&&(v(e),v(o),v(r),v(f)),at(k,O),n[6](null),V(c,O),g=!1,h()}}}const ld=n=>n.name;function GT(n,e,t){let i;We(n,gi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,g){for(let h=0;hs==null?void 0:s.show(m,g),a=()=>s==null?void 0:s.show();function u(m){te[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let g=0;g{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class XT extends be{constructor(e){super(),_e(this,e,GT,ZT,me,{collection:0})}}function sd(n,e,t){const i=n.slice();return i[6]=e[t],i}function od(n){let e,t,i,l,s,o,r;function a(){return n[4](n[6])}function u(...f){return n[5](n[6],...f)}return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[6].label}`,s=M(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(f,c){w(f,e,c),y(e,t),y(e,i),y(e,l),y(e,s),o||(r=[K(e,"click",fn(a)),K(e,"keydown",fn(u))],o=!0)},p(f,c){n=f},d(f){f&&v(e),o=!1,we(r)}}}function QT(n){let e,t=pe(n[2]),i=[];for(let l=0;l{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,l,s,o,r,a]}class t$ extends be{constructor(e){super(),_e(this,e,e$,xT,me,{class:0})}}const n$=n=>({interactive:n&64,hasErrors:n&32}),rd=n=>({interactive:n[6],hasErrors:n[5]}),i$=n=>({interactive:n&64,hasErrors:n&32}),ad=n=>({interactive:n[6],hasErrors:n[5]}),l$=n=>({interactive:n&64,hasErrors:n&32}),ud=n=>({interactive:n[6],hasErrors:n[5]});function fd(n){let e;return{c(){e=b("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&&v(e)}}}function cd(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=Y(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),y(e,t),y(t,i)},p(l,s){s&16&&se(i,l[4])},d(l){l&&v(e)}}}function s$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[0].required&&cd(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(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,h){m&&m.m(g,h),w(g,e,h),w(g,t,h),y(t,i),w(g,s,h),w(g,o,h),n[14](o),n[0].id||o.focus(),c||(d=K(o,"input",n[15]),c=!0)},p(g,h){g[0].required?m?m.p(g,h):(m=cd(g),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),h&1&&l!==(l=j.getFieldTypeIcon(g[0].type))&&p(i,"class",l),h&64&&x(t,"txt-disabled",!g[6]),h&64&&r!==(r=!g[6])&&(o.disabled=r),h&1&&a!==(a=g[0].id&&g[0].system)&&(o.readOnly=a),h&1&&u!==(u=!g[0].id)&&(o.autofocus=u),h&1&&f!==(f=g[0].name)&&o.value!==f&&(o.value=f)},d(g){g&&(v(e),v(t),v(s),v(o)),m&&m.d(g),n[14](null),c=!1,d()}}}function o$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function r$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("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")),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),y(e,t),l||(s=K(e,"click",n[11]),l=!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&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function a$(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=[ve(Fe.call(null,e,"Restore")),K(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function dd(n){let e,t,i,l,s,o,r,a,u,f,c;const d=n[13].options,m=vt(d,n,n[18],ad);s=new he({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[u$,({uniqueId:k})=>({24:k}),({uniqueId:k})=>k?16777216:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[f$,({uniqueId:k})=>({24:k}),({uniqueId:k})=>k?16777216:0]},$$scope:{ctx:n}}});const g=n[13].optionsFooter,h=vt(g,n,n[18],rd);let _=!n[0].toDelete&&pd(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),h&&h.c(),u=M(),_&&_.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(k,S){w(k,e,S),y(e,t),m&&m.m(t,null),y(e,i),y(e,l),z(s,l,null),y(l,o),z(r,l,null),y(l,a),h&&h.m(l,null),y(l,u),_&&_.m(l,null),c=!0},p(k,S){m&&m.p&&(!c||S&262240)&&St(m,d,k,k[18],c?wt(d,k[18],S,i$):Tt(k[18]),ad);const $={};S&17039377&&($.$$scope={dirty:S,ctx:k}),s.$set($);const T={};S&17039361&&(T.$$scope={dirty:S,ctx:k}),r.$set(T),h&&h.p&&(!c||S&262240)&&St(h,g,k,k[18],c?wt(g,k[18],S,n$):Tt(k[18]),rd),k[0].toDelete?_&&(re(),I(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&1&&A(_,1)):(_=pd(k),_.c(),A(_,1),_.m(l,null))},i(k){c||(A(m,k),A(s.$$.fragment,k),A(r.$$.fragment,k),A(h,k),A(_),k&&Ke(()=>{c&&(f||(f=Le(e,et,{duration:150},!0)),f.run(1))}),c=!0)},o(k){I(m,k),I(s.$$.fragment,k),I(r.$$.fragment,k),I(h,k),I(_),k&&(f||(f=Le(e,et,{duration:150},!1)),f.run(0)),c=!1},d(k){k&&v(e),m&&m.d(k),V(s),V(r),h&&h.d(k),_&&_.d(),k&&f&&f.end()}}}function u$(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=Y(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[24])},m(m,g){w(m,e,g),e.checked=n[0].required,w(m,i,g),w(m,l,g),y(l,s),y(s,o),y(l,r),y(l,a),c||(d=[K(e,"change",n[16]),ve(u=Fe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,g){g&16777216&&t!==(t=m[24])&&p(e,"id",t),g&1&&(e.checked=m[0].required),g&16&&se(o,m[4]),u&&$t(u.update)&&g&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),g&16777216&&f!==(f=m[24])&&p(l,"for",f)},d(m){m&&(v(e),v(i),v(l)),c=!1,we(d)}}}function f$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[24])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[17]),ve(Fe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function pd(n){let e,t,i,l,s,o,r,a,u;return a=new En({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[c$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=M(),l=b("div"),s=b("button"),o=b("i"),r=M(),B(a.$$.fragment),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(s,"type","button"),p(s,"aria-label","More"),p(s,"class","btn btn-circle btn-sm btn-transparent"),p(l,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(f,c){w(f,e,c),y(e,t),y(e,i),y(e,l),y(l,s),y(s,o),y(s,r),z(a,s,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&&v(e),V(a)}}}function c$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function d$(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&fd();l=new he({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[s$]},$$scope:{ctx:n}}});const c=n[13].default,d=vt(c,n,n[18],ud),m=d||o$();function g(S,$){if(S[0].toDelete)return a$;if(S[6])return r$}let h=g(n),_=h&&h(n),k=n[6]&&n[3]&&dd(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),_&&_.c(),r=M(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,$){w(S,e,$),y(e,t),f&&f.m(t,null),y(t,i),z(l,t,null),y(t,s),m&&m.m(t,null),y(t,o),_&&_.m(t,null),y(e,r),k&&k.m(e,null),u=!0},p(S,[$]){S[6]?f||(f=fd(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$&64&&(T.class="form-field required m-0 "+(S[6]?"":"disabled")),$&2&&(T.name="schema."+S[1]+".name"),$&262229&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),d&&d.p&&(!u||$&262240)&&St(d,c,S,S[18],u?wt(c,S[18],$,l$):Tt(S[18]),ud),h===(h=g(S))&&_?_.p(S,$):(_&&_.d(1),_=h&&h(S),_&&(_.c(),_.m(t,null))),S[6]&&S[3]?k?(k.p(S,$),$&72&&A(k,1)):(k=dd(S),k.c(),A(k,1),k.m(e,null)):k&&(re(),I(k,1,1,()=>{k=null}),ae()),(!u||$&1)&&x(e,"required",S[0].required),(!u||$&72)&&x(e,"expanded",S[6]&&S[3]),(!u||$&1)&&x(e,"deleted",S[0].toDelete)},i(S){u||(A(l.$$.fragment,S),A(m,S),A(k),S&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(S){I(l.$$.fragment,S),I(m,S),I(k),S&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&v(e),f&&f.d(),V(l),m&&m.d(S),_&&_.d(),k&&k.d(),S&&a&&a.end()}}}let Ar=[];function p$(n,e,t){let i,l,s,o;We(n,gi,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+j.randomString(8),f=rt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,g,h=!1;function _(){m.id?t(0,m.toDelete=!0,m):f("remove")}function k(){t(0,m.toDelete=!1,m),Gt({})}function S(P){return j.slugify(P)}function $(){t(3,h=!0),D()}function T(){t(3,h=!1)}function C(){h?T():$()}function D(){for(let P of Ar)P.id!=u&&P.collapse()}Vt(()=>(Ar.push({id:u,collapse:T}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),g==null||g.select()),()=>{j.removeByKey(Ar,"id",u)}));function O(P){te[P?"unshift":"push"](()=>{g=P,t(2,g)})}const E=P=>{const F=m.name;t(0,m.name=S(P.target.value),m),P.target.value=m.name,f("rename",{oldName:F,newName:m.name})};function L(){m.required=this.checked,t(0,m)}function R(){m.presentable=this.checked,t(0,m)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,m=P.field),"$$scope"in P&&t(18,a=P.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&4098&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,g,h,s,l,i,f,_,k,S,C,o,r,O,E,L,R,a]}class si extends be{constructor(e){super(),_e(this,e,p$,d$,me,{key:1,field:0})}}function m$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min length"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"step","1"),p(s,"min","0")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.min),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.min&&ce(s,u[0].options.min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function h$(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max length"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ce(s,n[0].options.max),a||(u=K(s,"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(s,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.max&&ce(s,f[0].options.max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function g$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","text"),p(s,"id",o=n[9]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.pattern),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].options.pattern&&ce(s,u[0].options.pattern)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function _$(n){let e,t,i,l,s,o,r,a,u,f;return i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[m$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[h$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new he({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[g$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),f=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&1537&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const h={};d&2&&(h.name="schema."+c[1]+".options.pattern"),d&1537&&(h.$$scope={dirty:d,ctx:c}),u.$set(h)},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&&v(e),V(i),V(o),V(u)}}}function b$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[_$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 y$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=ut(this.value),t(0,s)}function a(){s.options.max=ut(this.value),t(0,s)}function u(){s.options.pattern=this.value,t(0,s)}function f(m){s=m,t(0,s)}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$set=m=>{e=Pe(Pe({},e),Kt(m)),t(2,l=Ze(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class k$ extends be{constructor(e){super(),_e(this,e,y$,b$,me,{field:0,key:1})}}function v$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9])},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.min),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.min&&ce(s,u[0].options.min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function w$(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"min",r=n[0].options.min)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ce(s,n[0].options.max),a||(u=K(s,"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(s,"id",o),c&1&&r!==(r=f[0].options.min)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.max&&ce(s,f[0].options.max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function S$(n){let e,t,i,l,s,o,r;return i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[v$,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[w$,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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&&v(e),V(i),V(o)}}}function T$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[3]),ve(Fe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function $$(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[T$,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function C$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[$$],options:[S$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 M$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=ut(this.value),t(0,s)}function u(){s.options.max=ut(this.value),t(0,s)}function f(m){s=m,t(0,s)}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$set=m=>{e=Pe(Pe({},e),Kt(m)),t(2,l=Ze(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class O$ extends be{constructor(e){super(),_e(this,e,M$,C$,me,{field:0,key:1})}}function D$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rge(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(f){s=f,t(0,s)}function a(f){Ee.call(this,n,f)}function u(f){Ee.call(this,n,f)}return n.$$set=f=>{e=Pe(Pe({},e),Kt(f)),t(2,l=Ze(e,i)),"field"in f&&t(0,s=f.field),"key"in f&&t(1,o=f.key)},[s,o,l,r,a,u]}class A$ extends be{constructor(e){super(),_e(this,e,E$,D$,me,{field:0,key:1})}}function I$(n){let e,t,i,l,s=[{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=Pe(Pe({},e),Kt(c)),t(5,s=Ze(e,l)),"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,s,f]}class Nl extends be{constructor(e){super(),_e(this,e,L$,I$,me,{value:0,separator:1,readonly:2,disabled:3})}}function P$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[3](_)}let h={id:n[8],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(h.value=n[0].options.exceptDomains),r=new Nl({props:h}),te.push(()=>ge(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[8]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Fe.call(null,l,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&256&&s!==(s=_[8]))&&p(e,"for",s);const S={};k&256&&(S.id=_[8]),k&1&&(S.disabled=!j.isEmpty(_[0].options.onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.exceptDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function F$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[4](_)}let h={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(h.value=n[0].options.onlyDomains),r=new Nl({props:h}),te.push(()=>ge(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Fe.call(null,l,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&256&&s!==(s=_[8]+".options.onlyDomains"))&&p(e,"for",s);const S={};k&256&&(S.id=_[8]+".options.onlyDomains"),k&1&&(S.disabled=!j.isEmpty(_[0].options.exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.onlyDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function N$(n){let e,t,i,l,s,o,r;return i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[P$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[F$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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&&v(e),V(i),V(o)}}}function R$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[N$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 q$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(d){n.$$.not_equal(s.options.exceptDomains,d)&&(s.options.exceptDomains=d,t(0,s))}function a(d){n.$$.not_equal(s.options.onlyDomains,d)&&(s.options.onlyDomains=d,t(0,s))}function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Pe(Pe({},e),Kt(d)),t(2,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},[s,o,l,r,a,u,f,c]}class Kb extends be{constructor(e){super(),_e(this,e,q$,R$,me,{field:0,key:1})}}function j$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rge(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 H$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(f){s=f,t(0,s)}function a(f){Ee.call(this,n,f)}function u(f){Ee.call(this,n,f)}return n.$$set=f=>{e=Pe(Pe({},e),Kt(f)),t(2,l=Ze(e,i)),"field"in f&&t(0,s=f.field),"key"in f&&t(1,o=f.key)},[s,o,l,r,a,u]}class z$ extends be{constructor(e){super(),_e(this,e,H$,j$,me,{field:0,key:1})}}function V$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[3]),ve(Fe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function B$(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[V$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&769&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function U$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[B$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 W$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Pe(Pe({},e),Kt(d)),t(2,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,u,f,c]}class Y$ extends be{constructor(e){super(),_e(this,e,W$,U$,me,{field:0,key:1})}}var Ir=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Sl={_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},ys={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},pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Ln=function(n){return n===!0?1:0};function md(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Lr=function(n){return n instanceof Array?n:[n]};function rn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ct(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 Jb(n,e){if(e(n))return n;if(n.parentNode)return Jb(n.parentNode,e)}function lo(n,e){var t=ct("div","numInputWrapper"),i=ct("input","numInput "+n),l=ct("span","arrowUp"),s=ct("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(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Pr=function(){},Ho=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},K$={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*Ln(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),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},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))}},Zi={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})"},as={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[as.w(n,e,t)]},F:function(n,e,t){return Ho(as.n(n,e,t)-1,!1,e)},G:function(n,e,t){return pn(as.h(n,e,t))},H:function(n){return pn(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[Ln(n.getHours()>11)]},M:function(n,e){return Ho(n.getMonth(),!0,e)},S:function(n){return pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return pn(n.getFullYear(),4)},d:function(n){return pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return pn(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)}},Zb=function(n){var e=n.config,t=e===void 0?Sl:e,i=n.l10n,l=i===void 0?ys:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return as[c]&&m[d-1]!=="\\"?as[c](r,f,t):c!=="\\"?c:""}).join("")}},pa=function(n){var e=n.config,t=e===void 0?Sl:e,i=n.l10n,l=i===void 0?ys:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||Sl).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var g=void 0,h=[],_=0,k=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ie=Nr(t.config);X.setHours(ie.hours,ie.minutes,ie.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var de=t._input.value;c(),en(),t._input.value!==de&&t._debouncedChange()}function u(Z,X){return Z%12+12*Ln(X===t.l10n.amPM[1])}function f(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ie=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=u(Z,t.amPM.textContent));var de=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&kn(t.latestSelectedDateObj,t.config.minDate,!0)===0,$e=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&kn(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 Ie=Fr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Je=Fr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Fr(Z,X,ie);if(qe>Je&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=pn(ie)))}function g(Z){var X=yn(Z),ie=parseInt(X.value)+(Z.delta||0);(ie/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ie.toString()))&&tt(ie)}function h(Z,X,ie,de){if(X instanceof Array)return X.forEach(function($e){return h(Z,$e,ie,de)});if(Z instanceof Array)return Z.forEach(function($e){return h($e,X,ie,de)});Z.addEventListener(X,ie,de),t._handlers.push({remove:function(){return Z.removeEventListener(X,ie,de)}})}function _(){bt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ie){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ie+"]"),function(de){return h(de,"click",t[ie])})}),t.isMobile){fl();return}var Z=md(ze,50);if(t._debouncedChange=md(_,X$),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&h(t.daysContainer,"mouseover",function(ie){t.config.mode==="range"&&De(yn(ie))}),h(t._input,"keydown",Ce),t.calendarContainer!==void 0&&h(t.calendarContainer,"keydown",Ce),!t.config.inline&&!t.config.static&&h(window,"resize",Z),window.ontouchstart!==void 0?h(window.document,"touchstart",Qe):h(window.document,"mousedown",Qe),h(window.document,"focus",Qe,{capture:!0}),t.config.clickOpens===!0&&(h(t._input,"focus",t.open),h(t._input,"click",t.open)),t.daysContainer!==void 0&&(h(t.monthNav,"click",Bn),h(t.monthNav,["keyup","increment"],g),h(t.daysContainer,"click",al)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ie){return yn(ie).select()};h(t.timeContainer,["increment"],a),h(t.timeContainer,"blur",a,{capture:!0}),h(t.timeContainer,"click",$),h([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&h(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&h(t.amPM,"click",function(ie){a(ie)})}t.config.allowInput&&h(t._input,"blur",Pt)}function S(Z,X){var ie=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var $e=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&&(!$e&&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 Ie=ct("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ie,t.element),Ie.appendChild(t.element),t.altInput&&Ie.appendChild(t.altInput),Ie.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function D(Z,X,ie,de){var $e=Ge(X,!0),Ie=ct("span",Z,X.getDate().toString());return Ie.dateObj=X,Ie.$i=de,Ie.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&kn(X,t.now)===0&&(t.todayDateElem=Ie,Ie.classList.add("today"),Ie.setAttribute("aria-current","date")),$e?(Ie.tabIndex=-1,Me(X)&&(Ie.classList.add("selected"),t.selectedDateElem=Ie,t.config.mode==="range"&&(rn(Ie,"startRange",t.selectedDates[0]&&kn(X,t.selectedDates[0],!0)===0),rn(Ie,"endRange",t.selectedDates[1]&&kn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Ie.classList.add("inRange")))):Ie.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Xe(X)&&!Me(X)&&Ie.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&de%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),bt("onDayCreate",Ie),Ie}function O(Z){Z.focus(),t.config.mode==="range"&&De(Z)}function E(Z){for(var X=Z>0?0:t.config.showMonths-1,ie=Z>0?t.config.showMonths:-1,de=X;de!=ie;de+=Z)for(var $e=t.daysContainer.children[de],Ie=Z>0?0:$e.children.length-1,Je=Z>0?$e.children.length:-1,qe=Ie;qe!=Je;qe+=Z){var xe=$e.children[qe];if(xe.className.indexOf("hidden")===-1&&Ge(xe.dateObj))return xe}}function L(Z,X){for(var ie=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,de=X>0?t.config.showMonths:-1,$e=X>0?1:-1,Ie=ie-t.currentMonth;Ie!=de;Ie+=$e)for(var Je=t.daysContainer.children[Ie],qe=ie-t.currentMonth===Ie?Z.$i+X:X<0?Je.children.length-1:0,xe=Je.children.length,Re=qe;Re>=0&&Re0?xe:-1);Re+=$e){var Be=Je.children[Re];if(Be.className.indexOf("hidden")===-1&&Ge(Be.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return O(Be)}t.changeMonth($e),R(E($e),0)}function R(Z,X){var ie=s(),de=Mt(ie||document.body),$e=Z!==void 0?Z:de?ie:t.selectedDateElem!==void 0&&Mt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Mt(t.todayDateElem)?t.todayDateElem:E(X>0?1:-1);$e===void 0?t._input.focus():de?L($e,X):O($e)}function P(Z,X){for(var ie=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,de=t.utils.getDaysInMonth((X-1+12)%12,Z),$e=t.utils.getDaysInMonth(X,Z),Ie=window.document.createDocumentFragment(),Je=t.config.showMonths>1,qe=Je?"prevMonthDay hidden":"prevMonthDay",xe=Je?"nextMonthDay hidden":"nextMonthDay",Re=de+1-ie,Be=0;Re<=de;Re++,Be++)Ie.appendChild(D("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Be));for(Re=1;Re<=$e;Re++,Be++)Ie.appendChild(D("flatpickr-day",new Date(Z,X,Re),Re,Be));for(var kt=$e+1;kt<=42-ie&&(t.config.showMonths===1||Be%7!==0);kt++,Be++)Ie.appendChild(D("flatpickr-day "+xe,new Date(Z,X+1,kt%$e),kt,Be));var Xn=ct("div","dayContainer");return Xn.appendChild(Ie),Xn}function F(){if(t.daysContainer!==void 0){io(t.daysContainer),t.weekNumbers&&io(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(de){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&det.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ie=ct("option","flatpickr-monthDropdown-month");ie.value=new Date(t.currentYear,X).getMonth().toString(),ie.textContent=Ho(X,t.config.shorthandCurrentMonth,t.l10n),ie.tabIndex=-1,t.currentMonth===X&&(ie.selected=!0),t.monthsDropdownContainer.appendChild(ie)}}}function q(){var Z=ct("div","flatpickr-month"),X=window.document.createDocumentFragment(),ie;t.config.showMonths>1||t.config.monthSelectorType==="static"?ie=ct("span","cur-month"):(t.monthsDropdownContainer=ct("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),h(t.monthsDropdownContainer,"change",function(Je){var qe=yn(Je),xe=parseInt(qe.value,10);t.changeMonth(xe-t.currentMonth),bt("onMonthChange")}),N(),ie=t.monthsDropdownContainer);var de=lo("cur-year",{tabindex:"-1"}),$e=de.getElementsByTagName("input")[0];$e.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&$e.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&($e.setAttribute("max",t.config.maxDate.getFullYear().toString()),$e.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ie=ct("div","flatpickr-current-month");return Ie.appendChild(ie),Ie.appendChild(de),X.appendChild(Ie),Z.appendChild(X),{container:Z,yearElement:$e,monthElement:ie}}function W(){io(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function G(){return t.monthNav=ct("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ct("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ct("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,W(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(rn(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(rn(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Jt(),t.monthNav}function J(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Nr(t.config);t.timeContainer=ct("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ct("span","flatpickr-time-separator",":"),ie=lo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ie.getElementsByTagName("input")[0];var de=lo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=de.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:f(Z.hours)),t.minuteElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.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(X),t.timeContainer.appendChild(de),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var $e=lo("flatpickr-second");t.secondElement=$e.getElementsByTagName("input")[0],t.secondElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.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(ct("span","flatpickr-time-separator",":")),t.timeContainer.appendChild($e)}return t.config.time_24hr||(t.amPM=ct("span","flatpickr-am-pm",t.l10n.amPM[Ln((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 H(){t.weekdayContainer?io(t.weekdayContainer):t.weekdayContainer=ct("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=ct("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return U(),t.weekdayContainer}function U(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=hd(t.l10n.weekdays.shorthand);Z>0&&Z>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),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 JS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(l,s){w(l,e,s),y(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function ZS(n,e,t){let{class:i=""}=e,{content:l=""}=e,{language:s="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Jl.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Jl.highlight(a,Jl.languages[s]||Jl.languages.javascript,s)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,l=a.content),"language"in a&&t(3,s=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Jl<"u"&&l&&t(1,o=r(l))},[i,o,l,s]}class Bb extends _e{constructor(e){super(),ge(this,e,ZS,JS,he,{class:0,content:2,language:3})}}const GS=n=>({}),Rc=n=>({}),XS=n=>({}),qc=n=>({});function jc(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$=n[4]&&!n[2]&&Hc(n);const T=n[19].header,C=vt(T,n,n[18],qc);let D=n[4]&&n[2]&&zc(n);const O=n[19].default,E=vt(O,n,n[18],null),L=n[19].footer,R=vt(L,n,n[18],Rc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),$&&$.c(),r=M(),C&&C.c(),a=M(),D&&D.c(),u=M(),f=b("div"),E&&E.c(),c=M(),d=b("div"),R&&R.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(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(P,F){w(P,e,F),y(e,t),y(e,l),y(e,s),y(s,o),$&&$.m(o,null),y(o,r),C&&C.m(o,null),y(o,a),D&&D.m(o,null),y(s,u),y(s,f),E&&E.m(f,null),n[21](f),y(s,c),y(s,d),R&&R.m(d,null),_=!0,k||(S=[K(t,"click",Ye(n[20])),K(f,"scroll",n[22])],k=!0)},p(P,F){n=P,n[4]&&!n[2]?$?($.p(n,F),F[0]&20&&A($,1)):($=Hc(n),$.c(),A($,1),$.m(o,r)):$&&(re(),I($,1,1,()=>{$=null}),ae()),C&&C.p&&(!_||F[0]&262144)&&St(C,T,n,n[18],_?wt(T,n[18],F,XS):Tt(n[18]),qc),n[4]&&n[2]?D?D.p(n,F):(D=zc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),E&&E.p&&(!_||F[0]&262144)&&St(E,O,n,n[18],_?wt(O,n[18],F,null):Tt(n[18]),null),R&&R.p&&(!_||F[0]&262144)&&St(R,L,n,n[18],_?wt(L,n[18],F,GS):Tt(n[18]),Rc),(!_||F[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||F[0]&262)&&x(s,"popup",n[2]),(!_||F[0]&4)&&x(e,"padded",n[2]),(!_||F[0]&1)&&x(e,"active",n[0])},i(P){_||(P&&Ke(()=>{_&&(i||(i=Le(t,cs,{duration:Si,opacity:0},!0)),i.run(1))}),A($),A(C,P),A(E,P),A(R,P),P&&Ke(()=>{_&&(h&&h.end(1),g=H_(s,jn,n[2]?{duration:Si,y:-10}:{duration:Si,x:50}),g.start())}),_=!0)},o(P){P&&(i||(i=Le(t,cs,{duration:Si,opacity:0},!1)),i.run(0)),I($),I(C,P),I(E,P),I(R,P),g&&g.invalidate(),P&&(h=ka(s,jn,n[2]?{duration:Si,y:10}:{duration:Si,x:50})),_=!1},d(P){P&&v(e),P&&i&&i.end(),$&&$.d(),C&&C.d(P),D&&D.d(),E&&E.d(P),n[21](null),R&&R.d(P),P&&h&&h.end(),k=!1,we(S)}}}function Hc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",Ye(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,cs,{duration:Si},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,cs,{duration:Si},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function zc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function QS(n){let e,t,i,l,s=n[0]&&jc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&A(s,1)):(s=jc(o),s.c(),A(s,1),s.m(e,null)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){t||(A(s),t=!0)},o(o){I(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,we(l)}}}let Wi,Dr=[];function Ub(){return Wi=Wi||document.querySelector(".overlays"),Wi||(Wi=document.createElement("div"),Wi.classList.add("overlays"),document.body.appendChild(Wi)),Wi}let Si=150;function Vc(){return 1e3+Ub().querySelectorAll(".overlay-panel-container.active").length}function xS(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=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 m=rt(),g="op_"+j.randomString(10);let h,_,k,S,$="",T=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function D(){typeof d=="function"&&d()===!1||t(0,o=!1)}function O(){return o}async function E(U){t(17,T=U),U?(k=document.activeElement,m("show"),h==null||h.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await Qt(),L()}function L(){h&&(o?t(6,h.style.zIndex=Vc(),h):t(6,h.style="",h))}function R(){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)&&h&&h.style.zIndex==Vc()&&(U.preventDefault(),D())}function N(U){o&&q(_)}function q(U,le){le&&t(8,$=""),!(!U||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!U)return;if(U.scrollHeight-U.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}U.scrollTop==0?t(8,$+=" scroll-top-reached"):U.scrollTop+U.offsetHeight==U.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Vt(()=>(Ub().appendChild(h),()=>{var U;clearTimeout(S),P(),(U=h==null?void 0:h.classList)==null||U.add("hidden"),setTimeout(()=>{h==null||h.remove()},0)}));const W=()=>a?D():!0;function G(U){te[U?"unshift":"push"](()=>{_=U,t(7,_)})}const J=U=>q(U.target);function H(U){te[U?"unshift":"push"](()=>{h=U,t(6,h)})}return n.$$set=U=>{"class"in U&&t(1,s=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,l=U.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&E(o),n.$$.dirty[0]&128&&q(_,!0),n.$$.dirty[0]&64&&h&&L(),n.$$.dirty[0]&1&&(o?R():P())},[o,s,r,a,u,D,h,_,$,F,N,q,f,c,d,C,O,T,l,i,W,G,J,H]}class Xt extends _e{constructor(e){super(),ge(this,e,xS,QS,he,{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 eT(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),l||(s=[ve(i=Pe.call(null,e,n[2]?"":"Copy")),K(e,"click",fn(n[3]))],l=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&$t(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:Q,o:Q,d(o){o&&v(e),l=!1,we(s)}}}function tT(n,e,t){let{value:i=""}=e,{idleClasses:l="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:s="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 Vt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,l=u.idleClasses),"successClasses"in u&&t(1,s=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[l,s,r,a,i,o]}class rl extends _e{constructor(e){super(),ge(this,e,tT,eT,he,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function Bc(n,e,t){const i=n.slice();i[13]=e[t];const l=i[1].data[i[13]];return i[14]=l,i}function Uc(n){let e,t,i,l;function s(a,u){return a[1].message?iT:nT}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,u){w(a,e,u),y(e,t),y(e,i),y(e,l),r.m(l,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function nT(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function iT(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&se(i,t)},d(l){l&&v(e)}}}function lT(n){let e,t=n[14]+"",i,l=n[13]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=Y(t),s=Y(l),p(e,"class","txt")},m(o,r){w(o,e,r),y(e,i),y(e,s)},p(o,r){r&2&&t!==(t=o[14]+"")&&se(i,t),r&2&&l!==(l=o[13]=="execTime"?"ms":"")&&se(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function sT(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function oT(n){let e,t;return e=new Bb({props:{content:JSON.stringify(n[14],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[14],null,2)),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Wc(n){let e,t,i,l=n[13]+"",s,o,r,a,u,f,c,d;const m=[oT,sT,lT],g=[];function h(_,k){return k&2&&(a=null),_[14]!==null&&typeof _[14]=="object"?0:(a==null&&(a=!!j.isEmpty(_[14])),a?1:2)}return u=h(n,-1),f=g[u]=m[u](n),{c(){e=b("tr"),t=b("td"),i=Y("data."),s=Y(l),o=M(),r=b("td"),f.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[3])},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,s),y(e,o),y(e,r),g[u].m(r,null),y(e,c),d=!0},p(_,k){(!d||k&2)&&l!==(l=_[13]+"")&&se(s,l),(!d||k&8)&&x(t,"v-align-top",_[3]);let S=u;u=h(_,k),u===S?g[u].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),f=g[u],f?f.p(_,k):(f=g[u]=m[u](_),f.c()),A(f,1),f.m(r,null))},i(_){d||(A(f),d=!0)},o(_){I(f),d=!1},d(_){_&&v(e),g[u].d()}}}function rT(n){var G;let e,t,i,l,s,o,r,a,u,f,c=n[1].id+"",d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;a=new rl({props:{value:n[1].id}}),S=new Q1({props:{level:n[1].level}}),E=new x1({props:{date:n[1].created}});let F=((G=n[1].data)==null?void 0:G.type)!="request"&&Uc(n),N=pe(n[4](n[1].data)),q=[];for(let J=0;JI(q[J],1,1,()=>{q[J]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),u=M(),f=b("div"),d=Y(c),m=M(),g=b("tr"),h=b("td"),h.textContent="level",_=M(),k=b("td"),B(S.$$.fragment),$=M(),T=b("tr"),C=b("td"),C.textContent="created",D=M(),O=b("td"),B(E.$$.fragment),L=M(),F&&F.c(),R=M();for(let J=0;JClose',t=M(),i=b("button"),i.innerHTML=' Download as JSON',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-primary")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[7]),K(i,"click",n[8])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function fT(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[uT],header:[aT],default:[rT]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[9](e),e.$on("hide",n[10]),e.$on("show",n[11]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&131082&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[9](null),V(e,l)}}}function cT(n,e,t){let i,l,s={};function o(_){if(!j.isEmpty(_))return t(1,s=_),l==null?void 0:l.show()}function r(){return l==null?void 0:l.hide()}const a=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","error","details"];function u(_){if(!_)return[];let k=[];for(let $ of a)typeof _[$]<"u"&&k.push($);const S=Object.keys(_);for(let $ of S)k.includes($)||k.push($);return k}function f(){j.downloadJson(s,"log_"+s.created.replaceAll(/[-:\. ]/gi,"")+".json")}const c=()=>r(),d=()=>f();function m(_){te[_?"unshift":"push"](()=>{l=_,t(2,l)})}function g(_){Ee.call(this,n,_)}function h(_){Ee.call(this,n,_)}return n.$$.update=()=>{n.$$.dirty&2&&t(3,i=!j.isEmpty(s.data))},[r,s,l,i,u,f,o,c,d,m,g,h]}class dT extends _e{constructor(e){super(),ge(this,e,cT,fT,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function pT(n,e,t){const i=n.slice();return i[1]=e[t],i}function mT(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function hT(n){let e,t,i,l=pe(K1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Wb extends _e{constructor(e){super(),ge(this,e,gT,hT,he,{class:0})}}function _T(n){let e,t,i,l,s,o,r,a,u;return t=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[yT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[kT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[vT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(f,c){w(f,e,c),z(t,e,null),y(e,i),z(l,e,null),y(e,s),z(o,e,null),r=!0,a||(u=K(e,"submit",Ye(n[7])),a=!0)},p(f,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:f}),l.$set(m);const g={};c&12582914&&(g.$$scope={dirty:c,ctx:f}),o.$set(g)},i(f){r||(A(t.$$.fragment,f),A(l.$$.fragment,f),A(o.$$.fragment,f),r=!0)},o(f){I(t.$$.fragment,f),I(l.$$.fragment,f),I(o.$$.fragment,f),r=!1},d(f){f&&v(e),V(t),V(l),V(o),a=!1,u()}}}function bT(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function yT(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&ut(s.value)!==c[1].logs.maxDays&&ue(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function kT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new Wb({}),{c(){e=b("label"),t=Y("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=M(),B(f.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(g,h){w(g,e,h),y(e,t),w(g,l,h),w(g,s,h),ue(s,n[1].logs.minLevel),w(g,o,h),w(g,r,h),y(r,a),y(r,u),z(f,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(g,h){(!c||h&4194304&&i!==(i=g[22]))&&p(e,"for",i),h&2&&ut(s.value)!==g[1].logs.minLevel&&ue(s,g[1].logs.minLevel)},i(g){c||(A(f.$$.fragment,g),c=!0)},o(g){I(f.$$.fragment,g),c=!1},d(g){g&&(v(e),v(l),v(s),v(o),v(r)),V(f),d=!1,m()}}}function vT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIp,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[13]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIp),f&4194304&&o!==(o=u[22])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function wT(n){let e,t,i,l;const s=[bT,_T],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function ST(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function $T(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[TT],header:[ST],default:[wT]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function CT(n,e,t){let i,l;const s=rt(),o="logs_settings_"+j.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return g(),h(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function g(){Gt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function h(){t(4,u=!0);try{const L=await fe.settings.getAll()||{};k(L)}catch(L){fe.error(L)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const L=await fe.settings.update(j.filterRedactedProps(c));k(L),t(3,a=!1),m(),It("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),fe.error(L)}}}function k(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=ut(this.value),t(1,c)}function $(){c.logs.minLevel=ut(this.value),t(1,c)}function T(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function D(L){te[L?"unshift":"push"](()=>{r=L,t(2,r)})}function O(L){Ee.call(this,n,L)}function E(L){Ee.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,_,d,f,i,S,$,T,C,D,O,E]}class MT extends _e{constructor(e){super(),ge(this,e,CT,$T,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function OT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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]),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function Yc(n){let e,t;return e=new US({props:{filter:n[0],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.filter=i[0]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Kc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[0]!==void 0&&(s.filter=n[0]),e=new a2({props:s}),te.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&1&&(t=!0,a.filter=o[0],ye(()=>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 DT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T=n[4],C,D=n[4],O,E,L,R;u=new Xo({}),u.$on("refresh",n[10]),g=new me({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[OT,({uniqueId:N})=>({20:N}),({uniqueId:N})=>N?1048576:0]},$$scope:{ctx:n}}}),_=new Os({props:{value:n[0],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[12]),S=new Wb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let P=Yc(n),F=Kc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=Y(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(u.$$.fragment),f=M(),c=b("div"),d=M(),m=b("div"),B(g.$$.fragment),h=M(),B(_.$$.fragment),k=M(),B(S.$$.fragment),$=M(),P.c(),C=M(),F.c(),O=ke(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(N,q){w(N,e,q),y(e,t),y(t,i),y(i,l),y(l,s),y(t,o),y(t,r),y(t,a),z(u,t,null),y(t,f),y(t,c),y(t,d),y(t,m),z(g,m,null),y(e,h),z(_,e,null),y(e,k),z(S,e,null),y(e,$),P.m(e,null),w(N,C,q),F.m(N,q),w(N,O,q),E=!0,L||(R=[ve(Pe.call(null,r,{text:"Logs settings",position:"right"})),K(r,"click",n[9])],L=!0)},p(N,q){(!E||q&64)&&se(s,N[6]);const W={};q&3145730&&(W.$$scope={dirty:q,ctx:N}),g.$set(W);const G={};q&1&&(G.value=N[0]),_.$set(G),q&16&&he(T,T=N[4])?(re(),I(P,1,1,Q),ae(),P=Yc(N),P.c(),A(P,1),P.m(e,null)):P.p(N,q),q&16&&he(D,D=N[4])?(re(),I(F,1,1,Q),ae(),F=Kc(N),F.c(),A(F,1),F.m(O.parentNode,O)):F.p(N,q)},i(N){E||(A(u.$$.fragment,N),A(g.$$.fragment,N),A(_.$$.fragment,N),A(S.$$.fragment,N),A(P),A(F),E=!0)},o(N){I(u.$$.fragment,N),I(g.$$.fragment,N),I(_.$$.fragment,N),I(S.$$.fragment,N),I(P),I(F),E=!1},d(N){N&&(v(e),v(C),v(O)),V(u),V(g),V(_),V(S),P.d(N),F.d(N),L=!1,we(R)}}}function ET(n){let e,t,i,l,s,o;e=new _n({props:{$$slots:{default:[DT]},$$scope:{ctx:n}}});let r={};i=new dT({props:r}),n[15](i);let a={};return s=new MT({props:a}),n[16](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(u,f){z(e,u,f),w(u,t,f),z(i,u,f),w(u,l,f),z(s,u,f),o=!0},p(u,[f]){const c={};f&2097279&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(A(e.$$.fragment,u),A(i.$$.fragment,u),A(s.$$.fragment,u),o=!0)},o(u){I(e.$$.fragment,u),I(i.$$.fragment,u),I(s.$$.fragment,u),o=!1},d(u){u&&(v(t),v(l)),V(e,u),n[15](null),V(i,u),n[16](null),V(s,u)}}}const Jc="adminRequests",Zc="adminLogRequests";function AT(n,e,t){var O;let i,l,s;We(n,Bo,E=>t(17,l=E)),We(n,Et,E=>t(6,s=E)),tn(Et,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c=(o.get(Jc)||((O=window.localStorage)==null?void 0:O.getItem(Zc)))<<0,d=c;function m(){t(4,u++,u)}function g(E={}){let L={};L.filter=f||null,L[Jc]=c<<0||null,j.replaceHashQueryParams(Object.assign(L,E))}const h=()=>a==null?void 0:a.show(),_=()=>m();function k(){c=this.checked,t(1,c)}const S=E=>t(0,f=E.detail);function $(E){f=E,t(0,f)}const T=E=>r==null?void 0:r.show(E==null?void 0:E.detail);function C(E){te[E?"unshift":"push"](()=>{r=E,t(2,r)})}function D(E){te[E?"unshift":"push"](()=>{a=E,t(3,a)})}return n.$$.update=()=>{var E;n.$$.dirty&2&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&258&&d!=c&&(t(8,d=c),(E=window.localStorage)==null||E.setItem(Zc,c<<0),g()),n.$$.dirty&1&&typeof f<"u"&&g()},[f,c,r,a,u,i,s,m,d,h,_,k,S,$,T,C,D]}class IT extends _e{constructor(e){super(),ge(this,e,AT,ET,he,{})}}function LT(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-1g2t3dj"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[K(e,"mousedown",n[5]),K(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,we(i)}}}function PT(n,e,t){const i=rt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-s.offsetLeft,u=_.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(_){let k=_.clientX-o,S=_.clientY-r,$=_.clientX-a,T=_.clientY-u;!f&&Math.abs($-s.offsetLeft){s=_,t(0,s)})}const h=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,l=_.tolerance)},[s,f,c,l,g,h]}class FT extends _e{constructor(e){super(),ge(this,e,PT,LT,he,{tolerance:3})}}function NT(n){let e,t,i,l,s;const o=n[5].default,r=vt(o,n,n[4],null);return l=new FT({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){w(a,e,u),r&&r.m(e,null),n[6](e),w(a,i,u),z(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&St(r,o,a,a[4],s?wt(o,a[4],u,null):Tt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(A(r,a),A(l.$$.fragment,a),s=!0)},o(a){I(r,a),I(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const Gc="@adminSidebarWidth";function RT(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Gc)||null;function u(m){te[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Gc,a))},[s,o,a,r,l,i,u,f,c,d]}class Yb extends _e{constructor(e){super(),ge(this,e,RT,NT,he,{class:0})}}const Xa=Dn({});function an(n,e,t){Xa.set({text:n,yesCallback:e,noCallback:t})}function Kb(){Xa.set({})}function Xc(n){let e,t,i;const l=n[17].default,s=vt(l,n,n[16],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[18](e),i=!0},p(o,r){s&&s.p&&(!i||r&65536)&&St(s,l,o,o[16],i?wt(l,o[16],r,null):Tt(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(A(s,o),o&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){I(s,o),o&&(t||(t=Le(e,jn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[18](null),o&&t&&t.end()}}}function qT(n){let e,t,i,l,s=n[0]&&Xc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),t=!0,i||(l=[K(window,"mousedown",n[5]),K(window,"click",n[6]),K(window,"keydown",n[4]),K(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?s?(s.p(o,r),r&1&&A(s,1)):(s=Xc(o),s.c(),A(s,1),s.m(e,null)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){t||(A(s),t=!0)},o(o){I(s),t=!1},d(o){o&&v(e),s&&s.d(),n[19](null),i=!1,we(l)}}}function jT(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,g,h=!1;const _=rt();function k(){t(0,o=!1),h=!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 $(){o?k():S()}function T(W){return!c||W.classList.contains(u)||(m==null?void 0:m.contains(W))&&!c.contains(W)||c.contains(W)&&W.closest&&W.closest("."+u)}function C(W){(!o||T(W.target))&&(W.preventDefault(),W.stopPropagation(),$())}function D(W){(W.code==="Enter"||W.code==="Space")&&(!o||T(W.target))&&(W.preventDefault(),W.stopPropagation(),$())}function O(W){o&&r&&W.code==="Escape"&&(W.preventDefault(),k())}function E(W){o&&!(c!=null&&c.contains(W.target))?h=!0:h&&(h=!1)}function L(W){var G;o&&h&&!(c!=null&&c.contains(W.target))&&!(m!=null&&m.contains(W.target))&&!((G=W.target)!=null&&G.closest(".flatpickr-calendar"))&&k()}function R(W){E(W),L(W)}function P(W){F(),c==null||c.addEventListener("click",C),t(15,m=W||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",C),m==null||m.addEventListener("keydown",D)}function F(){clearTimeout(g),c==null||c.removeEventListener("click",C),m==null||m.removeEventListener("click",C),m==null||m.removeEventListener("keydown",D)}Vt(()=>(P(),()=>F()));function N(W){te[W?"unshift":"push"](()=>{d=W,t(3,d)})}function q(W){te[W?"unshift":"push"](()=>{c=W,t(2,c)})}return n.$$set=W=>{"trigger"in W&&t(8,s=W.trigger),"active"in W&&t(0,o=W.active),"escClose"in W&&t(9,r=W.escClose),"autoScroll"in W&&t(10,a=W.autoScroll),"closableClass"in W&&t(11,u=W.closableClass),"class"in W&&t(1,f=W.class),"$$scope"in W&&t(16,l=W.$$scope)},n.$$.update=()=>{var W,G;n.$$.dirty&260&&c&&P(s),n.$$.dirty&32769&&(o?((W=m==null?void 0:m.classList)==null||W.add("active"),_("show")):((G=m==null?void 0:m.classList)==null||G.remove("active"),_("hide")))},[o,f,c,d,O,E,L,R,s,r,a,u,k,S,$,m,l,i,N,q]}class En extends _e{constructor(e){super(),ge(this,e,jT,qT,he,{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 Qc(n,e,t){const i=n.slice();return i[27]=e[t],i}function HT(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=M(),s=b("label"),o=Y("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){w(f,e,c),w(f,l,c),w(f,s,c),y(s,o),a||(u=K(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(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function zT(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!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=Dt(o,r(a)),te.push(()=>be(e,"value",s)),B(e.$$.fragment),A(e.$$.fragment,1),z(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],ye(()=>t=!1)),e.$set(c)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function VT(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function BT(n){let e,t,i,l;const s=[VT,zT],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function xc(n){let e,t,i,l=pe(n[10]),s=[];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:[BT,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&xc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ke()},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),r&&r.m(a,u),w(a,s,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=xc(a),r.c(),r.m(s.parentNode,s)):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&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function WT(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=Y(t),l=Y(" index")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&se(i,t)},d(s){s&&v(e)}}}function td(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[ve(Pe.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function YT(n){let e,t,i,l,s,o,r=n[5]!=""&&td(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"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,l,u),s||(o=[K(t,"click",n[17]),K(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=td(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,we(o)}}}function KT(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[YT],header:[WT],default:[UT]},$$scope:{ctx:n}};for(let s=0;sH.name==W);J?j.removeByValue(G.columns,J):j.pushUnique(G.columns,{name:W}),t(2,d=j.buildIndex(G))}Vt(async()=>{t(8,h=!0);try{t(7,g=(await st(()=>import("./CodeEditor-6ddcf228.js"),["./CodeEditor-6ddcf228.js","./index-102ce751.js"],import.meta.url)).default)}catch(W){console.warn(W)}t(8,h=!1)});const D=()=>$(),O=()=>k(),E=()=>T(),L=W=>{t(3,l.unique=W.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=j.buildIndex(l))};function R(W){d=W,t(2,d)}const P=W=>C(W);function F(W){te[W?"unshift":"push"](()=>{f=W,t(4,f)})}function N(W){Ee.call(this,n,W)}function q(W){Ee.call(this,n,W)}return n.$$set=W=>{e=Fe(Fe({},e),Kt(W)),t(14,r=Ze(e,o)),"collection"in W&&t(0,u=W.collection)},n.$$.update=()=>{var W,G,J;n.$$.dirty[0]&1&&t(10,i=(((G=(W=u==null?void 0:u.schema)==null?void 0:W.filter(H=>!H.toDelete))==null?void 0:G.map(H=>H.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((J=l.columns)==null?void 0:J.map(H=>H.name))||[])},[u,k,d,l,f,c,m,g,h,s,i,$,T,C,r,_,D,O,E,L,R,P,F,N,q]}class ZT extends _e{constructor(e){super(),ge(this,e,JT,KT,he,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function nd(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function id(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ld(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(sd).join(", "))+"",s,o,r,a,u,f=n[11].unique&&id();function c(){return n[4](n[10],n[13])}return{c(){var m,g;e=b("button"),f&&f.c(),t=M(),i=b("span"),s=Y(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((g=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&g.message?"label-danger":"")+" svelte-167lbwu")},m(m,g){var h,_;w(m,e,g),f&&f.m(e,null),y(e,t),y(e,i),y(i,s),a||(u=[ve(r=Pe.call(null,e,((_=(h=n[2].indexes)==null?void 0:h[n[13]])==null?void 0:_.message)||"")),K(e,"click",c)],a=!0)},p(m,g){var h,_,k,S,$;n=m,n[11].unique?f||(f=id(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),g&1&&l!==(l=((h=n[11].columns)==null?void 0:h.map(sd).join(", "))+"")&&se(s,l),g&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&$t(r.update)&&g&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&v(e),f&&f.d(),a=!1,we(u)}}}function GT(n){var T,C,D;let e,t,i=(((C=(T=n[0])==null?void 0:T.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,u,f,c,d,m,g,h,_=pe(((D=n[0])==null?void 0:D.indexes)||[]),k=[];for(let O=0;O<_.length;O+=1)k[O]=ld(nd(n,_,O));function S(O){n[7](O)}let $={};return n[0]!==void 0&&($.collection=n[0]),c=new ZT({props:$}),n[6](c),te.push(()=>be(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=Y("Unique constraints and indexes ("),l=Y(i),s=Y(")"),o=M(),r=b("div");for(let O=0;O+ New index',f=M(),B(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(O,E){w(O,e,E),y(e,t),y(e,l),y(e,s),w(O,o,E),w(O,r,E);for(let L=0;Ld=!1)),c.$set(L)},i(O){m||(A(c.$$.fragment,O),m=!0)},o(O){I(c.$$.fragment,O),m=!1},d(O){O&&(v(e),v(o),v(r),v(f)),at(k,O),n[6](null),V(c,O),g=!1,h()}}}const sd=n=>n.name;function XT(n,e,t){let i;We(n,gi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,g){for(let h=0;hs==null?void 0:s.show(m,g),a=()=>s==null?void 0:s.show();function u(m){te[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let g=0;g{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class QT extends _e{constructor(e){super(),ge(this,e,XT,GT,he,{collection:0})}}function od(n,e,t){const i=n.slice();return i[6]=e[t],i}function rd(n){let e,t,i,l,s,o,r;function a(){return n[4](n[6])}function u(...f){return n[5](n[6],...f)}return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[6].label}`,s=M(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(f,c){w(f,e,c),y(e,t),y(e,i),y(e,l),y(e,s),o||(r=[K(e,"click",fn(a)),K(e,"keydown",fn(u))],o=!0)},p(f,c){n=f},d(f){f&&v(e),o=!1,we(r)}}}function xT(n){let e,t=pe(n[2]),i=[];for(let l=0;l{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,l,s,o,r,a]}class n$ extends _e{constructor(e){super(),ge(this,e,t$,e$,he,{class:0})}}const i$=n=>({interactive:n&64,hasErrors:n&32}),ad=n=>({interactive:n[6],hasErrors:n[5]}),l$=n=>({interactive:n&64,hasErrors:n&32}),ud=n=>({interactive:n[6],hasErrors:n[5]}),s$=n=>({interactive:n&64,hasErrors:n&32}),fd=n=>({interactive:n[6],hasErrors:n[5]});function cd(n){let e;return{c(){e=b("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&&v(e)}}}function dd(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=Y(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),y(e,t),y(t,i)},p(l,s){s&16&&se(i,l[4])},d(l){l&&v(e)}}}function o$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[0].required&&dd(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(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,h){m&&m.m(g,h),w(g,e,h),w(g,t,h),y(t,i),w(g,s,h),w(g,o,h),n[14](o),n[0].id||o.focus(),c||(d=K(o,"input",n[15]),c=!0)},p(g,h){g[0].required?m?m.p(g,h):(m=dd(g),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),h&1&&l!==(l=j.getFieldTypeIcon(g[0].type))&&p(i,"class",l),h&64&&x(t,"txt-disabled",!g[6]),h&64&&r!==(r=!g[6])&&(o.disabled=r),h&1&&a!==(a=g[0].id&&g[0].system)&&(o.readOnly=a),h&1&&u!==(u=!g[0].id)&&(o.autofocus=u),h&1&&f!==(f=g[0].name)&&o.value!==f&&(o.value=f)},d(g){g&&(v(e),v(t),v(s),v(o)),m&&m.d(g),n[14](null),c=!1,d()}}}function r$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function a$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("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")),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),y(e,t),l||(s=K(e,"click",n[11]),l=!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&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function u$(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=[ve(Pe.call(null,e,"Restore")),K(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function pd(n){let e,t,i,l,s,o,r,a,u,f,c;const d=n[13].options,m=vt(d,n,n[18],ud);s=new me({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[f$,({uniqueId:k})=>({24:k}),({uniqueId:k})=>k?16777216:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[c$,({uniqueId:k})=>({24:k}),({uniqueId:k})=>k?16777216:0]},$$scope:{ctx:n}}});const g=n[13].optionsFooter,h=vt(g,n,n[18],ad);let _=!n[0].toDelete&&md(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),h&&h.c(),u=M(),_&&_.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(k,S){w(k,e,S),y(e,t),m&&m.m(t,null),y(e,i),y(e,l),z(s,l,null),y(l,o),z(r,l,null),y(l,a),h&&h.m(l,null),y(l,u),_&&_.m(l,null),c=!0},p(k,S){m&&m.p&&(!c||S&262240)&&St(m,d,k,k[18],c?wt(d,k[18],S,l$):Tt(k[18]),ud);const $={};S&17039377&&($.$$scope={dirty:S,ctx:k}),s.$set($);const T={};S&17039361&&(T.$$scope={dirty:S,ctx:k}),r.$set(T),h&&h.p&&(!c||S&262240)&&St(h,g,k,k[18],c?wt(g,k[18],S,i$):Tt(k[18]),ad),k[0].toDelete?_&&(re(),I(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&1&&A(_,1)):(_=md(k),_.c(),A(_,1),_.m(l,null))},i(k){c||(A(m,k),A(s.$$.fragment,k),A(r.$$.fragment,k),A(h,k),A(_),k&&Ke(()=>{c&&(f||(f=Le(e,et,{duration:150},!0)),f.run(1))}),c=!0)},o(k){I(m,k),I(s.$$.fragment,k),I(r.$$.fragment,k),I(h,k),I(_),k&&(f||(f=Le(e,et,{duration:150},!1)),f.run(0)),c=!1},d(k){k&&v(e),m&&m.d(k),V(s),V(r),h&&h.d(k),_&&_.d(),k&&f&&f.end()}}}function f$(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=Y(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[24])},m(m,g){w(m,e,g),e.checked=n[0].required,w(m,i,g),w(m,l,g),y(l,s),y(s,o),y(l,r),y(l,a),c||(d=[K(e,"change",n[16]),ve(u=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,g){g&16777216&&t!==(t=m[24])&&p(e,"id",t),g&1&&(e.checked=m[0].required),g&16&&se(o,m[4]),u&&$t(u.update)&&g&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),g&16777216&&f!==(f=m[24])&&p(l,"for",f)},d(m){m&&(v(e),v(i),v(l)),c=!1,we(d)}}}function c$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[24])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[17]),ve(Pe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function md(n){let e,t,i,l,s,o,r,a,u;return a=new En({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[d$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=M(),l=b("div"),s=b("button"),o=b("i"),r=M(),B(a.$$.fragment),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(s,"type","button"),p(s,"aria-label","More"),p(s,"class","btn btn-circle btn-sm btn-transparent"),p(l,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(f,c){w(f,e,c),y(e,t),y(e,i),y(e,l),y(l,s),y(s,o),y(s,r),z(a,s,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&&v(e),V(a)}}}function d$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function p$(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&cd();l=new me({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[o$]},$$scope:{ctx:n}}});const c=n[13].default,d=vt(c,n,n[18],fd),m=d||r$();function g(S,$){if(S[0].toDelete)return u$;if(S[6])return a$}let h=g(n),_=h&&h(n),k=n[6]&&n[3]&&pd(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),_&&_.c(),r=M(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,$){w(S,e,$),y(e,t),f&&f.m(t,null),y(t,i),z(l,t,null),y(t,s),m&&m.m(t,null),y(t,o),_&&_.m(t,null),y(e,r),k&&k.m(e,null),u=!0},p(S,[$]){S[6]?f||(f=cd(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$&64&&(T.class="form-field required m-0 "+(S[6]?"":"disabled")),$&2&&(T.name="schema."+S[1]+".name"),$&262229&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),d&&d.p&&(!u||$&262240)&&St(d,c,S,S[18],u?wt(c,S[18],$,s$):Tt(S[18]),fd),h===(h=g(S))&&_?_.p(S,$):(_&&_.d(1),_=h&&h(S),_&&(_.c(),_.m(t,null))),S[6]&&S[3]?k?(k.p(S,$),$&72&&A(k,1)):(k=pd(S),k.c(),A(k,1),k.m(e,null)):k&&(re(),I(k,1,1,()=>{k=null}),ae()),(!u||$&1)&&x(e,"required",S[0].required),(!u||$&72)&&x(e,"expanded",S[6]&&S[3]),(!u||$&1)&&x(e,"deleted",S[0].toDelete)},i(S){u||(A(l.$$.fragment,S),A(m,S),A(k),S&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(S){I(l.$$.fragment,S),I(m,S),I(k),S&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&v(e),f&&f.d(),V(l),m&&m.d(S),_&&_.d(),k&&k.d(),S&&a&&a.end()}}}let Er=[];function m$(n,e,t){let i,l,s,o;We(n,gi,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+j.randomString(8),f=rt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,g,h=!1;function _(){m.id?t(0,m.toDelete=!0,m):f("remove")}function k(){t(0,m.toDelete=!1,m),Gt({})}function S(P){return j.slugify(P)}function $(){t(3,h=!0),D()}function T(){t(3,h=!1)}function C(){h?T():$()}function D(){for(let P of Er)P.id!=u&&P.collapse()}Vt(()=>(Er.push({id:u,collapse:T}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),g==null||g.select()),()=>{j.removeByKey(Er,"id",u)}));function O(P){te[P?"unshift":"push"](()=>{g=P,t(2,g)})}const E=P=>{const F=m.name;t(0,m.name=S(P.target.value),m),P.target.value=m.name,f("rename",{oldName:F,newName:m.name})};function L(){m.required=this.checked,t(0,m)}function R(){m.presentable=this.checked,t(0,m)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,m=P.field),"$$scope"in P&&t(18,a=P.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&4098&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,g,h,s,l,i,f,_,k,S,C,o,r,O,E,L,R,a]}class si extends _e{constructor(e){super(),ge(this,e,m$,p$,he,{key:1,field:0})}}function h$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min length"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"step","1"),p(s,"min","0")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].options.min),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.min&&ue(s,u[0].options.min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function g$(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max length"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ue(s,n[0].options.max),a||(u=K(s,"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(s,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.max&&ue(s,f[0].options.max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function _$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","text"),p(s,"id",o=n[9]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].options.pattern),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].options.pattern&&ue(s,u[0].options.pattern)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function b$(n){let e,t,i,l,s,o,r,a,u,f;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[h$,({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:[g$,({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:[_$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),f=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&1537&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const h={};d&2&&(h.name="schema."+c[1]+".options.pattern"),d&1537&&(h.$$scope={dirty:d,ctx:c}),u.$set(h)},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&&v(e),V(i),V(o),V(u)}}}function y$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[b$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 k$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=ut(this.value),t(0,s)}function a(){s.options.max=ut(this.value),t(0,s)}function u(){s.options.pattern=this.value,t(0,s)}function f(m){s=m,t(0,s)}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$set=m=>{e=Fe(Fe({},e),Kt(m)),t(2,l=Ze(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class v$ extends _e{constructor(e){super(),ge(this,e,k$,y$,he,{field:0,key:1})}}function w$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9])},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].options.min),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.min&&ue(s,u[0].options.min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function S$(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"min",r=n[0].options.min)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ue(s,n[0].options.max),a||(u=K(s,"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(s,"id",o),c&1&&r!==(r=f[0].options.min)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.max&&ue(s,f[0].options.max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function T$(n){let e,t,i,l,s,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[w$,({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:[S$,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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&&v(e),V(i),V(o)}}}function $$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[3]),ve(Pe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function C$(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[$$,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function M$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[C$],options:[T$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=ut(this.value),t(0,s)}function u(){s.options.max=ut(this.value),t(0,s)}function f(m){s=m,t(0,s)}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$set=m=>{e=Fe(Fe({},e),Kt(m)),t(2,l=Ze(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class D$ extends _e{constructor(e){super(),ge(this,e,O$,M$,he,{field:0,key:1})}}function E$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 A$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(f){s=f,t(0,s)}function a(f){Ee.call(this,n,f)}function u(f){Ee.call(this,n,f)}return n.$$set=f=>{e=Fe(Fe({},e),Kt(f)),t(2,l=Ze(e,i)),"field"in f&&t(0,s=f.field),"key"in f&&t(1,o=f.key)},[s,o,l,r,a,u]}class I$ extends _e{constructor(e){super(),ge(this,e,A$,E$,he,{field:0,key:1})}}function L$(n){let e,t,i,l,s=[{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=Fe(Fe({},e),Kt(c)),t(5,s=Ze(e,l)),"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,s,f]}class Fl extends _e{constructor(e){super(),ge(this,e,P$,L$,he,{value:0,separator:1,readonly:2,disabled:3})}}function F$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[3](_)}let h={id:n[8],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(h.value=n[0].options.exceptDomains),r=new Fl({props:h}),te.push(()=>be(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[8]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Pe.call(null,l,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&256&&s!==(s=_[8]))&&p(e,"for",s);const S={};k&256&&(S.id=_[8]),k&1&&(S.disabled=!j.isEmpty(_[0].options.onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.exceptDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function N$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[4](_)}let h={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(h.value=n[0].options.onlyDomains),r=new Fl({props:h}),te.push(()=>be(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Pe.call(null,l,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&256&&s!==(s=_[8]+".options.onlyDomains"))&&p(e,"for",s);const S={};k&256&&(S.id=_[8]+".options.onlyDomains"),k&1&&(S.disabled=!j.isEmpty(_[0].options.exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.onlyDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function R$(n){let e,t,i,l,s,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[F$,({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:[N$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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&&v(e),V(i),V(o)}}}function q$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[R$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 j$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(d){n.$$.not_equal(s.options.exceptDomains,d)&&(s.options.exceptDomains=d,t(0,s))}function a(d){n.$$.not_equal(s.options.onlyDomains,d)&&(s.options.onlyDomains=d,t(0,s))}function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Fe(Fe({},e),Kt(d)),t(2,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},[s,o,l,r,a,u,f,c]}class Jb extends _e{constructor(e){super(),ge(this,e,j$,q$,he,{field:0,key:1})}}function H$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 z$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(f){s=f,t(0,s)}function a(f){Ee.call(this,n,f)}function u(f){Ee.call(this,n,f)}return n.$$set=f=>{e=Fe(Fe({},e),Kt(f)),t(2,l=Ze(e,i)),"field"in f&&t(0,s=f.field),"key"in f&&t(1,o=f.key)},[s,o,l,r,a,u]}class V$ extends _e{constructor(e){super(),ge(this,e,z$,H$,he,{field:0,key:1})}}function B$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[3]),ve(Pe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function U$(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[B$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&769&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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 l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[U$]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 Y$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Fe(Fe({},e),Kt(d)),t(2,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,u,f,c]}class K$ extends _e{constructor(e){super(),ge(this,e,Y$,W$,he,{field:0,key:1})}}var Ar=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],wl={_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},bs={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},pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Ln=function(n){return n===!0?1:0};function hd(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Ir=function(n){return n instanceof Array?n:[n]};function rn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ct(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 Zb(n,e){if(e(n))return n;if(n.parentNode)return Zb(n.parentNode,e)}function io(n,e){var t=ct("div","numInputWrapper"),i=ct("input","numInput "+n),l=ct("span","arrowUp"),s=ct("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(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Lr=function(){},jo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},J$={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*Ln(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),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},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))}},Zi={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})"},rs={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[rs.w(n,e,t)]},F:function(n,e,t){return jo(rs.n(n,e,t)-1,!1,e)},G:function(n,e,t){return pn(rs.h(n,e,t))},H:function(n){return pn(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[Ln(n.getHours()>11)]},M:function(n,e){return jo(n.getMonth(),!0,e)},S:function(n){return pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return pn(n.getFullYear(),4)},d:function(n){return pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return pn(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)}},Gb=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?bs:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return rs[c]&&m[d-1]!=="\\"?rs[c](r,f,t):c!=="\\"?c:""}).join("")}},ma=function(n){var e=n.config,t=e===void 0?wl:e,i=n.l10n,l=i===void 0?bs:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||wl).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var g=void 0,h=[],_=0,k=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ie=Fr(t.config);X.setHours(ie.hours,ie.minutes,ie.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var de=t._input.value;c(),en(),t._input.value!==de&&t._debouncedChange()}function u(Z,X){return Z%12+12*Ln(X===t.l10n.amPM[1])}function f(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ie=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=u(Z,t.amPM.textContent));var de=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&kn(t.latestSelectedDateObj,t.config.minDate,!0)===0,$e=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&kn(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 Ie=Pr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Je=Pr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Pr(Z,X,ie);if(qe>Je&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=pn(ie)))}function g(Z){var X=yn(Z),ie=parseInt(X.value)+(Z.delta||0);(ie/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ie.toString()))&&tt(ie)}function h(Z,X,ie,de){if(X instanceof Array)return X.forEach(function($e){return h(Z,$e,ie,de)});if(Z instanceof Array)return Z.forEach(function($e){return h($e,X,ie,de)});Z.addEventListener(X,ie,de),t._handlers.push({remove:function(){return Z.removeEventListener(X,ie,de)}})}function _(){bt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ie){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ie+"]"),function(de){return h(de,"click",t[ie])})}),t.isMobile){fl();return}var Z=hd(ze,50);if(t._debouncedChange=hd(_,Q$),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&h(t.daysContainer,"mouseover",function(ie){t.config.mode==="range"&&De(yn(ie))}),h(t._input,"keydown",Ce),t.calendarContainer!==void 0&&h(t.calendarContainer,"keydown",Ce),!t.config.inline&&!t.config.static&&h(window,"resize",Z),window.ontouchstart!==void 0?h(window.document,"touchstart",Qe):h(window.document,"mousedown",Qe),h(window.document,"focus",Qe,{capture:!0}),t.config.clickOpens===!0&&(h(t._input,"focus",t.open),h(t._input,"click",t.open)),t.daysContainer!==void 0&&(h(t.monthNav,"click",Bn),h(t.monthNav,["keyup","increment"],g),h(t.daysContainer,"click",al)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ie){return yn(ie).select()};h(t.timeContainer,["increment"],a),h(t.timeContainer,"blur",a,{capture:!0}),h(t.timeContainer,"click",$),h([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&h(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&h(t.amPM,"click",function(ie){a(ie)})}t.config.allowInput&&h(t._input,"blur",Pt)}function S(Z,X){var ie=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var $e=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&&(!$e&&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 Ie=ct("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ie,t.element),Ie.appendChild(t.element),t.altInput&&Ie.appendChild(t.altInput),Ie.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function D(Z,X,ie,de){var $e=Ge(X,!0),Ie=ct("span",Z,X.getDate().toString());return Ie.dateObj=X,Ie.$i=de,Ie.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&kn(X,t.now)===0&&(t.todayDateElem=Ie,Ie.classList.add("today"),Ie.setAttribute("aria-current","date")),$e?(Ie.tabIndex=-1,Me(X)&&(Ie.classList.add("selected"),t.selectedDateElem=Ie,t.config.mode==="range"&&(rn(Ie,"startRange",t.selectedDates[0]&&kn(X,t.selectedDates[0],!0)===0),rn(Ie,"endRange",t.selectedDates[1]&&kn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Ie.classList.add("inRange")))):Ie.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Xe(X)&&!Me(X)&&Ie.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&de%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),bt("onDayCreate",Ie),Ie}function O(Z){Z.focus(),t.config.mode==="range"&&De(Z)}function E(Z){for(var X=Z>0?0:t.config.showMonths-1,ie=Z>0?t.config.showMonths:-1,de=X;de!=ie;de+=Z)for(var $e=t.daysContainer.children[de],Ie=Z>0?0:$e.children.length-1,Je=Z>0?$e.children.length:-1,qe=Ie;qe!=Je;qe+=Z){var xe=$e.children[qe];if(xe.className.indexOf("hidden")===-1&&Ge(xe.dateObj))return xe}}function L(Z,X){for(var ie=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,de=X>0?t.config.showMonths:-1,$e=X>0?1:-1,Ie=ie-t.currentMonth;Ie!=de;Ie+=$e)for(var Je=t.daysContainer.children[Ie],qe=ie-t.currentMonth===Ie?Z.$i+X:X<0?Je.children.length-1:0,xe=Je.children.length,Re=qe;Re>=0&&Re0?xe:-1);Re+=$e){var Be=Je.children[Re];if(Be.className.indexOf("hidden")===-1&&Ge(Be.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return O(Be)}t.changeMonth($e),R(E($e),0)}function R(Z,X){var ie=s(),de=Mt(ie||document.body),$e=Z!==void 0?Z:de?ie:t.selectedDateElem!==void 0&&Mt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Mt(t.todayDateElem)?t.todayDateElem:E(X>0?1:-1);$e===void 0?t._input.focus():de?L($e,X):O($e)}function P(Z,X){for(var ie=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,de=t.utils.getDaysInMonth((X-1+12)%12,Z),$e=t.utils.getDaysInMonth(X,Z),Ie=window.document.createDocumentFragment(),Je=t.config.showMonths>1,qe=Je?"prevMonthDay hidden":"prevMonthDay",xe=Je?"nextMonthDay hidden":"nextMonthDay",Re=de+1-ie,Be=0;Re<=de;Re++,Be++)Ie.appendChild(D("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Be));for(Re=1;Re<=$e;Re++,Be++)Ie.appendChild(D("flatpickr-day",new Date(Z,X,Re),Re,Be));for(var kt=$e+1;kt<=42-ie&&(t.config.showMonths===1||Be%7!==0);kt++,Be++)Ie.appendChild(D("flatpickr-day "+xe,new Date(Z,X+1,kt%$e),kt,Be));var Xn=ct("div","dayContainer");return Xn.appendChild(Ie),Xn}function F(){if(t.daysContainer!==void 0){no(t.daysContainer),t.weekNumbers&&no(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(de){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&det.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ie=ct("option","flatpickr-monthDropdown-month");ie.value=new Date(t.currentYear,X).getMonth().toString(),ie.textContent=jo(X,t.config.shorthandCurrentMonth,t.l10n),ie.tabIndex=-1,t.currentMonth===X&&(ie.selected=!0),t.monthsDropdownContainer.appendChild(ie)}}}function q(){var Z=ct("div","flatpickr-month"),X=window.document.createDocumentFragment(),ie;t.config.showMonths>1||t.config.monthSelectorType==="static"?ie=ct("span","cur-month"):(t.monthsDropdownContainer=ct("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),h(t.monthsDropdownContainer,"change",function(Je){var qe=yn(Je),xe=parseInt(qe.value,10);t.changeMonth(xe-t.currentMonth),bt("onMonthChange")}),N(),ie=t.monthsDropdownContainer);var de=io("cur-year",{tabindex:"-1"}),$e=de.getElementsByTagName("input")[0];$e.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&$e.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&($e.setAttribute("max",t.config.maxDate.getFullYear().toString()),$e.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ie=ct("div","flatpickr-current-month");return Ie.appendChild(ie),Ie.appendChild(de),X.appendChild(Ie),Z.appendChild(X),{container:Z,yearElement:$e,monthElement:ie}}function W(){no(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function G(){return t.monthNav=ct("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ct("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ct("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,W(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(rn(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(rn(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Jt(),t.monthNav}function J(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Fr(t.config);t.timeContainer=ct("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ct("span","flatpickr-time-separator",":"),ie=io("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ie.getElementsByTagName("input")[0];var de=io("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=de.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:f(Z.hours)),t.minuteElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.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(X),t.timeContainer.appendChild(de),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var $e=io("flatpickr-second");t.secondElement=$e.getElementsByTagName("input")[0],t.secondElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.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(ct("span","flatpickr-time-separator",":")),t.timeContainer.appendChild($e)}return t.config.time_24hr||(t.amPM=ct("span","flatpickr-am-pm",t.l10n.amPM[Ln((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 H(){t.weekdayContainer?no(t.weekdayContainer):t.weekdayContainer=ct("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=ct("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return U(),t.weekdayContainer}function U(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=gd(t.l10n.weekdays.shorthand);Z>0&&Z `+X.join("")+` - `}}function le(){t.calendarContainer.classList.add("hasWeeks");var Z=ct("div","flatpickr-weekwrapper");Z.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ct("div","flatpickr-weeks");return Z.appendChild(X),{weekWrapper:Z,weekNumbers:X}}function ee(Z,X){X===void 0&&(X=!0);var ie=X?Z:Z-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,bt("onYearChange"),N()),F(),bt("onMonthChange"),Jt())}function oe(Z,X){if(Z===void 0&&(Z=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Nr(t.config),de=ie.hours,$e=ie.minutes,Ie=ie.seconds;m(de,$e,Ie)}t.redraw(),Z&&bt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),bt("onClose")}function je(){t.config!==void 0&&bt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].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 X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}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(Z){return t.calendarContainer.contains(Z)}function Qe(Z){if(t.isOpen&&!t.config.inline){var X=yn(Z),ie=Ve(X),de=X===t.input||X===t.altInput||t.element.contains(X)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),$e=!de&&!ie&&!Ve(Z.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Je){return Je.contains(X)});$e&&Ie&&(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 tt(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var X=Z,ie=t.currentYear!==X;t.currentYear=X||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(),bt("onYearChange"),N())}}function Ge(Z,X){var ie;X===void 0&&(X=!0);var de=t.parseDate(Z,void 0,X);if(t.config.minDate&&de&&kn(de,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&de&&kn(de,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(de===void 0)return!1;for(var $e=!!t.config.enable,Ie=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,Je=0,qe=void 0;Je=qe.from.getTime()&&de.getTime()<=qe.to.getTime())return $e}return!$e}function Mt(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function Pt(Z){var X=Z.target===t._input,ie=t._input.value.trimEnd()!==nt();X&&ie&&!(Z.relatedTarget&&Ve(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ce(Z){var X=yn(Z),ie=t.config.wrap?n.contains(X):X===t._input,de=t.config.allowInput,$e=t.isOpen&&(!de||!ie),Ie=t.config.inline&&ie&&!de;if(Z.keyCode===13&&ie){if(de)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Ve(X)||$e||Ie){var Je=!!t.timeContainer&&t.timeContainer.contains(X);switch(Z.keyCode){case 13:Je?(Z.preventDefault(),a(),Ni()):al(Z);break;case 27:Z.preventDefault(),Ni();break;case 8:case 46:ie&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Je&&!ie){Z.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(de===!1||qe&&Mt(qe))){var xe=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),ee(xe),R(E(1),0)):R(void 0,xe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Re=Z.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?Z.ctrlKey?(Z.stopPropagation(),tt(t.currentYear-Re),R(E(1),0)):Je||R(void 0,Re*7):X===t.currentYearElement?tt(t.currentYear-Re):t.config.enableTime&&(!Je&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Je){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(bn){return bn}),kt=Be.indexOf(X);if(kt!==-1){var Xn=Be[kt+(Z.shiftKey?-1:1)];Z.preventDefault(),(Xn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),en();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),en();break}(ie||Ve(X))&&bt("onKeyDown",Z)}function De(Z,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(X)||Z.classList.contains("flatpickr-disabled")))){for(var ie=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),de=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),$e=Math.min(ie,t.selectedDates[0].getTime()),Ie=Math.max(ie,t.selectedDates[0].getTime()),Je=!1,qe=0,xe=0,Re=$e;Re$e&&Reqe)?qe=Re:Re>de&&(!xe||Re ."+X));Be.forEach(function(kt){var Xn=kt.dateObj,bn=Xn.getTime(),ql=qe>0&&bn0&&bn>xe;if(ql){kt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(dl){kt.classList.remove(dl)});return}else if(Je&&!ql)return;["startRange","inRange","endRange","notAllowed"].forEach(function(dl){kt.classList.remove(dl)}),Z!==void 0&&(Z.classList.add(ie<=t.selectedDates[0].getTime()?"startRange":"endRange"),deie&&bn===de&&kt.classList.add("endRange"),bn>=qe&&(xe===0||bn<=xe)&&J$(bn,de,ie)&&kt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&Bt()}function _t(Z,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var ie=yn(Z);ie&&ie.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),bt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var de=t.isOpen;t.isOpen=!0,de||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),bt("onOpen"),Bt(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ne(Z){return function(X){var ie=t.config["_"+Z+"Date"]=t.parseDate(X,t.config.dateFormat),de=t.config["_"+(Z==="min"?"max":"min")+"Date"];ie!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=ie.getHours()>0||ie.getMinutes()>0||ie.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function($e){return Ge($e)}),!t.selectedDates.length&&Z==="min"&&d(ie),en()),t.daysContainer&&(Vn(),ie!==void 0?t.currentYearElement[Z]=ie.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!de&&ie!==void 0&&de.getFullYear()===ie.getFullYear())}}function Ne(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=sn(sn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ie={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Be){t.config._enable=Gn(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=Gn(Be)}});var de=X.mode==="time";if(!X.dateFormat&&(X.enableTime||de)){var $e=Wt.defaultConfig.dateFormat||Sl.dateFormat;ie.dateFormat=X.noCalendar||de?"H:i"+(X.enableSeconds?":S":""):$e+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||de)&&!X.altFormat){var Ie=Wt.defaultConfig.altFormat||Sl.altFormat;ie.altFormat=X.noCalendar||de?"h:i"+(X.enableSeconds?":S K":" K"):Ie+(" h:i"+(X.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 Je=function(Be){return function(kt){t.config[Be==="min"?"_minTime":"_maxTime"]=t.parseDate(kt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Je("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Je("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ie,X);for(var qe=0;qe-1?t.config[Re]=Lr(xe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=xe[Re])}X.altInputClass||(t.config.altInputClass=Se().className+" "+t.config.altInputClass),bt("onParseConfig")}function Se(){return t.config.wrap?n.querySelector("[data-input]"):n}function mt(){typeof t.config.locale!="object"&&typeof Wt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=sn(sn({},Wt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Wt.l10ns[t.config.locale]:void 0),Zi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Zi.l="("+t.l10n.weekdays.longhand.join("|")+")",Zi.M="("+t.l10n.months.shorthand.join("|")+")",Zi.F="("+t.l10n.months.longhand.join("|")+")",Zi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=sn(sn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&Wt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Zb(t),t.parseDate=pa({config:t.config,l10n:t.l10n})}function Bt(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){bt("onPreCalendarPosition");var X=Z||t._positionElement,ie=Array.prototype.reduce.call(t.calendarContainer.children,function(c0,d0){return c0+d0.offsetHeight},0),de=t.calendarContainer.offsetWidth,$e=t.config.position.split(" "),Ie=$e[0],Je=$e.length>1?$e[1]:null,qe=X.getBoundingClientRect(),xe=window.innerHeight-qe.bottom,Re=Ie==="above"||Ie!=="below"&&xeie,Be=window.pageYOffset+qe.top+(Re?-ie-2:X.offsetHeight+2);if(rn(t.calendarContainer,"arrowTop",!Re),rn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var kt=window.pageXOffset+qe.left,Xn=!1,bn=!1;Je==="center"?(kt-=(de-qe.width)/2,Xn=!0):Je==="right"&&(kt-=de-qe.width,bn=!0),rn(t.calendarContainer,"arrowLeft",!Xn&&!bn),rn(t.calendarContainer,"arrowCenter",Xn),rn(t.calendarContainer,"arrowRight",bn);var ql=window.document.body.offsetWidth-(window.pageXOffset+qe.right),dl=kt+de>window.document.body.offsetWidth,l0=ql+de>window.document.body.offsetWidth;if(rn(t.calendarContainer,"rightMost",dl),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!dl)t.calendarContainer.style.left=kt+"px",t.calendarContainer.style.right="auto";else if(!l0)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=ql+"px";else{var lr=cn();if(lr===void 0)return;var s0=window.document.body.offsetWidth,o0=Math.max(0,s0/2-de/2),r0=".flatpickr-calendar.centerMost:before",a0=".flatpickr-calendar.centerMost:after",u0=lr.cssRules.length,f0="{left:"+qe.left+"px;right:auto;}";rn(t.calendarContainer,"rightMost",!1),rn(t.calendarContainer,"centerMost",!0),lr.insertRule(r0+","+a0+f0,u0),t.calendarContainer.style.left=o0+"px",t.calendarContainer.style.right="auto"}}}}function cn(){for(var Z=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=de,t.config.mode==="single")t.selectedDates=[$e];else if(t.config.mode==="multiple"){var Je=Me($e);Je?t.selectedDates.splice(parseInt(Je),1):t.selectedDates.push($e)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=$e,t.selectedDates.push($e),kn($e,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Be,kt){return Be.getTime()-kt.getTime()}));if(c(),Ie){var qe=t.currentYear!==$e.getFullYear();t.currentYear=$e.getFullYear(),t.currentMonth=$e.getMonth(),qe&&(bt("onYearChange"),N()),bt("onMonthChange")}if(Jt(),F(),en(),!Ie&&t.config.mode!=="range"&&t.config.showMonths===1?O(de):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 xe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(xe||Re)&&Ni()}_()}}var yi={locale:[mt,U],showMonths:[W,r,H],minDate:[S],maxDate:[S],positionElement:[ki],clickOpens:[function(){t.config.clickOpens===!0?(h(t._input,"focus",t.open),h(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ae(Z,X){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var ie in Z)yi[ie]!==void 0&&yi[ie].forEach(function(de){return de()})}else t.config[Z]=X,yi[Z]!==void 0?yi[Z].forEach(function(de){return de()}):Ir.indexOf(Z)>-1&&(t.config[Z]=Lr(X));t.redraw(),en(!0)}function Ft(Z,X){var ie=[];if(Z instanceof Array)ie=Z.map(function(de){return t.parseDate(de,X)});else if(Z instanceof Date||typeof Z=="number")ie=[t.parseDate(Z,X)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":ie=[t.parseDate(Z,X)];break;case"multiple":ie=Z.split(t.config.conjunction).map(function(de){return t.parseDate(de,X)});break;case"range":ie=Z.split(t.l10n.rangeSeparator).map(function(de){return t.parseDate(de,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?ie:ie.filter(function(de){return de instanceof Date&&Ge(de,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(de,$e){return de.getTime()-$e.getTime()})}function Ri(Z,X,ie){if(X===void 0&&(X=!1),ie===void 0&&(ie=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(X);Ft(Z,ie),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),en(X),X&&bt("onChange")}function Gn(Z){return Z.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function ul(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Ft(Z,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 Rl(){if(t.input=Se(),!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=ct(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"),ki()}function ki(){t._positionElement=t.config.positionElement||t._input}function fl(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ct("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="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{}h(t.mobileInput,"change",function(X){t.setDate(yn(X).value,!1,t.mobileFormatStr),bt("onChange"),bt("onClose")})}function cl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function bt(Z,X){if(t.config!==void 0){var ie=t.config[Z];if(ie!==void 0&&ie.length>0)for(var de=0;ie[de]&&de=0&&kn(Z,t.selectedDates[1])<=0}function Jt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,X){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=Ho(ie.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ie.getMonth().toString(),Z.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(Z){var X=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ie){return t.formatDate(ie,X)}).filter(function(ie,de,$e){return t.config.mode!=="range"||t.config.enableTime||$e.indexOf(ie)===de}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function en(Z){Z===void 0&&(Z=!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)),Z!==!1&&bt("onValueUpdate")}function Bn(Z){var X=yn(Z),ie=t.prevMonthNav.contains(X),de=t.nextMonthNav.contains(X);ie||de?ee(ie?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(Z){Z.preventDefault();var X=Z.type==="keydown",ie=yn(Z),de=ie;t.amPM!==void 0&&ie===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]);var $e=parseFloat(de.getAttribute("min")),Ie=parseFloat(de.getAttribute("max")),Je=parseFloat(de.getAttribute("step")),qe=parseInt(de.value,10),xe=Z.delta||(X?Z.which===38?1:-1:0),Re=qe+Je*xe;if(typeof de.value<"u"&&de.value.length===2){var Be=de===t.hourElement,kt=de===t.minuteElement;Re<$e?(Re=Ie+Re+Ln(!Be)+(Ln(Be)&&Ln(!t.amPM)),kt&&T(void 0,-1,t.hourElement)):Re>Ie&&(Re=de===t.hourElement?Re-Ie-Ln(!t.amPM):$e,kt&&T(void 0,1,t.hourElement)),t.amPM&&Be&&(Je===1?Re+qe===23:Math.abs(Re-qe)>Je)&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]),de.value=pn(Re)}}return l(),t}function Tl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function nC(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Ze(e,i),{$$slots:s={},$$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,m=!1,{input:g=void 0,flatpickr:h=void 0}=e;Vt(()=>{const T=f??g,C=k(d);return C.onReady.push((D,O,E)=>{a===void 0&&S(D,O,E),Qt().then(()=>{t(8,m=!0)})}),t(3,h=Wt(T,Object.assign(C,f?{wrap:!0}:{}))),()=>{h.destroy()}});const _=rt();function k(T={}){T=Object.assign({},T);for(const C of r){const D=(O,E,L)=>{_(tC(C),[O,E,L])};C in T?(Array.isArray(T[C])||(T[C]=[T[C]]),T[C].push(D)):T[C]=[D]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,C,D){const O=gd(D,T);!_d(a,O)&&(a||O)&&t(2,a=O),t(4,u=C)}function $(T){te[T?"unshift":"push"](()=>{g=T,t(0,g)})}return n.$$set=T=>{e=Pe(Pe({},e),Kt(T)),t(1,l=Ze(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,h=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&h&&m&&(_d(a,gd(h,h.selectedDates))||h.setDate(a,!0,c)),n.$$.dirty&392&&h&&m)for(const[T,C]of Object.entries(k(d)))h.set(T,C)},[g,l,a,h,u,f,c,d,m,o,s,$]}class Xa extends be{constructor(e){super(),_e(this,e,nC,eC,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function iC(n){let e,t,i,l,s,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),s=new Xa({props:c}),te.push(()=>ge(s,"value",u)),te.push(()=>ge(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=Y("Min date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};m&32768&&(g.id=d[15]),!o&&m&4&&(o=!0,g.value=d[2],ye(()=>o=!1)),!r&&m&1&&(r=!0,g.formattedValue=d[0].options.min,ye(()=>r=!1)),s.$set(g)},i(d){a||(A(s.$$.fragment,d),a=!0)},o(d){I(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function lC(n){let e,t,i,l,s,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),s=new Xa({props:c}),te.push(()=>ge(s,"value",u)),te.push(()=>ge(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=Y("Max date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};m&32768&&(g.id=d[15]),!o&&m&8&&(o=!0,g.value=d[3],ye(()=>o=!1)),!r&&m&1&&(r=!0,g.formattedValue=d[0].options.max,ye(()=>r=!1)),s.$set(g)},i(d){a||(A(s.$$.fragment,d),a=!0)},o(d){I(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function sC(n){let e,t,i,l,s,o,r;return i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[iC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[lC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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&&v(e),V(i),V(o)}}}function oC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[sC]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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){var $,T;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(T=s==null?void 0:s.options)==null?void 0:T.max;function u(C,D){C.detail&&C.detail.length==3&&t(0,s.options[D]=C.detail[1],s)}function f(C){r=C,t(2,r),t(0,s)}function c(C){n.$$.not_equal(s.options.min,C)&&(s.options.min=C,t(0,s))}const d=C=>u(C,"min");function m(C){a=C,t(3,a),t(0,s)}function g(C){n.$$.not_equal(s.options.max,C)&&(s.options.max=C,t(0,s))}const h=C=>u(C,"max");function _(C){s=C,t(0,s)}function k(C){Ee.call(this,n,C)}function S(C){Ee.call(this,n,C)}return n.$$set=C=>{e=Pe(Pe({},e),Kt(C)),t(5,l=Ze(e,i)),"field"in C&&t(0,s=C.field),"key"in C&&t(1,o=C.key)},n.$$.update=()=>{var C,D,O,E;n.$$.dirty&5&&r!=((C=s==null?void 0:s.options)==null?void 0:C.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((O=s==null?void 0:s.options)==null?void 0:O.max)&&t(3,a=(E=s==null?void 0:s.options)==null?void 0:E.max)},[s,o,r,a,u,l,f,c,d,m,g,h,_,k,S]}class aC extends be{constructor(e){super(),_e(this,e,rC,oC,me,{field:0,key:1})}}const uC=n=>({}),bd=n=>({});function yd(n,e,t){const i=n.slice();return i[48]=e[t],i}const fC=n=>({}),kd=n=>({});function vd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function wd(n){let e,t,i;return{c(){e=b("div"),t=Y(n[2]),i=M(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),y(e,t),y(e,i)},p(l,s){s[0]&4&&se(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function cC(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function dC(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let u={};if(a!==void 0&&a[0]&2049)u=pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(r[11])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(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&&v(t),e&&V(e,r)}}}function Sd(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[ve(Fe.call(null,e,"Clear")),K(e,"click",fn(Ye(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,we(i)}}}function Td(n){let e,t,i,l,s,o;const r=[dC,cC],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])&&Sd(n);return{c(){e=b("div"),i.c(),l=M(),f&&f.c(),s=M(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),y(e,l),f&&f.m(e,null),y(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(re(),I(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Sd(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){I(i),o=!1},d(c){c&&v(e),a[t].d(),f&&f.d()}}}function $d(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[hC]},$$scope:{ctx:n}};return e=new En({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[41](null),V(e,l)}}}function Cd(n){let e,t,i,l,s,o,r,a,u=n[17].length&&Md(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=M(),s=b("input"),o=M(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"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),y(e,t),y(t,i),y(t,l),y(t,s),ce(s,n[17]),y(t,o),u&&u.m(t,null),s.focus(),r||(a=K(s,"input",n[38]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&ce(s,f[17]),f[17].length?u?u.p(f,c):(u=Md(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&v(e),u&&u.d(),r=!1,a()}}}function Md(n){let e,t,i,l;return{c(){e=b("div"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",fn(Ye(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function Od(n){let e,t=n[1]&&Dd(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=Dd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Dd(n){let e,t;return{c(){e=b("div"),t=Y(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l[0]&2&&se(t,i[1])},d(i){i&&v(e)}}}function pC(n){let e=n[48]+"",t;return{c(){t=Y(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&se(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function mC(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let u={};if(a!==void 0&&a[0]&4202496)u=pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(r[13])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(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&&v(t),e&&V(e,r)}}}function Ed(n){let e,t,i,l,s,o,r;const a=[mC,pC],u=[];function f(m,g){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=M(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,g){w(m,e,g),u[t].m(e,null),y(e,l),s=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(m,g){n=m;let h=t;t=f(n),t===h?u[t].p(n,g):(re(),I(u[h],1,1,()=>{u[h]=null}),ae(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,l)),(!s||g[0]&512)&&x(e,"closable",n[9]),(!s||g[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(A(i),s=!0)},o(m){I(i),s=!1},d(m){m&&v(e),u[t].d(),o=!1,we(r)}}}function hC(n){let e,t,i,l,s,o=n[14]&&Cd(n);const r=n[35].beforeOptions,a=vt(r,n,n[44],kd);let u=pe(n[22]),f=[];for(let h=0;hI(f[h],1,1,()=>{f[h]=null});let d=null;u.length||(d=Od(n));const m=n[35].afterOptions,g=vt(m,n,n[44],bd);return{c(){o&&o.c(),e=M(),a&&a.c(),t=M(),i=b("div");for(let h=0;hI(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=wd(n));let c=!n[5]&&!n[6]&&$d(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mSe(mt,Ne))||[]}function Te(ne,Ne){ne.preventDefault(),k&&d?G(Ne):W(Ne)}function je(ne,Ne){(ne.code==="Enter"||ne.code==="Space")&&(Te(ne,Ne),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 Qe(ne){ne.stopPropagation(),!g&&!m&&(R==null||R.toggle())}Vt(()=>{const ne=document.querySelectorAll(`label[for="${r}"]`);for(const Ne of ne)Ne.addEventListener("click",Qe);return()=>{for(const Ne of ne)Ne.removeEventListener("click",Qe)}});const tt=ne=>q(ne);function Ge(ne){te[ne?"unshift":"push"](()=>{N=ne,t(20,N)})}function Mt(){P=this.value,t(17,P)}const Pt=(ne,Ne)=>Te(Ne,ne),Ce=(ne,Ne)=>je(Ne,ne);function De(ne){te[ne?"unshift":"push"](()=>{R=ne,t(18,R)})}function ze(ne){Ee.call(this,n,ne)}function _t(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,m=ne.disabled),"readonly"in ne&&t(6,g=ne.readonly),"upside"in ne&&t(7,h=ne.upside),"selected"in ne&&t(0,_=ne.selected),"toggle"in ne&&t(8,k=ne.toggle),"closable"in ne&&t(9,S=ne.closable),"labelComponent"in ne&&t(10,$=ne.labelComponent),"labelComponentProps"in ne&&t(11,T=ne.labelComponentProps),"optionComponent"in ne&&t(12,C=ne.optionComponent),"optionComponentProps"in ne&&t(13,D=ne.optionComponentProps),"searchable"in ne&&t(14,O=ne.searchable),"searchFunc"in ne&&t(29,E=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&&(le(),ee()),n.$$.dirty[0]&268566528&&t(22,i=oe(c,P)),n.$$.dirty[0]&1&&t(21,l=function(ne){const Ne=j.toArray(_);return j.inArray(Ne,ne)})},[_,a,u,f,d,m,g,h,k,S,$,T,C,D,O,L,q,P,R,F,N,l,i,ee,Te,je,Ve,r,c,E,W,G,J,H,U,s,tt,Ge,Mt,Pt,Ce,De,ze,_t,o]}class Gb extends be{constructor(e){super(),_e(this,e,bC,gC,me,{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 Ad(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function yC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&Ad(n);return{c(){s&&s.c(),e=M(),t=b("span"),l=Y(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),y(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=Ad(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function kC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Id extends be{constructor(e){super(),_e(this,e,kC,yC,me,{item:0})}}const vC=n=>({}),Ld=n=>({});function wC(n){let e;const t=n[8].afterOptions,i=vt(t,n,n[12],Ld);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&St(i,t,l,l[12],e?wt(t,l[12],s,vC):Tt(l[12]),Ld)},i(l){e||(A(i,l),e=!0)},o(l){I(i,l),e=!1},d(l){i&&i.d(l)}}}function SC(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[wC]},$$scope:{ctx:n}};for(let r=0;rge(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&62?pt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ct(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ye(()=>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 TC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Ze(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Id}=e,{optionComponent:c=Id}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function g($){$=j.toArray($,!0);let T=[];for(let C of $){const D=j.findByKey(r,d,C);D&&T.push(D)}$.length&&!T.length||t(0,u=a?T:T[0])}async function h($){let T=j.toArray($,!0).map(C=>C[d]);r.length&&t(6,m=a?T:T[0])}function _($){u=$,t(0,u)}function k($){Ee.call(this,n,$)}function S($){Ee.call(this,n,$)}return n.$$set=$=>{e=Pe(Pe({},e),Kt($)),t(5,l=Ze(e,i)),"items"in $&&t(1,r=$.items),"multiple"in $&&t(2,a=$.multiple),"selected"in $&&t(0,u=$.selected),"labelComponent"in $&&t(3,f=$.labelComponent),"optionComponent"in $&&t(4,c=$.optionComponent),"selectionKey"in $&&t(7,d=$.selectionKey),"keyOfSelected"in $&&t(6,m=$.keyOfSelected),"$$scope"in $&&t(12,o=$.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(m),n.$$.dirty&1&&h(u)},[u,r,a,f,c,l,m,d,s,_,k,S,o]}class _i extends be{constructor(e){super(),_e(this,e,TC,SC,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function $C(n){let e,t,i,l,s,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 Nl({props:a}),te.push(()=>ge(t,"value",r)),{c(){e=b("div"),B(t.$$.fragment)},m(u,f){w(u,e,f),z(t,e,null),l=!0,s||(o=ve(Fe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!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,ye(()=>i=!1)),t.$set(c)},i(u){l||(A(t.$$.fragment,u),l=!0)},o(u){I(t.$$.fragment,u),l=!1},d(u){u&&v(e),V(t),s=!1,o()}}}function CC(n){let e,t,i;function l(o){n[8](o)}let s={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 MC(n){let e,t,i,l,s,o,r,a,u,f;return i=new he({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[$C,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[CC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&16384&&(m.class="form-field required "+(c[14]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&57345&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);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&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),V(i,c),V(r,c)}}}function Pd(n){let e,t;return e=new he({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[OC,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&40961&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function OC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"id",o=n[13]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.maxSelect),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.maxSelect&&ce(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function DC(n){let e,t,i=!n[2]&&Pd(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(re(),I(i,1,1,()=>{i=null}),ae()):i?(i.p(l,s),s&4&&A(i,1)):(i=Pd(l),i.c(),A(i,1),i.m(e.parentNode,e))},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function EC(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[DC],default:[MC,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&18?pt(l,[a&2&&{key:r[1]},a&16&&Ct(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 k;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((k=s.options)==null?void 0:k.maxSelect)<=1,u=a;function f(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,u=a)}function c(){s.options.maxSelect=ut(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.options.values,S)&&(s.options.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function g(S){s=S,t(0,s),t(5,u),t(2,a)}function h(S){Ee.call(this,n,S)}function _(S){Ee.call(this,n,S)}return n.$$set=S=>{e=Pe(Pe({},e),Kt(S)),t(4,l=Ze(e,i)),"field"in S&&t(0,s=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,$;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(S=s.options)==null?void 0:S.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&f()},[s,o,a,r,l,u,c,d,m,g,h,_]}class IC extends be{constructor(e){super(),_e(this,e,AC,EC,me,{field:0,key:1})}}function LC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function PC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Fd(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O='"{"a":1,"b":2}"',E,L,R,P,F,N,q,W,G,J,H,U,le;return{c(){e=b("div"),t=b("div"),i=b("div"),l=Y("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=Y(` and + `}}function le(){t.calendarContainer.classList.add("hasWeeks");var Z=ct("div","flatpickr-weekwrapper");Z.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ct("div","flatpickr-weeks");return Z.appendChild(X),{weekWrapper:Z,weekNumbers:X}}function ee(Z,X){X===void 0&&(X=!0);var ie=X?Z:Z-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,bt("onYearChange"),N()),F(),bt("onMonthChange"),Jt())}function oe(Z,X){if(Z===void 0&&(Z=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Fr(t.config),de=ie.hours,$e=ie.minutes,Ie=ie.seconds;m(de,$e,Ie)}t.redraw(),Z&&bt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),bt("onClose")}function je(){t.config!==void 0&&bt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].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 X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}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(Z){return t.calendarContainer.contains(Z)}function Qe(Z){if(t.isOpen&&!t.config.inline){var X=yn(Z),ie=Ve(X),de=X===t.input||X===t.altInput||t.element.contains(X)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),$e=!de&&!ie&&!Ve(Z.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Je){return Je.contains(X)});$e&&Ie&&(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 tt(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var X=Z,ie=t.currentYear!==X;t.currentYear=X||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(),bt("onYearChange"),N())}}function Ge(Z,X){var ie;X===void 0&&(X=!0);var de=t.parseDate(Z,void 0,X);if(t.config.minDate&&de&&kn(de,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&de&&kn(de,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(de===void 0)return!1;for(var $e=!!t.config.enable,Ie=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,Je=0,qe=void 0;Je=qe.from.getTime()&&de.getTime()<=qe.to.getTime())return $e}return!$e}function Mt(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function Pt(Z){var X=Z.target===t._input,ie=t._input.value.trimEnd()!==nt();X&&ie&&!(Z.relatedTarget&&Ve(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ce(Z){var X=yn(Z),ie=t.config.wrap?n.contains(X):X===t._input,de=t.config.allowInput,$e=t.isOpen&&(!de||!ie),Ie=t.config.inline&&ie&&!de;if(Z.keyCode===13&&ie){if(de)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Ve(X)||$e||Ie){var Je=!!t.timeContainer&&t.timeContainer.contains(X);switch(Z.keyCode){case 13:Je?(Z.preventDefault(),a(),Ni()):al(Z);break;case 27:Z.preventDefault(),Ni();break;case 8:case 46:ie&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Je&&!ie){Z.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(de===!1||qe&&Mt(qe))){var xe=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),ee(xe),R(E(1),0)):R(void 0,xe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Re=Z.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?Z.ctrlKey?(Z.stopPropagation(),tt(t.currentYear-Re),R(E(1),0)):Je||R(void 0,Re*7):X===t.currentYearElement?tt(t.currentYear-Re):t.config.enableTime&&(!Je&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Je){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(bn){return bn}),kt=Be.indexOf(X);if(kt!==-1){var Xn=Be[kt+(Z.shiftKey?-1:1)];Z.preventDefault(),(Xn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),en();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),en();break}(ie||Ve(X))&&bt("onKeyDown",Z)}function De(Z,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(X)||Z.classList.contains("flatpickr-disabled")))){for(var ie=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),de=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),$e=Math.min(ie,t.selectedDates[0].getTime()),Ie=Math.max(ie,t.selectedDates[0].getTime()),Je=!1,qe=0,xe=0,Re=$e;Re$e&&Reqe)?qe=Re:Re>de&&(!xe||Re ."+X));Be.forEach(function(kt){var Xn=kt.dateObj,bn=Xn.getTime(),Rl=qe>0&&bn0&&bn>xe;if(Rl){kt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(dl){kt.classList.remove(dl)});return}else if(Je&&!Rl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(dl){kt.classList.remove(dl)}),Z!==void 0&&(Z.classList.add(ie<=t.selectedDates[0].getTime()?"startRange":"endRange"),deie&&bn===de&&kt.classList.add("endRange"),bn>=qe&&(xe===0||bn<=xe)&&Z$(bn,de,ie)&&kt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&Bt()}function _t(Z,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var ie=yn(Z);ie&&ie.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),bt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var de=t.isOpen;t.isOpen=!0,de||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),bt("onOpen"),Bt(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ne(Z){return function(X){var ie=t.config["_"+Z+"Date"]=t.parseDate(X,t.config.dateFormat),de=t.config["_"+(Z==="min"?"max":"min")+"Date"];ie!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=ie.getHours()>0||ie.getMinutes()>0||ie.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function($e){return Ge($e)}),!t.selectedDates.length&&Z==="min"&&d(ie),en()),t.daysContainer&&(Vn(),ie!==void 0?t.currentYearElement[Z]=ie.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!de&&ie!==void 0&&de.getFullYear()===ie.getFullYear())}}function Ne(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=sn(sn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ie={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Be){t.config._enable=Gn(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=Gn(Be)}});var de=X.mode==="time";if(!X.dateFormat&&(X.enableTime||de)){var $e=Wt.defaultConfig.dateFormat||wl.dateFormat;ie.dateFormat=X.noCalendar||de?"H:i"+(X.enableSeconds?":S":""):$e+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||de)&&!X.altFormat){var Ie=Wt.defaultConfig.altFormat||wl.altFormat;ie.altFormat=X.noCalendar||de?"h:i"+(X.enableSeconds?":S K":" K"):Ie+(" h:i"+(X.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 Je=function(Be){return function(kt){t.config[Be==="min"?"_minTime":"_maxTime"]=t.parseDate(kt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Je("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Je("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ie,X);for(var qe=0;qe-1?t.config[Re]=Ir(xe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=xe[Re])}X.altInputClass||(t.config.altInputClass=Se().className+" "+t.config.altInputClass),bt("onParseConfig")}function Se(){return t.config.wrap?n.querySelector("[data-input]"):n}function mt(){typeof t.config.locale!="object"&&typeof Wt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=sn(sn({},Wt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Wt.l10ns[t.config.locale]:void 0),Zi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Zi.l="("+t.l10n.weekdays.longhand.join("|")+")",Zi.M="("+t.l10n.months.shorthand.join("|")+")",Zi.F="("+t.l10n.months.longhand.join("|")+")",Zi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=sn(sn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&Wt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Gb(t),t.parseDate=ma({config:t.config,l10n:t.l10n})}function Bt(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){bt("onPreCalendarPosition");var X=Z||t._positionElement,ie=Array.prototype.reduce.call(t.calendarContainer.children,function(d0,p0){return d0+p0.offsetHeight},0),de=t.calendarContainer.offsetWidth,$e=t.config.position.split(" "),Ie=$e[0],Je=$e.length>1?$e[1]:null,qe=X.getBoundingClientRect(),xe=window.innerHeight-qe.bottom,Re=Ie==="above"||Ie!=="below"&&xeie,Be=window.pageYOffset+qe.top+(Re?-ie-2:X.offsetHeight+2);if(rn(t.calendarContainer,"arrowTop",!Re),rn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var kt=window.pageXOffset+qe.left,Xn=!1,bn=!1;Je==="center"?(kt-=(de-qe.width)/2,Xn=!0):Je==="right"&&(kt-=de-qe.width,bn=!0),rn(t.calendarContainer,"arrowLeft",!Xn&&!bn),rn(t.calendarContainer,"arrowCenter",Xn),rn(t.calendarContainer,"arrowRight",bn);var Rl=window.document.body.offsetWidth-(window.pageXOffset+qe.right),dl=kt+de>window.document.body.offsetWidth,s0=Rl+de>window.document.body.offsetWidth;if(rn(t.calendarContainer,"rightMost",dl),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!dl)t.calendarContainer.style.left=kt+"px",t.calendarContainer.style.right="auto";else if(!s0)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Rl+"px";else{var ir=cn();if(ir===void 0)return;var o0=window.document.body.offsetWidth,r0=Math.max(0,o0/2-de/2),a0=".flatpickr-calendar.centerMost:before",u0=".flatpickr-calendar.centerMost:after",f0=ir.cssRules.length,c0="{left:"+qe.left+"px;right:auto;}";rn(t.calendarContainer,"rightMost",!1),rn(t.calendarContainer,"centerMost",!0),ir.insertRule(a0+","+u0+c0,f0),t.calendarContainer.style.left=r0+"px",t.calendarContainer.style.right="auto"}}}}function cn(){for(var Z=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=de,t.config.mode==="single")t.selectedDates=[$e];else if(t.config.mode==="multiple"){var Je=Me($e);Je?t.selectedDates.splice(parseInt(Je),1):t.selectedDates.push($e)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=$e,t.selectedDates.push($e),kn($e,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Be,kt){return Be.getTime()-kt.getTime()}));if(c(),Ie){var qe=t.currentYear!==$e.getFullYear();t.currentYear=$e.getFullYear(),t.currentMonth=$e.getMonth(),qe&&(bt("onYearChange"),N()),bt("onMonthChange")}if(Jt(),F(),en(),!Ie&&t.config.mode!=="range"&&t.config.showMonths===1?O(de):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 xe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(xe||Re)&&Ni()}_()}}var yi={locale:[mt,U],showMonths:[W,r,H],minDate:[S],maxDate:[S],positionElement:[ki],clickOpens:[function(){t.config.clickOpens===!0?(h(t._input,"focus",t.open),h(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ae(Z,X){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var ie in Z)yi[ie]!==void 0&&yi[ie].forEach(function(de){return de()})}else t.config[Z]=X,yi[Z]!==void 0?yi[Z].forEach(function(de){return de()}):Ar.indexOf(Z)>-1&&(t.config[Z]=Ir(X));t.redraw(),en(!0)}function Ft(Z,X){var ie=[];if(Z instanceof Array)ie=Z.map(function(de){return t.parseDate(de,X)});else if(Z instanceof Date||typeof Z=="number")ie=[t.parseDate(Z,X)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":ie=[t.parseDate(Z,X)];break;case"multiple":ie=Z.split(t.config.conjunction).map(function(de){return t.parseDate(de,X)});break;case"range":ie=Z.split(t.l10n.rangeSeparator).map(function(de){return t.parseDate(de,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?ie:ie.filter(function(de){return de instanceof Date&&Ge(de,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(de,$e){return de.getTime()-$e.getTime()})}function Ri(Z,X,ie){if(X===void 0&&(X=!1),ie===void 0&&(ie=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(X);Ft(Z,ie),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),en(X),X&&bt("onChange")}function Gn(Z){return Z.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function ul(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Ft(Z,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 Nl(){if(t.input=Se(),!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=ct(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"),ki()}function ki(){t._positionElement=t.config.positionElement||t._input}function fl(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ct("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="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{}h(t.mobileInput,"change",function(X){t.setDate(yn(X).value,!1,t.mobileFormatStr),bt("onChange"),bt("onClose")})}function cl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function bt(Z,X){if(t.config!==void 0){var ie=t.config[Z];if(ie!==void 0&&ie.length>0)for(var de=0;ie[de]&&de=0&&kn(Z,t.selectedDates[1])<=0}function Jt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,X){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=jo(ie.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ie.getMonth().toString(),Z.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(Z){var X=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ie){return t.formatDate(ie,X)}).filter(function(ie,de,$e){return t.config.mode!=="range"||t.config.enableTime||$e.indexOf(ie)===de}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function en(Z){Z===void 0&&(Z=!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)),Z!==!1&&bt("onValueUpdate")}function Bn(Z){var X=yn(Z),ie=t.prevMonthNav.contains(X),de=t.nextMonthNav.contains(X);ie||de?ee(ie?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(Z){Z.preventDefault();var X=Z.type==="keydown",ie=yn(Z),de=ie;t.amPM!==void 0&&ie===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]);var $e=parseFloat(de.getAttribute("min")),Ie=parseFloat(de.getAttribute("max")),Je=parseFloat(de.getAttribute("step")),qe=parseInt(de.value,10),xe=Z.delta||(X?Z.which===38?1:-1:0),Re=qe+Je*xe;if(typeof de.value<"u"&&de.value.length===2){var Be=de===t.hourElement,kt=de===t.minuteElement;Re<$e?(Re=Ie+Re+Ln(!Be)+(Ln(Be)&&Ln(!t.amPM)),kt&&T(void 0,-1,t.hourElement)):Re>Ie&&(Re=de===t.hourElement?Re-Ie-Ln(!t.amPM):$e,kt&&T(void 0,1,t.hourElement)),t.amPM&&Be&&(Je===1?Re+qe===23:Math.abs(Re-qe)>Je)&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]),de.value=pn(Re)}}return l(),t}function Sl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function iC(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Ze(e,i),{$$slots:s={},$$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,m=!1,{input:g=void 0,flatpickr:h=void 0}=e;Vt(()=>{const T=f??g,C=k(d);return C.onReady.push((D,O,E)=>{a===void 0&&S(D,O,E),Qt().then(()=>{t(8,m=!0)})}),t(3,h=Wt(T,Object.assign(C,f?{wrap:!0}:{}))),()=>{h.destroy()}});const _=rt();function k(T={}){T=Object.assign({},T);for(const C of r){const D=(O,E,L)=>{_(nC(C),[O,E,L])};C in T?(Array.isArray(T[C])||(T[C]=[T[C]]),T[C].push(D)):T[C]=[D]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,C,D){const O=_d(D,T);!bd(a,O)&&(a||O)&&t(2,a=O),t(4,u=C)}function $(T){te[T?"unshift":"push"](()=>{g=T,t(0,g)})}return n.$$set=T=>{e=Fe(Fe({},e),Kt(T)),t(1,l=Ze(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,h=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&h&&m&&(bd(a,_d(h,h.selectedDates))||h.setDate(a,!0,c)),n.$$.dirty&392&&h&&m)for(const[T,C]of Object.entries(k(d)))h.set(T,C)},[g,l,a,h,u,f,c,d,m,o,s,$]}class Qa extends _e{constructor(e){super(),ge(this,e,iC,tC,he,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function lC(n){let e,t,i,l,s,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),s=new Qa({props:c}),te.push(()=>be(s,"value",u)),te.push(()=>be(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=Y("Min date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};m&32768&&(g.id=d[15]),!o&&m&4&&(o=!0,g.value=d[2],ye(()=>o=!1)),!r&&m&1&&(r=!0,g.formattedValue=d[0].options.min,ye(()=>r=!1)),s.$set(g)},i(d){a||(A(s.$$.fragment,d),a=!0)},o(d){I(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function sC(n){let e,t,i,l,s,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),s=new Qa({props:c}),te.push(()=>be(s,"value",u)),te.push(()=>be(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=Y("Max date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};m&32768&&(g.id=d[15]),!o&&m&8&&(o=!0,g.value=d[3],ye(()=>o=!1)),!r&&m&1&&(r=!0,g.formattedValue=d[0].options.max,ye(()=>r=!1)),s.$set(g)},i(d){a||(A(s.$$.fragment,d),a=!0)},o(d){I(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function oC(n){let e,t,i,l,s,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[lC,({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:[sC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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&&v(e),V(i),V(o)}}}function rC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[oC]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 $,T;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(T=s==null?void 0:s.options)==null?void 0:T.max;function u(C,D){C.detail&&C.detail.length==3&&t(0,s.options[D]=C.detail[1],s)}function f(C){r=C,t(2,r),t(0,s)}function c(C){n.$$.not_equal(s.options.min,C)&&(s.options.min=C,t(0,s))}const d=C=>u(C,"min");function m(C){a=C,t(3,a),t(0,s)}function g(C){n.$$.not_equal(s.options.max,C)&&(s.options.max=C,t(0,s))}const h=C=>u(C,"max");function _(C){s=C,t(0,s)}function k(C){Ee.call(this,n,C)}function S(C){Ee.call(this,n,C)}return n.$$set=C=>{e=Fe(Fe({},e),Kt(C)),t(5,l=Ze(e,i)),"field"in C&&t(0,s=C.field),"key"in C&&t(1,o=C.key)},n.$$.update=()=>{var C,D,O,E;n.$$.dirty&5&&r!=((C=s==null?void 0:s.options)==null?void 0:C.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((O=s==null?void 0:s.options)==null?void 0:O.max)&&t(3,a=(E=s==null?void 0:s.options)==null?void 0:E.max)},[s,o,r,a,u,l,f,c,d,m,g,h,_,k,S]}class uC extends _e{constructor(e){super(),ge(this,e,aC,rC,he,{field:0,key:1})}}const fC=n=>({}),yd=n=>({});function kd(n,e,t){const i=n.slice();return i[48]=e[t],i}const cC=n=>({}),vd=n=>({});function wd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function Sd(n){let e,t,i;return{c(){e=b("div"),t=Y(n[2]),i=M(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),y(e,t),y(e,i)},p(l,s){s[0]&4&&se(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function dC(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function pC(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let u={};if(a!==void 0&&a[0]&2049)u=pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(r[11])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(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&&v(t),e&&V(e,r)}}}function Td(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[ve(Pe.call(null,e,"Clear")),K(e,"click",fn(Ye(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,we(i)}}}function $d(n){let e,t,i,l,s,o;const r=[pC,dC],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])&&Td(n);return{c(){e=b("div"),i.c(),l=M(),f&&f.c(),s=M(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),y(e,l),f&&f.m(e,null),y(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(re(),I(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Td(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){I(i),o=!1},d(c){c&&v(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:[gC]},$$scope:{ctx:n}};return e=new En({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[41](null),V(e,l)}}}function Md(n){let e,t,i,l,s,o,r,a,u=n[17].length&&Od(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=M(),s=b("input"),o=M(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"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),y(e,t),y(t,i),y(t,l),y(t,s),ue(s,n[17]),y(t,o),u&&u.m(t,null),s.focus(),r||(a=K(s,"input",n[38]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&ue(s,f[17]),f[17].length?u?u.p(f,c):(u=Od(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&v(e),u&&u.d(),r=!1,a()}}}function Od(n){let e,t,i,l;return{c(){e=b("div"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",fn(Ye(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function Dd(n){let e,t=n[1]&&Ed(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=Ed(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Ed(n){let e,t;return{c(){e=b("div"),t=Y(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l[0]&2&&se(t,i[1])},d(i){i&&v(e)}}}function mC(n){let e=n[48]+"",t;return{c(){t=Y(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&se(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function hC(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let u={};if(a!==void 0&&a[0]&4202496)u=pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(r[13])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(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&&v(t),e&&V(e,r)}}}function Ad(n){let e,t,i,l,s,o,r;const a=[hC,mC],u=[];function f(m,g){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=M(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,g){w(m,e,g),u[t].m(e,null),y(e,l),s=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(m,g){n=m;let h=t;t=f(n),t===h?u[t].p(n,g):(re(),I(u[h],1,1,()=>{u[h]=null}),ae(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,l)),(!s||g[0]&512)&&x(e,"closable",n[9]),(!s||g[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(A(i),s=!0)},o(m){I(i),s=!1},d(m){m&&v(e),u[t].d(),o=!1,we(r)}}}function gC(n){let e,t,i,l,s,o=n[14]&&Md(n);const r=n[35].beforeOptions,a=vt(r,n,n[44],vd);let u=pe(n[22]),f=[];for(let h=0;hI(f[h],1,1,()=>{f[h]=null});let d=null;u.length||(d=Dd(n));const m=n[35].afterOptions,g=vt(m,n,n[44],yd);return{c(){o&&o.c(),e=M(),a&&a.c(),t=M(),i=b("div");for(let h=0;hI(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Sd(n));let c=!n[5]&&!n[6]&&Cd(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mSe(mt,Ne))||[]}function Te(ne,Ne){ne.preventDefault(),k&&d?G(Ne):W(Ne)}function je(ne,Ne){(ne.code==="Enter"||ne.code==="Space")&&(Te(ne,Ne),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 Qe(ne){ne.stopPropagation(),!g&&!m&&(R==null||R.toggle())}Vt(()=>{const ne=document.querySelectorAll(`label[for="${r}"]`);for(const Ne of ne)Ne.addEventListener("click",Qe);return()=>{for(const Ne of ne)Ne.removeEventListener("click",Qe)}});const tt=ne=>q(ne);function Ge(ne){te[ne?"unshift":"push"](()=>{N=ne,t(20,N)})}function Mt(){P=this.value,t(17,P)}const Pt=(ne,Ne)=>Te(Ne,ne),Ce=(ne,Ne)=>je(Ne,ne);function De(ne){te[ne?"unshift":"push"](()=>{R=ne,t(18,R)})}function ze(ne){Ee.call(this,n,ne)}function _t(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,m=ne.disabled),"readonly"in ne&&t(6,g=ne.readonly),"upside"in ne&&t(7,h=ne.upside),"selected"in ne&&t(0,_=ne.selected),"toggle"in ne&&t(8,k=ne.toggle),"closable"in ne&&t(9,S=ne.closable),"labelComponent"in ne&&t(10,$=ne.labelComponent),"labelComponentProps"in ne&&t(11,T=ne.labelComponentProps),"optionComponent"in ne&&t(12,C=ne.optionComponent),"optionComponentProps"in ne&&t(13,D=ne.optionComponentProps),"searchable"in ne&&t(14,O=ne.searchable),"searchFunc"in ne&&t(29,E=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&&(le(),ee()),n.$$.dirty[0]&268566528&&t(22,i=oe(c,P)),n.$$.dirty[0]&1&&t(21,l=function(ne){const Ne=j.toArray(_);return j.inArray(Ne,ne)})},[_,a,u,f,d,m,g,h,k,S,$,T,C,D,O,L,q,P,R,F,N,l,i,ee,Te,je,Ve,r,c,E,W,G,J,H,U,s,tt,Ge,Mt,Pt,Ce,De,ze,_t,o]}class Xb extends _e{constructor(e){super(),ge(this,e,yC,_C,he,{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 Id(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function kC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&Id(n);return{c(){s&&s.c(),e=M(),t=b("span"),l=Y(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),y(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=Id(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function vC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Ld extends _e{constructor(e){super(),ge(this,e,vC,kC,he,{item:0})}}const wC=n=>({}),Pd=n=>({});function SC(n){let e;const t=n[8].afterOptions,i=vt(t,n,n[12],Pd);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&St(i,t,l,l[12],e?wt(t,l[12],s,wC):Tt(l[12]),Pd)},i(l){e||(A(i,l),e=!0)},o(l){I(i,l),e=!1},d(l){i&&i.d(l)}}}function TC(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[SC]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&62?pt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ct(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ye(()=>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 $C(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Ze(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Ld}=e,{optionComponent:c=Ld}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function g($){$=j.toArray($,!0);let T=[];for(let C of $){const D=j.findByKey(r,d,C);D&&T.push(D)}$.length&&!T.length||t(0,u=a?T:T[0])}async function h($){let T=j.toArray($,!0).map(C=>C[d]);r.length&&t(6,m=a?T:T[0])}function _($){u=$,t(0,u)}function k($){Ee.call(this,n,$)}function S($){Ee.call(this,n,$)}return n.$$set=$=>{e=Fe(Fe({},e),Kt($)),t(5,l=Ze(e,i)),"items"in $&&t(1,r=$.items),"multiple"in $&&t(2,a=$.multiple),"selected"in $&&t(0,u=$.selected),"labelComponent"in $&&t(3,f=$.labelComponent),"optionComponent"in $&&t(4,c=$.optionComponent),"selectionKey"in $&&t(7,d=$.selectionKey),"keyOfSelected"in $&&t(6,m=$.keyOfSelected),"$$scope"in $&&t(12,o=$.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(m),n.$$.dirty&1&&h(u)},[u,r,a,f,c,l,m,d,s,_,k,S,o]}class _i extends _e{constructor(e){super(),ge(this,e,$C,TC,he,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function CC(n){let e,t,i,l,s,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 Fl({props:a}),te.push(()=>be(t,"value",r)),{c(){e=b("div"),B(t.$$.fragment)},m(u,f){w(u,e,f),z(t,e,null),l=!0,s||(o=ve(Pe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!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,ye(()=>i=!1)),t.$set(c)},i(u){l||(A(t.$$.fragment,u),l=!0)},o(u){I(t.$$.fragment,u),l=!1},d(u){u&&v(e),V(t),s=!1,o()}}}function MC(n){let e,t,i;function l(o){n[8](o)}let s={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 OC(n){let e,t,i,l,s,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:[CC,({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:[MC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&16384&&(m.class="form-field required "+(c[14]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&57345&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);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&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),V(i,c),V(r,c)}}}function Fd(n){let e,t;return e=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[DC,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&40961&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function DC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"id",o=n[13]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].options.maxSelect),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.maxSelect&&ue(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function EC(n){let e,t,i=!n[2]&&Fd(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(re(),I(i,1,1,()=>{i=null}),ae()):i?(i.p(l,s),s&4&&A(i,1)):(i=Fd(l),i.c(),A(i,1),i.m(e.parentNode,e))},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function AC(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[EC],default:[OC,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&18?pt(l,[a&2&&{key:r[1]},a&16&&Ct(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 IC(n,e,t){var k;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((k=s.options)==null?void 0:k.maxSelect)<=1,u=a;function f(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,u=a)}function c(){s.options.maxSelect=ut(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.options.values,S)&&(s.options.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function g(S){s=S,t(0,s),t(5,u),t(2,a)}function h(S){Ee.call(this,n,S)}function _(S){Ee.call(this,n,S)}return n.$$set=S=>{e=Fe(Fe({},e),Kt(S)),t(4,l=Ze(e,i)),"field"in S&&t(0,s=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,$;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(S=s.options)==null?void 0:S.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&f()},[s,o,a,r,l,u,c,d,m,g,h,_]}class LC extends _e{constructor(e){super(),ge(this,e,IC,AC,he,{field:0,key:1})}}function PC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function FC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Nd(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O='"{"a":1,"b":2}"',E,L,R,P,F,N,q,W,G,J,H,U,le;return{c(){e=b("div"),t=b("div"),i=b("div"),l=Y("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=Y(` and `),r=b("code"),r.textContent="multipart/form-data",a=Y(` requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=Y(` field is a `),c=b("strong"),c.textContent="plain string",d=Y(`: `),m=b("ul"),g=b("li"),g.innerHTML=""true" is converted to the json true",h=M(),_=b("li"),_.innerHTML=""false" is converted to the json false",k=M(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=M(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",C=M(),D=b("li"),E=Y(O),L=Y(" is converted to the json "),R=b("code"),R.textContent='{"a":1,"b":2}',P=M(),F=b("li"),F.textContent="numeric strings are converted to json number",N=M(),q=b("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",W=M(),G=b("li"),G.textContent="any other string (empty string too) is double quoted",J=Y(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),H=b("code"),H.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,oe){w(ee,e,oe),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(m,g),y(m,h),y(m,_),y(m,k),y(m,S),y(m,$),y(m,T),y(m,C),y(m,D),y(D,E),y(D,L),y(D,R),y(m,P),y(m,F),y(m,N),y(m,q),y(m,W),y(m,G),y(i,J),y(i,H),le=!0},i(ee){le||(ee&&Ke(()=>{le&&(U||(U=Le(e,et,{duration:150},!0)),U.run(1))}),le=!0)},o(ee){ee&&(U||(U=Le(e,et,{duration:150},!1)),U.run(0)),le=!1},d(ee){ee&&v(e),ee&&U&&U.end()}}}function FC(n){let e,t,i,l,s,o,r;function a(d,m){return d[2]?PC:LC}let u=a(n),f=u(n),c=n[2]&&Fd();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=M(),f.c(),l=M(),c&&c.c(),s=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){w(d,e,m),y(e,t),y(e,i),f.m(e,null),w(d,l,m),c&&c.m(d,m),w(d,s,m),o||(r=K(e,"click",n[4]),o=!0)},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?m&4&&A(c,1):(c=Fd(),c.c(),A(c,1),c.m(s.parentNode,s)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&(v(e),v(l),v(s)),f.d(),c&&c.d(d),o=!1,r()}}}function NC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[5](r)}let o={$$slots:{options:[FC]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&10?pt(l,[a&2&&{key:r[1]},a&8&&Ct(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 l=Ze(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Pe(Pe({},e),Kt(d)),t(3,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},[s,o,r,l,a,u,f,c]}class qC extends be{constructor(e){super(),_e(this,e,RC,NC,me,{field:0,key:1})}}function jC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=Y(t),l=M(),s=b("small"),r=Y(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),w(a,s,u),y(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function HC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Nd extends be{constructor(e){super(),_e(this,e,HC,jC,me,{item:0})}}const zC=[{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 VC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 BC(n){let e,t,i,l,s,o;return i=new he({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[VC,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),w(r,s,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&&(v(e),v(t),v(l),v(s)),V(i,r)}}}function UC(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=M(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=M(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=M(),r=b("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(s,"type","button"),p(s,"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,l,c),w(f,s,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[9]),K(i,"click",n[10]),K(s,"click",n[11]),K(r,"click",n[12])],a=!0)},p:Q,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,we(u)}}}function WC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$;function T(D){n[8](D)}let C={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Nd,optionComponent:Nd};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new _i({props:C}),te.push(()=>ge(r,"keyOfSelected",T)),_=new En({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[UC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),c=b("button"),d=b("span"),d.textContent="Choose presets",m=M(),g=b("i"),h=M(),B(_.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=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(D,O){w(D,e,O),y(e,t),y(e,i),y(e,l),w(D,o,O),z(r,D,O),w(D,u,O),w(D,f,O),y(f,c),y(c,d),y(c,m),y(c,g),y(c,h),z(_,c,null),k=!0,S||($=ve(Fe.call(null,l,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(D,O){(!k||O&4194304&&s!==(s=D[22]))&&p(e,"for",s);const E={};O&4194304&&(E.id=D[22]),O&8&&(E.items=D[3]),!a&&O&1&&(a=!0,E.keyOfSelected=D[0].options.mimeTypes,ye(()=>a=!1)),r.$set(E);const L={};O&16777217&&(L.$$scope={dirty:O,ctx:D}),_.$set(L)},i(D){k||(A(r.$$.fragment,D),A(_.$$.fragment,D),k=!0)},o(D){I(r.$$.fragment,D),I(_.$$.fragment,D),k=!1},d(D){D&&(v(e),v(o),v(u),v(f)),V(r,D),V(_),S=!1,$()}}}function YC(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH + data inside an object, eg.`),H=b("code"),H.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,oe){w(ee,e,oe),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(m,g),y(m,h),y(m,_),y(m,k),y(m,S),y(m,$),y(m,T),y(m,C),y(m,D),y(D,E),y(D,L),y(D,R),y(m,P),y(m,F),y(m,N),y(m,q),y(m,W),y(m,G),y(i,J),y(i,H),le=!0},i(ee){le||(ee&&Ke(()=>{le&&(U||(U=Le(e,et,{duration:150},!0)),U.run(1))}),le=!0)},o(ee){ee&&(U||(U=Le(e,et,{duration:150},!1)),U.run(0)),le=!1},d(ee){ee&&v(e),ee&&U&&U.end()}}}function NC(n){let e,t,i,l,s,o,r;function a(d,m){return d[2]?FC:PC}let u=a(n),f=u(n),c=n[2]&&Nd();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=M(),f.c(),l=M(),c&&c.c(),s=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){w(d,e,m),y(e,t),y(e,i),f.m(e,null),w(d,l,m),c&&c.m(d,m),w(d,s,m),o||(r=K(e,"click",n[4]),o=!0)},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?m&4&&A(c,1):(c=Nd(),c.c(),A(c,1),c.m(s.parentNode,s)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&(v(e),v(l),v(s)),f.d(),c&&c.d(d),o=!1,r()}}}function RC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[5](r)}let o={$$slots:{options:[NC]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&10?pt(l,[a&2&&{key:r[1]},a&8&&Ct(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 qC(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Fe(Fe({},e),Kt(d)),t(3,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},[s,o,r,l,a,u,f,c]}class jC extends _e{constructor(e){super(),ge(this,e,qC,RC,he,{field:0,key:1})}}function HC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=Y(t),l=M(),s=b("small"),r=Y(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),w(a,s,u),y(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function zC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Rd extends _e{constructor(e){super(),ge(this,e,zC,HC,he,{item:0})}}const VC=[{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 BC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 UC(n){let e,t,i,l,s,o;return i=new me({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[BC,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),w(r,s,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&&(v(e),v(t),v(l),v(s)),V(i,r)}}}function WC(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=M(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=M(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=M(),r=b("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(s,"type","button"),p(s,"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,l,c),w(f,s,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[9]),K(i,"click",n[10]),K(s,"click",n[11]),K(r,"click",n[12])],a=!0)},p:Q,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,we(u)}}}function YC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$;function T(D){n[8](D)}let C={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Rd,optionComponent:Rd};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new _i({props:C}),te.push(()=>be(r,"keyOfSelected",T)),_=new En({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[WC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),c=b("button"),d=b("span"),d.textContent="Choose presets",m=M(),g=b("i"),h=M(),B(_.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=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(D,O){w(D,e,O),y(e,t),y(e,i),y(e,l),w(D,o,O),z(r,D,O),w(D,u,O),w(D,f,O),y(f,c),y(c,d),y(c,m),y(c,g),y(c,h),z(_,c,null),k=!0,S||($=ve(Pe.call(null,l,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(D,O){(!k||O&4194304&&s!==(s=D[22]))&&p(e,"for",s);const E={};O&4194304&&(E.id=D[22]),O&8&&(E.items=D[3]),!a&&O&1&&(a=!0,E.keyOfSelected=D[0].options.mimeTypes,ye(()=>a=!1)),r.$set(E);const L={};O&16777217&&(L.$$scope={dirty:O,ctx:D}),_.$set(L)},i(D){k||(A(r.$$.fragment,D),A(_.$$.fragment,D),k=!0)},o(D){I(r.$$.fragment,D),I(_.$$.fragment,D),k=!1},d(D){D&&(v(e),v(o),v(u),v(f)),V(r,D),V(_),S=!1,$()}}}function KC(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e)}}}function KC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C;function D(E){n[13](E)}let O={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Nl({props:O}),te.push(()=>ge(r,"value",D)),S=new En({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[YC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),g=b("span"),g.textContent="Supported formats",h=M(),_=b("i"),k=M(),B(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){w(E,e,L),y(e,t),y(e,i),y(e,l),w(E,o,L),z(r,E,L),w(E,u,L),w(E,f,L),y(f,c),y(f,d),y(f,m),y(m,g),y(m,h),y(m,_),y(m,k),z(S,m,null),$=!0,T||(C=ve(Fe.call(null,l,{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(E,L){(!$||L&4194304&&s!==(s=E[22]))&&p(e,"for",s);const R={};L&4194304&&(R.id=E[22]),!a&&L&1&&(a=!0,R.value=E[0].options.thumbs,ye(()=>a=!1)),r.$set(R);const P={};L&16777216&&(P.$$scope={dirty:L,ctx:E}),S.$set(P)},i(E){$||(A(r.$$.fragment,E),A(S.$$.fragment,E),$=!0)},o(E){I(r.$$.fragment,E),I(S.$$.fragment,E),$=!1},d(E){E&&(v(e),v(o),v(u),v(f)),V(r,E),V(S),T=!1,C()}}}function JC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&1&&ut(s.value)!==c[0].options.maxSize&&ce(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function Rd(n){let e,t,i;return t=new he({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[ZC,({uniqueId:l})=>({22:l}),({uniqueId:l})=>l?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&20971521&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function ZC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[22]),p(s,"id",o=n[22]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.maxSelect),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.maxSelect&&ce(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function GC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[WC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[KC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),f=new he({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[JC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&Rd(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),d=M(),g&&g.c(),p(t,"class","col-sm-12"),p(s,"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(h,_){w(h,e,_),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,a),y(e,u),z(f,u,null),y(e,d),g&&g.m(e,null),m=!0},p(h,_){const k={};_&2&&(k.name="schema."+h[1]+".options.mimeTypes"),_&20971529&&(k.$$scope={dirty:_,ctx:h}),i.$set(k);const S={};_&2&&(S.name="schema."+h[1]+".options.thumbs"),_&20971521&&(S.$$scope={dirty:_,ctx:h}),o.$set(S),(!m||_&4&&r!==(r=h[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const $={};_&2&&($.name="schema."+h[1]+".options.maxSize"),_&20971521&&($.$$scope={dirty:_,ctx:h}),f.$set($),(!m||_&4&&c!==(c=h[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),h[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(h,_),_&4&&A(g,1)):(g=Rd(h),g.c(),A(g,1),g.m(e,null))},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),A(g),m=!0)},o(h){I(i.$$.fragment,h),I(o.$$.fragment,h),I(f.$$.fragment,h),I(g),m=!1},d(h){h&&v(e),V(i),V(o),V(f),g&&g.d()}}}function XC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Protected",r=M(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(s,"class","txt"),p(l,"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,l,d),y(l,s),w(c,r,d),w(c,a,d),u||(f=K(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(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),u=!1,f()}}}function QC(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[XC,({uniqueId:i})=>({22:i}),({uniqueId:i})=>i?4194304:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&20971521&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[QC],options:[GC],default:[BC,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 e6(n,e,t){var R;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=zC.slice(),u=((R=s.options)==null?void 0:R.maxSelect)<=1,f=u;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,u=!0),t(6,f=u)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const P=[];for(const F of s.options.mimeTypes)a.find(N=>N.mimeType===F)||P.push({mimeType:F});P.length&&t(3,a=a.concat(P))}function m(){s.options.protected=this.checked,t(0,s),t(6,f),t(2,u)}function g(P){n.$$.not_equal(s.options.mimeTypes,P)&&(s.options.mimeTypes=P,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},_=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},k=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function $(P){n.$$.not_equal(s.options.thumbs,P)&&(s.options.thumbs=P,t(0,s),t(6,f),t(2,u))}function T(){s.options.maxSize=ut(this.value),t(0,s),t(6,f),t(2,u)}function C(){s.options.maxSelect=ut(this.value),t(0,s),t(6,f),t(2,u)}function D(P){u=P,t(2,u)}function O(P){s=P,t(0,s),t(6,f),t(2,u)}function E(P){Ee.call(this,n,P)}function L(P){Ee.call(this,n,P)}return n.$$set=P=>{e=Pe(Pe({},e),Kt(P)),t(5,l=Ze(e,i)),"field"in P&&t(0,s=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,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((F=(P=s.options)==null?void 0:P.values)==null?void 0:F.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,u,a,r,l,f,m,g,h,_,k,S,$,T,C,D,O,E,L]}class t6 extends be{constructor(e){super(),_e(this,e,e6,xC,me,{field:0,key:1})}}function n6(n){let e,t,i,l,s;return{c(){e=b("hr"),t=M(),i=b("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),l||(s=K(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function i6(n){let e,t,i;function l(o){n[15](o)}let s={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:[n6]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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,ye(()=>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 l6(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[6],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 s6(n){let e,t,i,l,s,o,r,a,u,f;return i=new he({props:{class:"form-field required "+(n[24]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[i6,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[l6,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&16777216&&(m.class="form-field required "+(c[24]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&58720297&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);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&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),V(i,c),V(r,c)}}}function qd(n){let e,t,i,l,s,o;return t=new he({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[o6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),s=new he({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[r6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),i=M(),l=b("div"),B(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),z(t,e,null),w(r,i,a),w(r,l,a),z(s,l,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}),s.$set(f)},i(r){o||(A(t.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),V(t),V(s)}}}function o6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.minSelect),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.minSelect&&ce(s,u[0].options.minSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function r6(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ce(s,n[0].options.maxSelect),a||(u=K(s,"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(s,"id",o),c&1&&r!==(r=f[0].options.minSelect||2)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.maxSelect&&ce(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function a6(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(h){n[13](h)}let g={id:n[23],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(g.keyOfSelected=n[0].options.cascadeDelete),a=new _i({props:g}),te.push(()=>ge(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=M(),l=b("i"),r=M(),B(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[23])},m(h,_){var k,S;w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,r,_),z(a,h,_),f=!0,c||(d=ve(s=Fe.call(null,l,{text:[`Whether on ${((k=n[4])==null?void 0:k.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:Q,d(t){t&&v(e)}}}function JC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C;function D(E){n[13](E)}let O={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Fl({props:O}),te.push(()=>be(r,"value",D)),S=new En({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[KC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),g=b("span"),g.textContent="Supported formats",h=M(),_=b("i"),k=M(),B(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){w(E,e,L),y(e,t),y(e,i),y(e,l),w(E,o,L),z(r,E,L),w(E,u,L),w(E,f,L),y(f,c),y(f,d),y(f,m),y(m,g),y(m,h),y(m,_),y(m,k),z(S,m,null),$=!0,T||(C=ve(Pe.call(null,l,{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(E,L){(!$||L&4194304&&s!==(s=E[22]))&&p(e,"for",s);const R={};L&4194304&&(R.id=E[22]),!a&&L&1&&(a=!0,R.value=E[0].options.thumbs,ye(()=>a=!1)),r.$set(R);const P={};L&16777216&&(P.$$scope={dirty:L,ctx:E}),S.$set(P)},i(E){$||(A(r.$$.fragment,E),A(S.$$.fragment,E),$=!0)},o(E){I(r.$$.fragment,E),I(S.$$.fragment,E),$=!1},d(E){E&&(v(e),v(o),v(u),v(f)),V(r,E),V(S),T=!1,C()}}}function ZC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&1&&ut(s.value)!==c[0].options.maxSize&&ue(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function qd(n){let e,t,i;return t=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[GC,({uniqueId:l})=>({22:l}),({uniqueId:l})=>l?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&20971521&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function GC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[22]),p(s,"id",o=n[22]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].options.maxSelect),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.maxSelect&&ue(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function XC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[YC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[JC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[ZC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&qd(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),d=M(),g&&g.c(),p(t,"class","col-sm-12"),p(s,"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(h,_){w(h,e,_),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,a),y(e,u),z(f,u,null),y(e,d),g&&g.m(e,null),m=!0},p(h,_){const k={};_&2&&(k.name="schema."+h[1]+".options.mimeTypes"),_&20971529&&(k.$$scope={dirty:_,ctx:h}),i.$set(k);const S={};_&2&&(S.name="schema."+h[1]+".options.thumbs"),_&20971521&&(S.$$scope={dirty:_,ctx:h}),o.$set(S),(!m||_&4&&r!==(r=h[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const $={};_&2&&($.name="schema."+h[1]+".options.maxSize"),_&20971521&&($.$$scope={dirty:_,ctx:h}),f.$set($),(!m||_&4&&c!==(c=h[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),h[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(h,_),_&4&&A(g,1)):(g=qd(h),g.c(),A(g,1),g.m(e,null))},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),A(g),m=!0)},o(h){I(i.$$.fragment,h),I(o.$$.fragment,h),I(f.$$.fragment,h),I(g),m=!1},d(h){h&&v(e),V(i),V(o),V(f),g&&g.d()}}}function QC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Protected",r=M(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(s,"class","txt"),p(l,"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,l,d),y(l,s),w(c,r,d),w(c,a,d),u||(f=K(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(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),u=!1,f()}}}function xC(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[QC,({uniqueId:i})=>({22:i}),({uniqueId:i})=>i?4194304:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&20971521&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[xC],options:[XC],default:[UC,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>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 t6(n,e,t){var R;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=VC.slice(),u=((R=s.options)==null?void 0:R.maxSelect)<=1,f=u;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,u=!0),t(6,f=u)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const P=[];for(const F of s.options.mimeTypes)a.find(N=>N.mimeType===F)||P.push({mimeType:F});P.length&&t(3,a=a.concat(P))}function m(){s.options.protected=this.checked,t(0,s),t(6,f),t(2,u)}function g(P){n.$$.not_equal(s.options.mimeTypes,P)&&(s.options.mimeTypes=P,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},_=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},k=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function $(P){n.$$.not_equal(s.options.thumbs,P)&&(s.options.thumbs=P,t(0,s),t(6,f),t(2,u))}function T(){s.options.maxSize=ut(this.value),t(0,s),t(6,f),t(2,u)}function C(){s.options.maxSelect=ut(this.value),t(0,s),t(6,f),t(2,u)}function D(P){u=P,t(2,u)}function O(P){s=P,t(0,s),t(6,f),t(2,u)}function E(P){Ee.call(this,n,P)}function L(P){Ee.call(this,n,P)}return n.$$set=P=>{e=Fe(Fe({},e),Kt(P)),t(5,l=Ze(e,i)),"field"in P&&t(0,s=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,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((F=(P=s.options)==null?void 0:P.values)==null?void 0:F.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,u,a,r,l,f,m,g,h,_,k,S,$,T,C,D,O,E,L]}class n6 extends _e{constructor(e){super(),ge(this,e,t6,e6,he,{field:0,key:1})}}function i6(n){let e,t,i,l,s;return{c(){e=b("hr"),t=M(),i=b("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),l||(s=K(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function l6(n){let e,t,i;function l(o){n[15](o)}let s={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:[i6]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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,ye(()=>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 s6(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[6],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 o6(n){let e,t,i,l,s,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:[l6,({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:[s6,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&16777216&&(m.class="form-field required "+(c[24]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&58720297&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);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&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),V(i,c),V(r,c)}}}function jd(n){let e,t,i,l,s,o;return t=new me({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[r6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[a6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),i=M(),l=b("div"),B(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),z(t,e,null),w(r,i,a),w(r,l,a),z(s,l,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}),s.$set(f)},i(r){o||(A(t.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),V(t),V(s)}}}function r6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].options.minSelect),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.minSelect&&ue(s,u[0].options.minSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function a6(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ue(s,n[0].options.maxSelect),a||(u=K(s,"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(s,"id",o),c&1&&r!==(r=f[0].options.minSelect||2)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.maxSelect&&ue(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function u6(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(h){n[13](h)}let g={id:n[23],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(g.keyOfSelected=n[0].options.cascadeDelete),a=new _i({props:g}),te.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=M(),l=b("i"),r=M(),B(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[23])},m(h,_){var k,S;w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,r,_),z(a,h,_),f=!0,c||(d=ve(s=Pe.call(null,l,{text:[`Whether on ${((k=n[4])==null?void 0:k.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(h,_){var S,$;s&&$t(s.update)&&_&20&&s.update.call(null,{text:[`Whether on ${((S=h[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,h[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=h[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!f||_&8388608&&o!==(o=h[23]))&&p(e,"for",o);const k={};_&8388608&&(k.id=h[23]),!u&&_&1&&(u=!0,k.keyOfSelected=h[0].options.cascadeDelete,ye(()=>u=!1)),a.$set(k)},i(h){f||(A(a.$$.fragment,h),f=!0)},o(h){I(a.$$.fragment,h),f=!1},d(h){h&&(v(e),v(r)),V(a,h),c=!1,d()}}}function u6(n){let e,t,i,l,s,o=!n[2]&&qd(n);return l=new he({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[a6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),B(l.$$.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),y(e,t),y(e,i),z(l,i,null),s=!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=qd(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}),l.$set(u)},i(r){s||(A(o),A(l.$$.fragment,r),s=!0)},o(r){I(o),I(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),V(l)}}}function f6(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[u6],default:[s6,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;fge(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return l=new Qa({props:u}),n[20](l),l.$on("save",n[21]),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment)},m(f,c){z(e,f,c),w(f,i,c),z(l,f,c),s=!0},p(f,[c]){const d=c&258?pt(o,[c&2&&{key:f[1]},c&256&&Ct(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ye(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(A(e.$$.fragment,f),A(l.$$.fragment,f),s=!0)},o(f){I(e.$$.fragment,f),I(l.$$.fragment,f),s=!1},d(f){f&&v(i),V(e,f),n[20](null),V(l,f)}}}function c6(n,e,t){var P;let i,l;const s=["field","key"];let o=Ze(e,s),r;We(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,m=((P=a.options)==null?void 0:P.maxSelect)==1,g=m;function h(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,g=m)}function _(){a.options.minSelect=ut(this.value),t(0,a),t(9,g),t(2,m)}function k(){a.options.maxSelect=ut(this.value),t(0,a),t(9,g),t(2,m)}function S(F){n.$$.not_equal(a.options.cascadeDelete,F)&&(a.options.cascadeDelete=F,t(0,a),t(9,g),t(2,m))}const $=()=>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,m))}function C(F){m=F,t(2,m)}function D(F){a=F,t(0,a),t(9,g),t(2,m)}function O(F){Ee.call(this,n,F)}function E(F){Ee.call(this,n,F)}function L(F){te[F?"unshift":"push"](()=>{d=F,t(3,d)})}const R=F=>{var N,q;(q=(N=F==null?void 0:F.detail)==null?void 0:N.collection)!=null&&q.id&&F.detail.collection.type!="view"&&t(0,a.options.collectionId=F.detail.collection.id,a)};return n.$$set=F=>{e=Pe(Pe({},e),Kt(F)),t(8,o=Ze(e,s)),"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!=m&&(t(9,g=m),m?(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)&&h(),n.$$.dirty&1025&&t(4,l=r.find(F=>F.id==a.options.collectionId)||null)},[a,u,m,d,l,i,f,c,o,g,r,_,k,S,$,T,C,D,O,E,L,R]}class d6 extends be{constructor(e){super(),_e(this,e,c6,f6,me,{field:0,key:1})}}const p6=n=>({dragging:n&4,dragover:n&8}),jd=n=>({dragging:n[2],dragover:n[3]});function m6(n){let e,t,i,l,s;const o=n[10].default,r=vt(o,n,n[9],jd);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"dragover",Ye(n[11])),K(e,"dragleave",Ye(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&St(r,o,a,a[9],i?wt(o,a[9],u,p6):Tt(a[9]),jd),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,we(s)}}}function h6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,C){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:C,group:a})),s("drag",T)}}function g(T,C){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let D={};try{D=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(D.group!=a)return;const O=D.index<<0;O{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=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,l=T.$$scope)},[o,u,c,d,m,g,r,a,f,l,i,h,_,k,S,$]}class Ls extends be{constructor(e){super(),_e(this,e,h6,m6,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Hd(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function zd(n){let e,t,i,l,s,o,r,a;return{c(){e=Y(`, +`),position:"top"}),(!f||_&8388608&&o!==(o=h[23]))&&p(e,"for",o);const k={};_&8388608&&(k.id=h[23]),!u&&_&1&&(u=!0,k.keyOfSelected=h[0].options.cascadeDelete,ye(()=>u=!1)),a.$set(k)},i(h){f||(A(a.$$.fragment,h),f=!0)},o(h){I(a.$$.fragment,h),f=!1},d(h){h&&(v(e),v(r)),V(a,h),c=!1,d()}}}function f6(n){let e,t,i,l,s,o=!n[2]&&jd(n);return l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[u6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),B(l.$$.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),y(e,t),y(e,i),z(l,i,null),s=!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=jd(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}),l.$set(u)},i(r){s||(A(o),A(l.$$.fragment,r),s=!0)},o(r){I(o),I(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),V(l)}}}function c6(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[f6],default:[o6,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;fbe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return l=new xa({props:u}),n[20](l),l.$on("save",n[21]),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment)},m(f,c){z(e,f,c),w(f,i,c),z(l,f,c),s=!0},p(f,[c]){const d=c&258?pt(o,[c&2&&{key:f[1]},c&256&&Ct(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ye(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(A(e.$$.fragment,f),A(l.$$.fragment,f),s=!0)},o(f){I(e.$$.fragment,f),I(l.$$.fragment,f),s=!1},d(f){f&&v(i),V(e,f),n[20](null),V(l,f)}}}function d6(n,e,t){var P;let i,l;const s=["field","key"];let o=Ze(e,s),r;We(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,m=((P=a.options)==null?void 0:P.maxSelect)==1,g=m;function h(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,g=m)}function _(){a.options.minSelect=ut(this.value),t(0,a),t(9,g),t(2,m)}function k(){a.options.maxSelect=ut(this.value),t(0,a),t(9,g),t(2,m)}function S(F){n.$$.not_equal(a.options.cascadeDelete,F)&&(a.options.cascadeDelete=F,t(0,a),t(9,g),t(2,m))}const $=()=>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,m))}function C(F){m=F,t(2,m)}function D(F){a=F,t(0,a),t(9,g),t(2,m)}function O(F){Ee.call(this,n,F)}function E(F){Ee.call(this,n,F)}function L(F){te[F?"unshift":"push"](()=>{d=F,t(3,d)})}const R=F=>{var N,q;(q=(N=F==null?void 0:F.detail)==null?void 0:N.collection)!=null&&q.id&&F.detail.collection.type!="view"&&t(0,a.options.collectionId=F.detail.collection.id,a)};return n.$$set=F=>{e=Fe(Fe({},e),Kt(F)),t(8,o=Ze(e,s)),"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!=m&&(t(9,g=m),m?(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)&&h(),n.$$.dirty&1025&&t(4,l=r.find(F=>F.id==a.options.collectionId)||null)},[a,u,m,d,l,i,f,c,o,g,r,_,k,S,$,T,C,D,O,E,L,R]}class p6 extends _e{constructor(e){super(),ge(this,e,d6,c6,he,{field:0,key:1})}}const m6=n=>({dragging:n&4,dragover:n&8}),Hd=n=>({dragging:n[2],dragover:n[3]});function h6(n){let e,t,i,l,s;const o=n[10].default,r=vt(o,n,n[9],Hd);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"dragover",Ye(n[11])),K(e,"dragleave",Ye(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&St(r,o,a,a[9],i?wt(o,a[9],u,m6):Tt(a[9]),Hd),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,we(s)}}}function g6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,C){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:C,group:a})),s("drag",T)}}function g(T,C){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let D={};try{D=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(D.group!=a)return;const O=D.index<<0;O{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=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,l=T.$$scope)},[o,u,c,d,m,g,r,a,f,l,i,h,_,k,S,$]}class Is extends _e{constructor(e){super(),ge(this,e,g6,h6,he,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function zd(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function Vd(n){let e,t,i,l,s,o,r,a;return{c(){e=Y(`, `),t=b("code"),t.textContent="username",i=Y(` , `),l=b("code"),l.textContent="email",s=Y(` , `),o=b("code"),o.textContent="emailVisibility",r=Y(` , - `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"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,l,f),w(u,s,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function g6(n){let e,t,i,l;function s(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=Dt(r,a(n)),te.push(()=>ge(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&B(e.$$.fragment),i=M()},m(u,f){e&&z(e,u,f),w(u,i,f),l=!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=Dt(r,a(n)),te.push(()=>ge(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8]),B(e.$$.fragment),A(e.$$.fragment,1),z(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],ye(()=>t=!1)),e.$set(c)}},i(u){l||(e&&A(e.$$.fragment,u),l=!0)},o(u){e&&I(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&V(e,u)}}}function Vd(n,e){let t,i,l,s;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:[g6]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Ls({props:r}),te.push(()=>ge(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u&1&&(l=!0,f.list=e[0].schema,ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function _6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=[],g=new Map,h,_,k,S,$,T,C,D,O=n[0].type==="auth"&&zd(),E=pe(n[0].schema);const L=F=>F[17];for(let F=0;Fge(T,"collection",R)),{c(){e=b("div"),t=b("p"),i=Y(`System fields: + `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"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,l,f),w(u,s,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function _6(n){let e,t,i,l;function s(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=Dt(r,a(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&B(e.$$.fragment),i=M()},m(u,f){e&&z(e,u,f),w(u,i,f),l=!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=Dt(r,a(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8]),B(e.$$.fragment),A(e.$$.fragment,1),z(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],ye(()=>t=!1)),e.$set(c)}},i(u){l||(e&&A(e.$$.fragment,u),l=!0)},o(u){e&&I(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&V(e,u)}}}function Bd(n,e){let t,i,l,s;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:[_6]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Is({props:r}),te.push(()=>be(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u&1&&(l=!0,f.list=e[0].schema,ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function b6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=[],g=new Map,h,_,k,S,$,T,C,D,O=n[0].type==="auth"&&Vd(),E=pe(n[0].schema);const L=F=>F[17];for(let F=0;Fbe(T,"collection",R)),{c(){e=b("div"),t=b("p"),i=Y(`System fields: `),l=b("code"),l.textContent="id",s=Y(` , `),o=b("code"),o.textContent="created",r=Y(` , `),a=b("code"),a.textContent="updated",u=M(),O&&O.c(),f=Y(` - .`),c=M(),d=b("div");for(let F=0;FC=!1)),T.$set(q)},i(F){if(!D){for(let N=0;ND.name===T))}function f(T){return i.findIndex(C=>C===T)}function c(T,C){var D;!((D=l==null?void 0:l.schema)!=null&&D.length)||T===C||!C||t(0,l.indexes=l.indexes.map(O=>j.replaceIndexColumn(O,T,C)),l)}function d(T,C,D,O){D[O]=T,t(0,l)}const m=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function h(T){n.$$.not_equal(l.schema,T)&&(l.schema=T,t(0,l))}const _=T=>{if(!T.detail)return;const C=T.detail.target;C.style.opacity=0,setTimeout(()=>{var D;(D=C==null?void 0:C.style)==null||D.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage(C,0,0)},k=()=>{Gt({})},S=T=>r(T.detail);function $(T){l=T,t(0,l)}return n.$$set=T=>{"collection"in T&&t(0,l=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(T=>!T.toDelete)||[])},[l,s,o,r,f,c,d,m,g,h,_,k,S,$]}class y6 extends be{constructor(e){super(),_e(this,e,b6,_6,me,{collection:0})}}const k6=n=>({isAdminOnly:n&512}),Bd=n=>({isAdminOnly:n[9]}),v6=n=>({isAdminOnly:n&512}),Ud=n=>({isAdminOnly:n[9]}),w6=n=>({isAdminOnly:n&512}),Wd=n=>({isAdminOnly:n[9]});function S6(n){let e,t;return e=new he({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[$6,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function T6(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Yd(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=K(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Kd(n){let e,t,i,l,s;return{c(){e=b("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,l||(s=K(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function $6(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,u,f,c,d,m,g,h,_,k,S;const $=n[12].beforeLabel,T=vt($,n,n[15],Wd),C=n[12].afterLabel,D=vt(C,n,n[15],Ud);let O=!n[9]&&Yd(n);function E(q){n[14](q)}var L=n[7];function R(q,W){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&&(m=Dt(L,R(n)),n[13](m),te.push(()=>ge(m,"value",E)));let P=n[9]&&Kd(n);const F=n[12].default,N=vt(F,n,n[15],Bd);return{c(){e=b("div"),t=b("label"),T&&T.c(),i=M(),l=b("span"),s=Y(n[2]),o=M(),a=Y(r),u=M(),D&&D.c(),f=M(),O&&O.c(),d=M(),m&&B(m.$$.fragment),h=M(),P&&P.c(),_=M(),k=b("div"),N&&N.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(k,"class","help-block")},m(q,W){w(q,e,W),y(e,t),T&&T.m(t,null),y(t,i),y(t,l),y(l,s),y(l,o),y(l,a),y(t,u),D&&D.m(t,null),y(t,f),O&&O.m(t,null),y(e,d),m&&z(m,e,null),y(e,h),P&&P.m(e,null),w(q,_,W),w(q,k,W),N&&N.m(k,null),S=!0},p(q,W){if(T&&T.p&&(!S||W&33280)&&St(T,$,q,q[15],S?wt($,q[15],W,w6):Tt(q[15]),Wd),(!S||W&4)&&se(s,q[2]),(!S||W&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||W&512)&&x(l,"txt-hint",q[9]),D&&D.p&&(!S||W&33280)&&St(D,C,q,q[15],S?wt(C,q[15],W,v6):Tt(q[15]),Ud),q[9]?O&&(O.d(1),O=null):O?O.p(q,W):(O=Yd(q),O.c(),O.m(t,null)),(!S||W&262144&&c!==(c=q[18]))&&p(t,"for",c),W&128&&L!==(L=q[7])){if(m){re();const G=m;I(G.$$.fragment,1,0,()=>{V(G,1)}),ae()}L?(m=Dt(L,R(q)),q[13](m),te.push(()=>ge(m,"value",E)),B(m.$$.fragment),A(m.$$.fragment,1),z(m,e,h)):m=null}else if(L){const G={};W&262144&&(G.id=q[18]),W&2&&(G.baseCollection=q[1]),W&512&&(G.disabled=q[9]),W&544&&(G.placeholder=q[9]?"":q[5]),!g&&W&1&&(g=!0,G.value=q[0],ye(()=>g=!1)),m.$set(G)}q[9]?P?(P.p(q,W),W&512&&A(P,1)):(P=Kd(q),P.c(),A(P,1),P.m(e,null)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),N&&N.p&&(!S||W&33280)&&St(N,F,q,q[15],S?wt(F,q[15],W,k6):Tt(q[15]),Bd)},i(q){S||(A(T,q),A(D,q),m&&A(m.$$.fragment,q),A(P),A(N,q),S=!0)},o(q){I(T,q),I(D,q),m&&I(m.$$.fragment,q),I(P),I(N,q),S=!1},d(q){q&&(v(e),v(_),v(k)),T&&T.d(q),D&&D.d(q),O&&O.d(),n[13](null),m&&V(m),P&&P.d(),N&&N.d(q)}}}function C6(n){let e,t,i,l;const s=[T6,S6],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Jd;function M6(n,e,t){let i,{$$slots:l={},$$scope:s}=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,m=null,g=Jd,h=!1;_();async function _(){g||h||(t(8,h=!0),t(7,g=(await st(()=>import("./FilterAutocompleteInput-66e3909f.js"),["./FilterAutocompleteInput-66e3909f.js","./index-102ce751.js"],import.meta.url)).default),Jd=g,t(8,h=!1))}async function k(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function $(C){te[C?"unshift":"push"](()=>{d=C,t(6,d)})}function T(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,g,h,i,k,S,l,$,T,s]}class $l extends be{constructor(e){super(),_e(this,e,M6,C6,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Zd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Gd(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L=pe(n[2]),R=[];for(let P=0;P@request
    filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),g=b("hr"),h=M(),_=b("p"),_.innerHTML="You could also add constraints and query other collections using the @collection filter:",k=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=M(),T=b("hr"),C=M(),D=b("p"),D.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"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),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let N=0;N{E&&(O||(O=Le(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(P){P&&(O||(O=Le(e,et,{duration:150},!1)),O.run(0)),E=!1},d(P){P&&v(e),at(R,P),P&&O&&O.end()}}}function Xd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=Y(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&se(i,t)},d(l){l&&v(e)}}}function Qd(n){let e,t,i,l,s,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[O6,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new $l({props:c}),te.push(()=>ge(e,"rule",f));function d(_){n[7](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new $l({props:m}),te.push(()=>ge(l,"rule",d));function g(_){n[8](_)}let h={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(h.rule=n[0].deleteRule),r=new $l({props:h}),te.push(()=>ge(r,"rule",g)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(_,k){z(e,_,k),w(_,i,k),z(l,_,k),w(_,o,k),z(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&17408&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,ye(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),!s&&k&1&&(s=!0,$.rule=_[0].updateRule,ye(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(l.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(l.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){_&&(v(i),v(o)),V(e,_),V(l,_),V(r,_)}}}function xd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=ve(Fe.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(l){l&&v(e),t=!1,i()}}}function O6(n){let e,t=!n[10]&&xd();return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=xd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function ep(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[D6]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new $l({props:s}),te.push(()=>ge(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(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,ye(()=>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 D6(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. + .`),c=M(),d=b("div");for(let F=0;FC=!1)),T.$set(q)},i(F){if(!D){for(let N=0;ND.name===T))}function f(T){return i.findIndex(C=>C===T)}function c(T,C){var D;!((D=l==null?void 0:l.schema)!=null&&D.length)||T===C||!C||t(0,l.indexes=l.indexes.map(O=>j.replaceIndexColumn(O,T,C)),l)}function d(T,C,D,O){D[O]=T,t(0,l)}const m=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function h(T){n.$$.not_equal(l.schema,T)&&(l.schema=T,t(0,l))}const _=T=>{if(!T.detail)return;const C=T.detail.target;C.style.opacity=0,setTimeout(()=>{var D;(D=C==null?void 0:C.style)==null||D.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage(C,0,0)},k=()=>{Gt({})},S=T=>r(T.detail);function $(T){l=T,t(0,l)}return n.$$set=T=>{"collection"in T&&t(0,l=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(T=>!T.toDelete)||[])},[l,s,o,r,f,c,d,m,g,h,_,k,S,$]}class k6 extends _e{constructor(e){super(),ge(this,e,y6,b6,he,{collection:0})}}const v6=n=>({isAdminOnly:n&512}),Ud=n=>({isAdminOnly:n[9]}),w6=n=>({isAdminOnly:n&512}),Wd=n=>({isAdminOnly:n[9]}),S6=n=>({isAdminOnly:n&512}),Yd=n=>({isAdminOnly:n[9]});function T6(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:[C6,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $6(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Kd(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=K(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Jd(n){let e,t,i,l,s;return{c(){e=b("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,l||(s=K(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function C6(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,u,f,c,d,m,g,h,_,k,S;const $=n[12].beforeLabel,T=vt($,n,n[15],Yd),C=n[12].afterLabel,D=vt(C,n,n[15],Wd);let O=!n[9]&&Kd(n);function E(q){n[14](q)}var L=n[7];function R(q,W){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&&(m=Dt(L,R(n)),n[13](m),te.push(()=>be(m,"value",E)));let P=n[9]&&Jd(n);const F=n[12].default,N=vt(F,n,n[15],Ud);return{c(){e=b("div"),t=b("label"),T&&T.c(),i=M(),l=b("span"),s=Y(n[2]),o=M(),a=Y(r),u=M(),D&&D.c(),f=M(),O&&O.c(),d=M(),m&&B(m.$$.fragment),h=M(),P&&P.c(),_=M(),k=b("div"),N&&N.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(k,"class","help-block")},m(q,W){w(q,e,W),y(e,t),T&&T.m(t,null),y(t,i),y(t,l),y(l,s),y(l,o),y(l,a),y(t,u),D&&D.m(t,null),y(t,f),O&&O.m(t,null),y(e,d),m&&z(m,e,null),y(e,h),P&&P.m(e,null),w(q,_,W),w(q,k,W),N&&N.m(k,null),S=!0},p(q,W){if(T&&T.p&&(!S||W&33280)&&St(T,$,q,q[15],S?wt($,q[15],W,S6):Tt(q[15]),Yd),(!S||W&4)&&se(s,q[2]),(!S||W&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||W&512)&&x(l,"txt-hint",q[9]),D&&D.p&&(!S||W&33280)&&St(D,C,q,q[15],S?wt(C,q[15],W,w6):Tt(q[15]),Wd),q[9]?O&&(O.d(1),O=null):O?O.p(q,W):(O=Kd(q),O.c(),O.m(t,null)),(!S||W&262144&&c!==(c=q[18]))&&p(t,"for",c),W&128&&L!==(L=q[7])){if(m){re();const G=m;I(G.$$.fragment,1,0,()=>{V(G,1)}),ae()}L?(m=Dt(L,R(q)),q[13](m),te.push(()=>be(m,"value",E)),B(m.$$.fragment),A(m.$$.fragment,1),z(m,e,h)):m=null}else if(L){const G={};W&262144&&(G.id=q[18]),W&2&&(G.baseCollection=q[1]),W&512&&(G.disabled=q[9]),W&544&&(G.placeholder=q[9]?"":q[5]),!g&&W&1&&(g=!0,G.value=q[0],ye(()=>g=!1)),m.$set(G)}q[9]?P?(P.p(q,W),W&512&&A(P,1)):(P=Jd(q),P.c(),A(P,1),P.m(e,null)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),N&&N.p&&(!S||W&33280)&&St(N,F,q,q[15],S?wt(F,q[15],W,v6):Tt(q[15]),Ud)},i(q){S||(A(T,q),A(D,q),m&&A(m.$$.fragment,q),A(P),A(N,q),S=!0)},o(q){I(T,q),I(D,q),m&&I(m.$$.fragment,q),I(P),I(N,q),S=!1},d(q){q&&(v(e),v(_),v(k)),T&&T.d(q),D&&D.d(q),O&&O.d(),n[13](null),m&&V(m),P&&P.d(),N&&N.d(q)}}}function M6(n){let e,t,i,l;const s=[$6,T6],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Zd;function O6(n,e,t){let i,{$$slots:l={},$$scope:s}=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,m=null,g=Zd,h=!1;_();async function _(){g||h||(t(8,h=!0),t(7,g=(await st(()=>import("./FilterAutocompleteInput-dec586dc.js"),["./FilterAutocompleteInput-dec586dc.js","./index-102ce751.js"],import.meta.url)).default),Zd=g,t(8,h=!1))}async function k(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function $(C){te[C?"unshift":"push"](()=>{d=C,t(6,d)})}function T(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,g,h,i,k,S,l,$,T,s]}class Tl extends _e{constructor(e){super(),ge(this,e,O6,M6,he,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Gd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Xd(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L=pe(n[2]),R=[];for(let P=0;P@request filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),g=b("hr"),h=M(),_=b("p"),_.innerHTML="You could also add constraints and query other collections using the @collection filter:",k=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=M(),T=b("hr"),C=M(),D=b("p"),D.innerHTML=`Example rule: +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"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),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let N=0;N{E&&(O||(O=Le(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(P){P&&(O||(O=Le(e,et,{duration:150},!1)),O.run(0)),E=!1},d(P){P&&v(e),at(R,P),P&&O&&O.end()}}}function Qd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=Y(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&se(i,t)},d(l){l&&v(e)}}}function xd(n){let e,t,i,l,s,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[D6,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Tl({props:c}),te.push(()=>be(e,"rule",f));function d(_){n[7](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new Tl({props:m}),te.push(()=>be(l,"rule",d));function g(_){n[8](_)}let h={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(h.rule=n[0].deleteRule),r=new Tl({props:h}),te.push(()=>be(r,"rule",g)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(_,k){z(e,_,k),w(_,i,k),z(l,_,k),w(_,o,k),z(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&17408&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,ye(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),!s&&k&1&&(s=!0,$.rule=_[0].updateRule,ye(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(l.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(l.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){_&&(v(i),v(o)),V(e,_),V(l,_),V(r,_)}}}function ep(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=ve(Pe.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(l){l&&v(e),t=!1,i()}}}function D6(n){let e,t=!n[10]&&ep();return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=ep(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function tp(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[E6]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new Tl({props:s}),te.push(()=>be(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(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,ye(()=>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 E6(n){let e,t,i;return{c(){e=b("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=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function E6(n){var F,N;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,g,h,_,k,S,$,T,C=n[1]&&Gd(n);function D(q){n[4](q)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new $l({props:O}),te.push(()=>ge(f,"rule",D));function E(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new $l({props:L}),te.push(()=>ge(m,"rule",E));let R=((F=n[0])==null?void 0:F.type)!=="view"&&Qd(n),P=((N=n[0])==null?void 0:N.type)==="auth"&&ep(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the + state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function A6(n){var F,N;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,g,h,_,k,S,$,T,C=n[1]&&Xd(n);function D(q){n[4](q)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Tl({props:O}),te.push(()=>be(f,"rule",D));function E(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Tl({props:L}),te.push(()=>be(m,"rule",E));let R=((F=n[0])==null?void 0:F.type)!=="view"&&xd(n),P=((N=n[0])==null?void 0:N.type)==="auth"&&tp(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators - .`,l=M(),s=b("button"),r=Y(o),a=M(),C&&C.c(),u=M(),B(f.$$.fragment),d=M(),B(m.$$.fragment),h=M(),R&&R.c(),_=M(),P&&P.c(),k=ke(),p(s,"type","button"),p(s,"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,W){w(q,e,W),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),C&&C.m(e,null),w(q,u,W),z(f,q,W),w(q,d,W),z(m,q,W),w(q,h,W),R&&R.m(q,W),w(q,_,W),P&&P.m(q,W),w(q,k,W),S=!0,$||(T=K(s,"click",n[3]),$=!0)},p(q,[W]){var H,U;(!S||W&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?C?(C.p(q,W),W&2&&A(C,1)):(C=Gd(q),C.c(),A(C,1),C.m(e,null)):C&&(re(),I(C,1,1,()=>{C=null}),ae());const G={};W&1&&(G.collection=q[0]),!c&&W&1&&(c=!0,G.rule=q[0].listRule,ye(()=>c=!1)),f.$set(G);const J={};W&1&&(J.collection=q[0]),!g&&W&1&&(g=!0,J.rule=q[0].viewRule,ye(()=>g=!1)),m.$set(J),((H=q[0])==null?void 0:H.type)!=="view"?R?(R.p(q,W),W&1&&A(R,1)):(R=Qd(q),R.c(),A(R,1),R.m(_.parentNode,_)):R&&(re(),I(R,1,1,()=>{R=null}),ae()),((U=q[0])==null?void 0:U.type)==="auth"?P?(P.p(q,W),W&1&&A(P,1)):(P=ep(q),P.c(),A(P,1),P.m(k.parentNode,k)):P&&(re(),I(P,1,1,()=>{P=null}),ae())},i(q){S||(A(C),A(f.$$.fragment,q),A(m.$$.fragment,q),A(R),A(P),S=!0)},o(q){I(C),I(f.$$.fragment,q),I(m.$$.fragment,q),I(R),I(P),S=!1},d(q){q&&(v(e),v(u),v(d),v(h),v(_),v(k)),C&&C.d(),V(f,q),V(m,q),R&&R.d(q),P&&P.d(q),$=!1,T()}}}function A6(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function u(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function f(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,u,f,c,d]}class I6 extends be{constructor(e){super(),_e(this,e,A6,E6,me,{collection:0})}}function tp(n,e,t){const i=n.slice();return i[9]=e[t],i}function L6(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>ge(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!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=Dt(o,r(a)),te.push(()=>ge(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(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,ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function P6(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function np(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. + .`,l=M(),s=b("button"),r=Y(o),a=M(),C&&C.c(),u=M(),B(f.$$.fragment),d=M(),B(m.$$.fragment),h=M(),R&&R.c(),_=M(),P&&P.c(),k=ke(),p(s,"type","button"),p(s,"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,W){w(q,e,W),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),C&&C.m(e,null),w(q,u,W),z(f,q,W),w(q,d,W),z(m,q,W),w(q,h,W),R&&R.m(q,W),w(q,_,W),P&&P.m(q,W),w(q,k,W),S=!0,$||(T=K(s,"click",n[3]),$=!0)},p(q,[W]){var H,U;(!S||W&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?C?(C.p(q,W),W&2&&A(C,1)):(C=Xd(q),C.c(),A(C,1),C.m(e,null)):C&&(re(),I(C,1,1,()=>{C=null}),ae());const G={};W&1&&(G.collection=q[0]),!c&&W&1&&(c=!0,G.rule=q[0].listRule,ye(()=>c=!1)),f.$set(G);const J={};W&1&&(J.collection=q[0]),!g&&W&1&&(g=!0,J.rule=q[0].viewRule,ye(()=>g=!1)),m.$set(J),((H=q[0])==null?void 0:H.type)!=="view"?R?(R.p(q,W),W&1&&A(R,1)):(R=xd(q),R.c(),A(R,1),R.m(_.parentNode,_)):R&&(re(),I(R,1,1,()=>{R=null}),ae()),((U=q[0])==null?void 0:U.type)==="auth"?P?(P.p(q,W),W&1&&A(P,1)):(P=tp(q),P.c(),A(P,1),P.m(k.parentNode,k)):P&&(re(),I(P,1,1,()=>{P=null}),ae())},i(q){S||(A(C),A(f.$$.fragment,q),A(m.$$.fragment,q),A(R),A(P),S=!0)},o(q){I(C),I(f.$$.fragment,q),I(m.$$.fragment,q),I(R),I(P),S=!1},d(q){q&&(v(e),v(u),v(d),v(h),v(_),v(k)),C&&C.d(),V(f,q),V(m,q),R&&R.d(q),P&&P.d(q),$=!1,T()}}}function I6(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function u(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function f(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,u,f,c,d]}class L6 extends _e{constructor(e){super(),ge(this,e,I6,A6,he,{collection:0})}}function np(n,e,t){const i=n.slice();return i[9]=e[t],i}function P6(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!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=Dt(o,r(a)),te.push(()=>be(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(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,ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function F6(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function ip(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s
  • 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=M(),h&&h.c(),f=ke(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){w(_,e,k),y(e,t),w(_,l,k),m[s].m(_,k),w(_,r,k),w(_,a,k),w(_,u,k),h&&h.m(_,k),w(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=g(_),s===S?m[s].p(_,k):(re(),I(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?h?h.p(_,k):(h=np(_),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(_),h&&h.d(_)}}}function N6(n){let e,t;return e=new he({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[F6,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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 i;We(n,gi,c=>t(4,i=c));let{collection:l}=e,s,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 m=j.extractColumnsFromQuery((g=l==null?void 0:l.options)==null?void 0:g.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let h in d)for(let _ in d[h]){const k=d[h][_].message,S=m[h]||h;r.push(j.sentenize(S+": "+k))}}Vt(async()=>{t(2,o=!0);try{t(1,s=(await st(()=>import("./CodeEditor-80667d26.js"),["./CodeEditor-80667d26.js","./index-102ce751.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const f=()=>{r.length&&ii("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class q6 extends be{constructor(e){super(),_e(this,e,R6,N6,me,{collection:0})}}const j6=n=>({active:n&1}),lp=n=>({active:n[0]});function sp(n){let e,t,i;const l=n[15].default,s=vt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&St(s,l,o,o[14],i?wt(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(A(s,o),o&&Ke(()=>{i&&(t||(t=Le(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(s,o),o&&(t||(t=Le(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function H6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=vt(a,n,n[14],lp);let f=n[0]&&sp(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=M(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),y(e,t),u&&u.m(t,null),y(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[K(t,"click",Ye(n[17])),K(t,"drop",Ye(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",Ye(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&St(u,a,c,c[14],s?wt(a,c[14],d,j6):Tt(c[14]),lp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=sp(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(A(u,c),A(f),s=!0)},o(c){I(u,c),I(f),s=!1},d(c){c&&v(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,we(r)}}}function z6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function g(){return!!f}function h(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?_():h()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of R)P.click()}}Vt(()=>()=>clearTimeout(r));function $(R){Ee.call(this,n,R)}const T=()=>c&&k(),C=R=>{u&&(t(7,m=!1),S(),s("drop",R))},D=R=>u&&s("dragstart",R),O=R=>{u&&(t(7,m=!0),s("dragenter",R))},E=R=>{u&&(t(7,m=!1),s("dragleave",R))};function L(R){te[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,u=R.draggable),"active"in R&&t(0,f=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$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,k,S,o,m,s,d,g,h,_,r,l,i,$,T,C,D,O,E,L]}class _o extends be{constructor(e){super(),_e(this,e,z6,H6,me,{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 V6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function B6(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[V6,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&12289&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function U6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function W6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function op(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Y6(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?W6:U6}let a=r(n),u=a(n),f=n[3]&&op();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),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,l,d),u.m(c,d),w(c,s,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(s.parentNode,s))),c[3]?f?d&8&&A(f,1):(f=op(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function K6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function rp(n){let e,t,i,l,s,o,r,a;return i=new he({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[J6,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[Z6,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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&&Ke(()=>{a&&(r||(r=Le(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=Le(e,et,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),V(i),V(o),u&&r&&r.end()}}}function J6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[7](_)}let h={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(h.value=n[0].options.exceptEmailDomains),r=new Nl({props:h}),te.push(()=>ge(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[12]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Fe.call(null,l,{text:`Email domains that are NOT allowed to sign up. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&4096&&s!==(s=_[12]))&&p(e,"for",s);const S={};k&4096&&(S.id=_[12]),k&1&&(S.disabled=!j.isEmpty(_[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function Z6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[8](_)}let h={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(h.value=n[0].options.onlyEmailDomains),r=new Nl({props:h}),te.push(()=>ge(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[12]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Fe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&4096&&s!==(s=_[12]))&&p(e,"for",s);const S={};k&4096&&(S.id=_[12]),k&1&&(S.disabled=!j.isEmpty(_[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function G6(n){let e,t,i,l;e=new he({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[K6,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&rp(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ke()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&A(s,1)):(s=rp(o),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(e.$$.fragment,o),A(s),l=!0)},o(o){I(e.$$.fragment,o),I(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function X6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Q6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ap(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function x6(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?Q6:X6}let a=r(n),u=a(n),f=n[2]&&ap();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),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,l,d),u.m(c,d),w(c,s,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(s.parentNode,s))),c[2]?f?d&4&&A(f,1):(f=ap(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function e5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function up(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function t5(n){let e,t,i,l;e=new he({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[e5,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&up();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ke()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&A(s,1):(s=up(),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(e.$$.fragment,o),A(s),l=!0)},o(o){I(e.$$.fragment,o),I(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function n5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function i5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function fp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function l5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?i5:n5}let a=r(n),u=a(n),f=n[1]&&fp();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),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,l,d),u.m(c,d),w(c,s,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(s.parentNode,s))),c[1]?f?d&2&&A(f,1):(f=fp(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function s5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.minPasswordLength),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.minPasswordLength&&ce(s,u[0].options.minPasswordLength)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function o5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[11]),ve(Fe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function r5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k;return l=new _o({props:{single:!0,$$slots:{header:[Y6],default:[B6]},$$scope:{ctx:n}}}),o=new _o({props:{single:!0,$$slots:{header:[x6],default:[G6]},$$scope:{ctx:n}}}),a=new _o({props:{single:!0,$$slots:{header:[l5],default:[t5]},$$scope:{ctx:n}}}),g=new he({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[s5,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new he({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[o5,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),B(g.$$.fragment),h=M(),B(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,$){w(S,e,$),w(S,t,$),w(S,i,$),z(l,i,null),y(i,s),z(o,i,null),y(i,r),z(a,i,null),w(S,u,$),w(S,f,$),w(S,c,$),w(S,d,$),w(S,m,$),z(g,S,$),w(S,h,$),z(_,S,$),k=!0},p(S,[$]){const T={};$&8201&&(T.$$scope={dirty:$,ctx:S}),l.$set(T);const C={};$&8197&&(C.$$scope={dirty:$,ctx:S}),o.$set(C);const D={};$&8195&&(D.$$scope={dirty:$,ctx:S}),a.$set(D);const O={};$&12289&&(O.$$scope={dirty:$,ctx:S}),g.$set(O);const E={};$&12289&&(E.$$scope={dirty:$,ctx:S}),_.$set(E)},i(S){k||(A(l.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),k=!0)},o(S){I(l.$$.fragment,S),I(o.$$.fragment,S),I(a.$$.fragment,S),I(g.$$.fragment,S),I(_.$$.fragment,S),k=!1},d(S){S&&(v(e),v(t),v(i),v(u),v(f),v(c),v(d),v(m),v(h)),V(l),V(o),V(a),V(g,S),V(_,S)}}}function a5(n,e,t){let i,l,s,o;We(n,gi,h=>t(4,o=h));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(h){n.$$.not_equal(r.options.exceptEmailDomains,h)&&(r.options.exceptEmailDomains=h,t(0,r))}function c(h){n.$$.not_equal(r.options.onlyEmailDomains,h)&&(r.options.onlyEmailDomains=h,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=ut(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=h=>{"collection"in h&&t(0,r=h.collection)},n.$$.update=()=>{var h,_,k,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,l=!j.isEmpty((h=o==null?void 0:o.options)==null?void 0:h.allowEmailAuth)||!j.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,u,f,c,d,m,g]}class u5 extends be{constructor(e){super(),_e(this,e,a5,r5,me,{collection:0})}}function cp(n,e,t){const i=n.slice();return i[18]=e[t],i}function dp(n,e,t){const i=n.slice();return i[18]=e[t],i}function pp(n,e,t){const i=n.slice();return i[18]=e[t],i}function mp(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hp(n){let e,t,i,l,s=n[3]&&gp(n),o=!n[4]&&_p(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),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),s&&s.m(i,null),y(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=gp(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=_p(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function gp(n){var m,g;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((g=n[2])==null?void 0:g.name)+"",d;return{c(){e=b("li"),t=b("div"),i=Y(`Renamed collection - `),l=b("strong"),o=Y(s),r=M(),a=b("i"),u=M(),f=b("strong"),d=Y(c),p(l,"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(h,_){w(h,e,_),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,u),y(t,f),y(f,d)},p(h,_){var k,S;_&2&&s!==(s=((k=h[1])==null?void 0:k.name)+"")&&se(o,s),_&4&&c!==(c=((S=h[2])==null?void 0:S.name)+"")&&se(d,c)},d(h){h&&v(e)}}}function _p(n){let e,t,i,l=pe(n[6]),s=[];for(let f=0;f
    ',i=M(),l=b("div"),s=b("p"),s.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=M(),u&&u.c(),r=M(),f&&f.c(),a=ke(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),u&&u.m(l,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=mp(),u.c(),u.m(l,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=hp(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(v(e),v(r),v(a)),u&&u.d(),f&&f.d(c)}}}function c5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function d5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("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(),l||(s=[K(e,"click",n[12]),K(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function p5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[d5],header:[c5],default:[f5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function m5(n,e,t){let i,l,s,o,r,a;const u=rt();let f,c,d;async function m(C,D){t(1,c=C),t(2,d=D),await Qt(),i||s.length||o.length||r.length?f==null||f.show():h()}function g(){f==null||f.hide()}function h(){g(),u("confirm")}const _=()=>g(),k=()=>h();function S(C){te[C?"unshift":"push"](()=>{f=C,t(5,f)})}function $(C){Ee.call(this,n,C)}function T(C){Ee.call(this,n,C)}return n.$$.update=()=>{var C,D,O;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(E=>E.id&&!E.toDelete&&E.originalName!=E.name))||[]),n.$$.dirty&4&&t(7,o=((D=d==null?void 0:d.schema)==null?void 0:D.filter(E=>E.id&&E.toDelete))||[]),n.$$.dirty&6&&t(6,r=((O=d==null?void 0:d.schema)==null?void 0:O.filter(E=>{var R,P,F;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(N=>N.id==E.id);return L?((P=L.options)==null?void 0:P.maxSelect)!=1&&((F=E.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[g,c,d,i,l,f,r,o,s,a,h,m,_,k,S,$,T]}class h5 extends be{constructor(e){super(),_e(this,e,m5,p5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function vp(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function g5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new y6({props:s}),te.push(()=>ge(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>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 _5(n){let e,t,i;function l(o){n[34](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new q6({props:s}),te.push(()=>ge(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>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 wp(n){let e,t,i,l;function s(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new I6({props:o}),te.push(()=>ge(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){l||(A(t.$$.fragment,r),l=!0)},o(r){I(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function Sp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new u5({props:o}),te.push(()=>ge(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Al)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&x(e,"active",r[3]===Al)},i(r){l||(A(t.$$.fragment,r),l=!0)},o(r){I(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function b5(n){let e,t,i,l,s,o,r;const a=[_5,g5],u=[];function f(m,g){return m[14]?0:1}i=f(n),l=u[i]=a[i](n);let c=n[3]===ks&&wp(n),d=n[15]&&Sp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ei),p(e,"class","tabs-content svelte-12y0yzb")},m(m,g){w(m,e,g),y(e,t),u[i].m(t,null),y(e,s),c&&c.m(e,null),y(e,o),d&&d.m(e,null),r=!0},p(m,g){let h=i;i=f(m),i===h?u[i].p(m,g):(re(),I(u[h],1,1,()=>{u[h]=null}),ae(),l=u[i],l?l.p(m,g):(l=u[i]=a[i](m),l.c()),A(l,1),l.m(t,null)),(!r||g[0]&8)&&x(t,"active",m[3]===Ei),m[3]===ks?c?(c.p(m,g),g[0]&8&&A(c,1)):(c=wp(m),c.c(),A(c,1),c.m(e,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),m[15]?d?(d.p(m,g),g[0]&32768&&A(d,1)):(d=Sp(m),d.c(),A(d,1),d.m(e,null)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(m){r||(A(l),A(c),A(d),r=!0)},o(m){I(l),I(c),I(d),r=!1},d(m){m&&v(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Tp(n){let e,t,i,l,s,o,r;return o=new En({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[y5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("button"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"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),y(i,l),y(i,s),z(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&&(v(e),v(t),v(i)),V(o)}}}function y5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("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),l||(s=[K(e,"click",n[26]),K(i,"click",fn(Ye(n[27])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function $p(n){let e,t,i,l;return i=new En({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[k5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function Cp(n){let e,t,i,l,s,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=Y(" collection"),u=M(),p(t,"class",i=Jn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(s,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[49]==n[2].type)},m(m,g){w(m,e,g),y(e,t),y(e,l),y(e,s),y(s,r),y(s,a),y(e,u),f||(c=K(e,"click",d),f=!0)},p(m,g){n=m,g[0]&64&&i!==(i=Jn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),g[0]&64&&o!==(o=n[50]+"")&&se(r,o),g[0]&68&&x(e,"selected",n[49]==n[2].type)},d(m){m&&v(e),f=!1,c()}}}function k5(n){let e,t=pe(Object.entries(n[6])),i=[];for(let l=0;l{P=null}),ae()):P?(P.p(N,q),q[0]&4&&A(P,1)):(P=$p(N),P.c(),A(P,1),P.m(d,null)),(!E||q[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(N[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",T),(!E||q[0]&4&&C!==(C=!!N[2].id))&&(d.disabled=C),N[2].system?F||(F=Mp(),F.c(),F.m(O.parentNode,O)):F&&(F.d(1),F=null)},i(N){E||(A(P),E=!0)},o(N){I(P),E=!1},d(N){N&&(v(e),v(l),v(s),v(f),v(c),v(D),v(O)),P&&P.d(),F&&F.d(N),L=!1,R()}}}function Op(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=ve(t=Fe.call(null,e,n[11])),s=!0)},p(r,a){t&&$t(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Le(e,Yt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Le(e,Yt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function Dp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Ep(n){var a,u,f;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),s,o,r=l&&Ap();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Al)},m(c,d){w(c,e,d),y(e,t),y(e,i),r&&r.m(e,null),s||(o=K(e,"click",n[33]),s=!0)},p(c,d){var m,g,h;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((h=(g=c[5])==null?void 0:g.options)!=null&&h.manageRule)),l?r?d[0]&32&&A(r,1):(r=Ap(),r.c(),A(r,1),r.m(e,null)):r&&(re(),I(r,1,1,()=>{r=null}),ae()),d[0]&8&&x(e,"active",c[3]===Al)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function Ap(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function w5(n){var W,G,J,H,U,le,ee;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,g=n[14]?"Query":"Fields",h,_,k=!j.isEmpty(n[11]),S,$,T,C,D=!j.isEmpty((W=n[5])==null?void 0:W.listRule)||!j.isEmpty((G=n[5])==null?void 0:G.viewRule)||!j.isEmpty((J=n[5])==null?void 0:J.createRule)||!j.isEmpty((H=n[5])==null?void 0:H.updateRule)||!j.isEmpty((U=n[5])==null?void 0:U.deleteRule)||!j.isEmpty((ee=(le=n[5])==null?void 0:le.options)==null?void 0:ee.manageRule),O,E,L,R,P=!!n[2].id&&!n[2].system&&Tp(n);r=new he({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[v5,({uniqueId:oe})=>({48:oe}),({uniqueId:oe})=>[0,oe?131072:0]]},$$scope:{ctx:n}}});let F=k&&Op(n),N=D&&Dp(),q=n[15]&&Ep(n);return{c(){e=b("h4"),i=Y(t),l=M(),P&&P.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),u=b("input"),f=M(),c=b("div"),d=b("button"),m=b("span"),h=Y(g),_=M(),F&&F.c(),S=M(),$=b("button"),T=b("span"),T.textContent="API Rules",C=M(),N&&N.c(),O=M(),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(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ei),p(T,"class","txt"),p($,"type","button"),p($,"class","tab-item"),x($,"active",n[3]===ks),p(c,"class","tabs-header stretched")},m(oe,Te){w(oe,e,Te),y(e,i),w(oe,l,Te),P&&P.m(oe,Te),w(oe,s,Te),w(oe,o,Te),z(r,o,null),y(o,a),y(o,u),w(oe,f,Te),w(oe,c,Te),y(c,d),y(d,m),y(m,h),y(d,_),F&&F.m(d,null),y(c,S),y(c,$),y($,T),y($,C),N&&N.m($,null),y(c,O),q&&q.m(c,null),E=!0,L||(R=[K(o,"submit",Ye(n[30])),K(d,"click",n[31]),K($,"click",n[32])],L=!0)},p(oe,Te){var Ve,Qe,tt,Ge,Mt,Pt,Ce;(!E||Te[0]&4)&&t!==(t=oe[2].id?"Edit collection":"New collection")&&se(i,t),oe[2].id&&!oe[2].system?P?(P.p(oe,Te),Te[0]&4&&A(P,1)):(P=Tp(oe),P.c(),A(P,1),P.m(s.parentNode,s)):P&&(re(),I(P,1,1,()=>{P=null}),ae());const je={};Te[0]&8192&&(je.class="form-field collection-field-name required m-b-0 "+(oe[13]?"disabled":"")),Te[0]&41028|Te[1]&4325376&&(je.$$scope={dirty:Te,ctx:oe}),r.$set(je),(!E||Te[0]&16384)&&g!==(g=oe[14]?"Query":"Fields")&&se(h,g),Te[0]&2048&&(k=!j.isEmpty(oe[11])),k?F?(F.p(oe,Te),Te[0]&2048&&A(F,1)):(F=Op(oe),F.c(),A(F,1),F.m(d,null)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),(!E||Te[0]&8)&&x(d,"active",oe[3]===Ei),Te[0]&32&&(D=!j.isEmpty((Ve=oe[5])==null?void 0:Ve.listRule)||!j.isEmpty((Qe=oe[5])==null?void 0:Qe.viewRule)||!j.isEmpty((tt=oe[5])==null?void 0:tt.createRule)||!j.isEmpty((Ge=oe[5])==null?void 0:Ge.updateRule)||!j.isEmpty((Mt=oe[5])==null?void 0:Mt.deleteRule)||!j.isEmpty((Ce=(Pt=oe[5])==null?void 0:Pt.options)==null?void 0:Ce.manageRule)),D?N?Te[0]&32&&A(N,1):(N=Dp(),N.c(),A(N,1),N.m($,null)):N&&(re(),I(N,1,1,()=>{N=null}),ae()),(!E||Te[0]&8)&&x($,"active",oe[3]===ks),oe[15]?q?q.p(oe,Te):(q=Ep(oe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(oe){E||(A(P),A(r.$$.fragment,oe),A(F),A(N),E=!0)},o(oe){I(P),I(r.$$.fragment,oe),I(F),I(N),E=!1},d(oe){oe&&(v(e),v(l),v(s),v(o),v(f),v(c)),P&&P.d(oe),V(r),F&&F.d(),N&&N.d(),q&&q.d(),L=!1,we(R)}}}function S5(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=Y(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(s,r),u||(f=[K(e,"click",n[24]),K(l,"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")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function T5(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[S5],header:[w5],default:[b5]},$$scope:{ctx:n}};e=new Xt({props:s}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new h5({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!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){l||(A(e.$$.fragment,r),A(i.$$.fragment,r),l=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[39](null),V(e,r),n[42](null),V(i,r)}}}const Ei="schema",ks="api_rules",Al="options",$5="base",Ip="auth",Lp="view";function Rr(n){return JSON.stringify(n)}function C5(n,e,t){let i,l,s,o,r,a;We(n,gi,ne=>t(5,a=ne));const u={};u[$5]="Base",u[Lp]="View",u[Ip]="Auth";const f=rt();let c,d,m=null,g=j.initCollection(),h=!1,_=!1,k=Ei,S=Rr(g),$="";function T(ne){t(3,k=ne)}function C(ne){return O(ne),t(10,_=!0),T(Ei),c==null?void 0:c.show()}function D(){return c==null?void 0:c.hide()}async function O(ne){Gt({}),typeof ne<"u"?(t(22,m=ne),t(2,g=structuredClone(ne))):(t(22,m=null),t(2,g=j.initCollection())),t(2,g.schema=g.schema||[],g),t(2,g.originalName=g.name||"",g),await Qt(),t(23,S=Rr(g))}function E(){g.id?d==null||d.show(m,g):L()}function L(){if(h)return;t(9,h=!0);const ne=R();let Ne;g.id?Ne=ue.collections.update(g.id,ne):Ne=ue.collections.create(ne),Ne.then(Se=>{Ea(),uv(Se),t(10,_=!1),D(),It(g.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!g.id,collection:Se})}).catch(Se=>{ue.error(Se)}).finally(()=>{t(9,h=!1)})}function R(){const ne=Object.assign({},g);ne.schema=ne.schema.slice(0);for(let Ne=ne.schema.length-1;Ne>=0;Ne--)ne.schema[Ne].toDelete&&ne.schema.splice(Ne,1);return ne}function P(){m!=null&&m.id&&an(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ue.collections.delete(m.id).then(()=>{D(),It(`Successfully deleted collection "${m.name}".`),f("delete",m),fv(m)}).catch(ne=>{ue.error(ne)}))}function F(ne){t(2,g.type=ne,g),ii("schema")}function N(){o?an("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ne=m?structuredClone(m):null;if(ne){if(ne.id="",ne.created="",ne.updated="",ne.name+="_duplicate",!j.isEmpty(ne.schema))for(const Ne of ne.schema)Ne.id="";if(!j.isEmpty(ne.indexes))for(let Ne=0;NeD(),G=()=>E(),J=()=>N(),H=()=>P(),U=ne=>{t(2,g.name=j.slugify(ne.target.value),g),ne.target.value=g.name},le=ne=>F(ne),ee=()=>{r&&E()},oe=()=>T(Ei),Te=()=>T(ks),je=()=>T(Al);function Ve(ne){g=ne,t(2,g),t(22,m)}function Qe(ne){g=ne,t(2,g),t(22,m)}function tt(ne){g=ne,t(2,g),t(22,m)}function Ge(ne){g=ne,t(2,g),t(22,m)}const Mt=()=>o&&_?(an("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),D()}),!1):!0;function Pt(ne){te[ne?"unshift":"push"](()=>{c=ne,t(7,c)})}function Ce(ne){Ee.call(this,n,ne)}function De(ne){Ee.call(this,n,ne)}function ze(ne){te[ne?"unshift":"push"](()=>{d=ne,t(8,d)})}const _t=()=>L();return n.$$.update=()=>{var ne,Ne;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&&(m==null?void 0:m.name)!=g.name&&g.indexes.length>0&&t(2,g.indexes=(ne=g.indexes)==null?void 0:ne.map(Se=>j.replaceIndexTableName(Se,g.name)),g),n.$$.dirty[0]&4&&t(15,i=g.type===Ip),n.$$.dirty[0]&4&&t(14,l=g.type===Lp),n.$$.dirty[0]&32&&(a.schema||(Ne=a.options)!=null&&Ne.query?t(11,$=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,$="")),n.$$.dirty[0]&4&&t(13,s=!!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&&k===Al&&g.type!=="auth"&&T(Ei)},[T,D,g,k,o,a,u,c,d,h,_,$,r,s,l,i,E,L,P,F,N,C,m,S,W,G,J,H,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce,De,ze,_t]}class Qa extends be{constructor(e){super(),_e(this,e,C5,T5,me,{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 M5(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function O5(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,g;function h(S,$){return S[1]?O5:M5}let _=h(n),k=_(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=M(),u=b("span"),k.c(),p(t,"class",i=Jn(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(s,"class","txt m-r-auto"),p(u,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(u,"aria-label","Pin collection"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,$){w(S,e,$),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),y(e,u),k.m(u,null),m||(g=[ve(f=Fe.call(null,u,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),K(u,"click",fn(Ye(n[5]))),ve(ln.call(null,e))],m=!0)},p(S,[$]){var T;$&1&&i!==(i=Jn(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),$&1&&o!==(o=S[0].name+"")&&se(r,o),_!==(_=h(S))&&(k.d(1),k=_(S),k&&(k.c(),k.m(u,null))),f&&$t(f.update)&&$&2&&f.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),$&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),$&1&&d!==(d=S[0].name)&&p(e,"title",d),$&5&&x(e,"active",((T=S[2])==null?void 0:T.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),k.d(),m=!1,we(g)}}}function E5(n,e,t){let i,l;We(n,li,u=>t(2,l=u));let{collection:s}=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(s);return n.$$set=u=>{"collection"in u&&t(0,s=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Xb extends be{constructor(e){super(),_e(this,e,E5,D5,me,{collection:0,pinnedIds:4})}}function Pp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Fp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Np(n){let e,t,i=[],l=new Map,s,o,r=pe(n[6]);const a=u=>u[22].id;for(let u=0;uge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u&64&&(f.collection=e[22]),!l&&u&2&&(l=!0,f.pinnedIds=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function qp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&jp(),r=pe(n[5]);const a=u=>u[22].id;for(let u=0;uge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u&32&&(f.collection=e[22]),!l&&u&2&&(l=!0,f.pinnedIds=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function zp(n){let e;return{c(){e=b("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&&v(e)}}}function Vp(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function A5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S=n[6].length&&Np(n),$=n[5].length&&qp(n),T=n[3].length&&!n[2].length&&zp(),C=!n[9]&&Vp(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),u=M(),f=b("div"),S&&S.c(),c=M(),$&&$.c(),d=M(),T&&T.c(),m=M(),C&&C.c(),g=ke(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),x(f,"fade",n[8]),x(f,"sidebar-content-compact",n[2].length>20)},m(D,O){w(D,e,O),y(e,t),y(t,i),y(i,l),y(t,s),y(t,o),ce(o,n[0]),w(D,r,O),w(D,a,O),w(D,u,O),w(D,f,O),S&&S.m(f,null),y(f,c),$&&$.m(f,null),y(f,d),T&&T.m(f,null),w(D,m,O),C&&C.m(D,O),w(D,g,O),h=!0,_||(k=[K(l,"click",n[12]),K(o,"input",n[13])],_=!0)},p(D,O){(!h||O&128)&&x(l,"hidden",!D[7]),O&1&&o.value!==D[0]&&ce(o,D[0]),(!h||O&128)&&x(t,"active",D[7]),D[6].length?S?(S.p(D,O),O&64&&A(S,1)):(S=Np(D),S.c(),A(S,1),S.m(f,c)):S&&(re(),I(S,1,1,()=>{S=null}),ae()),D[5].length?$?($.p(D,O),O&32&&A($,1)):($=qp(D),$.c(),A($,1),$.m(f,d)):$&&(re(),I($,1,1,()=>{$=null}),ae()),D[3].length&&!D[2].length?T||(T=zp(),T.c(),T.m(f,null)):T&&(T.d(1),T=null),(!h||O&256)&&x(f,"fade",D[8]),(!h||O&4)&&x(f,"sidebar-content-compact",D[2].length>20),D[9]?C&&(C.d(1),C=null):C?C.p(D,O):(C=Vp(D),C.c(),C.m(g.parentNode,g))},i(D){h||(A(S),A($),h=!0)},o(D){I(S),I($),h=!1},d(D){D&&(v(e),v(r),v(a),v(u),v(f),v(m),v(g)),S&&S.d(),$&&$.d(),T&&T.d(),C&&C.d(D),_=!1,we(k)}}}function I5(n){let e,t,i,l;e=new Wb({props:{class:"collection-sidebar",$$slots:{default:[A5]},$$scope:{ctx:n}}});let s={};return i=new Qa({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(A(e.$$.fragment,o),A(i.$$.fragment,o),l=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Bp="@pinnedCollections";function L5(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function P5(n,e,t){let i,l,s,o,r,a,u,f,c;We(n,zn,L=>t(11,a=L)),We(n,li,L=>t(19,u=L)),We(n,Co,L=>t(8,f=L)),We(n,Ml,L=>t(9,c=L));let d,m="",g=[];_();function h(L){tn(li,u=L,u)}function _(){t(1,g=[]);try{const L=localStorage.getItem(Bp);L&&t(1,g=JSON.parse(L)||[])}catch{}}function k(){t(1,g=g.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function $(){m=this.value,t(0,m)}function T(L){g=L,t(1,g)}function C(L){g=L,t(1,g)}const D=()=>d==null?void 0:d.show();function O(L){te[L?"unshift":"push"](()=>{d=L,t(4,d)})}const E=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&h(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(k(),L5()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&g&&localStorage.setItem(Bp,JSON.stringify(g)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>g.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!g.includes(L.id)))},[m,g,s,i,d,r,o,l,f,c,h,a,S,$,T,C,D,O,E]}class F5 extends be{constructor(e){super(),_e(this,e,P5,I5,me,{})}}function Up(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Wp(n){n[18]=n[19].default}function Yp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Kp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Jp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,u,f,c=i&&Kp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ke(),c&&c.c(),l=M(),s=b("button"),r=Y(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,g){w(m,t,g),c&&c.m(m,g),w(m,l,g),w(m,s,g),y(s,r),y(s,a),u||(f=K(s,"click",d),u=!0)},p(m,g){e=m,g&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Kp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),g&8&&o!==(o=e[15].label+"")&&se(r,o),g&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),u=!1,f()}}}function Zp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:q5,then:R5,catch:N5,value:19,blocks:[,,,]};return su(t=n[15].component,l),{c(){e=ke(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&su(t,l)||I0(l,n,o)},i(s){i||(A(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];I(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function N5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function R5(n){Wp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Wp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(A(e.$$.fragment,l),i=!0)},o(l){I(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function q5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Gp(n,e){let t,i,l,s=e[5]===e[14]&&Zp(e);return{key:n,first:null,c(){t=ke(),s&&s.c(),i=ke(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&A(s,1)):(s=Zp(e),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(s),l=!0)},o(o){I(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function j5(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=h=>h[14];for(let h=0;hh[14];for(let h=0;hClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function z5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[H5],default:[j5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function V5(n,e,t){const i={list:{label:"List/Search",component:st(()=>import("./ListApiDocs-481c529b.js"),["./ListApiDocs-481c529b.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:st(()=>import("./ViewApiDocs-a97d2bf3.js"),["./ViewApiDocs-a97d2bf3.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js"],import.meta.url)},create:{label:"Create",component:st(()=>import("./CreateApiDocs-8e2e6ca4.js"),["./CreateApiDocs-8e2e6ca4.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js"],import.meta.url)},update:{label:"Update",component:st(()=>import("./UpdateApiDocs-59dd218c.js"),["./UpdateApiDocs-59dd218c.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js"],import.meta.url)},delete:{label:"Delete",component:st(()=>import("./DeleteApiDocs-98707e26.js"),["./DeleteApiDocs-98707e26.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:st(()=>import("./RealtimeApiDocs-9e5f186a.js"),["./RealtimeApiDocs-9e5f186a.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:st(()=>import("./AuthWithPasswordDocs-28f9fe69.js"),["./AuthWithPasswordDocs-28f9fe69.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:st(()=>import("./AuthWithOAuth2Docs-d0abb670.js"),["./AuthWithOAuth2Docs-d0abb670.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js"],import.meta.url)},refresh:{label:"Auth refresh",component:st(()=>import("./AuthRefreshDocs-208327ef.js"),["./AuthRefreshDocs-208327ef.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js"],import.meta.url)},"request-verification":{label:"Request verification",component:st(()=>import("./RequestVerificationDocs-6658a4af.js"),["./RequestVerificationDocs-6658a4af.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:st(()=>import("./ConfirmVerificationDocs-4a55a580.js"),["./ConfirmVerificationDocs-4a55a580.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:st(()=>import("./RequestPasswordResetDocs-a22604e7.js"),["./RequestPasswordResetDocs-a22604e7.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:st(()=>import("./ConfirmPasswordResetDocs-592fbd7c.js"),["./ConfirmPasswordResetDocs-592fbd7c.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:st(()=>import("./RequestEmailChangeDocs-cd0de76f.js"),["./RequestEmailChangeDocs-cd0de76f.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:st(()=>import("./ConfirmEmailChangeDocs-207789fe.js"),["./ConfirmEmailChangeDocs-207789fe.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:st(()=>import("./AuthMethodsDocs-25f3f0dc.js"),["./AuthMethodsDocs-25f3f0dc.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:st(()=>import("./ListExternalAuthsDocs-f2601f25.js"),["./ListExternalAuthsDocs-f2601f25.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-bc547030.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:st(()=>import("./UnlinkExternalAuthDocs-7056f391.js"),["./UnlinkExternalAuthDocs-7056f391.js","./SdkTabs-16daad5a.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function g(k){te[k?"unshift":"push"](()=>{s=k,t(4,s)})}function h(k){Ee.call(this,n,k)}function _(k){Ee.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!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,s,r,i,u,d,m,g,h,_]}class B5 extends be{constructor(e){super(),_e(this,e,V5,z5,me,{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 U5(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=ve(t=Fe.call(null,e,{text:n[0].join(` + MAX(balance) as maxBalance).`,u=M(),h&&h.c(),f=ke(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){w(_,e,k),y(e,t),w(_,l,k),m[s].m(_,k),w(_,r,k),w(_,a,k),w(_,u,k),h&&h.m(_,k),w(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=g(_),s===S?m[s].p(_,k):(re(),I(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?h?h.p(_,k):(h=ip(_),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(_),h&&h.d(_)}}}function R6(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[N6,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function q6(n,e,t){let i;We(n,gi,c=>t(4,i=c));let{collection:l}=e,s,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 m=j.extractColumnsFromQuery((g=l==null?void 0:l.options)==null?void 0:g.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let h in d)for(let _ in d[h]){const k=d[h][_].message,S=m[h]||h;r.push(j.sentenize(S+": "+k))}}Vt(async()=>{t(2,o=!0);try{t(1,s=(await st(()=>import("./CodeEditor-6ddcf228.js"),["./CodeEditor-6ddcf228.js","./index-102ce751.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const f=()=>{r.length&&ii("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class j6 extends _e{constructor(e){super(),ge(this,e,q6,R6,he,{collection:0})}}const H6=n=>({active:n&1}),sp=n=>({active:n[0]});function op(n){let e,t,i;const l=n[15].default,s=vt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&St(s,l,o,o[14],i?wt(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(A(s,o),o&&Ke(()=>{i&&(t||(t=Le(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(s,o),o&&(t||(t=Le(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function z6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=vt(a,n,n[14],sp);let f=n[0]&&op(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=M(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),y(e,t),u&&u.m(t,null),y(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[K(t,"click",Ye(n[17])),K(t,"drop",Ye(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",Ye(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&St(u,a,c,c[14],s?wt(a,c[14],d,H6):Tt(c[14]),sp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=op(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(A(u,c),A(f),s=!0)},o(c){I(u,c),I(f),s=!1},d(c){c&&v(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,we(r)}}}function V6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function g(){return!!f}function h(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?_():h()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of R)P.click()}}Vt(()=>()=>clearTimeout(r));function $(R){Ee.call(this,n,R)}const T=()=>c&&k(),C=R=>{u&&(t(7,m=!1),S(),s("drop",R))},D=R=>u&&s("dragstart",R),O=R=>{u&&(t(7,m=!0),s("dragenter",R))},E=R=>{u&&(t(7,m=!1),s("dragleave",R))};function L(R){te[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,u=R.draggable),"active"in R&&t(0,f=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$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,k,S,o,m,s,d,g,h,_,r,l,i,$,T,C,D,O,E,L]}class go extends _e{constructor(e){super(),ge(this,e,V6,z6,he,{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 B6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function U6(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[B6,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&12289&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Y6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function rp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function K6(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?Y6:W6}let a=r(n),u=a(n),f=n[3]&&rp();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),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,l,d),u.m(c,d),w(c,s,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(s.parentNode,s))),c[3]?f?d&8&&A(f,1):(f=rp(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function J6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function ap(n){let e,t,i,l,s,o,r,a;return i=new me({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[Z6,({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:[G6,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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&&Ke(()=>{a&&(r||(r=Le(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=Le(e,et,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),V(i),V(o),u&&r&&r.end()}}}function Z6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[7](_)}let h={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(h.value=n[0].options.exceptEmailDomains),r=new Fl({props:h}),te.push(()=>be(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[12]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&4096&&s!==(s=_[12]))&&p(e,"for",s);const S={};k&4096&&(S.id=_[12]),k&1&&(S.disabled=!j.isEmpty(_[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function G6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[8](_)}let h={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(h.value=n[0].options.onlyEmailDomains),r=new Fl({props:h}),te.push(()=>be(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[12]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&4096&&s!==(s=_[12]))&&p(e,"for",s);const S={};k&4096&&(S.id=_[12]),k&1&&(S.disabled=!j.isEmpty(_[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function X6(n){let e,t,i,l;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[J6,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&ap(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ke()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&A(s,1)):(s=ap(o),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(e.$$.fragment,o),A(s),l=!0)},o(o){I(e.$$.fragment,o),I(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function Q6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function x6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function up(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function e5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?x6:Q6}let a=r(n),u=a(n),f=n[2]&&up();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),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,l,d),u.m(c,d),w(c,s,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(s.parentNode,s))),c[2]?f?d&4&&A(f,1):(f=up(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function t5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function fp(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function n5(n){let e,t,i,l;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[t5,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&fp();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ke()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&A(s,1):(s=fp(),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(e.$$.fragment,o),A(s),l=!0)},o(o){I(e.$$.fragment,o),I(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function i5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function l5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function s5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?l5:i5}let a=r(n),u=a(n),f=n[1]&&cp();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),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,l,d),u.m(c,d),w(c,s,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(s.parentNode,s))),c[1]?f?d&2&&A(f,1):(f=cp(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function o5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].options.minPasswordLength),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.minPasswordLength&&ue(s,u[0].options.minPasswordLength)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function r5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[11]),ve(Pe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function a5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k;return l=new go({props:{single:!0,$$slots:{header:[K6],default:[U6]},$$scope:{ctx:n}}}),o=new go({props:{single:!0,$$slots:{header:[e5],default:[X6]},$$scope:{ctx:n}}}),a=new go({props:{single:!0,$$slots:{header:[s5],default:[n5]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[o5,({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:[r5,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),B(g.$$.fragment),h=M(),B(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,$){w(S,e,$),w(S,t,$),w(S,i,$),z(l,i,null),y(i,s),z(o,i,null),y(i,r),z(a,i,null),w(S,u,$),w(S,f,$),w(S,c,$),w(S,d,$),w(S,m,$),z(g,S,$),w(S,h,$),z(_,S,$),k=!0},p(S,[$]){const T={};$&8201&&(T.$$scope={dirty:$,ctx:S}),l.$set(T);const C={};$&8197&&(C.$$scope={dirty:$,ctx:S}),o.$set(C);const D={};$&8195&&(D.$$scope={dirty:$,ctx:S}),a.$set(D);const O={};$&12289&&(O.$$scope={dirty:$,ctx:S}),g.$set(O);const E={};$&12289&&(E.$$scope={dirty:$,ctx:S}),_.$set(E)},i(S){k||(A(l.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),k=!0)},o(S){I(l.$$.fragment,S),I(o.$$.fragment,S),I(a.$$.fragment,S),I(g.$$.fragment,S),I(_.$$.fragment,S),k=!1},d(S){S&&(v(e),v(t),v(i),v(u),v(f),v(c),v(d),v(m),v(h)),V(l),V(o),V(a),V(g,S),V(_,S)}}}function u5(n,e,t){let i,l,s,o;We(n,gi,h=>t(4,o=h));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(h){n.$$.not_equal(r.options.exceptEmailDomains,h)&&(r.options.exceptEmailDomains=h,t(0,r))}function c(h){n.$$.not_equal(r.options.onlyEmailDomains,h)&&(r.options.onlyEmailDomains=h,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=ut(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=h=>{"collection"in h&&t(0,r=h.collection)},n.$$.update=()=>{var h,_,k,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,l=!j.isEmpty((h=o==null?void 0:o.options)==null?void 0:h.allowEmailAuth)||!j.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,u,f,c,d,m,g]}class f5 extends _e{constructor(e){super(),ge(this,e,u5,a5,he,{collection:0})}}function dp(n,e,t){const i=n.slice();return i[18]=e[t],i}function pp(n,e,t){const i=n.slice();return i[18]=e[t],i}function mp(n,e,t){const i=n.slice();return i[18]=e[t],i}function hp(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function gp(n){let e,t,i,l,s=n[3]&&_p(n),o=!n[4]&&bp(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),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),s&&s.m(i,null),y(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=_p(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=bp(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function _p(n){var m,g;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((g=n[2])==null?void 0:g.name)+"",d;return{c(){e=b("li"),t=b("div"),i=Y(`Renamed collection + `),l=b("strong"),o=Y(s),r=M(),a=b("i"),u=M(),f=b("strong"),d=Y(c),p(l,"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(h,_){w(h,e,_),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,u),y(t,f),y(f,d)},p(h,_){var k,S;_&2&&s!==(s=((k=h[1])==null?void 0:k.name)+"")&&se(o,s),_&4&&c!==(c=((S=h[2])==null?void 0:S.name)+"")&&se(d,c)},d(h){h&&v(e)}}}function bp(n){let e,t,i,l=pe(n[6]),s=[];for(let f=0;f
    ',i=M(),l=b("div"),s=b("p"),s.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=M(),u&&u.c(),r=M(),f&&f.c(),a=ke(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),u&&u.m(l,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=hp(),u.c(),u.m(l,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=gp(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(v(e),v(r),v(a)),u&&u.d(),f&&f.d(c)}}}function d5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function p5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("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(),l||(s=[K(e,"click",n[12]),K(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function m5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[p5],header:[d5],default:[c5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function h5(n,e,t){let i,l,s,o,r,a;const u=rt();let f,c,d;async function m(C,D){t(1,c=C),t(2,d=D),await Qt(),i||s.length||o.length||r.length?f==null||f.show():h()}function g(){f==null||f.hide()}function h(){g(),u("confirm")}const _=()=>g(),k=()=>h();function S(C){te[C?"unshift":"push"](()=>{f=C,t(5,f)})}function $(C){Ee.call(this,n,C)}function T(C){Ee.call(this,n,C)}return n.$$.update=()=>{var C,D,O;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(E=>E.id&&!E.toDelete&&E.originalName!=E.name))||[]),n.$$.dirty&4&&t(7,o=((D=d==null?void 0:d.schema)==null?void 0:D.filter(E=>E.id&&E.toDelete))||[]),n.$$.dirty&6&&t(6,r=((O=d==null?void 0:d.schema)==null?void 0:O.filter(E=>{var R,P,F;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(N=>N.id==E.id);return L?((P=L.options)==null?void 0:P.maxSelect)!=1&&((F=E.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[g,c,d,i,l,f,r,o,s,a,h,m,_,k,S,$,T]}class g5 extends _e{constructor(e){super(),ge(this,e,h5,m5,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function wp(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function _5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new k6({props:s}),te.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>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 b5(n){let e,t,i;function l(o){n[34](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new j6({props:s}),te.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>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 Sp(n){let e,t,i,l;function s(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new L6({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){l||(A(t.$$.fragment,r),l=!0)},o(r){I(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function Tp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new f5({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===El)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&x(e,"active",r[3]===El)},i(r){l||(A(t.$$.fragment,r),l=!0)},o(r){I(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function y5(n){let e,t,i,l,s,o,r;const a=[b5,_5],u=[];function f(m,g){return m[14]?0:1}i=f(n),l=u[i]=a[i](n);let c=n[3]===ys&&Sp(n),d=n[15]&&Tp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ei),p(e,"class","tabs-content svelte-12y0yzb")},m(m,g){w(m,e,g),y(e,t),u[i].m(t,null),y(e,s),c&&c.m(e,null),y(e,o),d&&d.m(e,null),r=!0},p(m,g){let h=i;i=f(m),i===h?u[i].p(m,g):(re(),I(u[h],1,1,()=>{u[h]=null}),ae(),l=u[i],l?l.p(m,g):(l=u[i]=a[i](m),l.c()),A(l,1),l.m(t,null)),(!r||g[0]&8)&&x(t,"active",m[3]===Ei),m[3]===ys?c?(c.p(m,g),g[0]&8&&A(c,1)):(c=Sp(m),c.c(),A(c,1),c.m(e,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),m[15]?d?(d.p(m,g),g[0]&32768&&A(d,1)):(d=Tp(m),d.c(),A(d,1),d.m(e,null)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(m){r||(A(l),A(c),A(d),r=!0)},o(m){I(l),I(c),I(d),r=!1},d(m){m&&v(e),u[i].d(),c&&c.d(),d&&d.d()}}}function $p(n){let e,t,i,l,s,o,r;return o=new En({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[k5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("button"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"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),y(i,l),y(i,s),z(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&&(v(e),v(t),v(i)),V(o)}}}function k5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("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),l||(s=[K(e,"click",n[26]),K(i,"click",fn(Ye(n[27])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function Cp(n){let e,t,i,l;return i=new En({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[v5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function Mp(n){let e,t,i,l,s,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=Y(" collection"),u=M(),p(t,"class",i=Jn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(s,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[49]==n[2].type)},m(m,g){w(m,e,g),y(e,t),y(e,l),y(e,s),y(s,r),y(s,a),y(e,u),f||(c=K(e,"click",d),f=!0)},p(m,g){n=m,g[0]&64&&i!==(i=Jn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),g[0]&64&&o!==(o=n[50]+"")&&se(r,o),g[0]&68&&x(e,"selected",n[49]==n[2].type)},d(m){m&&v(e),f=!1,c()}}}function v5(n){let e,t=pe(Object.entries(n[6])),i=[];for(let l=0;l{P=null}),ae()):P?(P.p(N,q),q[0]&4&&A(P,1)):(P=Cp(N),P.c(),A(P,1),P.m(d,null)),(!E||q[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(N[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",T),(!E||q[0]&4&&C!==(C=!!N[2].id))&&(d.disabled=C),N[2].system?F||(F=Op(),F.c(),F.m(O.parentNode,O)):F&&(F.d(1),F=null)},i(N){E||(A(P),E=!0)},o(N){I(P),E=!1},d(N){N&&(v(e),v(l),v(s),v(f),v(c),v(D),v(O)),P&&P.d(),F&&F.d(N),L=!1,R()}}}function Dp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=ve(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&$t(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Le(e,Yt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Le(e,Yt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function Ep(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Ap(n){var a,u,f;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),s,o,r=l&&Ip();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===El)},m(c,d){w(c,e,d),y(e,t),y(e,i),r&&r.m(e,null),s||(o=K(e,"click",n[33]),s=!0)},p(c,d){var m,g,h;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((h=(g=c[5])==null?void 0:g.options)!=null&&h.manageRule)),l?r?d[0]&32&&A(r,1):(r=Ip(),r.c(),A(r,1),r.m(e,null)):r&&(re(),I(r,1,1,()=>{r=null}),ae()),d[0]&8&&x(e,"active",c[3]===El)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function Ip(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function S5(n){var W,G,J,H,U,le,ee;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,g=n[14]?"Query":"Fields",h,_,k=!j.isEmpty(n[11]),S,$,T,C,D=!j.isEmpty((W=n[5])==null?void 0:W.listRule)||!j.isEmpty((G=n[5])==null?void 0:G.viewRule)||!j.isEmpty((J=n[5])==null?void 0:J.createRule)||!j.isEmpty((H=n[5])==null?void 0:H.updateRule)||!j.isEmpty((U=n[5])==null?void 0:U.deleteRule)||!j.isEmpty((ee=(le=n[5])==null?void 0:le.options)==null?void 0:ee.manageRule),O,E,L,R,P=!!n[2].id&&!n[2].system&&$p(n);r=new me({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[w5,({uniqueId:oe})=>({48:oe}),({uniqueId:oe})=>[0,oe?131072:0]]},$$scope:{ctx:n}}});let F=k&&Dp(n),N=D&&Ep(),q=n[15]&&Ap(n);return{c(){e=b("h4"),i=Y(t),l=M(),P&&P.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),u=b("input"),f=M(),c=b("div"),d=b("button"),m=b("span"),h=Y(g),_=M(),F&&F.c(),S=M(),$=b("button"),T=b("span"),T.textContent="API Rules",C=M(),N&&N.c(),O=M(),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(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ei),p(T,"class","txt"),p($,"type","button"),p($,"class","tab-item"),x($,"active",n[3]===ys),p(c,"class","tabs-header stretched")},m(oe,Te){w(oe,e,Te),y(e,i),w(oe,l,Te),P&&P.m(oe,Te),w(oe,s,Te),w(oe,o,Te),z(r,o,null),y(o,a),y(o,u),w(oe,f,Te),w(oe,c,Te),y(c,d),y(d,m),y(m,h),y(d,_),F&&F.m(d,null),y(c,S),y(c,$),y($,T),y($,C),N&&N.m($,null),y(c,O),q&&q.m(c,null),E=!0,L||(R=[K(o,"submit",Ye(n[30])),K(d,"click",n[31]),K($,"click",n[32])],L=!0)},p(oe,Te){var Ve,Qe,tt,Ge,Mt,Pt,Ce;(!E||Te[0]&4)&&t!==(t=oe[2].id?"Edit collection":"New collection")&&se(i,t),oe[2].id&&!oe[2].system?P?(P.p(oe,Te),Te[0]&4&&A(P,1)):(P=$p(oe),P.c(),A(P,1),P.m(s.parentNode,s)):P&&(re(),I(P,1,1,()=>{P=null}),ae());const je={};Te[0]&8192&&(je.class="form-field collection-field-name required m-b-0 "+(oe[13]?"disabled":"")),Te[0]&41028|Te[1]&4325376&&(je.$$scope={dirty:Te,ctx:oe}),r.$set(je),(!E||Te[0]&16384)&&g!==(g=oe[14]?"Query":"Fields")&&se(h,g),Te[0]&2048&&(k=!j.isEmpty(oe[11])),k?F?(F.p(oe,Te),Te[0]&2048&&A(F,1)):(F=Dp(oe),F.c(),A(F,1),F.m(d,null)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),(!E||Te[0]&8)&&x(d,"active",oe[3]===Ei),Te[0]&32&&(D=!j.isEmpty((Ve=oe[5])==null?void 0:Ve.listRule)||!j.isEmpty((Qe=oe[5])==null?void 0:Qe.viewRule)||!j.isEmpty((tt=oe[5])==null?void 0:tt.createRule)||!j.isEmpty((Ge=oe[5])==null?void 0:Ge.updateRule)||!j.isEmpty((Mt=oe[5])==null?void 0:Mt.deleteRule)||!j.isEmpty((Ce=(Pt=oe[5])==null?void 0:Pt.options)==null?void 0:Ce.manageRule)),D?N?Te[0]&32&&A(N,1):(N=Ep(),N.c(),A(N,1),N.m($,null)):N&&(re(),I(N,1,1,()=>{N=null}),ae()),(!E||Te[0]&8)&&x($,"active",oe[3]===ys),oe[15]?q?q.p(oe,Te):(q=Ap(oe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(oe){E||(A(P),A(r.$$.fragment,oe),A(F),A(N),E=!0)},o(oe){I(P),I(r.$$.fragment,oe),I(F),I(N),E=!1},d(oe){oe&&(v(e),v(l),v(s),v(o),v(f),v(c)),P&&P.d(oe),V(r),F&&F.d(),N&&N.d(),q&&q.d(),L=!1,we(R)}}}function T5(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=Y(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(s,r),u||(f=[K(e,"click",n[24]),K(l,"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")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function $5(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[T5],header:[S5],default:[y5]},$$scope:{ctx:n}};e=new Xt({props:s}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new g5({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!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){l||(A(e.$$.fragment,r),A(i.$$.fragment,r),l=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[39](null),V(e,r),n[42](null),V(i,r)}}}const Ei="schema",ys="api_rules",El="options",C5="base",Lp="auth",Pp="view";function Nr(n){return JSON.stringify(n)}function M5(n,e,t){let i,l,s,o,r,a;We(n,gi,ne=>t(5,a=ne));const u={};u[C5]="Base",u[Pp]="View",u[Lp]="Auth";const f=rt();let c,d,m=null,g=j.initCollection(),h=!1,_=!1,k=Ei,S=Nr(g),$="";function T(ne){t(3,k=ne)}function C(ne){return O(ne),t(10,_=!0),T(Ei),c==null?void 0:c.show()}function D(){return c==null?void 0:c.hide()}async function O(ne){Gt({}),typeof ne<"u"?(t(22,m=ne),t(2,g=structuredClone(ne))):(t(22,m=null),t(2,g=j.initCollection())),t(2,g.schema=g.schema||[],g),t(2,g.originalName=g.name||"",g),await Qt(),t(23,S=Nr(g))}function E(){g.id?d==null||d.show(m,g):L()}function L(){if(h)return;t(9,h=!0);const ne=R();let Ne;g.id?Ne=fe.collections.update(g.id,ne):Ne=fe.collections.create(ne),Ne.then(Se=>{Aa(),fv(Se),t(10,_=!1),D(),It(g.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!g.id,collection:Se})}).catch(Se=>{fe.error(Se)}).finally(()=>{t(9,h=!1)})}function R(){const ne=Object.assign({},g);ne.schema=ne.schema.slice(0);for(let Ne=ne.schema.length-1;Ne>=0;Ne--)ne.schema[Ne].toDelete&&ne.schema.splice(Ne,1);return ne}function P(){m!=null&&m.id&&an(`Do you really want to delete collection "${m.name}" and all its records?`,()=>fe.collections.delete(m.id).then(()=>{D(),It(`Successfully deleted collection "${m.name}".`),f("delete",m),cv(m)}).catch(ne=>{fe.error(ne)}))}function F(ne){t(2,g.type=ne,g),ii("schema")}function N(){o?an("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ne=m?structuredClone(m):null;if(ne){if(ne.id="",ne.created="",ne.updated="",ne.name+="_duplicate",!j.isEmpty(ne.schema))for(const Ne of ne.schema)Ne.id="";if(!j.isEmpty(ne.indexes))for(let Ne=0;NeD(),G=()=>E(),J=()=>N(),H=()=>P(),U=ne=>{t(2,g.name=j.slugify(ne.target.value),g),ne.target.value=g.name},le=ne=>F(ne),ee=()=>{r&&E()},oe=()=>T(Ei),Te=()=>T(ys),je=()=>T(El);function Ve(ne){g=ne,t(2,g),t(22,m)}function Qe(ne){g=ne,t(2,g),t(22,m)}function tt(ne){g=ne,t(2,g),t(22,m)}function Ge(ne){g=ne,t(2,g),t(22,m)}const Mt=()=>o&&_?(an("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),D()}),!1):!0;function Pt(ne){te[ne?"unshift":"push"](()=>{c=ne,t(7,c)})}function Ce(ne){Ee.call(this,n,ne)}function De(ne){Ee.call(this,n,ne)}function ze(ne){te[ne?"unshift":"push"](()=>{d=ne,t(8,d)})}const _t=()=>L();return n.$$.update=()=>{var ne,Ne;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&&(m==null?void 0:m.name)!=g.name&&g.indexes.length>0&&t(2,g.indexes=(ne=g.indexes)==null?void 0:ne.map(Se=>j.replaceIndexTableName(Se,g.name)),g),n.$$.dirty[0]&4&&t(15,i=g.type===Lp),n.$$.dirty[0]&4&&t(14,l=g.type===Pp),n.$$.dirty[0]&32&&(a.schema||(Ne=a.options)!=null&&Ne.query?t(11,$=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,$="")),n.$$.dirty[0]&4&&t(13,s=!!g.id&&g.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Nr(g)),n.$$.dirty[0]&20&&t(12,r=!g.id||o),n.$$.dirty[0]&12&&k===El&&g.type!=="auth"&&T(Ei)},[T,D,g,k,o,a,u,c,d,h,_,$,r,s,l,i,E,L,P,F,N,C,m,S,W,G,J,H,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce,De,ze,_t]}class xa extends _e{constructor(e){super(),ge(this,e,M5,$5,he,{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 O5(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function E5(n){let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,g;function h(S,$){return S[1]?D5:O5}let _=h(n),k=_(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=M(),u=b("span"),k.c(),p(t,"class",i=Jn(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(s,"class","txt m-r-auto"),p(u,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(u,"aria-label","Pin collection"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,$){w(S,e,$),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),y(e,u),k.m(u,null),m||(g=[ve(f=Pe.call(null,u,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),K(u,"click",fn(Ye(n[5]))),ve(ln.call(null,e))],m=!0)},p(S,[$]){var T;$&1&&i!==(i=Jn(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),$&1&&o!==(o=S[0].name+"")&&se(r,o),_!==(_=h(S))&&(k.d(1),k=_(S),k&&(k.c(),k.m(u,null))),f&&$t(f.update)&&$&2&&f.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),$&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),$&1&&d!==(d=S[0].name)&&p(e,"title",d),$&5&&x(e,"active",((T=S[2])==null?void 0:T.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),k.d(),m=!1,we(g)}}}function A5(n,e,t){let i,l;We(n,li,u=>t(2,l=u));let{collection:s}=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(s);return n.$$set=u=>{"collection"in u&&t(0,s=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Qb extends _e{constructor(e){super(),ge(this,e,A5,E5,he,{collection:0,pinnedIds:4})}}function Fp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Np(n,e,t){const i=n.slice();return i[22]=e[t],i}function Rp(n){let e,t,i=[],l=new Map,s,o,r=pe(n[6]);const a=u=>u[22].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u&64&&(f.collection=e[22]),!l&&u&2&&(l=!0,f.pinnedIds=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function jp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Hp(),r=pe(n[5]);const a=u=>u[22].id;for(let u=0;ube(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u&32&&(f.collection=e[22]),!l&&u&2&&(l=!0,f.pinnedIds=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Vp(n){let e;return{c(){e=b("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&&v(e)}}}function Bp(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function I5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S=n[6].length&&Rp(n),$=n[5].length&&jp(n),T=n[3].length&&!n[2].length&&Vp(),C=!n[9]&&Bp(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),u=M(),f=b("div"),S&&S.c(),c=M(),$&&$.c(),d=M(),T&&T.c(),m=M(),C&&C.c(),g=ke(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),x(f,"fade",n[8]),x(f,"sidebar-content-compact",n[2].length>20)},m(D,O){w(D,e,O),y(e,t),y(t,i),y(i,l),y(t,s),y(t,o),ue(o,n[0]),w(D,r,O),w(D,a,O),w(D,u,O),w(D,f,O),S&&S.m(f,null),y(f,c),$&&$.m(f,null),y(f,d),T&&T.m(f,null),w(D,m,O),C&&C.m(D,O),w(D,g,O),h=!0,_||(k=[K(l,"click",n[12]),K(o,"input",n[13])],_=!0)},p(D,O){(!h||O&128)&&x(l,"hidden",!D[7]),O&1&&o.value!==D[0]&&ue(o,D[0]),(!h||O&128)&&x(t,"active",D[7]),D[6].length?S?(S.p(D,O),O&64&&A(S,1)):(S=Rp(D),S.c(),A(S,1),S.m(f,c)):S&&(re(),I(S,1,1,()=>{S=null}),ae()),D[5].length?$?($.p(D,O),O&32&&A($,1)):($=jp(D),$.c(),A($,1),$.m(f,d)):$&&(re(),I($,1,1,()=>{$=null}),ae()),D[3].length&&!D[2].length?T||(T=Vp(),T.c(),T.m(f,null)):T&&(T.d(1),T=null),(!h||O&256)&&x(f,"fade",D[8]),(!h||O&4)&&x(f,"sidebar-content-compact",D[2].length>20),D[9]?C&&(C.d(1),C=null):C?C.p(D,O):(C=Bp(D),C.c(),C.m(g.parentNode,g))},i(D){h||(A(S),A($),h=!0)},o(D){I(S),I($),h=!1},d(D){D&&(v(e),v(r),v(a),v(u),v(f),v(m),v(g)),S&&S.d(),$&&$.d(),T&&T.d(),C&&C.d(D),_=!1,we(k)}}}function L5(n){let e,t,i,l;e=new Yb({props:{class:"collection-sidebar",$$slots:{default:[I5]},$$scope:{ctx:n}}});let s={};return i=new xa({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(A(e.$$.fragment,o),A(i.$$.fragment,o),l=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Up="@pinnedCollections";function P5(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function F5(n,e,t){let i,l,s,o,r,a,u,f,c;We(n,zn,L=>t(11,a=L)),We(n,li,L=>t(19,u=L)),We(n,$o,L=>t(8,f=L)),We(n,Cl,L=>t(9,c=L));let d,m="",g=[];_();function h(L){tn(li,u=L,u)}function _(){t(1,g=[]);try{const L=localStorage.getItem(Up);L&&t(1,g=JSON.parse(L)||[])}catch{}}function k(){t(1,g=g.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function $(){m=this.value,t(0,m)}function T(L){g=L,t(1,g)}function C(L){g=L,t(1,g)}const D=()=>d==null?void 0:d.show();function O(L){te[L?"unshift":"push"](()=>{d=L,t(4,d)})}const E=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&h(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(k(),P5()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&g&&localStorage.setItem(Up,JSON.stringify(g)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>g.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!g.includes(L.id)))},[m,g,s,i,d,r,o,l,f,c,h,a,S,$,T,C,D,O,E]}class N5 extends _e{constructor(e){super(),ge(this,e,F5,L5,he,{})}}function Wp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Yp(n){n[18]=n[19].default}function Kp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Jp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Zp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,u,f,c=i&&Jp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ke(),c&&c.c(),l=M(),s=b("button"),r=Y(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,g){w(m,t,g),c&&c.m(m,g),w(m,l,g),w(m,s,g),y(s,r),y(s,a),u||(f=K(s,"click",d),u=!0)},p(m,g){e=m,g&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Jp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),g&8&&o!==(o=e[15].label+"")&&se(r,o),g&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),u=!1,f()}}}function Gp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:j5,then:q5,catch:R5,value:19,blocks:[,,,]};return ou(t=n[15].component,l),{c(){e=ke(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&ou(t,l)||L0(l,n,o)},i(s){i||(A(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];I(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function R5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function q5(n){Yp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Yp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(A(e.$$.fragment,l),i=!0)},o(l){I(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function j5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Xp(n,e){let t,i,l,s=e[5]===e[14]&&Gp(e);return{key:n,first:null,c(){t=ke(),s&&s.c(),i=ke(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&A(s,1)):(s=Gp(e),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(s),l=!0)},o(o){I(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function H5(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=h=>h[14];for(let h=0;hh[14];for(let h=0;hClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function V5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[z5],default:[H5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function B5(n,e,t){const i={list:{label:"List/Search",component:st(()=>import("./ListApiDocs-531b324b.js"),["./ListApiDocs-531b324b.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:st(()=>import("./ViewApiDocs-b3a10802.js"),["./ViewApiDocs-b3a10802.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js"],import.meta.url)},create:{label:"Create",component:st(()=>import("./CreateApiDocs-e470749e.js"),["./CreateApiDocs-e470749e.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js"],import.meta.url)},update:{label:"Update",component:st(()=>import("./UpdateApiDocs-ae75e9e7.js"),["./UpdateApiDocs-ae75e9e7.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js"],import.meta.url)},delete:{label:"Delete",component:st(()=>import("./DeleteApiDocs-fd46ff19.js"),["./DeleteApiDocs-fd46ff19.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:st(()=>import("./RealtimeApiDocs-45d83ff0.js"),["./RealtimeApiDocs-45d83ff0.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:st(()=>import("./AuthWithPasswordDocs-0d8891cf.js"),["./AuthWithPasswordDocs-0d8891cf.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:st(()=>import("./AuthWithOAuth2Docs-8666d543.js"),["./AuthWithOAuth2Docs-8666d543.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js"],import.meta.url)},refresh:{label:"Auth refresh",component:st(()=>import("./AuthRefreshDocs-7d5bb1ce.js"),["./AuthRefreshDocs-7d5bb1ce.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js"],import.meta.url)},"request-verification":{label:"Request verification",component:st(()=>import("./RequestVerificationDocs-8c75a2dc.js"),["./RequestVerificationDocs-8c75a2dc.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:st(()=>import("./ConfirmVerificationDocs-67d8a971.js"),["./ConfirmVerificationDocs-67d8a971.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:st(()=>import("./RequestPasswordResetDocs-0d7b5713.js"),["./RequestPasswordResetDocs-0d7b5713.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:st(()=>import("./ConfirmPasswordResetDocs-f363f429.js"),["./ConfirmPasswordResetDocs-f363f429.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:st(()=>import("./RequestEmailChangeDocs-0497f3ef.js"),["./RequestEmailChangeDocs-0497f3ef.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:st(()=>import("./ConfirmEmailChangeDocs-1efc427e.js"),["./ConfirmEmailChangeDocs-1efc427e.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:st(()=>import("./AuthMethodsDocs-ca345469.js"),["./AuthMethodsDocs-ca345469.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:st(()=>import("./ListExternalAuthsDocs-20410026.js"),["./ListExternalAuthsDocs-20410026.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-b1f57668.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:st(()=>import("./UnlinkExternalAuthDocs-adc881c1.js"),["./UnlinkExternalAuthDocs-adc881c1.js","./SdkTabs-96702c72.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function g(k){te[k?"unshift":"push"](()=>{s=k,t(4,s)})}function h(k){Ee.call(this,n,k)}function _(k){Ee.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!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,s,r,i,u,d,m,g,h,_]}class U5 extends _e{constructor(e){super(),ge(this,e,B5,V5,he,{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 W5(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=ve(t=Pe.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(s,[o]){t&&$t(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` -`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const Xp="yyyy-MM-dd HH:mm:ss.SSS";function W5(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,Xp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,Xp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Qb extends be{constructor(e){super(),_e(this,e,W5,U5,me,{model:1})}}function Y5(n){let e,t,i,l,s,o,r,a,u,f;return s=new rl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=Y(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("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),y(e,t),y(t,i),n[6](t),y(e,l),z(s,e,null),y(e,o),y(e,r),a=!0,u||(f=[ve(Fe.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(A(s.$$.fragment,c),a=!0)},o(c){I(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),u=!1,we(f)}}}function K5(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[Y5]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new En({props:d}),te.push(()=>ge(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.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(m,g){w(m,e,g),y(e,t),y(e,i),z(l,e,null),a=!0,u||(f=ve(r=Fe.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[g]){const h={};g&518&&(h.$$scope={dirty:g,ctx:m}),!s&&g&8&&(s=!0,h.active=m[3],ye(()=>s=!1)),l.$set(h),(!a||g&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&$t(r.update)&&g&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(A(l.$$.fragment,m),a=!0)},o(m){I(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),u=!1,f()}}}function J5(n,e,t){const i=rt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),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,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class xb extends be{constructor(e){super(),_e(this,e,J5,K5,me,{class:0,length:5})}}function Z5(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=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(m,g){w(m,e,g),y(e,t),y(e,i),y(e,l),w(m,o,g),w(m,r,g),ce(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(m,g){g&8192&&s!==(s=m[13])&&p(e,"for",s),g&4&&a!==(a=!m[2])&&p(r,"requried",a),g&4&&u!==(u=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",u),g&8192&&f!==(f=m[13])&&p(r,"id",f),g&1&&r.value!==m[0].username&&ce(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function G5(n){let e,t,i,l,s,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,g,h,_,k,S,$;return{c(){var T;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),u=b("span"),f=Y("Public: "),d=Y(c),g=M(),h=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(h,"type","email"),h.autofocus=n[2],p(h,"autocomplete","off"),p(h,"id",_=n[13]),h.required=k=(T=n[1].options)==null?void 0:T.requireEmail,p(h,"class","svelte-1751a4d")},m(T,C){w(T,e,C),y(e,t),y(e,i),y(e,l),w(T,o,C),w(T,r,C),y(r,a),y(a,u),y(u,f),y(u,d),w(T,g,C),w(T,h,C),ce(h,n[0].email),n[2]&&h.focus(),S||($=[ve(Fe.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",Ye(n[6])),K(h,"input",n[7])],S=!0)},p(T,C){var D;C&8192&&s!==(s=T[13])&&p(e,"for",s),C&1&&c!==(c=T[0].emailVisibility?"On":"Off")&&se(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(h.autofocus=T[2]),C&8192&&_!==(_=T[13])&&p(h,"id",_),C&2&&k!==(k=(D=T[1].options)==null?void 0:D.requireEmail)&&(h.required=k),C&1&&h.value!==T[0].email&&ce(h,T[0].email)},d(T){T&&(v(e),v(o),v(r),v(g),v(h)),S=!1,we($)}}}function Qp(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[X5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function X5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function xp(n){let e,t,i,l,s,o,r,a,u;return l=new he({props:{class:"form-field required",name:"password",$$slots:{default:[Q5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[x5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&8)&&x(t,"p-t-xs",f[3])},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function Q5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return c=new xb({props:{length:15}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),u=M(),f=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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(h,_){w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,o,_),w(h,r,_),ce(r,n[0].password),w(h,u,_),w(h,f,_),z(c,f,null),d=!0,m||(g=K(r,"input",n[9]),m=!0)},p(h,_){(!d||_&8192&&s!==(s=h[13]))&&p(e,"for",s),(!d||_&8192&&a!==(a=h[13]))&&p(r,"id",a),_&1&&r.value!==h[0].password&&ce(r,h[0].password)},i(h){d||(A(c.$$.fragment,h),d=!0)},o(h){I(c.$$.fragment,h),d=!1},d(h){h&&(v(e),v(o),v(r),v(u),v(f)),V(c),m=!1,g()}}}function x5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[0].passwordConfirm),u||(f=K(r,"input",n[10]),u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),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&&(v(e),v(o),v(r)),u=!1,f()}}}function eM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,l,f),y(l,s),r||(a=[K(e,"change",n[11]),K(e,"change",Ye(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,we(a)}}}function tM(n){var _;let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new he({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[Z5,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[G5,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}});let g=!n[2]&&Qp(n),h=(n[2]||n[3])&&xp(n);return d=new he({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[eM,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),g&&g.c(),u=M(),h&&h.c(),f=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(k,S){w(k,e,S),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),g&&g.m(a,null),y(a,u),h&&h.m(a,null),y(e,f),y(e,c),z(d,c,null),m=!0},p(k,[S]){var D;const $={};S&4&&($.class="form-field "+(k[2]?"":"required")),S&24581&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.class="form-field "+((D=k[1].options)!=null&&D.requireEmail?"required":"")),S&24583&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),k[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(k,S),S&4&&A(g,1)):(g=Qp(k),g.c(),A(g,1),g.m(a,u)),k[2]||k[3]?h?(h.p(k,S),S&12&&A(h,1)):(h=xp(k),h.c(),A(h,1),h.m(a,null)):h&&(re(),I(h,1,1,()=>{h=null}),ae());const C={};S&24581&&(C.$$scope={dirty:S,ctx:k}),d.$set(C)},i(k){m||(A(i.$$.fragment,k),A(o.$$.fragment,k),A(g),A(h),A(d.$$.fragment,k),m=!0)},o(k){I(i.$$.fragment,k),I(o.$$.fragment,k),I(g),I(h),I(d.$$.fragment,k),m=!1},d(k){k&&v(e),V(i),V(o),g&&g.d(),h&&h.d(),V(d)}}}function nM(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(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 m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function g(){i.verified=this.checked,t(0,i),t(3,r)}const h=_=>{s||an("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,l=_.collection),"isNew"in _&&t(2,s=_.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),ii("password"),ii("passwordConfirm")))},[i,l,s,r,o,a,u,f,c,d,m,g,h]}class iM extends be{constructor(e){super(),_e(this,e,nM,tM,me,{record:0,collection:1,isNew:2})}}function lM(n){let e,t,i,l=[n[3]],s={};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(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Vt(()=>(u(),()=>clearTimeout(a)));function c(m){te[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Pe(Pe({},e),Kt(m)),t(3,l=Ze(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class oM extends be{constructor(e){super(),_e(this,e,sM,lM,me,{value:0,maxHeight:4})}}function rM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d;function m(h){n[2](h)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new oM({props:g}),te.push(()=>ge(f,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),B(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),z(f,h,_),d=!0},p(h,_){(!d||_&2&&i!==(i=j.getFieldTypeIcon(h[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=h[1].name+"")&&se(r,o),(!d||_&8&&a!==(a=h[3]))&&p(e,"for",a);const k={};_&8&&(k.id=h[3]),_&2&&(k.required=h[1].required),!c&&_&1&&(c=!0,k.value=h[0],ye(()=>c=!1)),f.$set(k)},i(h){d||(A(f.$$.fragment,h),d=!0)},o(h){I(f.$$.fragment,h),d=!1},d(h){h&&(v(e),v(u)),V(f,h)}}}function aM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[rM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function uM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class fM extends be{constructor(e){super(),_e(this,e,uM,aM,me,{field:1,value:0})}}function cM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_;return{c(){var k,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"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",m=(k=n[1].options)==null?void 0:k.min),p(f,"max",g=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(k,S){w(k,e,S),y(e,t),y(e,l),y(e,s),y(s,r),w(k,u,S),w(k,f,S),ce(f,n[0]),h||(_=K(f,"input",n[2]),h=!0)},p(k,S){var $,T;S&2&&i!==(i=j.getFieldTypeIcon(k[1].type))&&p(t,"class",i),S&2&&o!==(o=k[1].name+"")&&se(r,o),S&8&&a!==(a=k[3])&&p(e,"for",a),S&8&&c!==(c=k[3])&&p(f,"id",c),S&2&&d!==(d=k[1].required)&&(f.required=d),S&2&&m!==(m=($=k[1].options)==null?void 0:$.min)&&p(f,"min",m),S&2&&g!==(g=(T=k[1].options)==null?void 0:T.max)&&p(f,"max",g),S&1&&ut(f.value)!==k[0]&&ce(f,k[0])},d(k){k&&(v(e),v(u),v(f)),h=!1,_()}}}function dM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[cM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=ut(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class mM extends be{constructor(e){super(),_e(this,e,pM,dM,me,{field:1,value:0})}}function hM(n){let e,t,i,l,s=n[1].name+"",o,r,a,u;return{c(){e=b("input"),i=M(),l=b("label"),o=Y(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,l,c),y(l,o),a||(u=K(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&&s!==(s=f[1].name+"")&&se(o,s),c&8&&r!==(r=f[3])&&p(l,"for",r)},d(f){f&&(v(e),v(i),v(l)),a=!1,u()}}}function gM(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[hM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _M(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class bM extends be{constructor(e){super(),_e(this,e,_M,gM,me,{field:1,value:0})}}function yM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"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(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),w(h,f,_),ce(f,n[0]),m||(g=K(f,"input",n[2]),m=!0)},p(h,_){_&2&&i!==(i=j.getFieldTypeIcon(h[1].type))&&p(t,"class",i),_&2&&o!==(o=h[1].name+"")&&se(r,o),_&8&&a!==(a=h[3])&&p(e,"for",a),_&8&&c!==(c=h[3])&&p(f,"id",c),_&2&&d!==(d=h[1].required)&&(f.required=d),_&1&&f.value!==h[0]&&ce(f,h[0])},d(h){h&&(v(e),v(u),v(f)),m=!1,g()}}}function kM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[yM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function vM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class wM extends be{constructor(e){super(),_e(this,e,vM,kM,me,{field:1,value:0})}}function SM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"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(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),w(h,f,_),ce(f,n[0]),m||(g=K(f,"input",n[2]),m=!0)},p(h,_){_&2&&i!==(i=j.getFieldTypeIcon(h[1].type))&&p(t,"class",i),_&2&&o!==(o=h[1].name+"")&&se(r,o),_&8&&a!==(a=h[3])&&p(e,"for",a),_&8&&c!==(c=h[3])&&p(f,"id",c),_&2&&d!==(d=h[1].required)&&(f.required=d),_&1&&f.value!==h[0]&&ce(f,h[0])},d(h){h&&(v(e),v(u),v(f)),m=!1,g()}}}function TM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[SM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $M(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class CM extends be{constructor(e){super(),_e(this,e,$M,TM,me,{field:1,value:0})}}function em(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),y(e,t),i||(l=[ve(Fe.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,we(l)}}}function MM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_=n[0]&&!n[1].required&&em(n);function k(T){n[6](T)}function S(T){n[7](T)}let $={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&($.value=n[2]),n[0]!==void 0&&($.formattedValue=n[0]),d=new Xa({props:$}),te.push(()=>ge(d,"value",k)),te.push(()=>ge(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=Y(" (UTC)"),f=M(),_&&_.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Jn(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",u=n[8])},m(T,C){w(T,e,C),y(e,t),y(e,l),y(e,s),y(s,r),y(s,a),w(T,f,C),_&&_.m(T,C),w(T,c,C),z(d,T,C),h=!0},p(T,C){(!h||C&2&&i!==(i=Jn(j.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!h||C&2)&&o!==(o=T[1].name+"")&&se(r,o),(!h||C&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?_?_.p(T,C):(_=em(T),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const D={};C&256&&(D.id=T[8]),!m&&C&4&&(m=!0,D.value=T[2],ye(()=>m=!1)),!g&&C&1&&(g=!0,D.formattedValue=T[0],ye(()=>g=!1)),d.$set(D)},i(T){h||(A(d.$$.fragment,T),h=!0)},o(T){I(d.$$.fragment,T),h=!1},d(T){T&&(v(e),v(f),v(c)),_&&_.d(T),V(d,T)}}}function OM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[MM,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function DM(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class EM extends be{constructor(e){super(),_e(this,e,DM,OM,me,{field:1,value:0})}}function tm(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=Y("Select up to "),l=Y(i),s=Y(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),y(e,t),y(e,l),y(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(l,i)},d(o){o&&v(e)}}}function AM(n){var S,$,T,C,D,O;let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;function h(E){n[3](E)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=(($=n[1].options)==null?void 0:$.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((D=(C=n[1].options)==null?void 0:C.values)==null?void 0:D.length)>5};n[0]!==void 0&&(_.selected=n[0]),f=new Gb({props:_}),te.push(()=>ge(f,"selected",h));let k=((O=n[1].options)==null?void 0:O.maxSelect)>1&&tm(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),B(f.$$.fragment),d=M(),k&&k.c(),m=ke(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(E,L){w(E,e,L),y(e,t),y(e,l),y(e,s),y(s,r),w(E,u,L),z(f,E,L),w(E,d,L),k&&k.m(E,L),w(E,m,L),g=!0},p(E,L){var P,F,N,q,W,G;(!g||L&2&&i!==(i=j.getFieldTypeIcon(E[1].type)))&&p(t,"class",i),(!g||L&2)&&o!==(o=E[1].name+"")&&se(r,o),(!g||L&16&&a!==(a=E[4]))&&p(e,"for",a);const R={};L&16&&(R.id=E[4]),L&6&&(R.toggle=!E[1].required||E[2]),L&4&&(R.multiple=E[2]),L&7&&(R.closable=!E[2]||((P=E[0])==null?void 0:P.length)>=((F=E[1].options)==null?void 0:F.maxSelect)),L&2&&(R.items=(N=E[1].options)==null?void 0:N.values),L&2&&(R.searchable=((W=(q=E[1].options)==null?void 0:q.values)==null?void 0:W.length)>5),!c&&L&1&&(c=!0,R.selected=E[0],ye(()=>c=!1)),f.$set(R),((G=E[1].options)==null?void 0:G.maxSelect)>1?k?k.p(E,L):(k=tm(E),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(E){g||(A(f.$$.fragment,E),g=!0)},o(E){I(f.$$.fragment,E),g=!1},d(E){E&&(v(e),v(u),v(d),v(m)),V(f,E),k&&k.d(E)}}}function IM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[AM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class PM extends be{constructor(e){super(),_e(this,e,LM,IM,me,{field:1,value:0})}}function FM(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function NM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function RM(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function qM(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ke()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;I(a.$$.fragment,1,0,()=>{V(a,1)}),ae()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){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&&v(t),e&&V(e,o)}}}function jM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_,k,S;function $(L,R){return L[4]?NM:FM}let T=$(n),C=T(n);const D=[qM,RM],O=[];function E(L,R){return L[3]?0:1}return m=E(n),g=O[m]=D[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=M(),u=b("span"),C.c(),d=M(),g.c(),h=ke(),p(t,"class",i=Jn(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),y(e,u),C.m(u,null),w(L,d,R),O[m].m(L,R),w(L,h,R),_=!0,k||(S=ve(f=Fe.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),k=!0)},p(L,R){(!_||R&2&&i!==(i=Jn(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!_||R&2)&&o!==(o=L[1].name+"")&&se(r,o),T!==(T=$(L))&&(C.d(1),C=T(L),C&&(C.c(),C.m(u,null))),f&&$t(f.update)&&R&16&&f.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!_||R&64&&c!==(c=L[6]))&&p(e,"for",c);let P=m;m=E(L),m===P?O[m].p(L,R):(re(),I(O[P],1,1,()=>{O[P]=null}),ae(),g=O[m],g?g.p(L,R):(g=O[m]=D[m](L),g.c()),A(g,1),g.m(h.parentNode,h))},i(L){_||(A(g),_=!0)},o(L){I(g),_=!1},d(L){L&&(v(e),v(d),v(h)),C.d(),O[m].d(L),k=!1,S()}}}function HM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jM,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nm(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function zM(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function VM(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=nm(s);Vt(async()=>{try{t(3,o=(await st(()=>import("./CodeEditor-80667d26.js"),["./CodeEditor-80667d26.js","./index-102ce751.js"],import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=nm(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=zM(r))},[s,l,r,o,i,a]}class BM extends be{constructor(e){super(),_e(this,e,VM,HM,me,{field:1,value:0})}}function UM(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function WM(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),nn(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(l,s){w(l,e,s)},p(l,s){s&4&&!nn(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function YM(n){let e;function t(s,o){return s[2]?WM:UM}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function KM(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).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,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class JM extends be{constructor(e){super(),_e(this,e,KM,YM,me,{file:0,size:1})}}function im(n){let e;function t(s,o){return s[4]==="image"?GM:ZM}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ZM(n){let e,t;return{c(){e=b("object"),t=Y("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function GM(n){let e,t,i;return{c(){e=b("img"),nn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!nn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function XM(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&im(n);return{c(){i&&i.c(),t=ke()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=im(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function QM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function xM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=Y(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"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),y(e,t),y(e,i),y(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=K(a,"click",n[0]),u=!0)},p(c,d){d&4&&se(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),u=!1,f()}}}function eO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[xM],header:[QM],default:[XM]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function tO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(m){te[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class nO extends be{constructor(e){super(),_e(this,e,tO,eO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function iO(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?rO:u[3]==="video"||u[3]==="audio"?oO:sO}let r=o(n),a=r(n);return{c(){e=b("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),l||(s=K(e,"click",fn(n[11])),l=!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&&v(e),a.d(),l=!1,s()}}}function lO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function sO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function oO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function rO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),nn(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),l||(s=K(e,"error",n[8]),l=!0)},p(o,r){r&32&&!nn(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&&v(e),l=!1,s()}}}function lm(n){let e,t,i={};return e=new nO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function aO(n){let e,t,i;function l(a,u){return a[2]?lO:iO}let s=l(n),o=s(n),r=n[7]&&lm(n);return{c(){o.c(),e=M(),r&&r.c(),t=ke()},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]){s===(s=l(a))&&o?o.p(a,u):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&A(r,1)):(r=lm(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&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function uO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ue.getAdminFileToken(s.collectionId))}catch(k){console.warn("File token failure:",k)}t(2,d=!1)}function g(){t(5,u="")}const h=k=>{l&&(k.preventDefault(),a==null||a.show(f))};function _(k){te[k?"unshift":"push"](()=>{a=k,t(4,a)})}return n.$$set=k=>{"record"in k&&t(9,s=k.record),"filename"in k&&t(0,o=k.filename),"size"in k&&t(1,r=k.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":ue.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":ue.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,l,g,s,c,h,_]}class xa extends be{constructor(e){super(),_e(this,e,uO,aO,me,{record:9,filename:0,size:1})}}function sm(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function om(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function fO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[ve(Fe.call(null,e,"Remove file")),K(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,we(i)}}}function cO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=K(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function dO(n){let e,t,i,l,s,o,r=n[34]+"",a,u,f,c,d,m;i=new xa({props:{record:n[3],filename:n[34]}});function g(k,S){return k[35]?cO:fO}let h=g(n),_=h(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=Y(r),c=M(),d=b("div"),_.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=ue.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(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(k,S){w(k,e,S),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),y(o,a),y(e,c),y(e,d),_.m(d,null),m=!0},p(k,S){const $={};S[0]&8&&($.record=k[3]),S[0]&32&&($.filename=k[34]),i.$set($),(!m||S[0]&36)&&x(t,"fade",k[35]),(!m||S[0]&32)&&r!==(r=k[34]+"")&&se(a,r),(!m||S[0]&1064&&u!==(u=ue.files.getUrl(k[3],k[34],{token:k[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(k[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),h===(h=g(k))&&_?_.p(k,S):(_.d(1),_=h(k),_&&(_.c(),_.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",k[32]),(!m||S[1]&4)&&x(e,"dragover",k[33])},i(k){m||(A(i.$$.fragment,k),m=!0)},o(k){I(i.$$.fragment,k),m=!1},d(k){k&&v(e),V(i),_.d()}}}function rm(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[dO,({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 Ls({props:r}),te.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u[0]&1&&(l=!0,f.list=e[0],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function pO(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,g,h,_;i=new JM({props:{file:n[29]}});function k(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),f=Y(u),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,$){w(S,e,$),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),y(s,r),y(s,a),y(a,f),y(e,d),y(e,m),g=!0,h||(_=[ve(Fe.call(null,m,"Remove file")),K(m,"click",k)],h=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[29]),i.$set(T),(!g||$[0]&2)&&u!==(u=n[29].name+"")&&se(f,u),(!g||$[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!g||$[1]&2)&&x(e,"dragging",n[32]),(!g||$[1]&4)&&x(e,"dragover",n[33])},i(S){g||(A(i.$$.fragment,S),g=!0)},o(S){I(i.$$.fragment,S),g=!1},d(S){S&&v(e),V(i),h=!1,we(_)}}}function am(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[pO,({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 Ls({props:r}),te.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u[0]&2&&(l=!0,f.list=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function mO(n){let e,t,i,l,s,o=n[4].name+"",r,a,u,f,c=[],d=new Map,m,g=[],h=new Map,_,k,S,$,T,C,D,O,E,L,R,P,F=pe(n[5]);const N=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&&s()},[l,i]}class xb extends _e{constructor(e){super(),ge(this,e,Y5,W5,he,{model:1})}}function K5(n){let e,t,i,l,s,o,r,a,u,f;return s=new rl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=Y(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("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),y(e,t),y(t,i),n[6](t),y(e,l),z(s,e,null),y(e,o),y(e,r),a=!0,u||(f=[ve(Pe.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(A(s.$$.fragment,c),a=!0)},o(c){I(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),u=!1,we(f)}}}function J5(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[K5]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new En({props:d}),te.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.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(m,g){w(m,e,g),y(e,t),y(e,i),z(l,e,null),a=!0,u||(f=ve(r=Pe.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[g]){const h={};g&518&&(h.$$scope={dirty:g,ctx:m}),!s&&g&8&&(s=!0,h.active=m[3],ye(()=>s=!1)),l.$set(h),(!a||g&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&$t(r.update)&&g&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(A(l.$$.fragment,m),a=!0)},o(m){I(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),u=!1,f()}}}function Z5(n,e,t){const i=rt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),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,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class e0 extends _e{constructor(e){super(),ge(this,e,Z5,J5,he,{class:0,length:5})}}function G5(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=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(m,g){w(m,e,g),y(e,t),y(e,i),y(e,l),w(m,o,g),w(m,r,g),ue(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(m,g){g&8192&&s!==(s=m[13])&&p(e,"for",s),g&4&&a!==(a=!m[2])&&p(r,"requried",a),g&4&&u!==(u=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",u),g&8192&&f!==(f=m[13])&&p(r,"id",f),g&1&&r.value!==m[0].username&&ue(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function X5(n){let e,t,i,l,s,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,g,h,_,k,S,$;return{c(){var T;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),u=b("span"),f=Y("Public: "),d=Y(c),g=M(),h=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(h,"type","email"),h.autofocus=n[2],p(h,"autocomplete","off"),p(h,"id",_=n[13]),h.required=k=(T=n[1].options)==null?void 0:T.requireEmail,p(h,"class","svelte-1751a4d")},m(T,C){w(T,e,C),y(e,t),y(e,i),y(e,l),w(T,o,C),w(T,r,C),y(r,a),y(a,u),y(u,f),y(u,d),w(T,g,C),w(T,h,C),ue(h,n[0].email),n[2]&&h.focus(),S||($=[ve(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",Ye(n[6])),K(h,"input",n[7])],S=!0)},p(T,C){var D;C&8192&&s!==(s=T[13])&&p(e,"for",s),C&1&&c!==(c=T[0].emailVisibility?"On":"Off")&&se(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(h.autofocus=T[2]),C&8192&&_!==(_=T[13])&&p(h,"id",_),C&2&&k!==(k=(D=T[1].options)==null?void 0:D.requireEmail)&&(h.required=k),C&1&&h.value!==T[0].email&&ue(h,T[0].email)},d(T){T&&(v(e),v(o),v(r),v(g),v(h)),S=!1,we($)}}}function xp(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[Q5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function em(n){let e,t,i,l,s,o,r,a,u;return l=new me({props:{class:"form-field required",name:"password",$$slots:{default:[x5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[eM,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&8)&&x(t,"p-t-xs",f[3])},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function x5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return c=new e0({props:{length:15}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),u=M(),f=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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(h,_){w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,o,_),w(h,r,_),ue(r,n[0].password),w(h,u,_),w(h,f,_),z(c,f,null),d=!0,m||(g=K(r,"input",n[9]),m=!0)},p(h,_){(!d||_&8192&&s!==(s=h[13]))&&p(e,"for",s),(!d||_&8192&&a!==(a=h[13]))&&p(r,"id",a),_&1&&r.value!==h[0].password&&ue(r,h[0].password)},i(h){d||(A(c.$$.fragment,h),d=!0)},o(h){I(c.$$.fragment,h),d=!1},d(h){h&&(v(e),v(o),v(r),v(u),v(f)),V(c),m=!1,g()}}}function eM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ue(r,n[0].passwordConfirm),u||(f=K(r,"input",n[10]),u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&ue(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function tM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,l,f),y(l,s),r||(a=[K(e,"change",n[11]),K(e,"change",Ye(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,we(a)}}}function nM(n){var _;let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new me({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[G5,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[X5,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}});let g=!n[2]&&xp(n),h=(n[2]||n[3])&&em(n);return d=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[tM,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),g&&g.c(),u=M(),h&&h.c(),f=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(k,S){w(k,e,S),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),g&&g.m(a,null),y(a,u),h&&h.m(a,null),y(e,f),y(e,c),z(d,c,null),m=!0},p(k,[S]){var D;const $={};S&4&&($.class="form-field "+(k[2]?"":"required")),S&24581&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.class="form-field "+((D=k[1].options)!=null&&D.requireEmail?"required":"")),S&24583&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),k[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(k,S),S&4&&A(g,1)):(g=xp(k),g.c(),A(g,1),g.m(a,u)),k[2]||k[3]?h?(h.p(k,S),S&12&&A(h,1)):(h=em(k),h.c(),A(h,1),h.m(a,null)):h&&(re(),I(h,1,1,()=>{h=null}),ae());const C={};S&24581&&(C.$$scope={dirty:S,ctx:k}),d.$set(C)},i(k){m||(A(i.$$.fragment,k),A(o.$$.fragment,k),A(g),A(h),A(d.$$.fragment,k),m=!0)},o(k){I(i.$$.fragment,k),I(o.$$.fragment,k),I(g),I(h),I(d.$$.fragment,k),m=!1},d(k){k&&v(e),V(i),V(o),g&&g.d(),h&&h.d(),V(d)}}}function iM(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(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 m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function g(){i.verified=this.checked,t(0,i),t(3,r)}const h=_=>{s||an("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,l=_.collection),"isNew"in _&&t(2,s=_.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),ii("password"),ii("passwordConfirm")))},[i,l,s,r,o,a,u,f,c,d,m,g,h]}class lM extends _e{constructor(e){super(),ge(this,e,iM,nM,he,{record:0,collection:1,isNew:2})}}function sM(n){let e,t,i,l=[n[3]],s={};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(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Vt(()=>(u(),()=>clearTimeout(a)));function c(m){te[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Fe(Fe({},e),Kt(m)),t(3,l=Ze(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class rM extends _e{constructor(e){super(),ge(this,e,oM,sM,he,{value:0,maxHeight:4})}}function aM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d;function m(h){n[2](h)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new rM({props:g}),te.push(()=>be(f,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),B(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),z(f,h,_),d=!0},p(h,_){(!d||_&2&&i!==(i=j.getFieldTypeIcon(h[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=h[1].name+"")&&se(r,o),(!d||_&8&&a!==(a=h[3]))&&p(e,"for",a);const k={};_&8&&(k.id=h[3]),_&2&&(k.required=h[1].required),!c&&_&1&&(c=!0,k.value=h[0],ye(()=>c=!1)),f.$set(k)},i(h){d||(A(f.$$.fragment,h),d=!0)},o(h){I(f.$$.fragment,h),d=!1},d(h){h&&(v(e),v(u)),V(f,h)}}}function uM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[aM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function fM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class cM extends _e{constructor(e){super(),ge(this,e,fM,uM,he,{field:1,value:0})}}function dM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_;return{c(){var k,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"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",m=(k=n[1].options)==null?void 0:k.min),p(f,"max",g=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(k,S){w(k,e,S),y(e,t),y(e,l),y(e,s),y(s,r),w(k,u,S),w(k,f,S),ue(f,n[0]),h||(_=K(f,"input",n[2]),h=!0)},p(k,S){var $,T;S&2&&i!==(i=j.getFieldTypeIcon(k[1].type))&&p(t,"class",i),S&2&&o!==(o=k[1].name+"")&&se(r,o),S&8&&a!==(a=k[3])&&p(e,"for",a),S&8&&c!==(c=k[3])&&p(f,"id",c),S&2&&d!==(d=k[1].required)&&(f.required=d),S&2&&m!==(m=($=k[1].options)==null?void 0:$.min)&&p(f,"min",m),S&2&&g!==(g=(T=k[1].options)==null?void 0:T.max)&&p(f,"max",g),S&1&&ut(f.value)!==k[0]&&ue(f,k[0])},d(k){k&&(v(e),v(u),v(f)),h=!1,_()}}}function pM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=ut(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class hM extends _e{constructor(e){super(),ge(this,e,mM,pM,he,{field:1,value:0})}}function gM(n){let e,t,i,l,s=n[1].name+"",o,r,a,u;return{c(){e=b("input"),i=M(),l=b("label"),o=Y(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,l,c),y(l,o),a||(u=K(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&&s!==(s=f[1].name+"")&&se(o,s),c&8&&r!==(r=f[3])&&p(l,"for",r)},d(f){f&&(v(e),v(i),v(l)),a=!1,u()}}}function _M(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:[gM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function bM(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class yM extends _e{constructor(e){super(),ge(this,e,bM,_M,he,{field:1,value:0})}}function kM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"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(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),w(h,f,_),ue(f,n[0]),m||(g=K(f,"input",n[2]),m=!0)},p(h,_){_&2&&i!==(i=j.getFieldTypeIcon(h[1].type))&&p(t,"class",i),_&2&&o!==(o=h[1].name+"")&&se(r,o),_&8&&a!==(a=h[3])&&p(e,"for",a),_&8&&c!==(c=h[3])&&p(f,"id",c),_&2&&d!==(d=h[1].required)&&(f.required=d),_&1&&f.value!==h[0]&&ue(f,h[0])},d(h){h&&(v(e),v(u),v(f)),m=!1,g()}}}function vM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[kM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function wM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class SM extends _e{constructor(e){super(),ge(this,e,wM,vM,he,{field:1,value:0})}}function TM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"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(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),w(h,f,_),ue(f,n[0]),m||(g=K(f,"input",n[2]),m=!0)},p(h,_){_&2&&i!==(i=j.getFieldTypeIcon(h[1].type))&&p(t,"class",i),_&2&&o!==(o=h[1].name+"")&&se(r,o),_&8&&a!==(a=h[3])&&p(e,"for",a),_&8&&c!==(c=h[3])&&p(f,"id",c),_&2&&d!==(d=h[1].required)&&(f.required=d),_&1&&f.value!==h[0]&&ue(f,h[0])},d(h){h&&(v(e),v(u),v(f)),m=!1,g()}}}function $M(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[TM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function CM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class MM extends _e{constructor(e){super(),ge(this,e,CM,$M,he,{field:1,value:0})}}function tm(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),y(e,t),i||(l=[ve(Pe.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,we(l)}}}function OM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_=n[0]&&!n[1].required&&tm(n);function k(T){n[6](T)}function S(T){n[7](T)}let $={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&($.value=n[2]),n[0]!==void 0&&($.formattedValue=n[0]),d=new Qa({props:$}),te.push(()=>be(d,"value",k)),te.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=Y(" (UTC)"),f=M(),_&&_.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Jn(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",u=n[8])},m(T,C){w(T,e,C),y(e,t),y(e,l),y(e,s),y(s,r),y(s,a),w(T,f,C),_&&_.m(T,C),w(T,c,C),z(d,T,C),h=!0},p(T,C){(!h||C&2&&i!==(i=Jn(j.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!h||C&2)&&o!==(o=T[1].name+"")&&se(r,o),(!h||C&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?_?_.p(T,C):(_=tm(T),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const D={};C&256&&(D.id=T[8]),!m&&C&4&&(m=!0,D.value=T[2],ye(()=>m=!1)),!g&&C&1&&(g=!0,D.formattedValue=T[0],ye(()=>g=!1)),d.$set(D)},i(T){h||(A(d.$$.fragment,T),h=!0)},o(T){I(d.$$.fragment,T),h=!1},d(T){T&&(v(e),v(f),v(c)),_&&_.d(T),V(d,T)}}}function DM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[OM,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function EM(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class AM extends _e{constructor(e){super(),ge(this,e,EM,DM,he,{field:1,value:0})}}function nm(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=Y("Select up to "),l=Y(i),s=Y(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),y(e,t),y(e,l),y(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(l,i)},d(o){o&&v(e)}}}function IM(n){var S,$,T,C,D,O;let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;function h(E){n[3](E)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=(($=n[1].options)==null?void 0:$.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((D=(C=n[1].options)==null?void 0:C.values)==null?void 0:D.length)>5};n[0]!==void 0&&(_.selected=n[0]),f=new Xb({props:_}),te.push(()=>be(f,"selected",h));let k=((O=n[1].options)==null?void 0:O.maxSelect)>1&&nm(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),B(f.$$.fragment),d=M(),k&&k.c(),m=ke(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(E,L){w(E,e,L),y(e,t),y(e,l),y(e,s),y(s,r),w(E,u,L),z(f,E,L),w(E,d,L),k&&k.m(E,L),w(E,m,L),g=!0},p(E,L){var P,F,N,q,W,G;(!g||L&2&&i!==(i=j.getFieldTypeIcon(E[1].type)))&&p(t,"class",i),(!g||L&2)&&o!==(o=E[1].name+"")&&se(r,o),(!g||L&16&&a!==(a=E[4]))&&p(e,"for",a);const R={};L&16&&(R.id=E[4]),L&6&&(R.toggle=!E[1].required||E[2]),L&4&&(R.multiple=E[2]),L&7&&(R.closable=!E[2]||((P=E[0])==null?void 0:P.length)>=((F=E[1].options)==null?void 0:F.maxSelect)),L&2&&(R.items=(N=E[1].options)==null?void 0:N.values),L&2&&(R.searchable=((W=(q=E[1].options)==null?void 0:q.values)==null?void 0:W.length)>5),!c&&L&1&&(c=!0,R.selected=E[0],ye(()=>c=!1)),f.$set(R),((G=E[1].options)==null?void 0:G.maxSelect)>1?k?k.p(E,L):(k=nm(E),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(E){g||(A(f.$$.fragment,E),g=!0)},o(E){I(f.$$.fragment,E),g=!1},d(E){E&&(v(e),v(u),v(d),v(m)),V(f,E),k&&k.d(E)}}}function LM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[IM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},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,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class FM extends _e{constructor(e){super(),ge(this,e,PM,LM,he,{field:1,value:0})}}function NM(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function RM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function qM(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function jM(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ke()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;I(a.$$.fragment,1,0,()=>{V(a,1)}),ae()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){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&&v(t),e&&V(e,o)}}}function HM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_,k,S;function $(L,R){return L[4]?RM:NM}let T=$(n),C=T(n);const D=[jM,qM],O=[];function E(L,R){return L[3]?0:1}return m=E(n),g=O[m]=D[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=M(),u=b("span"),C.c(),d=M(),g.c(),h=ke(),p(t,"class",i=Jn(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),y(e,u),C.m(u,null),w(L,d,R),O[m].m(L,R),w(L,h,R),_=!0,k||(S=ve(f=Pe.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),k=!0)},p(L,R){(!_||R&2&&i!==(i=Jn(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!_||R&2)&&o!==(o=L[1].name+"")&&se(r,o),T!==(T=$(L))&&(C.d(1),C=T(L),C&&(C.c(),C.m(u,null))),f&&$t(f.update)&&R&16&&f.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!_||R&64&&c!==(c=L[6]))&&p(e,"for",c);let P=m;m=E(L),m===P?O[m].p(L,R):(re(),I(O[P],1,1,()=>{O[P]=null}),ae(),g=O[m],g?g.p(L,R):(g=O[m]=D[m](L),g.c()),A(g,1),g.m(h.parentNode,h))},i(L){_||(A(g),_=!0)},o(L){I(g),_=!1},d(L){L&&(v(e),v(d),v(h)),C.d(),O[m].d(L),k=!1,S()}}}function zM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[HM,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function im(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function VM(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function BM(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=im(s);Vt(async()=>{try{t(3,o=(await st(()=>import("./CodeEditor-6ddcf228.js"),["./CodeEditor-6ddcf228.js","./index-102ce751.js"],import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=im(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=VM(r))},[s,l,r,o,i,a]}class UM extends _e{constructor(e){super(),ge(this,e,BM,zM,he,{field:1,value:0})}}function WM(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function YM(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),nn(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(l,s){w(l,e,s)},p(l,s){s&4&&!nn(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function KM(n){let e;function t(s,o){return s[2]?YM:WM}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function JM(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).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,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class ZM extends _e{constructor(e){super(),ge(this,e,JM,KM,he,{file:0,size:1})}}function lm(n){let e;function t(s,o){return s[4]==="image"?XM:GM}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function GM(n){let e,t;return{c(){e=b("object"),t=Y("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function XM(n){let e,t,i;return{c(){e=b("img"),nn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!nn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function QM(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&lm(n);return{c(){i&&i.c(),t=ke()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=lm(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function xM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=Y(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"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),y(e,t),y(e,i),y(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=K(a,"click",n[0]),u=!0)},p(c,d){d&4&&se(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),u=!1,f()}}}function tO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[eO],header:[xM],default:[QM]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function nO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(m){te[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class iO extends _e{constructor(e){super(),ge(this,e,nO,tO,he,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function lO(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?aO:u[3]==="video"||u[3]==="audio"?rO:oO}let r=o(n),a=r(n);return{c(){e=b("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),l||(s=K(e,"click",fn(n[11])),l=!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&&v(e),a.d(),l=!1,s()}}}function sO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function oO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function rO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function aO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),nn(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),l||(s=K(e,"error",n[8]),l=!0)},p(o,r){r&32&&!nn(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&&v(e),l=!1,s()}}}function sm(n){let e,t,i={};return e=new iO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function uO(n){let e,t,i;function l(a,u){return a[2]?sO:lO}let s=l(n),o=s(n),r=n[7]&&sm(n);return{c(){o.c(),e=M(),r&&r.c(),t=ke()},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]){s===(s=l(a))&&o?o.p(a,u):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&A(r,1)):(r=sm(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&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function fO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await fe.getAdminFileToken(s.collectionId))}catch(k){console.warn("File token failure:",k)}t(2,d=!1)}function g(){t(5,u="")}const h=k=>{l&&(k.preventDefault(),a==null||a.show(f))};function _(k){te[k?"unshift":"push"](()=>{a=k,t(4,a)})}return n.$$set=k=>{"record"in k&&t(9,s=k.record),"filename"in k&&t(0,o=k.filename),"size"in k&&t(1,r=k.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":fe.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":fe.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,l,g,s,c,h,_]}class eu extends _e{constructor(e){super(),ge(this,e,fO,uO,he,{record:9,filename:0,size:1})}}function om(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function rm(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function cO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[ve(Pe.call(null,e,"Remove file")),K(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,we(i)}}}function dO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=K(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function pO(n){let e,t,i,l,s,o,r=n[34]+"",a,u,f,c,d,m;i=new eu({props:{record:n[3],filename:n[34]}});function g(k,S){return k[35]?dO:cO}let h=g(n),_=h(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=Y(r),c=M(),d=b("div"),_.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=fe.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(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(k,S){w(k,e,S),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),y(o,a),y(e,c),y(e,d),_.m(d,null),m=!0},p(k,S){const $={};S[0]&8&&($.record=k[3]),S[0]&32&&($.filename=k[34]),i.$set($),(!m||S[0]&36)&&x(t,"fade",k[35]),(!m||S[0]&32)&&r!==(r=k[34]+"")&&se(a,r),(!m||S[0]&1064&&u!==(u=fe.files.getUrl(k[3],k[34],{token:k[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(k[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),h===(h=g(k))&&_?_.p(k,S):(_.d(1),_=h(k),_&&(_.c(),_.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",k[32]),(!m||S[1]&4)&&x(e,"dragover",k[33])},i(k){m||(A(i.$$.fragment,k),m=!0)},o(k){I(i.$$.fragment,k),m=!1},d(k){k&&v(e),V(i),_.d()}}}function am(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[pO,({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 Is({props:r}),te.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u[0]&1&&(l=!0,f.list=e[0],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function mO(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,g,h,_;i=new ZM({props:{file:n[29]}});function k(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),f=Y(u),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,$){w(S,e,$),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),y(s,r),y(s,a),y(a,f),y(e,d),y(e,m),g=!0,h||(_=[ve(Pe.call(null,m,"Remove file")),K(m,"click",k)],h=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[29]),i.$set(T),(!g||$[0]&2)&&u!==(u=n[29].name+"")&&se(f,u),(!g||$[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!g||$[1]&2)&&x(e,"dragging",n[32]),(!g||$[1]&4)&&x(e,"dragover",n[33])},i(S){g||(A(i.$$.fragment,S),g=!0)},o(S){I(i.$$.fragment,S),g=!1},d(S){S&&v(e),V(i),h=!1,we(_)}}}function um(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[mO,({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 Is({props:r}),te.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u[0]&2&&(l=!0,f.list=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function hO(n){let e,t,i,l,s,o=n[4].name+"",r,a,u,f,c=[],d=new Map,m,g=[],h=new Map,_,k,S,$,T,C,D,O,E,L,R,P,F=pe(n[5]);const N=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=b("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),z(t,e,null),i=!0,l||(s=[K(e,"dragover",Ye(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=` + `,name:n[4].name,$$slots:{default:[hO,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),z(t,e,null),i=!0,l||(s=[K(e,"dragover",Ye(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],l=!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&&v(e),V(t),l=!1,we(s)}}}function gO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,g="";function h(W){j.removeByValue(f,W),t(2,f)}function _(W){j.pushUnique(f,W),t(2,f)}function k(W){j.isEmpty(u[W])||u.splice(W,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(W){var J,H;W.preventDefault(),t(9,m=!1);const G=((J=W.dataTransfer)==null?void 0:J.files)||[];if(!(s||!G.length)){for(const U of G){const le=l.length+u.length-f.length;if(((H=r.options)==null?void 0:H.maxSelect)<=le)break;u.push(U)}t(1,u)}}Vt(async()=>{t(10,g=await ue.getAdminFileToken(o.collectionId))});const T=W=>h(W),C=W=>_(W);function D(W){a=W,t(0,a),t(6,i),t(4,r)}const O=W=>k(W);function E(W){u=W,t(1,u)}function L(W){te[W?"unshift":"push"](()=>{c=W,t(7,c)})}const R=()=>{for(let W of c.files)u.push(W);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function F(W){te[W?"unshift":"push"](()=>{d=W,t(8,d)})}const N=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=W=>{"record"in W&&t(3,o=W.record),"field"in W&&t(4,r=W.field),"value"in W&&t(0,a=W.value),"uploadedFiles"in W&&t(1,u=W.uploadedFiles),"deletedFileNames"in W&&t(2,f=W.deletedFileNames)},n.$$.update=()=>{var W,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=((W=r.options)==null?void 0:W.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&((G=r.options)==null?void 0:G.maxSelect)<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,g,s,h,_,k,$,T,C,D,O,E,L,R,P,F,N,q]}class _O extends be{constructor(e){super(),_e(this,e,gO,hO,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function um(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function bO(n,e){e=um(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=um(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function fm(n,e,t){const i=n.slice();i[5]=e[t];const l=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=l,i}function cm(n,e,t){const i=n.slice();return i[9]=e[t],i}function dm(n){let e,t;return e=new xa({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&5&&(s.filename=i[9]),e.$set(s)},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=!j.isEmpty(n[9]),t,i,l=e&&dm(n);return{c(){l&&l.c(),t=ke()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&5&&(e=!j.isEmpty(s[9])),e?l?(l.p(s,o),o&5&&A(l,1)):(l=dm(s),l.c(),A(l,1),l.m(t.parentNode,t)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(s){i||(A(l),i=!0)},o(s){I(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function mm(n){let e,t,i=pe(n[6]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oI(m[h],1,1,()=>{m[h]=null});return{c(){e=b("div"),t=b("i"),l=M();for(let h=0;ht(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,l=((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,s=((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,s,l,i,o]}class ir extends be{constructor(e){super(),_e(this,e,kO,yO,me,{record:0})}}function hm(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function gm(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function _m(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=K(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function bm(n){let e,t=!n[13]&&ym(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=ym(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function ym(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&km(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),y(e,t),y(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=km(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function km(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function vO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function wO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function vm(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("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),y(e,t),i||(l=[ve(Fe.call(null,t,"Edit")),K(t,"keydown",fn(n[27])),K(t,"click",fn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,we(l)}}}function wm(n,e){let t,i,l,s,o,r,a,u;function f(_,k){return _[6]?wO:vO}let c=f(e),d=c(e);s=new ir({props:{record:e[49]}});let m=!e[11]&&vm(e);function g(){return e[33](e[49])}function h(..._){return e[34](e[49],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,k){w(_,t,k),d.m(t,null),y(t,i),y(t,l),z(s,l,null),y(t,o),m&&m.m(t,null),r=!0,a||(u=[K(t,"click",g),K(t,"keydown",h)],a=!0)},p(_,k){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=vm(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&x(t,"selected",e[6]),(!r||k[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(A(s.$$.fragment,_),r=!0)},o(_){I(s.$$.fragment,_),r=!1},d(_){_&&v(t),d.d(),V(s),m&&m.d(),a=!1,we(u)}}}function Sm(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Tm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=Y("("),i=Y(t),l=Y(" of MAX "),s=Y(n[4]),o=Y(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function SO(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function TO(n){let e,t,i=pe(n[6]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=M(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,c){w(f,e,c),z(t,e,null),y(e,i),y(e,l),w(f,s,c),o=!0,r||(a=K(l,"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)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(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&&(v(e),v(s)),V(t),r=!1,a()}}}function $m(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[$O,({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&&(s.list=n[6]),e=new Ls({props:s}),te.push(()=>ge(e,"list",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,g,h,_,k,S,$;t=new Ds({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&_m(n),C=pe(n[8]);const D=N=>N[49].id;for(let N=0;N1&&Tm(n);const R=[TO,SO],P=[];function F(N,q){return N[6].length?0:1}return g=F(n),h=P[g]=R[g](n),{c(){e=b("div"),B(t.$$.fragment),i=M(),T&&T.c(),l=M(),s=b("div");for(let N=0;N1?L?L.p(N,q):(L=Tm(N),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let G=g;g=F(N),g===G?P[g].p(N,q):(re(),I(P[G],1,1,()=>{P[G]=null}),ae(),h=P[g],h?h.p(N,q):(h=P[g]=R[g](N),h.c()),A(h,1),h.m(_.parentNode,_))},i(N){if(!k){A(t.$$.fragment,N);for(let q=0;qCancel',t=M(),i=b("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),l||(s=[K(e,"click",n[28]),K(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function DO(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[OO],header:[MO],default:[CO]},$$scope:{ctx:n}};for(let a=0;at(26,m=Se));const g=rt(),h="picker_"+j.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",C=[],D=[],O=1,E=0,L=!1,R=!1;function P(){return t(2,T=""),t(8,C=[]),t(6,D=[]),N(),q(!0),S==null?void 0:S.show()}function F(){return S==null?void 0:S.hide()}async function N(){const Se=j.toArray(_);if(!l||!Se.length)return;t(24,R=!0);let mt=[];const Bt=Se.slice(),cn=[];for(;Bt.length>0;){const on=[];for(const Vn of Bt.splice(0,so))on.push(`id="${Vn}"`);cn.push(ue.collection(l).getFullList({batch:so,filter:on.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(cn).then(on=>{mt=mt.concat(...on)}),t(6,D=[]);for(const on of Se){const Vn=j.findByKey(mt,"id",on);Vn&&D.push(Vn)}T.trim()||t(8,C=j.filterDuplicatesByKey(D.concat(C))),t(24,R=!1)}catch(on){on.isAbort||(ue.error(on),t(24,R=!1))}}async function q(Se=!1){if(l){t(3,L=!0),Se&&(T.trim()?t(8,C=[]):t(8,C=j.toArray(D).slice()));try{const mt=Se?1:O+1,Bt=j.getAllCollectionIdentifiers(s),cn=await ue.collection(l).getList(mt,so,{filter:j.normalizeSearchFilter(T,Bt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:h+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(cn.items))),O=cn.page,t(23,E=cn.items.length),t(3,L=!1)}catch(mt){mt.isAbort||(ue.error(mt),t(3,L=!1))}}}function W(Se){i==1?t(6,D=[Se]):u&&(j.pushOrReplaceByKey(D,Se),t(6,D))}function G(Se){j.removeByKey(D,"id",Se.id),t(6,D)}function J(Se){f(Se)?G(Se):W(Se)}function H(){var Se;i!=1?t(20,_=D.map(mt=>mt.id)):t(20,_=((Se=D==null?void 0:D[0])==null?void 0:Se.id)||""),g("save",D),F()}function U(Se){Ee.call(this,n,Se)}const le=()=>F(),ee=()=>H(),oe=Se=>t(2,T=Se.detail),Te=()=>$==null?void 0:$.show(),je=Se=>$==null?void 0:$.show(Se),Ve=Se=>J(Se),Qe=(Se,mt)=>{(mt.code==="Enter"||mt.code==="Space")&&(mt.preventDefault(),mt.stopPropagation(),J(Se))},tt=()=>t(2,T=""),Ge=()=>{a&&!L&&q()},Mt=Se=>G(Se);function Pt(Se){D=Se,t(6,D)}function Ce(Se){te[Se?"unshift":"push"](()=>{S=Se,t(1,S)})}function De(Se){Ee.call(this,n,Se)}function ze(Se){Ee.call(this,n,Se)}function _t(Se){te[Se?"unshift":"push"](()=>{$=Se,t(7,$)})}const ne=Se=>{j.removeByKey(C,"id",Se.detail.record.id),C.unshift(Se.detail.record),t(8,C),W(Se.detail.record)},Ne=Se=>{j.removeByKey(C,"id",Se.detail.id),t(8,C),G(Se.detail)};return n.$$set=Se=>{e=Pe(Pe({},e),Kt(Se)),t(19,d=Ze(e,c)),"value"in Se&&t(20,_=Se.value),"field"in Se&&t(21,k=Se.field)},n.$$.update=()=>{var Se,mt;n.$$.dirty[0]&2097152&&t(4,i=((Se=k==null?void 0:k.options)==null?void 0:Se.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(mt=k==null?void 0:k.options)==null?void 0:mt.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Bt=>Bt.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=E==so),n.$$.dirty[0]&80&&t(10,u=i===null||i>D.length),n.$$.dirty[0]&64&&t(9,f=function(Bt){return j.findByKey(D,"id",Bt.id)})},[F,S,T,L,i,s,D,$,C,f,u,o,a,r,q,W,G,J,H,d,_,k,P,E,R,l,m,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne]}class AO extends be{constructor(e){super(),_e(this,e,EO,DO,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Cm(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function Mm(n,e,t){const i=n.slice();return i[26]=e[t],i}function Om(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=ve(t=Fe.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(s,o){t&&$t(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: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function Dm(n){let e,t=n[5]&&Em(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=Em(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Em(n){let e,t=pe(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function IO(n){let e,t,i,l,s,o,r,a,u,f;i=new ir({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("button"),o.innerHTML='',r=M(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),w(d,r,m),a=!0,u||(f=[ve(Fe.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(d,m){n=d;const g={};m&16&&(g.record=n[21]),i.$set(g),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(A(i.$$.fragment,d),a=!0)},o(d){I(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),V(i),u=!1,we(f)}}}function Im(n,e){let t,i,l,s;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 Ls({props:r}),te.push(()=>ge(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u&16&&(l=!0,f.list=e[4],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function LO(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m=[],g=new Map,h,_,k,S,$,T,C=n[6].length&&Om(n),D=pe(n[4]);const O=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Jn(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(k,"type","button"),p(k,"class","btn btn-transparent btn-sm btn-block"),p(_,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),C&&C.m(e,null),w(L,f,R),w(L,c,R),y(c,d);for(let P=0;P({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new he({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new AO({props:o}),n[16](i),i.$on("save",n[17]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!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){l||(A(e.$$.fragment,r),A(i.$$.fragment,r),l=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const Lm=100;function FO(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const O=j.toArray(s);return t(4,a=a.filter(E=>O.includes(E.id))),O.length!=a.length}async function m(){var R,P;const O=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!O.length){t(5,u=!1);return}t(5,u=!0);const E=O.slice(),L=[];for(;E.length>0;){const F=[];for(const N of E.splice(0,Lm))F.push(`id="${N}"`);L.push(ue.collection((P=l==null?void 0:l.options)==null?void 0:P.collectionId).getFullList(Lm,{filter:F.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let F=[];await Promise.all(L).then(N=>{F=F.concat(...N)});for(const N of O){const q=j.findByKey(F,"id",N);q?a.push(q):c.push(N)}t(4,a),h()}catch(F){ue.error(F)}t(5,u=!1)}function g(O){j.removeByKey(a,"id",O.id),t(4,a),h()}function h(){var O;i?t(0,s=a.map(E=>E.id)):t(0,s=((O=a[0])==null?void 0:O.id)||"")}Ts(()=>{clearTimeout(f)});const _=O=>g(O);function k(O){a=O,t(4,a)}const S=()=>{h()},$=()=>o==null?void 0:o.show();function T(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function C(O){te[O?"unshift":"push"](()=>{o=O,t(1,o)})}const D=O=>{var E;t(4,a=O.detail||[]),t(0,s=i?a.map(L=>L.id):((E=a[0])==null?void 0:E.id)||"")};return n.$$set=O=>{"field"in O&&t(2,l=O.field),"value"in O&&t(0,s=O.value),"picker"in O&&t(1,o=O.picker)},n.$$.update=()=>{var O;n.$$.dirty&4&&t(7,i=((O=l.options)==null?void 0:O.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(m,0)))},[s,o,l,r,a,u,c,i,g,h,f,_,k,S,$,T,C,D]}class NO extends be{constructor(e){super(),_e(this,e,FO,PO,me,{field:2,value:0,picker:1})}}function RO(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),S0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function qO(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function jO(n){let e;function t(s,o){return s[1]?qO:RO}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function HO(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let zO=HO();function qr(){return window&&window.tinymce?window.tinymce:null}function VO(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["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"],m=(E,L)=>{d.forEach(R=>{E.on(R,P=>{L(R.toLowerCase(),{eventName:R,event:P,editor:E})})})};let g,h,_,k=u,S=s;const $=rt();function T(){const E={...r,target:h,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,_=L),L.on("init",()=>{L.setContent(u),L.on(a,()=>{t(12,k=L.getContent()),k!==u&&(t(5,u=k),t(6,f=L.getContent({format:"text"})))})}),m(L,$),typeof r.setup=="function"&&r.setup(L)}};t(4,h.style.visibility="",h),qr().init(E)}Vt(()=>(qr()!==null?T():zO.load(g.ownerDocument,o,()=>{g&&T()}),()=>{var E;try{_&&((E=qr())==null||E.remove(_))}catch{}}));function C(E){te[E?"unshift":"push"](()=>{h=E,t(4,h)})}function D(E){te[E?"unshift":"push"](()=>{h=E,t(4,h)})}function O(E){te[E?"unshift":"push"](()=>{g=E,t(3,g)})}return n.$$set=E=>{"id"in E&&t(0,i=E.id),"inline"in E&&t(1,l=E.inline),"disabled"in E&&t(7,s=E.disabled),"scriptSrc"in E&&t(8,o=E.scriptSrc),"conf"in E&&t(9,r=E.conf),"modelEvents"in E&&t(10,a=E.modelEvents),"value"in E&&t(5,u=E.value),"text"in E&&t(6,f=E.text),"cssClass"in E&&t(2,c=E.cssClass)},n.$$.update=()=>{var E;if(n.$$.dirty&14496)try{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((E=_.mode)==null?void 0:E.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,g,h,u,f,s,o,r,a,_,k,S,C,D,O]}class eu extends be{constructor(e){super(),_e(this,e,VO,jO,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function Pm(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Fm(n,e,t){const i=n.slice();return i[48]=e[t],i}function Nm(n,e,t){const i=n.slice();return i[51]=e[t],i}function BO(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,g,h,_=pe(n[7]);const k=S=>S[51].id;for(let S=0;S<_.length;S+=1){let $=Nm(n,_,S),T=k($);l.set(T,i[S]=Rm(T,$))}return a=new Ds({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new xo({props:{class:"files-list",vThreshold:100,$$slots:{default:[ZO]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;SNew record',c=M(),B(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,$){w(S,e,$),y(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Rm(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=Y(i),s=M(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),y(t,l),y(t,s),o||(r=K(t,"click",Ye(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&se(l,i),f[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&v(t),o=!1,r()}}}function WO(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&qm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),y(e,t),y(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=qm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function YO(n){let e=[],t=new Map,i,l=pe(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function KO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JO(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),nn(e.src,t=ue.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!nn(e.src,t=ue.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function jm(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(f[48])),t?JO:KO}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=M(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),y(e,i),s||(o=[ve(l=Fe.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&&v(e),V(t),l=!1,we(s)}}}function _O(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,g="";function h(W){j.removeByValue(f,W),t(2,f)}function _(W){j.pushUnique(f,W),t(2,f)}function k(W){j.isEmpty(u[W])||u.splice(W,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(W){var J,H;W.preventDefault(),t(9,m=!1);const G=((J=W.dataTransfer)==null?void 0:J.files)||[];if(!(s||!G.length)){for(const U of G){const le=l.length+u.length-f.length;if(((H=r.options)==null?void 0:H.maxSelect)<=le)break;u.push(U)}t(1,u)}}Vt(async()=>{t(10,g=await fe.getAdminFileToken(o.collectionId))});const T=W=>h(W),C=W=>_(W);function D(W){a=W,t(0,a),t(6,i),t(4,r)}const O=W=>k(W);function E(W){u=W,t(1,u)}function L(W){te[W?"unshift":"push"](()=>{c=W,t(7,c)})}const R=()=>{for(let W of c.files)u.push(W);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function F(W){te[W?"unshift":"push"](()=>{d=W,t(8,d)})}const N=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=W=>{"record"in W&&t(3,o=W.record),"field"in W&&t(4,r=W.field),"value"in W&&t(0,a=W.value),"uploadedFiles"in W&&t(1,u=W.uploadedFiles),"deletedFileNames"in W&&t(2,f=W.deletedFileNames)},n.$$.update=()=>{var W,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=((W=r.options)==null?void 0:W.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&((G=r.options)==null?void 0:G.maxSelect)<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,g,s,h,_,k,$,T,C,D,O,E,L,R,P,F,N,q]}class bO extends _e{constructor(e){super(),ge(this,e,_O,gO,he,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function fm(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function yO(n,e){e=fm(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=fm(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function cm(n,e,t){const i=n.slice();i[5]=e[t];const l=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=l,i}function dm(n,e,t){const i=n.slice();return i[9]=e[t],i}function pm(n){let e,t;return e=new eu({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&5&&(s.filename=i[9]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mm(n){let e=!j.isEmpty(n[9]),t,i,l=e&&pm(n);return{c(){l&&l.c(),t=ke()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&5&&(e=!j.isEmpty(s[9])),e?l?(l.p(s,o),o&5&&A(l,1)):(l=pm(s),l.c(),A(l,1),l.m(t.parentNode,t)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(s){i||(A(l),i=!0)},o(s){I(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function hm(n){let e,t,i=pe(n[6]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oI(m[h],1,1,()=>{m[h]=null});return{c(){e=b("div"),t=b("i"),l=M();for(let h=0;ht(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,l=((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,s=((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,s,l,i,o]}class nr extends _e{constructor(e){super(),ge(this,e,vO,kO,he,{record:0})}}function gm(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function _m(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function bm(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=K(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function ym(n){let e,t=!n[13]&&km(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=km(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function km(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&vm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),y(e,t),y(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=vm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function vm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function wO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function SO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function wm(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("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),y(e,t),i||(l=[ve(Pe.call(null,t,"Edit")),K(t,"keydown",fn(n[27])),K(t,"click",fn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,we(l)}}}function Sm(n,e){let t,i,l,s,o,r,a,u;function f(_,k){return _[6]?SO:wO}let c=f(e),d=c(e);s=new nr({props:{record:e[49]}});let m=!e[11]&&wm(e);function g(){return e[33](e[49])}function h(..._){return e[34](e[49],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,k){w(_,t,k),d.m(t,null),y(t,i),y(t,l),z(s,l,null),y(t,o),m&&m.m(t,null),r=!0,a||(u=[K(t,"click",g),K(t,"keydown",h)],a=!0)},p(_,k){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=wm(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&x(t,"selected",e[6]),(!r||k[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(A(s.$$.fragment,_),r=!0)},o(_){I(s.$$.fragment,_),r=!1},d(_){_&&v(t),d.d(),V(s),m&&m.d(),a=!1,we(u)}}}function Tm(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $m(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=Y("("),i=Y(t),l=Y(" of MAX "),s=Y(n[4]),o=Y(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function TO(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function $O(n){let e,t,i=pe(n[6]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=M(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,c){w(f,e,c),z(t,e,null),y(e,i),y(e,l),w(f,s,c),o=!0,r||(a=K(l,"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)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(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&&(v(e),v(s)),V(t),r=!1,a()}}}function Cm(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[CO,({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&&(s.list=n[6]),e=new Is({props:s}),te.push(()=>be(e,"list",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 MO(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,g,h,_,k,S,$;t=new Os({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&bm(n),C=pe(n[8]);const D=N=>N[49].id;for(let N=0;N1&&$m(n);const R=[$O,TO],P=[];function F(N,q){return N[6].length?0:1}return g=F(n),h=P[g]=R[g](n),{c(){e=b("div"),B(t.$$.fragment),i=M(),T&&T.c(),l=M(),s=b("div");for(let N=0;N1?L?L.p(N,q):(L=$m(N),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let G=g;g=F(N),g===G?P[g].p(N,q):(re(),I(P[G],1,1,()=>{P[G]=null}),ae(),h=P[g],h?h.p(N,q):(h=P[g]=R[g](N),h.c()),A(h,1),h.m(_.parentNode,_))},i(N){if(!k){A(t.$$.fragment,N);for(let q=0;qCancel',t=M(),i=b("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),l||(s=[K(e,"click",n[28]),K(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function EO(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[DO],header:[OO],default:[MO]},$$scope:{ctx:n}};for(let a=0;at(26,m=Se));const g=rt(),h="picker_"+j.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",C=[],D=[],O=1,E=0,L=!1,R=!1;function P(){return t(2,T=""),t(8,C=[]),t(6,D=[]),N(),q(!0),S==null?void 0:S.show()}function F(){return S==null?void 0:S.hide()}async function N(){const Se=j.toArray(_);if(!l||!Se.length)return;t(24,R=!0);let mt=[];const Bt=Se.slice(),cn=[];for(;Bt.length>0;){const on=[];for(const Vn of Bt.splice(0,lo))on.push(`id="${Vn}"`);cn.push(fe.collection(l).getFullList({batch:lo,filter:on.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(cn).then(on=>{mt=mt.concat(...on)}),t(6,D=[]);for(const on of Se){const Vn=j.findByKey(mt,"id",on);Vn&&D.push(Vn)}T.trim()||t(8,C=j.filterDuplicatesByKey(D.concat(C))),t(24,R=!1)}catch(on){on.isAbort||(fe.error(on),t(24,R=!1))}}async function q(Se=!1){if(l){t(3,L=!0),Se&&(T.trim()?t(8,C=[]):t(8,C=j.toArray(D).slice()));try{const mt=Se?1:O+1,Bt=j.getAllCollectionIdentifiers(s),cn=await fe.collection(l).getList(mt,lo,{filter:j.normalizeSearchFilter(T,Bt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:h+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(cn.items))),O=cn.page,t(23,E=cn.items.length),t(3,L=!1)}catch(mt){mt.isAbort||(fe.error(mt),t(3,L=!1))}}}function W(Se){i==1?t(6,D=[Se]):u&&(j.pushOrReplaceByKey(D,Se),t(6,D))}function G(Se){j.removeByKey(D,"id",Se.id),t(6,D)}function J(Se){f(Se)?G(Se):W(Se)}function H(){var Se;i!=1?t(20,_=D.map(mt=>mt.id)):t(20,_=((Se=D==null?void 0:D[0])==null?void 0:Se.id)||""),g("save",D),F()}function U(Se){Ee.call(this,n,Se)}const le=()=>F(),ee=()=>H(),oe=Se=>t(2,T=Se.detail),Te=()=>$==null?void 0:$.show(),je=Se=>$==null?void 0:$.show(Se),Ve=Se=>J(Se),Qe=(Se,mt)=>{(mt.code==="Enter"||mt.code==="Space")&&(mt.preventDefault(),mt.stopPropagation(),J(Se))},tt=()=>t(2,T=""),Ge=()=>{a&&!L&&q()},Mt=Se=>G(Se);function Pt(Se){D=Se,t(6,D)}function Ce(Se){te[Se?"unshift":"push"](()=>{S=Se,t(1,S)})}function De(Se){Ee.call(this,n,Se)}function ze(Se){Ee.call(this,n,Se)}function _t(Se){te[Se?"unshift":"push"](()=>{$=Se,t(7,$)})}const ne=Se=>{j.removeByKey(C,"id",Se.detail.record.id),C.unshift(Se.detail.record),t(8,C),W(Se.detail.record)},Ne=Se=>{j.removeByKey(C,"id",Se.detail.id),t(8,C),G(Se.detail)};return n.$$set=Se=>{e=Fe(Fe({},e),Kt(Se)),t(19,d=Ze(e,c)),"value"in Se&&t(20,_=Se.value),"field"in Se&&t(21,k=Se.field)},n.$$.update=()=>{var Se,mt;n.$$.dirty[0]&2097152&&t(4,i=((Se=k==null?void 0:k.options)==null?void 0:Se.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(mt=k==null?void 0:k.options)==null?void 0:mt.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Bt=>Bt.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=E==lo),n.$$.dirty[0]&80&&t(10,u=i===null||i>D.length),n.$$.dirty[0]&64&&t(9,f=function(Bt){return j.findByKey(D,"id",Bt.id)})},[F,S,T,L,i,s,D,$,C,f,u,o,a,r,q,W,G,J,H,d,_,k,P,E,R,l,m,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne]}class IO extends _e{constructor(e){super(),ge(this,e,AO,EO,he,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Mm(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function Om(n,e,t){const i=n.slice();return i[26]=e[t],i}function Dm(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=ve(t=Pe.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(s,o){t&&$t(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: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function Em(n){let e,t=n[5]&&Am(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=Am(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Am(n){let e,t=pe(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LO(n){let e,t,i,l,s,o,r,a,u,f;i=new nr({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("button"),o.innerHTML='',r=M(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),w(d,r,m),a=!0,u||(f=[ve(Pe.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(d,m){n=d;const g={};m&16&&(g.record=n[21]),i.$set(g),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(A(i.$$.fragment,d),a=!0)},o(d){I(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),V(i),u=!1,we(f)}}}function Lm(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[LO,({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 Is({props:r}),te.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u&16&&(l=!0,f.list=e[4],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function PO(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m=[],g=new Map,h,_,k,S,$,T,C=n[6].length&&Dm(n),D=pe(n[4]);const O=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Jn(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(k,"type","button"),p(k,"class","btn btn-transparent btn-sm btn-block"),p(_,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),C&&C.m(e,null),w(L,f,R),w(L,c,R),y(c,d);for(let P=0;P({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new me({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new IO({props:o}),n[16](i),i.$on("save",n[17]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!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){l||(A(e.$$.fragment,r),A(i.$$.fragment,r),l=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const Pm=100;function NO(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const O=j.toArray(s);return t(4,a=a.filter(E=>O.includes(E.id))),O.length!=a.length}async function m(){var R,P;const O=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!O.length){t(5,u=!1);return}t(5,u=!0);const E=O.slice(),L=[];for(;E.length>0;){const F=[];for(const N of E.splice(0,Pm))F.push(`id="${N}"`);L.push(fe.collection((P=l==null?void 0:l.options)==null?void 0:P.collectionId).getFullList(Pm,{filter:F.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let F=[];await Promise.all(L).then(N=>{F=F.concat(...N)});for(const N of O){const q=j.findByKey(F,"id",N);q?a.push(q):c.push(N)}t(4,a),h()}catch(F){fe.error(F)}t(5,u=!1)}function g(O){j.removeByKey(a,"id",O.id),t(4,a),h()}function h(){var O;i?t(0,s=a.map(E=>E.id)):t(0,s=((O=a[0])==null?void 0:O.id)||"")}Ss(()=>{clearTimeout(f)});const _=O=>g(O);function k(O){a=O,t(4,a)}const S=()=>{h()},$=()=>o==null?void 0:o.show();function T(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function C(O){te[O?"unshift":"push"](()=>{o=O,t(1,o)})}const D=O=>{var E;t(4,a=O.detail||[]),t(0,s=i?a.map(L=>L.id):((E=a[0])==null?void 0:E.id)||"")};return n.$$set=O=>{"field"in O&&t(2,l=O.field),"value"in O&&t(0,s=O.value),"picker"in O&&t(1,o=O.picker)},n.$$.update=()=>{var O;n.$$.dirty&4&&t(7,i=((O=l.options)==null?void 0:O.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(m,0)))},[s,o,l,r,a,u,c,i,g,h,f,_,k,S,$,T,C,D]}class RO extends _e{constructor(e){super(),ge(this,e,NO,FO,he,{field:2,value:0,picker:1})}}function qO(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),T0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function jO(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function HO(n){let e;function t(s,o){return s[1]?jO:qO}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function zO(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let VO=zO();function Rr(){return window&&window.tinymce?window.tinymce:null}function BO(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["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"],m=(E,L)=>{d.forEach(R=>{E.on(R,P=>{L(R.toLowerCase(),{eventName:R,event:P,editor:E})})})};let g,h,_,k=u,S=s;const $=rt();function T(){const E={...r,target:h,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,_=L),L.on("init",()=>{L.setContent(u),L.on(a,()=>{t(12,k=L.getContent()),k!==u&&(t(5,u=k),t(6,f=L.getContent({format:"text"})))})}),m(L,$),typeof r.setup=="function"&&r.setup(L)}};t(4,h.style.visibility="",h),Rr().init(E)}Vt(()=>(Rr()!==null?T():VO.load(g.ownerDocument,o,()=>{g&&T()}),()=>{var E;try{_&&((E=Rr())==null||E.remove(_))}catch{}}));function C(E){te[E?"unshift":"push"](()=>{h=E,t(4,h)})}function D(E){te[E?"unshift":"push"](()=>{h=E,t(4,h)})}function O(E){te[E?"unshift":"push"](()=>{g=E,t(3,g)})}return n.$$set=E=>{"id"in E&&t(0,i=E.id),"inline"in E&&t(1,l=E.inline),"disabled"in E&&t(7,s=E.disabled),"scriptSrc"in E&&t(8,o=E.scriptSrc),"conf"in E&&t(9,r=E.conf),"modelEvents"in E&&t(10,a=E.modelEvents),"value"in E&&t(5,u=E.value),"text"in E&&t(6,f=E.text),"cssClass"in E&&t(2,c=E.cssClass)},n.$$.update=()=>{var E;if(n.$$.dirty&14496)try{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((E=_.mode)==null?void 0:E.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,g,h,u,f,s,o,r,a,_,k,S,C,D,O]}class tu extends _e{constructor(e){super(),ge(this,e,BO,HO,he,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function Fm(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Nm(n,e,t){const i=n.slice();return i[48]=e[t],i}function Rm(n,e,t){const i=n.slice();return i[51]=e[t],i}function UO(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,g,h,_=pe(n[7]);const k=S=>S[51].id;for(let S=0;S<_.length;S+=1){let $=Rm(n,_,S),T=k($);l.set(T,i[S]=qm(T,$))}return a=new Os({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Qo({props:{class:"files-list",vThreshold:100,$$slots:{default:[GO]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;SNew record',c=M(),B(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,$){w(S,e,$),y(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function qm(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=Y(i),s=M(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),y(t,l),y(t,s),o||(r=K(t,"click",Ye(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&se(l,i),f[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&v(t),o=!1,r()}}}function YO(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&jm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),y(e,t),y(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=jm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function KO(n){let e=[],t=new Map,i,l=pe(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function JO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ZO(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),nn(e.src,t=fe.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!nn(e.src,t=fe.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function Hm(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(f[48])),t?ZO:JO}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=M(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),y(e,i),s||(o=[ve(l=Pe.call(null,e,n[48]+` (record: `+n[44].id+")")),K(e,"click",Ye(function(){$t(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!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))),l&&$t(l.update)&&c[0]&32&&l.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,we(o)}}}function Hm(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ZO(n){let e,t;function i(r,a){if(r[15])return YO;if(!r[6])return WO}let l=i(n),s=l&&l(n),o=n[6]&&zm();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ke()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=zm(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function GO(n){let e,t,i,l;const s=[UO,BO],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function XO(n){let e,t;return{c(){e=b("h4"),t=Y(n[0])},m(i,l){w(i,e,l),y(e,t)},p(i,l){l[0]&1&&se(t,i[0])},d(i){i&&v(e)}}}function Vm(n){let e,t;return e=new he({props:{class:"form-field file-picker-size-select",$$slots:{default:[QO,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QO(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 xO(n){var g;let e,t,i,l=j.hasImageExtension((g=n[9])==null?void 0:g.name),s,o,r,a,u,f,c,d,m=l&&Vm(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=Y(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(h,_){w(h,e,_),y(e,t),w(h,i,_),m&&m.m(h,_),w(h,s,_),w(h,o,_),y(o,r),y(r,a),f=!0,c||(d=[K(e,"click",n[2]),K(o,"click",n[21])],c=!0)},p(h,_){var k;(!f||_[0]&64)&&(e.disabled=h[6]),_[0]&512&&(l=j.hasImageExtension((k=h[9])==null?void 0:k.name)),l?m?(m.p(h,_),_[0]&512&&A(m,1)):(m=Vm(h),m.c(),A(m,1),m.m(s.parentNode,s)):m&&(re(),I(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&se(a,h[1]),(!f||_[0]&8192&&u!==(u=!h[13]))&&(o.disabled=u)},i(h){f||(A(m),f=!0)},o(h){I(m),f=!1},d(h){h&&(v(e),v(i),v(s),v(o)),m&&m.d(h),c=!1,we(d)}}}function eD(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[xO],header:[XO],default:[GO]},$$scope:{ctx:n}};for(let a=0;at(27,u=De));const f=rt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:g=["image","document","video","audio","file"]}=e,h,_,k="",S=[],$=1,T=0,C=!1,D=[],O=[],E=[],L={},R={},P="";function F(){return G(!0),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,P="")}function W(){t(4,k="")}async function G(De=!1){if(L!=null&&L.id){t(6,C=!0),De&&q();try{const ze=De?1:$+1,_t=j.getAllCollectionIdentifiers(L);let ne=j.normalizeSearchFilter(k,_t)||"";ne&&(ne+=" && "),ne+="("+O.map(Se=>`${Se.name}:length>0`).join("||")+")";const Ne=await ue.collection(L.id).getList(ze,Bm,{filter:ne,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(Ne.items))),$=Ne.page,t(26,T=Ne.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(ue.error(ze),t(6,C=!1))}}}function J(){var ze,_t;let De=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const ne of O)if(j.toArray(R.record[ne.name]).includes(R.name)){De=De.concat(j.toArray((_t=ne.options)==null?void 0:_t.thumbs));break}}t(11,E=[{label:"Original size",value:""}]);for(const ne of De)E.push({label:`${ne} thumb`,value:ne});P&&!De.includes(P)&&t(12,P="")}function H(De){let ze=[];for(const _t of O){const ne=j.toArray(De[_t.name]);for(const Ne of ne)g.includes(j.getFileType(Ne))&&ze.push(Ne)}return ze}function U(De,ze){t(9,R={record:De,name:ze})}function le(){o&&(f("submit",Object.assign({size:P},R)),N())}function ee(De){P=De,t(12,P)}const oe=De=>{t(8,L=De)},Te=De=>t(4,k=De.detail),je=()=>_==null?void 0:_.show(),Ve=()=>{s&&G()};function Qe(De){te[De?"unshift":"push"](()=>{h=De,t(3,h)})}function tt(De){Ee.call(this,n,De)}function Ge(De){Ee.call(this,n,De)}function Mt(De){te[De?"unshift":"push"](()=>{_=De,t(10,_)})}const Pt=De=>{j.removeByKey(S,"id",De.detail.record.id),S.unshift(De.detail.record),t(5,S);const ze=H(De.detail.record);ze.length>0&&U(De.detail.record,ze[0])},Ce=De=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==De.detail.id&&t(9,R={}),j.removeByKey(S,"id",De.detail.id),t(5,S)};return n.$$set=De=>{e=Pe(Pe({},e),Kt(De)),t(22,a=Ze(e,r)),"title"in De&&t(0,d=De.title),"submitText"in De&&t(1,m=De.submitText),"fileTypes"in De&&t(24,g=De.fileTypes)},n.$$.update=()=>{var De;n.$$.dirty[0]&134217728&&t(7,D=u.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(_t=>{var ne,Ne,Se,mt,Bt;return _t.type==="file"&&!((ne=_t.options)!=null&&ne.protected)&&(!((Se=(Ne=_t.options)==null?void 0:Ne.mimeTypes)!=null&&Se.length)||!!((Bt=(mt=_t.options)==null?void 0:mt.mimeTypes)!=null&&Bt.find(cn=>cn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&D.length>0&&t(8,L=D[0]),n.$$.dirty[0]&256&&(O=(De=L==null?void 0:L.schema)==null?void 0:De.filter(ze=>{var _t;return ze.type==="file"&&!((_t=ze.options)!=null&&_t.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(W(),J()),n.$$.dirty[0]&512&&R!=null&&R.name&&J(),n.$$.dirty[0]&280&&typeof k<"u"&&L!=null&&L.id&&h!=null&&h.isActive()&&G(!0),n.$$.dirty[0]&512&&t(16,i=(ze,_t)=>{var ne;return(R==null?void 0:R.name)==_t&&((ne=R==null?void 0:R.record)==null?void 0:ne.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>H(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&T==Bm),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,N,h,k,S,C,D,L,R,_,E,P,o,s,l,i,W,G,H,U,le,a,c,g,F,T,u,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce]}class nD extends be{constructor(e){super(),_e(this,e,tD,eD,me,{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 iD(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function lD(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new eu({props:s}),te.push(()=>ge(e,"value",l)),e.$on("init",n[7]),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 sD(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m;const g=[lD,iD],h=[];function _(k,S){return k[4]?0:1}return f=_(n),c=h[f]=g[f](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),c.c(),d=ke(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(k,S){w(k,e,S),y(e,t),y(e,l),y(e,s),y(s,r),w(k,u,S),h[f].m(k,S),w(k,d,S),m=!0},p(k,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(k[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=k[1].name+"")&&se(r,o),(!m||S&2048&&a!==(a=k[11]))&&p(e,"for",a);let $=f;f=_(k),f===$?h[f].p(k,S):(re(),I(h[$],1,1,()=>{h[$]=null}),ae(),c=h[f],c?c.p(k,S):(c=h[f]=g[f](k),c.c()),A(c,1),c.m(d.parentNode,d))},i(k){m||(A(c),m=!0)},o(k){I(c),m=!1},d(k){k&&(v(e),v(u),v(d)),h[f].d(k)}}}function oD(n){let e,t,i,l;e=new he({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sD,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new nD({props:s}),n[8](i),i.$on("submit",n[9]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!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){l||(A(e.$$.fragment,o),A(i.$$.fragment,o),l=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[8](null),V(i,o)}}}function rD(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Vt(async()=>(typeof s>"u"&&t(0,s=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(g){s=g,t(0,s)}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 m=g=>{r==null||r.execCommand("InsertImage",!1,ue.files.getUrl(g.detail.record,g.detail.name,{thumb:g.detail.size}))};return n.$$set=g=>{"field"in g&&t(1,l=g.field),"value"in g&&t(0,s=g.value)},n.$$.update=()=>{var g;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(g=l.options)==null?void 0:g.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,f,c,d,m]}class aD extends be{constructor(e){super(),_e(this,e,rD,oD,me,{field:1,value:0})}}function uD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].authUrl),r||(a=K(s,"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(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authUrl&&ce(s,u[0].authUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function fD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].tokenUrl),r||(a=K(s,"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(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenUrl&&ce(s,u[0].tokenUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function cD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].userApiUrl),r||(a=K(s,"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(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userApiUrl&&ce(s,u[0].userApiUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function dD(n){let e,t,i,l,s,o,r,a,u;return l=new he({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[uD,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[fD,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new he({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[cD,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=Y(n[2]),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),y(e,t),w(f,i,c),z(l,f,c),w(f,s,c),z(o,f,c),w(f,r,c),z(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(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}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);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(l.$$.fragment,f),A(o.$$.fragment,f),A(a.$$.fragment,f),u=!0)},o(f){I(l.$$.fragment,f),I(o.$$.fragment,f),I(a.$$.fragment,f),u=!1},d(f){f&&(v(e),v(i),v(s),v(r)),V(l,f),V(o,f),V(a,f)}}}function pD(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function u(){s.tokenUrl=this.value,t(0,s)}function f(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=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&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class _l extends be{constructor(e){super(),_e(this,e,pD,dD,me,{key:1,config:0,required:4,title:2})}}function mD(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Auth URL"),l=M(),s=b("input"),a=M(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ce(s,n[0].authUrl),w(d,a,m),w(d,u,m),f||(c=K(s,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&ce(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function hD(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Token URL"),l=M(),s=b("input"),a=M(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ce(s,n[0].tokenUrl),w(d,a,m),w(d,u,m),f||(c=K(s,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&ce(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function gD(n){let e,t,i,l,s,o;return i=new he({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[mD,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new he({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[hD,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,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}),s.$set(f)},i(r){o||(A(i.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(i.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),V(i,r),V(s,r)}}}function _D(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class bD extends be{constructor(e){super(),_e(this,e,_D,gD,me,{key:1,config:0})}}function yD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function kD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Team ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[3]),r||(a=K(s,"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(s,"id",o),f&8&&s.value!==u[3]&&ce(s,u[3])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function vD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Key ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[4]),r||(a=K(s,"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(s,"id",o),f&16&&s.value!==u[4]&&ce(s,u[4])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function wD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",bo),r.required=!0},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[6]),u||(f=[ve(Fe.call(null,l,{text:`Max ${bo} seconds (~${bo/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&ce(r,c[6])},d(c){c&&(v(e),v(o),v(r)),u=!1,we(f)}}}function SD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Private key"),l=M(),s=b("textarea"),r=M(),a=b("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(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- +(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,we(o)}}}function zm(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function GO(n){let e,t;function i(r,a){if(r[15])return KO;if(!r[6])return YO}let l=i(n),s=l&&l(n),o=n[6]&&Vm();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ke()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Vm(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function XO(n){let e,t,i,l;const s=[WO,UO],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function QO(n){let e,t;return{c(){e=b("h4"),t=Y(n[0])},m(i,l){w(i,e,l),y(e,t)},p(i,l){l[0]&1&&se(t,i[0])},d(i){i&&v(e)}}}function Bm(n){let e,t;return e=new me({props:{class:"form-field file-picker-size-select",$$slots:{default:[xO,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xO(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 eD(n){var g;let e,t,i,l=j.hasImageExtension((g=n[9])==null?void 0:g.name),s,o,r,a,u,f,c,d,m=l&&Bm(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=Y(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(h,_){w(h,e,_),y(e,t),w(h,i,_),m&&m.m(h,_),w(h,s,_),w(h,o,_),y(o,r),y(r,a),f=!0,c||(d=[K(e,"click",n[2]),K(o,"click",n[21])],c=!0)},p(h,_){var k;(!f||_[0]&64)&&(e.disabled=h[6]),_[0]&512&&(l=j.hasImageExtension((k=h[9])==null?void 0:k.name)),l?m?(m.p(h,_),_[0]&512&&A(m,1)):(m=Bm(h),m.c(),A(m,1),m.m(s.parentNode,s)):m&&(re(),I(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&se(a,h[1]),(!f||_[0]&8192&&u!==(u=!h[13]))&&(o.disabled=u)},i(h){f||(A(m),f=!0)},o(h){I(m),f=!1},d(h){h&&(v(e),v(i),v(s),v(o)),m&&m.d(h),c=!1,we(d)}}}function tD(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[eD],header:[QO],default:[XO]},$$scope:{ctx:n}};for(let a=0;at(27,u=De));const f=rt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:g=["image","document","video","audio","file"]}=e,h,_,k="",S=[],$=1,T=0,C=!1,D=[],O=[],E=[],L={},R={},P="";function F(){return G(!0),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,P="")}function W(){t(4,k="")}async function G(De=!1){if(L!=null&&L.id){t(6,C=!0),De&&q();try{const ze=De?1:$+1,_t=j.getAllCollectionIdentifiers(L);let ne=j.normalizeSearchFilter(k,_t)||"";ne&&(ne+=" && "),ne+="("+O.map(Se=>`${Se.name}:length>0`).join("||")+")";const Ne=await fe.collection(L.id).getList(ze,Um,{filter:ne,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(Ne.items))),$=Ne.page,t(26,T=Ne.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(fe.error(ze),t(6,C=!1))}}}function J(){var ze,_t;let De=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const ne of O)if(j.toArray(R.record[ne.name]).includes(R.name)){De=De.concat(j.toArray((_t=ne.options)==null?void 0:_t.thumbs));break}}t(11,E=[{label:"Original size",value:""}]);for(const ne of De)E.push({label:`${ne} thumb`,value:ne});P&&!De.includes(P)&&t(12,P="")}function H(De){let ze=[];for(const _t of O){const ne=j.toArray(De[_t.name]);for(const Ne of ne)g.includes(j.getFileType(Ne))&&ze.push(Ne)}return ze}function U(De,ze){t(9,R={record:De,name:ze})}function le(){o&&(f("submit",Object.assign({size:P},R)),N())}function ee(De){P=De,t(12,P)}const oe=De=>{t(8,L=De)},Te=De=>t(4,k=De.detail),je=()=>_==null?void 0:_.show(),Ve=()=>{s&&G()};function Qe(De){te[De?"unshift":"push"](()=>{h=De,t(3,h)})}function tt(De){Ee.call(this,n,De)}function Ge(De){Ee.call(this,n,De)}function Mt(De){te[De?"unshift":"push"](()=>{_=De,t(10,_)})}const Pt=De=>{j.removeByKey(S,"id",De.detail.record.id),S.unshift(De.detail.record),t(5,S);const ze=H(De.detail.record);ze.length>0&&U(De.detail.record,ze[0])},Ce=De=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==De.detail.id&&t(9,R={}),j.removeByKey(S,"id",De.detail.id),t(5,S)};return n.$$set=De=>{e=Fe(Fe({},e),Kt(De)),t(22,a=Ze(e,r)),"title"in De&&t(0,d=De.title),"submitText"in De&&t(1,m=De.submitText),"fileTypes"in De&&t(24,g=De.fileTypes)},n.$$.update=()=>{var De;n.$$.dirty[0]&134217728&&t(7,D=u.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(_t=>{var ne,Ne,Se,mt,Bt;return _t.type==="file"&&!((ne=_t.options)!=null&&ne.protected)&&(!((Se=(Ne=_t.options)==null?void 0:Ne.mimeTypes)!=null&&Se.length)||!!((Bt=(mt=_t.options)==null?void 0:mt.mimeTypes)!=null&&Bt.find(cn=>cn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&D.length>0&&t(8,L=D[0]),n.$$.dirty[0]&256&&(O=(De=L==null?void 0:L.schema)==null?void 0:De.filter(ze=>{var _t;return ze.type==="file"&&!((_t=ze.options)!=null&&_t.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(W(),J()),n.$$.dirty[0]&512&&R!=null&&R.name&&J(),n.$$.dirty[0]&280&&typeof k<"u"&&L!=null&&L.id&&h!=null&&h.isActive()&&G(!0),n.$$.dirty[0]&512&&t(16,i=(ze,_t)=>{var ne;return(R==null?void 0:R.name)==_t&&((ne=R==null?void 0:R.record)==null?void 0:ne.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>H(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&T==Um),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,N,h,k,S,C,D,L,R,_,E,P,o,s,l,i,W,G,H,U,le,a,c,g,F,T,u,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce]}class iD extends _e{constructor(e){super(),ge(this,e,nD,tD,he,{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 lD(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function sD(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new tu({props:s}),te.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 oD(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m;const g=[sD,lD],h=[];function _(k,S){return k[4]?0:1}return f=_(n),c=h[f]=g[f](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),c.c(),d=ke(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(k,S){w(k,e,S),y(e,t),y(e,l),y(e,s),y(s,r),w(k,u,S),h[f].m(k,S),w(k,d,S),m=!0},p(k,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(k[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=k[1].name+"")&&se(r,o),(!m||S&2048&&a!==(a=k[11]))&&p(e,"for",a);let $=f;f=_(k),f===$?h[f].p(k,S):(re(),I(h[$],1,1,()=>{h[$]=null}),ae(),c=h[f],c?c.p(k,S):(c=h[f]=g[f](k),c.c()),A(c,1),c.m(d.parentNode,d))},i(k){m||(A(c),m=!0)},o(k){I(c),m=!1},d(k){k&&(v(e),v(u),v(d)),h[f].d(k)}}}function rD(n){let e,t,i,l;e=new me({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[oD,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new iD({props:s}),n[8](i),i.$on("submit",n[9]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!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){l||(A(e.$$.fragment,o),A(i.$$.fragment,o),l=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[8](null),V(i,o)}}}function aD(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Vt(async()=>(typeof s>"u"&&t(0,s=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(g){s=g,t(0,s)}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 m=g=>{r==null||r.execCommand("InsertImage",!1,fe.files.getUrl(g.detail.record,g.detail.name,{thumb:g.detail.size}))};return n.$$set=g=>{"field"in g&&t(1,l=g.field),"value"in g&&t(0,s=g.value)},n.$$.update=()=>{var g;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(g=l.options)==null?void 0:g.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,f,c,d,m]}class uD extends _e{constructor(e){super(),ge(this,e,aD,rD,he,{field:1,value:0})}}function fD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].authUrl),r||(a=K(s,"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(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authUrl&&ue(s,u[0].authUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function cD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].tokenUrl),r||(a=K(s,"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(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenUrl&&ue(s,u[0].tokenUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function dD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].userApiUrl),r||(a=K(s,"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(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userApiUrl&&ue(s,u[0].userApiUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function pD(n){let e,t,i,l,s,o,r,a,u;return l=new me({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[fD,({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:[cD,({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:[dD,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=Y(n[2]),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),y(e,t),w(f,i,c),z(l,f,c),w(f,s,c),z(o,f,c),w(f,r,c),z(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(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}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);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(l.$$.fragment,f),A(o.$$.fragment,f),A(a.$$.fragment,f),u=!0)},o(f){I(l.$$.fragment,f),I(o.$$.fragment,f),I(a.$$.fragment,f),u=!1},d(f){f&&(v(e),v(i),v(s),v(r)),V(l,f),V(o,f),V(a,f)}}}function mD(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function u(){s.tokenUrl=this.value,t(0,s)}function f(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=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&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class qr extends _e{constructor(e){super(),ge(this,e,mD,pD,he,{key:1,config:0,required:4,title:2})}}function hD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Display name"),l=M(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","text"),p(s,"id",o=n[7]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].displayName),r||(a=K(s,"input",n[2]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&ue(s,u[0].displayName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function gD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].authUrl),r||(a=K(s,"input",n[3]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].authUrl&&ue(s,u[0].authUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function _D(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].tokenUrl),r||(a=K(s,"input",n[4]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].tokenUrl&&ue(s,u[0].tokenUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function bD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[7]),p(s,"type","url"),p(s,"id",o=n[7]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].userApiUrl),r||(a=K(s,"input",n[5]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&o!==(o=u[7])&&p(s,"id",o),f&1&&s.value!==u[0].userApiUrl&&ue(s,u[0].userApiUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function yD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[7]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[7])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[6]),ve(Pe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if PKCE is not supported by their APIs.",position:"right"}))],u=!0)},p(c,d){d&128&&t!==(t=c[7])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&128&&a!==(a=c[7])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function kD(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new me({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[hD,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required",name:n[1]+".authUrl",$$slots:{default:[gD,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:n[1]+".tokenUrl",$$slots:{default:[_D,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:n[1]+".userApiUrl",$$slots:{default:[bD,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[yD,({uniqueId:m})=>({7:m}),({uniqueId:m})=>m?128:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),i=b("div"),i.textContent="Endpoints",l=M(),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),B(u.$$.fragment),f=M(),B(c.$$.fragment),p(i,"class","section-title")},m(m,g){z(e,m,g),w(m,t,g),w(m,i,g),w(m,l,g),z(s,m,g),w(m,o,g),z(r,m,g),w(m,a,g),z(u,m,g),w(m,f,g),z(c,m,g),d=!0},p(m,[g]){const h={};g&2&&(h.name=m[1]+".displayName"),g&385&&(h.$$scope={dirty:g,ctx:m}),e.$set(h);const _={};g&2&&(_.name=m[1]+".authUrl"),g&385&&(_.$$scope={dirty:g,ctx:m}),s.$set(_);const k={};g&2&&(k.name=m[1]+".tokenUrl"),g&385&&(k.$$scope={dirty:g,ctx:m}),r.$set(k);const S={};g&2&&(S.name=m[1]+".userApiUrl"),g&385&&(S.$$scope={dirty:g,ctx:m}),u.$set(S);const $={};g&2&&($.name=m[1]+".pkce"),g&385&&($.$$scope={dirty:g,ctx:m}),c.$set($)},i(m){d||(A(e.$$.fragment,m),A(s.$$.fragment,m),A(r.$$.fragment,m),A(u.$$.fragment,m),A(c.$$.fragment,m),d=!0)},o(m){I(e.$$.fragment,m),I(s.$$.fragment,m),I(r.$$.fragment,m),I(u.$$.fragment,m),I(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i),v(l),v(o),v(a),v(f)),V(e,m),V(s,m),V(r,m),V(u,m),V(c,m)}}}function vD(n,e,t){let{key:i=""}=e,{config:l={}}=e;j.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC");function s(){l.displayName=this.value,t(0,l)}function o(){l.authUrl=this.value,t(0,l)}function r(){l.tokenUrl=this.value,t(0,l)}function a(){l.userApiUrl=this.value,t(0,l)}function u(){l.pkce=this.checked,t(0,l)}return n.$$set=f=>{"key"in f&&t(1,i=f.key),"config"in f&&t(0,l=f.config)},[l,i,s,o,r,a,u]}class jr extends _e{constructor(e){super(),ge(this,e,vD,kD,he,{key:1,config:0})}}function wD(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Auth URL"),l=M(),s=b("input"),a=M(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ue(s,n[0].authUrl),w(d,a,m),w(d,u,m),f||(c=K(s,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&ue(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function SD(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Token URL"),l=M(),s=b("input"),a=M(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ue(s,n[0].tokenUrl),w(d,a,m),w(d,u,m),f||(c=K(s,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&ue(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function TD(n){let e,t,i,l,s,o;return i=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[wD,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[SD,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,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}),s.$set(f)},i(r){o||(A(i.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(i.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),V(i,r),V(s,r)}}}function $D(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class CD extends _e{constructor(e){super(),ge(this,e,$D,TD,he,{key:1,config:0})}}function MD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ue(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function OD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Team ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[3]),r||(a=K(s,"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(s,"id",o),f&8&&s.value!==u[3]&&ue(s,u[3])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function DD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Key ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[4]),r||(a=K(s,"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(s,"id",o),f&16&&s.value!==u[4]&&ue(s,u[4])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function ED(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",_o),r.required=!0},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ue(r,n[6]),u||(f=[ve(Pe.call(null,l,{text:`Max ${_o} seconds (~${_o/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&ue(r,c[6])},d(c){c&&(v(e),v(o),v(r)),u=!1,we(f)}}}function AD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Private key"),l=M(),s=b("textarea"),r=M(),a=b("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(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[5]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&32&&ce(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function TD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S;return l=new he({props:{class:"form-field required",name:"clientId",$$slots:{default:[yD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"teamId",$$slots:{default:[kD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new he({props:{class:"form-field required",name:"keyId",$$slots:{default:[vD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new he({props:{class:"form-field required",name:"duration",$$slots:{default:[wD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),h=new he({props:{class:"form-field required",name:"privateKey",$$slots:{default:[SD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),g=M(),B(h.$$.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($,T){w($,e,T),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),y(t,a),y(t,u),z(f,u,null),y(t,c),y(t,d),z(m,d,null),y(t,g),z(h,t,null),_=!0,k||(S=K(e,"submit",Ye(n[17])),k=!0)},p($,T){const C={};T&25165828&&(C.$$scope={dirty:T,ctx:$}),l.$set(C);const D={};T&25165832&&(D.$$scope={dirty:T,ctx:$}),r.$set(D);const O={};T&25165840&&(O.$$scope={dirty:T,ctx:$}),f.$set(O);const E={};T&25165888&&(E.$$scope={dirty:T,ctx:$}),m.$set(E);const L={};T&25165856&&(L.$$scope={dirty:T,ctx:$}),h.$set(L)},i($){_||(A(l.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(h.$$.fragment,$),_=!0)},o($){I(l.$$.fragment,$),I(r.$$.fragment,$),I(f.$$.fragment,$),I(m.$$.fragment,$),I(h.$$.fragment,$),_=!1},d($){$&&v(e),V(l),V(r),V(f),V(m),V(h),k=!1,S()}}}function $D(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function CD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function MD(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[CD],header:[$D],default:[TD]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const bo=15777e3;function OD(n,e,t){let i;const l=rt(),s="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,u=R.keyId||""),t(5,f=R.privateKey||""),t(6,c=R.duration||bo),Gt({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function h(){t(7,d=!0);try{const R=await ue.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),It("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){ue.error(R)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const C=()=>h(),D=()=>!d;function O(R){te[R?"unshift":"push"](()=>{o=R,t(1,o)})}function E(R){Ee.call(this,n,R)}function L(R){Ee.call(this,n,R)}return t(8,i=!0),[g,o,r,a,u,f,c,d,i,s,h,m,_,k,S,$,T,C,D,O,E,L]}class DD extends be{constructor(e){super(),_e(this,e,OD,MD,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function ED(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new DD({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent="Generate secret",o=M(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),y(e,t),y(e,i),y(e,l),w(d,o,m),z(r,d,m),a=!0,u||(f=K(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);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&&(v(e),v(o)),n[4](null),V(r,d),u=!1,f()}}}function AD(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){te[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class ID extends be{constructor(e){super(),_e(this,e,AD,ED,me,{key:1,config:0})}}const yo=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:ID},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:bD},{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:_l,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:_l,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:_l,optionsComponentProps:{required:!0}},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:_l,optionsComponentProps:{required:!0}},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:_l,optionsComponentProps:{required:!0}},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:_l,optionsComponentProps:{required:!0}}];function Um(n,e,t){const i=n.slice();return i[9]=e[t],i}function LD(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e)}}}function PD(n){let e,t=pe(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Wm(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,g,h,_,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=M(),o=b("span"),a=Y(r),u=M(),f=b("div"),c=Y("ID: "),m=Y(d),g=M(),h=b("button"),h.innerHTML='',_=M(),nn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,C){w(T,e,C),y(e,t),y(t,i),y(e,s),y(e,o),y(o,a),y(e,u),y(e,f),y(f,c),y(f,m),y(e,g),y(e,h),y(e,_),k||(S=K(h,"click",$),k=!0)},p(T,C){var D;n=T,C&2&&!nn(i.src,l="./images/oauth2/"+((D=n[3](n[9].provider))==null?void 0:D.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),C&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d(T){T&&v(e),k=!1,S()}}}function ND(n){let e;function t(s,o){var r;return s[2]?FD:(r=s[0])!=null&&r.id&&s[1].length?PD:LD}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function RD(n,e,t){const i=rt();let{record:l}=e,s=[],o=!1;function r(d){return yo.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await ue.collection(l.collectionId).listExternalAuths(l.id))}catch(d){ue.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||an(`Do you really want to unlink the ${a(d)} provider?`,()=>ue.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{It(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(m=>{ue.error(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class qD extends be{constructor(e){super(),_e(this,e,RD,ND,me,{record:0})}}function Ym(n,e,t){const i=n.slice();return i[69]=e[t],i[70]=e,i[71]=t,i}function Km(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=Y(`The record has previous unsaved changes. - `),r=b("button"),r.textContent="Restore draft",a=M(),u=b("button"),u.innerHTML='',f=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"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(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(t,a),y(t,u),y(e,f),y(e,c),m=!0,g||(h=[K(r,"click",n[38]),ve(Fe.call(null,u,"Discard draft")),K(u,"click",Ye(n[39]))],g=!0)},p:Q,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=ya(e,et,{duration:150})),m=!1},d(_){_&&v(e),_&&d&&d.end(),g=!1,we(h)}}}function Jm(n){let e,t,i;return t=new Qb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function jD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k=!n[6]&&Jm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),k&&k.c(),u=M(),f=b("input"),p(t,"class",Jn(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"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=m=!n[6]},m(S,$){w(S,e,$),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),w(S,a,$),k&&k.m(S,$),w(S,u,$),w(S,f,$),ce(f,n[3].id),g=!0,h||(_=K(f,"input",n[40]),h=!0)},p(S,$){(!g||$[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?k&&(re(),I(k,1,1,()=>{k=null}),ae()):k?(k.p(S,$),$[0]&64&&A(k,1)):(k=Jm(S),k.c(),A(k,1),k.m(u.parentNode,u)),(!g||$[2]&1024&&c!==(c=S[72]))&&p(f,"id",c),(!g||$[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!g||$[0]&64&&m!==(m=!S[6]))&&(f.readOnly=m),$[0]&8&&f.value!==S[3].id&&ce(f,S[3].id)},i(S){g||(A(k),g=!0)},o(S){I(k),g=!1},d(S){S&&(v(e),v(a),v(u),v(f)),k&&k.d(S),h=!1,_()}}}function Zm(n){var u,f;let e,t,i,l,s;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new iM({props:r}),te.push(()=>ge(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Gm();return{c(){B(e.$$.fragment),i=M(),a&&a.c(),l=ke()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var g,h;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ye(()=>t=!1)),e.$set(m),(h=(g=c[0])==null?void 0:g.schema)!=null&&h.length?a||(a=Gm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(A(e.$$.fragment,c),s=!0)},o(c){I(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),V(e,c),a&&a.d(c)}}}function Gm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function HD(n){let e,t,i;function l(o){n[54](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new NO({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 zD(n){let e,t,i,l,s;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 _O({props:u}),te.push(()=>ge(e,"value",o)),te.push(()=>ge(e,"uploadedFiles",r)),te.push(()=>ge(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(f,c){z(e,f,c),s=!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],ye(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ye(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[69].name],ye(()=>l=!1)),e.$set(d)},i(f){s||(A(e.$$.fragment,f),s=!0)},o(f){I(e.$$.fragment,f),s=!1},d(f){V(e,f)}}}function VD(n){let e,t,i;function l(o){n[50](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new BM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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,t,i;function l(o){n[49](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new PM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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,t,i;function l(o){n[48](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new EM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 WD(n){let e,t,i;function l(o){n[47](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new aD({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 YD(n){let e,t,i;function l(o){n[46](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new CM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 KD(n){let e,t,i;function l(o){n[45](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new wM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 JD(n){let e,t,i;function l(o){n[44](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new bM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 ZD(n){let e,t,i;function l(o){n[43](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new mM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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,t,i;function l(o){n[42](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new fM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 Xm(n,e){let t,i,l,s,o;const r=[GD,ZD,JD,KD,YD,WD,UD,BD,VD,zD,HD],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))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ke(),l&&l.c(),s=ke(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,s,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(l&&(re(),I(a[d],1,1,()=>{a[d]=null}),ae()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),A(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(A(l),o=!0)},o(f){I(l),o=!1},d(f){f&&(v(t),v(s)),~i&&a[i].d(f)}}}function Qm(n){let e,t,i;return t=new qD({props:{record:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===vs)},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===vs)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function XD(n){var S;let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[10]&&!n[7]&&Km(n);l=new he({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[jD,({uniqueId:$})=>({72:$}),({uniqueId:$})=>[0,0,$?1024:0]]},$$scope:{ctx:n}}});let g=n[14]&&Zm(n),h=pe(((S=n[0])==null?void 0:S.schema)||[]);const _=$=>$[69].name;for(let $=0;${m=null}),ae());const C={};T[0]&64&&(C.class="form-field "+($[6]?"":"readonly")),T[0]&200|T[2]&3072&&(C.$$scope={dirty:T,ctx:$}),l.$set(C),$[14]?g?(g.p($,T),T[0]&16384&&A(g,1)):(g=Zm($),g.c(),A(g,1),g.m(t,o)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),T[0]&57&&(h=pe(((D=$[0])==null?void 0:D.schema)||[]),re(),r=dt(r,T,_,1,$,h,a,t,Lt,Xm,null,Ym),ae()),(!f||T[0]&128)&&x(t,"no-pointer-events",$[7]),(!f||T[0]&8192)&&x(t,"active",$[13]===el),$[14]&&!$[6]?k?(k.p($,T),T[0]&16448&&A(k,1)):(k=Qm($),k.c(),A(k,1),k.m(e,null)):k&&(re(),I(k,1,1,()=>{k=null}),ae())},i($){if(!f){A(m),A(l.$$.fragment,$),A(g);for(let T=0;T{d=null}),ae()):d?(d.p(g,h),h[0]&64&&A(d,1)):(d=xm(g),d.c(),A(d,1),d.m(f.parentNode,f))},i(g){c||(A(d),c=!0)},o(g){I(d),c=!1},d(g){g&&(v(e),v(u),v(f)),d&&d.d(g)}}}function xD(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function xm(n){let e,t,i,l,s,o,r;return o=new En({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[eE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("button"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"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),y(i,l),y(i,s),z(o,i,null),r=!0},p(a,u){const f={};u[0]&16388|u[2]&2048&&(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&&(v(e),v(t),v(i)),V(o)}}}function eh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[32]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function th(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eE(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&eh(n),u=n[14]&&n[2].email&&th(n);return{c(){a&&a.c(),e=M(),u&&u.c(),t=M(),i=b("button"),i.innerHTML=' Duplicate',l=M(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"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,l,c),w(f,s,c),o||(r=[K(i,"click",n[34]),K(s,"click",fn(Ye(n[35])))],o=!0)},p(f,c){f[14]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=eh(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=th(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(f),u&&u.d(f),o=!1,we(r)}}}function nh(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=M(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===el),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===vs),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),s||(o=[K(t,"click",n[36]),K(l,"click",n[37])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===el),a[0]&8192&&x(l,"active",r[13]===vs)},d(r){r&&v(e),s=!1,we(o)}}}function tE(n){let e,t,i,l,s;const o=[xD,QD],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[14]&&!n[6]&&nh(n);return{c(){t.c(),i=M(),u&&u.c(),l=ke()},m(f,c){r[e].m(f,c),w(f,i,c),u&&u.m(f,c),w(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),A(t,1),t.m(i.parentNode,i)),f[14]&&!f[6]?u?u.p(f,c):(u=nh(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(A(t),s=!0)},o(f){I(t),s=!1},d(f){f&&(v(i),v(l)),r[e].d(f),u&&u.d(f)}}}function nE(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,u,f,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=Y(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(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=u=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),y(s,o),y(o,a),f||(c=K(e,"click",n[31]),f=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&se(a,r),m[0]&34816&&u!==(u=!d[15]||d[11])&&(s.disabled=u),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),f=!1,c()}}}function iE(n){let e,t,i={class:` +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[5]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&32&&ue(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function ID(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S;return l=new me({props:{class:"form-field required",name:"clientId",$$slots:{default:[MD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"teamId",$$slots:{default:[OD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"keyId",$$slots:{default:[DD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:"duration",$$slots:{default:[ED,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"privateKey",$$slots:{default:[AD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),g=M(),B(h.$$.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($,T){w($,e,T),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),y(t,a),y(t,u),z(f,u,null),y(t,c),y(t,d),z(m,d,null),y(t,g),z(h,t,null),_=!0,k||(S=K(e,"submit",Ye(n[17])),k=!0)},p($,T){const C={};T&25165828&&(C.$$scope={dirty:T,ctx:$}),l.$set(C);const D={};T&25165832&&(D.$$scope={dirty:T,ctx:$}),r.$set(D);const O={};T&25165840&&(O.$$scope={dirty:T,ctx:$}),f.$set(O);const E={};T&25165888&&(E.$$scope={dirty:T,ctx:$}),m.$set(E);const L={};T&25165856&&(L.$$scope={dirty:T,ctx:$}),h.$set(L)},i($){_||(A(l.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(h.$$.fragment,$),_=!0)},o($){I(l.$$.fragment,$),I(r.$$.fragment,$),I(f.$$.fragment,$),I(m.$$.fragment,$),I(h.$$.fragment,$),_=!1},d($){$&&v(e),V(l),V(r),V(f),V(m),V(h),k=!1,S()}}}function LD(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function PD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function FD(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[PD],header:[LD],default:[ID]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const _o=15777e3;function ND(n,e,t){let i;const l=rt(),s="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,u=R.keyId||""),t(5,f=R.privateKey||""),t(6,c=R.duration||_o),Gt({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function h(){t(7,d=!0);try{const R=await fe.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),It("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){fe.error(R)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const C=()=>h(),D=()=>!d;function O(R){te[R?"unshift":"push"](()=>{o=R,t(1,o)})}function E(R){Ee.call(this,n,R)}function L(R){Ee.call(this,n,R)}return t(8,i=!0),[g,o,r,a,u,f,c,d,i,s,h,m,_,k,S,$,T,C,D,O,E,L]}class RD extends _e{constructor(e){super(),ge(this,e,ND,FD,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function qD(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new RD({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent="Generate secret",o=M(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),y(e,t),y(e,i),y(e,l),w(d,o,m),z(r,d,m),a=!0,u||(f=K(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);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&&(v(e),v(o)),n[4](null),V(r,d),u=!1,f()}}}function jD(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){te[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class HD extends _e{constructor(e){super(),ge(this,e,jD,qD,he,{key:1,config:0})}}const bo=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:HD},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:CD},{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:qr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:qr,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:qr,optionsComponentProps:{required:!0}},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:jr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:jr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:jr}];function Wm(n,e,t){const i=n.slice();return i[9]=e[t],i}function zD(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e)}}}function VD(n){let e,t=pe(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ym(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,g,h,_,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=M(),o=b("span"),a=Y(r),u=M(),f=b("div"),c=Y("ID: "),m=Y(d),g=M(),h=b("button"),h.innerHTML='',_=M(),nn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,C){w(T,e,C),y(e,t),y(t,i),y(e,s),y(e,o),y(o,a),y(e,u),y(e,f),y(f,c),y(f,m),y(e,g),y(e,h),y(e,_),k||(S=K(h,"click",$),k=!0)},p(T,C){var D;n=T,C&2&&!nn(i.src,l="./images/oauth2/"+((D=n[3](n[9].provider))==null?void 0:D.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),C&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d(T){T&&v(e),k=!1,S()}}}function UD(n){let e;function t(s,o){var r;return s[2]?BD:(r=s[0])!=null&&r.id&&s[1].length?VD:zD}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function WD(n,e,t){const i=rt();let{record:l}=e,s=[],o=!1;function r(d){return bo.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await fe.collection(l.collectionId).listExternalAuths(l.id))}catch(d){fe.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||an(`Do you really want to unlink the ${a(d)} provider?`,()=>fe.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{It(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(m=>{fe.error(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class YD extends _e{constructor(e){super(),ge(this,e,WD,UD,he,{record:0})}}function Km(n,e,t){const i=n.slice();return i[69]=e[t],i[70]=e,i[71]=t,i}function Jm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=Y(`The record has previous unsaved changes. + `),r=b("button"),r.textContent="Restore draft",a=M(),u=b("button"),u.innerHTML='',f=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"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(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(t,a),y(t,u),y(e,f),y(e,c),m=!0,g||(h=[K(r,"click",n[38]),ve(Pe.call(null,u,"Discard draft")),K(u,"click",Ye(n[39]))],g=!0)},p:Q,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=ka(e,et,{duration:150})),m=!1},d(_){_&&v(e),_&&d&&d.end(),g=!1,we(h)}}}function Zm(n){let e,t,i;return t=new xb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function KD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k=!n[6]&&Zm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),k&&k.c(),u=M(),f=b("input"),p(t,"class",Jn(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"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=m=!n[6]},m(S,$){w(S,e,$),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),w(S,a,$),k&&k.m(S,$),w(S,u,$),w(S,f,$),ue(f,n[3].id),g=!0,h||(_=K(f,"input",n[40]),h=!0)},p(S,$){(!g||$[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?k&&(re(),I(k,1,1,()=>{k=null}),ae()):k?(k.p(S,$),$[0]&64&&A(k,1)):(k=Zm(S),k.c(),A(k,1),k.m(u.parentNode,u)),(!g||$[2]&1024&&c!==(c=S[72]))&&p(f,"id",c),(!g||$[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!g||$[0]&64&&m!==(m=!S[6]))&&(f.readOnly=m),$[0]&8&&f.value!==S[3].id&&ue(f,S[3].id)},i(S){g||(A(k),g=!0)},o(S){I(k),g=!1},d(S){S&&(v(e),v(a),v(u),v(f)),k&&k.d(S),h=!1,_()}}}function Gm(n){var u,f;let e,t,i,l,s;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new lM({props:r}),te.push(()=>be(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Xm();return{c(){B(e.$$.fragment),i=M(),a&&a.c(),l=ke()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var g,h;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ye(()=>t=!1)),e.$set(m),(h=(g=c[0])==null?void 0:g.schema)!=null&&h.length?a||(a=Xm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(A(e.$$.fragment,c),s=!0)},o(c){I(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),V(e,c),a&&a.d(c)}}}function Xm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function JD(n){let e,t,i;function l(o){n[54](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new RO({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 ZD(n){let e,t,i,l,s;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 bO({props:u}),te.push(()=>be(e,"value",o)),te.push(()=>be(e,"uploadedFiles",r)),te.push(()=>be(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(f,c){z(e,f,c),s=!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],ye(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ye(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[69].name],ye(()=>l=!1)),e.$set(d)},i(f){s||(A(e.$$.fragment,f),s=!0)},o(f){I(e.$$.fragment,f),s=!1},d(f){V(e,f)}}}function GD(n){let e,t,i;function l(o){n[50](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new UM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 XD(n){let e,t,i;function l(o){n[49](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new FM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 QD(n){let e,t,i;function l(o){n[48](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new AM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 xD(n){let e,t,i;function l(o){n[47](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new uD({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 eE(n){let e,t,i;function l(o){n[46](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new MM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 l(o){n[45](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new SM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 nE(n){let e,t,i;function l(o){n[44](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new yM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 iE(n){let e,t,i;function l(o){n[43](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new hM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 lE(n){let e,t,i;function l(o){n[42](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new cM({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 Qm(n,e){let t,i,l,s,o;const r=[lE,iE,nE,tE,eE,xD,QD,XD,GD,ZD,JD],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))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ke(),l&&l.c(),s=ke(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,s,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(l&&(re(),I(a[d],1,1,()=>{a[d]=null}),ae()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),A(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(A(l),o=!0)},o(f){I(l),o=!1},d(f){f&&(v(t),v(s)),~i&&a[i].d(f)}}}function xm(n){let e,t,i;return t=new YD({props:{record:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===ks)},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===ks)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function sE(n){var S;let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[10]&&!n[7]&&Jm(n);l=new me({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[KD,({uniqueId:$})=>({72:$}),({uniqueId:$})=>[0,0,$?1024:0]]},$$scope:{ctx:n}}});let g=n[14]&&Gm(n),h=pe(((S=n[0])==null?void 0:S.schema)||[]);const _=$=>$[69].name;for(let $=0;${m=null}),ae());const C={};T[0]&64&&(C.class="form-field "+($[6]?"":"readonly")),T[0]&200|T[2]&3072&&(C.$$scope={dirty:T,ctx:$}),l.$set(C),$[14]?g?(g.p($,T),T[0]&16384&&A(g,1)):(g=Gm($),g.c(),A(g,1),g.m(t,o)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),T[0]&57&&(h=pe(((D=$[0])==null?void 0:D.schema)||[]),re(),r=dt(r,T,_,1,$,h,a,t,Lt,Qm,null,Km),ae()),(!f||T[0]&128)&&x(t,"no-pointer-events",$[7]),(!f||T[0]&8192)&&x(t,"active",$[13]===el),$[14]&&!$[6]?k?(k.p($,T),T[0]&16448&&A(k,1)):(k=xm($),k.c(),A(k,1),k.m(e,null)):k&&(re(),I(k,1,1,()=>{k=null}),ae())},i($){if(!f){A(m),A(l.$$.fragment,$),A(g);for(let T=0;T{d=null}),ae()):d?(d.p(g,h),h[0]&64&&A(d,1)):(d=eh(g),d.c(),A(d,1),d.m(f.parentNode,f))},i(g){c||(A(d),c=!0)},o(g){I(d),c=!1},d(g){g&&(v(e),v(u),v(f)),d&&d.d(g)}}}function rE(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function eh(n){let e,t,i,l,s,o,r;return o=new En({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[aE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("button"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"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),y(i,l),y(i,s),z(o,i,null),r=!0},p(a,u){const f={};u[0]&16388|u[2]&2048&&(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&&(v(e),v(t),v(i)),V(o)}}}function th(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[32]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function nh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function aE(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&th(n),u=n[14]&&n[2].email&&nh(n);return{c(){a&&a.c(),e=M(),u&&u.c(),t=M(),i=b("button"),i.innerHTML=' Duplicate',l=M(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"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,l,c),w(f,s,c),o||(r=[K(i,"click",n[34]),K(s,"click",fn(Ye(n[35])))],o=!0)},p(f,c){f[14]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=th(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=nh(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(f),u&&u.d(f),o=!1,we(r)}}}function ih(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=M(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===el),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===ks),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),s||(o=[K(t,"click",n[36]),K(l,"click",n[37])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===el),a[0]&8192&&x(l,"active",r[13]===ks)},d(r){r&&v(e),s=!1,we(o)}}}function uE(n){let e,t,i,l,s;const o=[rE,oE],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[14]&&!n[6]&&ih(n);return{c(){t.c(),i=M(),u&&u.c(),l=ke()},m(f,c){r[e].m(f,c),w(f,i,c),u&&u.m(f,c),w(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),A(t,1),t.m(i.parentNode,i)),f[14]&&!f[6]?u?u.p(f,c):(u=ih(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(A(t),s=!0)},o(f){I(t),s=!1},d(f){f&&(v(i),v(l)),r[e].d(f),u&&u.d(f)}}}function fE(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,u,f,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=Y(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(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=u=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),y(s,o),y(o,a),f||(c=K(e,"click",n[31]),f=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&se(a,r),m[0]&34816&&u!==(u=!d[15]||d[11])&&(s.disabled=u),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),f=!1,c()}}}function cE(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:[nE],header:[tE],default:[XD]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` + `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[55],$$slots:{footer:[fE],header:[uE],default:[sE]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` record-panel `+(l[16]?"overlay-panel-xl":"overlay-panel-lg")+` `+(l[14]&&!l[6]?"colored-header":"")+` - `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[55]),s[0]&60925|s[2]&2048&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[56](null),V(e,l)}}}const el="form",vs="providers";function lE(n,e,t){let i,l,s,o,r;const a=rt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d={},m={},g=null,h=!1,_=!1,k={},S={},$=JSON.stringify(d),T=$,C=el,D=!0,O=!0;function E(fe){return F(fe),t(12,_=!0),t(13,C=el),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function R(){t(12,_=!1),L()}async function P(fe){if(fe&&typeof fe=="string"){try{return await ue.collection(f.id).getOne(fe)}catch(Me){Me.isAbort||(R(),console.warn("resolveModel:",Me),hi(`Unable to load record with id "${fe}"`))}return null}return fe}async function F(fe){t(7,O=!0),Gt({}),t(4,k={}),t(5,S={}),t(2,d=typeof fe=="string"?{id:fe,collectionId:f==null?void 0:f.id,collectionName:f==null?void 0:f.name}:fe||{}),t(3,m=structuredClone(d)),t(2,d=await P(fe)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,g=W()),!g||H(m,g)?t(10,g=null):(delete g.password,delete g.passwordConfirm),t(28,$=JSON.stringify(m)),t(7,O=!1)}async function N(fe){var Xe,Jt;Gt({}),t(2,d=fe||{}),t(4,k={}),t(5,S={});const Me=((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 fe)Me.includes(nt)||t(3,m[nt]=fe[nt],m);await Qt(),t(28,$=JSON.stringify(m)),U()}function q(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function W(fe){try{const Me=window.localStorage.getItem(q());if(Me)return JSON.parse(Me)}catch{}return fe}function G(fe){try{window.localStorage.setItem(q(),fe)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(q())}}function J(){g&&(t(3,m=g),t(10,g=null))}function H(fe,Me){var Bn;const Xe=structuredClone(fe||{}),Jt=structuredClone(Me||{}),nt=(Bn=f==null?void 0:f.schema)==null?void 0:Bn.filter(oi=>oi.type==="file");for(let oi of nt)delete Xe[oi.name],delete Jt[oi.name];const en=["expand","password","passwordConfirm"];for(let oi of en)delete Xe[oi],delete Jt[oi];return JSON.stringify(Xe)==JSON.stringify(Jt)}function U(){t(10,g=null),window.localStorage.removeItem(q())}async function le(fe=!0){if(!(h||!r||!(f!=null&&f.id))){t(11,h=!0);try{const Me=oe();let Xe;D?Xe=await ue.collection(f.id).create(Me):Xe=await ue.collection(f.id).update(m.id,Me),It(D?"Successfully created record.":"Successfully updated record."),U(),fe?R():N(Xe),a("save",{isNew:D,record:Xe})}catch(Me){ue.error(Me)}t(11,h=!1)}}function ee(){d!=null&&d.id&&an("Do you really want to delete the selected record?",()=>ue.collection(d.collectionId).delete(d.id).then(()=>{L(),It("Successfully deleted record."),a("delete",d)}).catch(fe=>{ue.error(fe)}))}function oe(){const fe=structuredClone(m||{}),Me=new FormData,Xe={id:fe.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 fe)if(Xe[nt]){if(typeof fe[nt]>"u"&&(fe[nt]=null),Jt[nt]&&fe[nt]!=="")try{JSON.parse(fe[nt])}catch(en){const Bn={};throw Bn[nt]={code:"invalid_json",message:en.toString()},new qn({status:400,response:{data:Bn}})}j.addValueToFormData(Me,nt,fe[nt])}for(const nt in k){const en=j.toArray(k[nt]);for(const Bn of en)Me.append(nt,Bn)}for(const nt in S){const en=j.toArray(S[nt]);for(const Bn of en)Me.append(nt+"."+Bn,"")}return Me}function Te(){!(f!=null&&f.id)||!(d!=null&&d.email)||an(`Do you really want to sent verification email to ${d.email}?`,()=>ue.collection(f.id).requestVerification(d.email).then(()=>{It(`Successfully sent verification email to ${d.email}.`)}).catch(fe=>{ue.error(fe)}))}function je(){!(f!=null&&f.id)||!(d!=null&&d.email)||an(`Do you really want to sent password reset email to ${d.email}?`,()=>ue.collection(f.id).requestPasswordReset(d.email).then(()=>{It(`Successfully sent password reset email to ${d.email}.`)}).catch(fe=>{ue.error(fe)}))}function Ve(){o?an("You have unsaved changes. Do you really want to discard them?",()=>{Qe()}):Qe()}async function Qe(){let fe=d?structuredClone(d):null;if(fe){fe.id="",fe.created="",fe.updated="";const Me=(f==null?void 0:f.schema)||[];for(const Xe of Me)Xe.type==="file"&&delete fe[Xe.name]}U(),E(fe),await Qt(),t(28,$="")}function tt(fe){(fe.ctrlKey||fe.metaKey)&&fe.code=="KeyS"&&(fe.preventDefault(),fe.stopPropagation(),le(!1))}const Ge=()=>L(),Mt=()=>Te(),Pt=()=>je(),Ce=()=>Ve(),De=()=>ee(),ze=()=>t(13,C=el),_t=()=>t(13,C=vs),ne=()=>J(),Ne=()=>U();function Se(){m.id=this.value,t(3,m)}function mt(fe){m=fe,t(3,m)}function Bt(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function cn(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function on(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Vn(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Ni(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function al(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function yi(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Ae(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Ft(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Ri(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Gn(fe,Me){n.$$.not_equal(k[Me.name],fe)&&(k[Me.name]=fe,t(4,k))}function ul(fe,Me){n.$$.not_equal(S[Me.name],fe)&&(S[Me.name]=fe,t(5,S))}function Rl(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}const ki=()=>o&&_?(an("You have unsaved changes. Do you really want to close the panel?",()=>{R()}),!1):(Gt({}),U(),!0);function fl(fe){te[fe?"unshift":"push"](()=>{c=fe,t(9,c)})}function cl(fe){Ee.call(this,n,fe)}function bt(fe){Ee.call(this,n,fe)}return n.$$set=fe=>{"collection"in fe&&t(0,f=fe.collection)},n.$$.update=()=>{var fe;n.$$.dirty[0]&1&&t(14,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((fe=f==null?void 0:f.schema)!=null&&fe.find(Me=>Me.type==="editor"))),n.$$.dirty[0]&48&&t(30,s=j.hasNonEmptyProps(k)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,T=JSON.stringify(m)),n.$$.dirty[0]&1879048192&&t(8,o=s||$!=T),n.$$.dirty[0]&4&&t(6,D=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!O&&(D||o)),n.$$.dirty[0]&536871040&&(O||G(T))},[f,L,d,m,k,S,D,O,o,c,g,h,_,C,i,r,l,u,R,J,U,le,ee,Te,je,Ve,tt,E,$,T,s,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne,Se,mt,Bt,cn,on,Vn,Ni,al,yi,Ae,Ft,Ri,Gn,ul,Rl,ki,fl,cl,bt]}class tu extends be{constructor(e){super(),_e(this,e,lE,iE,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function sE(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function oE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=Y(n[2]),l=M(),s=b("div"),o=Y(n[1]),r=Y(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),y(e,t),y(t,i),y(e,l),y(e,s),y(s,o),y(s,r),a||(u=ve(Fe.call(null,e,n[3])),a=!0)},p(f,c){c&4&&se(i,f[2]),c&2&&se(o,f[1])},d(f){f&&v(e),a=!1,u()}}}function rE(n){let e;function t(s,o){return s[0]?oE:sE}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function aE(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class nl extends be{constructor(e){super(),_e(this,e,aE,rE,me,{date:0})}}function ih(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function lh(n,e,t){const i=n.slice();return i[13]=e[t],i}function sh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function oh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function uE(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 fE(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function cE(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function dE(n){let e,t;return{c(){e=b("div"),t=Y(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function pE(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),y(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&se(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function mE(n){let e,t=[],i=new Map,l,s,o=pe(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;un[17]&&ah();return{c(){var u;e=b("div");for(let f=0;fu[17]?a||(a=ah(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&x(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!s){for(let f=0;fn[11]&&ch();return{c(){e=b("div"),i.c(),l=M(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),y(e,l),u&&u.m(e,null),s=!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,l)),f[9].length>f[11]?u||(u=ch(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(A(i),s=!0)},o(f){I(i),s=!1},d(f){f&&v(e),r[t].d(),u&&u.d()}}}function gE(n){let e,t=[],i=new Map,l=pe(j.toArray(n[3]));const s=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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function yE(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=Y(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),y(e,i),l||(s=[ve(Fe.call(null,e,"Open in new tab")),K(e,"click",fn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,we(s)}}}function kE(n){let e,t;return{c(){e=b("span"),t=Y(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function vE(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function wE(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function SE(n){let e,t,i,l;const s=[DE,OE],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function rh(n,e){let t,i,l;return i=new xa({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function ah(n){let e;return{c(){e=Y("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function TE(n){let e,t=pe(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&ph(n);return{c(){e=b("span"),i=Y(t),l=M(),r&&r.c(),s=ke(),p(e,"class","txt")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),r&&r.m(a,u),w(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=ph(a),r.c(),A(r,1),r.m(s.parentNode,s)):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&&(v(e),v(l),v(s)),r&&r.d(a)}}}function DE(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function ph(n){let e,t;return e=new rl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function EE(n){let e,t,i,l,s;const o=[SE,wE,vE,kE,yE,bE,_E,gE,hE,mE,pE,dE],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?cE(f):c===8?fE(f):c===9?uE(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ke()},m(f,c){r[t].m(f,c),w(f,l,c),s=!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(l.parentNode,l))},i(f){s||(A(i),s=!0)},o(f){I(i),s=!1},d(f){f&&v(l),r[t].d(f)}}}function AE(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Ee.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class e0 extends be{constructor(e){super(),_e(this,e,AE,EE,me,{record:0,field:1,short:2})}}function mh(n,e,t){const i=n.slice();return i[13]=e[t],i}function hh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new e0({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=Y(i),s=M(),o=b("td"),B(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),y(e,t),y(t,l),y(e,s),y(e,o),z(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&se(l,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&&v(e),V(r)}}}function gh(n){let e,t,i,l,s,o;return s=new nl({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),z(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),s.$set(u)},i(r){o||(A(s.$$.fragment,r),o=!0)},o(r){I(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function _h(n){let e,t,i,l,s,o;return s=new nl({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),z(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),s.$set(u)},i(r){o||(A(s.$$.fragment,r),o=!0)},o(r){I(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function IE(n){var D;let e,t,i,l,s,o,r,a,u,f,c=(n[3].id||"...")+"",d,m,g,h,_;a=new rl({props:{value:n[3].id}});let k=pe((D=n[0])==null?void 0:D.schema),S=[];for(let O=0;OI(S[O],1,1,()=>{S[O]=null});let T=n[3].created&&gh(n),C=n[3].updated&&_h(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),u=M(),f=b("span"),d=Y(c),m=M();for(let O=0;O{T=null}),ae()),O[3].updated?C?(C.p(O,E),E&8&&A(C,1)):(C=_h(O),C.c(),A(C,1),C.m(t,null)):C&&(re(),I(C,1,1,()=>{C=null}),ae()),(!_||E&16)&&x(e,"table-loading",O[4])},i(O){if(!_){A(a.$$.fragment,O);for(let E=0;EClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function FE(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[PE],header:[LE],default:[IE]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[8](null),V(e,l)}}}function NE(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(_){return f(_),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.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 ue.collection(l.id).getOne(_)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),hi(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function m(_){te[_?"unshift":"push"](()=>{s=_,t(2,s)})}function g(_){Ee.call(this,n,_)}function h(_){Ee.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,l=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=l==null?void 0:l.schema)!=null&&_.find(k=>k.type==="editor")))},[l,u,s,o,r,i,a,d,m,g,h]}class RE extends be{constructor(e){super(),_e(this,e,NE,FE,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function bh(n,e,t){const i=n.slice();return i[63]=e[t],i}function yh(n,e,t){const i=n.slice();return i[66]=e[t],i}function kh(n,e,t){const i=n.slice();return i[66]=e[t],i}function vh(n,e,t){const i=n.slice();return i[59]=e[t],i}function wh(n){let e;function t(s,o){return s[13]?jE:qE}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function qE(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),o||(r=K(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&&v(e),o=!1,r()}}}function jE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Sh(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[HE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 HE(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Th(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&$h(n),r=i&&Ch(n);return{c(){o&&o.c(),t=M(),r&&r.c(),l=ke()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,l,u),s=!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=$h(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=Ch(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){s||(A(o),A(r),s=!0)},o(a){I(o),I(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function $h(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[zE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 zE(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ch(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[VE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function BE(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=M(),s=b("span"),r=Y(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),y(s,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+"")&&se(r,o)},d(a){a&&v(e)}}}function Mh(n,e){let t,i,l,s;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:[BE]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Tn({props:r}),te.push(()=>ge(i,"sort",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u[0]&1&&(l=!0,f.sort=e[0],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Oh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[UE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 UE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Dh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[WE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Eh(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e),n[39](null)}}}function Ah(n){let e;function t(s,o){return s[13]?KE:YE}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function YE(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return ZE;if(!a[10])return JE}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=M(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),r&&r.m(t,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function KE(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function ZE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Ih(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=M(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=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,m){w(d,e,m),y(e,t),y(t,i),y(t,o),y(t,r),u||(f=[K(i,"change",c),K(t,"click",fn(n[30]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),u=!1,we(f)}}}function Lh(n){let e,t,i,l,s,o,r=n[63].id+"",a,u,f;l=new rl({props:{value:n[63].id}});let c=n[9]&&Ph(n);return{c(){e=b("td"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),a=Y(r),u=M(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),y(e,t),y(t,i),z(l,i,null),y(i,s),y(i,o),y(o,a),y(t,u),c&&c.m(t,null),f=!0},p(d,m){const g={};m[0]&8&&(g.value=d[63].id),l.$set(g),(!f||m[0]&8)&&r!==(r=d[63].id+"")&&se(a,r),d[9]?c?c.p(d,m):(c=Ph(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(l.$$.fragment,d),f=!0)},o(d){I(l.$$.fragment,d),f=!1},d(d){d&&v(e),V(l),c&&c.d()}}}function Ph(n){let e;function t(s,o){return s[63].verified?XE:GE}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function GE(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=ve(Fe.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function XE(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=ve(Fe.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function Fh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Nh(n),o=i&&Rh(n);return{c(){s&&s.c(),t=M(),o&&o.c(),l=ke()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Nh(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Rh(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Nh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?xE:QE}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function QE(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),y(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&se(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function xE(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Rh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?t8:e8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function e8(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),y(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&se(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function t8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qh(n,e){let t,i,l,s;return i=new e0({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),B(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),s=!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),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(A(i.$$.fragment,o),s=!0)},o(o){I(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function jh(n){let e,t,i;return t=new nl({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Hh(n){let e,t,i;return t=new nl({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function zh(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,g,h,_,k,S=!e[10]&&Ih(e),$=l&&Lh(e),T=e[9]&&Fh(e),C=pe(e[19]);const D=P=>P[66].name;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),y(t,i),$&&$.m(t,null),y(t,s),T&&T.m(t,null),y(t,o);for(let N=0;N{$=null}),ae()),e[9]?T?T.p(e,F):(T=Fh(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),F[0]&524296&&(C=pe(e[19]),re(),r=dt(r,F,D,1,e,C,a,t,Lt,qh,u,yh),ae()),F[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?O?(O.p(e,F),F[0]&288&&A(O,1)):(O=jh(e),O.c(),A(O,1),O.m(t,c)):O&&(re(),I(O,1,1,()=>{O=null}),ae()),F[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?E?(E.p(e,F),F[0]&160&&A(E,1)):(E=Hh(e),E.c(),A(E,1),E.m(t,m)):E&&(re(),I(E,1,1,()=>{E=null}),ae())},i(P){if(!h){A($);for(let F=0;FH[66].name;for(let H=0;HH[10]?H[63]:H[63].id;for(let H=0;H{O=null}),ae()),H[9]?E?(E.p(H,U),U[0]&512&&A(E,1)):(E=Th(H),E.c(),A(E,1),E.m(i,r)):E&&(re(),I(E,1,1,()=>{E=null}),ae()),U[0]&524289&&(L=pe(H[19]),re(),a=dt(a,U,R,1,H,L,u,i,Lt,Mh,f,kh),ae()),U[0]&288&&(c=H[8]&&!H[5].includes("@created")),c?P?(P.p(H,U),U[0]&288&&A(P,1)):(P=Oh(H),P.c(),A(P,1),P.m(i,d)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),U[0]&160&&(m=H[7]&&!H[5].includes("@updated")),m?F?(F.p(H,U),U[0]&160&&A(F,1)):(F=Dh(H),F.c(),A(F,1),F.m(i,g)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),H[16].length?N?N.p(H,U):(N=Eh(H),N.c(),N.m(h,null)):N&&(N.d(1),N=null),U[0]&9971642&&(q=pe(H[3]),re(),S=dt(S,U,W,1,H,q,$,k,Lt,zh,T,bh),ae(),!q.length&&G?G.p(H,U):q.length?G&&(G.d(1),G=null):(G=Ah(H),G.c(),G.m(k,T))),H[3].length&&H[18]?J?J.p(H,U):(J=Vh(H),J.c(),J.m(k,null)):J&&(J.d(1),J=null),(!C||U[0]&8192)&&x(e,"table-loading",H[13])},i(H){if(!C){A(O),A(E);for(let U=0;U({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function l8(n){let e,t,i=[],l=new Map,s,o,r=pe(n[16]);const a=u=>u[59].id+u[59].name;for(let u=0;u{i=null}),ae())},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Wh(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,g,h,_,k,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[6]),o=M(),a=Y(r),u=M(),f=b("button"),f.innerHTML='Reset',c=M(),d=b("div"),m=M(),g=b("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"),x(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-transparent btn-danger"),x(g,"btn-loading",n[14]),x(g,"btn-disabled",n[14]),p(e,"class","bulkbar")},m($,T){w($,e,T),y(e,t),y(t,i),y(t,l),y(l,s),y(t,o),y(t,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),_=!0,k||(S=[K(f,"click",n[47]),K(g,"click",n[48])],k=!0)},p($,T){(!_||T[0]&64)&&se(s,$[6]),(!_||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&se(a,r),(!_||T[0]&16384)&&x(f,"btn-disabled",$[14]),(!_||T[0]&16384)&&x(g,"btn-loading",$[14]),(!_||T[0]&16384)&&x(g,"btn-disabled",$[14])},i($){_||($&&Ke(()=>{_&&(h||(h=Le(e,jn,{duration:150,y:5},!0)),h.run(1))}),_=!0)},o($){$&&(h||(h=Le(e,jn,{duration:150,y:5},!1)),h.run(0)),_=!1},d($){$&&v(e),$&&h&&h.end(),k=!1,we(S)}}}function o8(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[s8],default:[n8]},$$scope:{ctx:n}};e=new xo({props:s}),n[46](e);let o=n[6]&&Wh(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=ke()},m(r,a){z(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!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=Wh(r),o.c(),A(o,1),o.m(i.parentNode,i)):o&&(re(),I(o,1,1,()=>{o=null}),ae())},i(r){l||(A(e.$$.fragment,r),A(o),l=!0)},o(r){I(e.$$.fragment,r),I(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),V(e,r),o&&o.d(r)}}}const r8=/^([\+\-])?(\w+)$/,Yh=40;function a8(n,e,t){let i,l,s,o,r,a,u,f,c,d,m,g;We(n,zn,Ae=>t(53,g=Ae));const h=rt();let{collection:_}=e,{sort:k=""}=e,{filter:S=""}=e,$,T=[],C=1,D=0,O={},E=!0,L=!1,R=0,P,F=[],N=[],q="";function W(){_!=null&&_.id&&(F.length?localStorage.setItem(q,JSON.stringify(F)):localStorage.removeItem(q))}function G(){if(t(5,F=[]),!!(_!=null&&_.id))try{const Ae=localStorage.getItem(q);Ae&&t(5,F=JSON.parse(Ae)||[])}catch{}}function J(Ae){return!!T.find(Ft=>Ft.id)}async function H(){const Ae=C;for(let Ft=1;Ft<=Ae;Ft++)(Ft===1||u)&&await U(Ft,!1)}async function U(Ae=1,Ft=!0){var fl,cl,bt;if(!(_!=null&&_.id))return;t(13,E=!0);let Ri=k;const Gn=Ri.match(r8),ul=Gn?r.find(fe=>fe.name===Gn[2]):null;if(Gn&&ul){const fe=((bt=(cl=(fl=g==null?void 0:g.find(Xe=>{var Jt;return Xe.id==((Jt=ul.options)==null?void 0:Jt.collectionId)}))==null?void 0:fl.schema)==null?void 0:cl.filter(Xe=>Xe.presentable))==null?void 0:bt.map(Xe=>Xe.name))||[],Me=[];for(const Xe of fe)Me.push((Gn[1]||"")+Gn[2]+"."+Xe);Me.length>0&&(Ri=Me.join(","))}const Rl=j.getAllCollectionIdentifiers(_),ki=o.map(fe=>fe.name+":excerpt(200)").concat(r.map(fe=>"expand."+fe.name+".*:excerpt(200)"));return ki.length&&ki.unshift("*"),ue.collection(_.id).getList(Ae,Yh,{sort:Ri,skipTotal:1,filter:j.normalizeSearchFilter(S,Rl),expand:r.map(fe=>fe.name).join(","),fields:ki.join(","),requestKey:"records_list"}).then(async fe=>{var Me;if(Ae<=1&&le(),t(13,E=!1),t(12,C=fe.page),t(28,D=fe.items.length),h("load",T.concat(fe.items)),o.length)for(let Xe of fe.items)Xe._partial=!0;if(Ft){const Xe=++R;for(;(Me=fe.items)!=null&&Me.length&&R==Xe;){const Jt=fe.items.splice(0,20);for(let nt of Jt)j.pushOrReplaceByKey(T,nt);t(3,T),await j.yieldToMain()}}else{for(let Xe of fe.items)j.pushOrReplaceByKey(T,Xe);t(3,T)}}).catch(fe=>{fe!=null&&fe.isAbort||(t(13,E=!1),console.warn(fe),le(),ue.error(fe,(fe==null?void 0:fe.status)!=400))})}function le(){$==null||$.resetVerticalScroll(),t(3,T=[]),t(12,C=1),t(28,D=0),t(4,O={})}function ee(){c?oe():Te()}function oe(){t(4,O={})}function Te(){for(const Ae of T)t(4,O[Ae.id]=Ae,O);t(4,O)}function je(Ae){O[Ae.id]?delete O[Ae.id]:t(4,O[Ae.id]=Ae,O),t(4,O)}function Ve(){an(`Do you really want to delete the selected ${f===1?"record":"records"}?`,Qe)}async function Qe(){if(L||!f||!(_!=null&&_.id))return;let Ae=[];for(const Ft of Object.keys(O))Ae.push(ue.collection(_.id).delete(Ft));return t(14,L=!0),Promise.all(Ae).then(()=>{It(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",O),oe()}).catch(Ft=>{ue.error(Ft)}).finally(()=>(t(14,L=!1),H()))}function tt(Ae){Ee.call(this,n,Ae)}const Ge=(Ae,Ft)=>{Ft.target.checked?j.removeByValue(F,Ae.id):j.pushUnique(F,Ae.id),t(5,F)},Mt=()=>ee();function Pt(Ae){k=Ae,t(0,k)}function Ce(Ae){k=Ae,t(0,k)}function De(Ae){k=Ae,t(0,k)}function ze(Ae){k=Ae,t(0,k)}function _t(Ae){k=Ae,t(0,k)}function ne(Ae){k=Ae,t(0,k)}function Ne(Ae){te[Ae?"unshift":"push"](()=>{P=Ae,t(15,P)})}const Se=Ae=>je(Ae),mt=Ae=>h("select",Ae),Bt=(Ae,Ft)=>{Ft.code==="Enter"&&(Ft.preventDefault(),h("select",Ae))},cn=()=>t(1,S=""),on=()=>h("new"),Vn=()=>U(C+1);function Ni(Ae){te[Ae?"unshift":"push"](()=>{$=Ae,t(11,$)})}const al=()=>oe(),yi=()=>Ve();return n.$$set=Ae=>{"collection"in Ae&&t(25,_=Ae.collection),"sort"in Ae&&t(0,k=Ae.sort),"filter"in Ae&&t(1,S=Ae.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(q=_.id+"@hiddenColumns",G(),le()),n.$$.dirty[0]&33554432&&t(10,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(Ae=>Ae.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(Ae=>Ae.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(Ae=>!F.includes(Ae.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&k!==-1&&S!==-1&&U(1),n.$$.dirty[0]&268435456&&t(18,u=D>=Yh),n.$$.dirty[0]&16&&t(6,f=Object.keys(O).length),n.$$.dirty[0]&72&&t(17,c=T.length&&f===T.length),n.$$.dirty[0]&32&&F!==-1&&W(),n.$$.dirty[0]&1032&&t(8,d=!i||T.length>0&&typeof T[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||T.length>0&&typeof T[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,N=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(Ae=>({id:Ae.id,name:Ae.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[k,S,U,T,O,F,f,m,d,l,i,$,C,E,L,P,N,c,u,a,h,ee,oe,je,Ve,_,J,H,D,s,tt,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne,Se,mt,Bt,cn,on,Vn,Ni,al,yi]}class u8 extends be{constructor(e){super(),_e(this,e,a8,o8,me,{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 f8(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=M(),l=b("span"),o=Y(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),y(e,t),y(e,i),y(e,l),y(l,o)},p(a,[u]){u&5&&s!==(s=(a[2]?"...":a[0])+"")&&se(o,s),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function c8(n,e,t){const i=rt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const f=j.getAllCollectionIdentifiers(l),c=await ue.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,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,l=f.collection),"filter"in f&&t(4,s=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&u()},[o,r,a,l,s,u]}class d8 extends be{constructor(e){super(),_e(this,e,c8,f8,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function p8(n){let e,t,i,l;return e=new F5({}),i=new _n({props:{class:"flex-content",$$slots:{footer:[_8],default:[g8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function m8(n){let e,t;return e=new _n({props:{center:!0,$$slots:{default:[k8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function h8(n){let e,t;return e=new _n({props:{center:!0,$$slots:{default:[v8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Kh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[ve(Fe.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function Jh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function g8(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P=!n[12]&&Kh(n);c=new Qo({}),c.$on("refresh",n[21]);let F=n[2].type!=="view"&&Jh(n);k=new Ds({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[24]);function N(G){n[26](G)}function q(G){n[27](G)}let W={collection:n[2]};return n[0]!==void 0&&(W.filter=n[0]),n[1]!==void 0&&(W.sort=n[1]),C=new u8({props:W}),n[25](C),te.push(()=>ge(C,"filter",N)),te.push(()=>ge(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=M(),s=b("div"),r=Y(o),a=M(),u=b("div"),P&&P.c(),f=M(),B(c.$$.fragment),d=M(),m=b("div"),g=b("button"),g.innerHTML=' API Preview',h=M(),F&&F.c(),_=M(),B(k.$$.fragment),S=M(),$=b("div"),T=M(),B(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"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(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(G,J){w(G,e,J),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),y(e,u),P&&P.m(u,null),y(u,f),z(c,u,null),y(e,d),y(e,m),y(m,g),y(m,h),F&&F.m(m,null),w(G,_,J),z(k,G,J),w(G,S,J),w(G,$,J),w(G,T,J),z(C,G,J),E=!0,L||(R=K(g,"click",n[22]),L=!0)},p(G,J){(!E||J[0]&4)&&o!==(o=G[2].name+"")&&se(r,o),G[12]?P&&(P.d(1),P=null):P?P.p(G,J):(P=Kh(G),P.c(),P.m(u,f)),G[2].type!=="view"?F?F.p(G,J):(F=Jh(G),F.c(),F.m(m,null)):F&&(F.d(1),F=null);const H={};J[0]&1&&(H.value=G[0]),J[0]&4&&(H.autocompleteCollection=G[2]),k.$set(H);const U={};J[0]&4&&(U.collection=G[2]),!D&&J[0]&1&&(D=!0,U.filter=G[0],ye(()=>D=!1)),!O&&J[0]&2&&(O=!0,U.sort=G[1],ye(()=>O=!1)),C.$set(U)},i(G){E||(A(c.$$.fragment,G),A(k.$$.fragment,G),A(C.$$.fragment,G),E=!0)},o(G){I(c.$$.fragment,G),I(k.$$.fragment,G),I(C.$$.fragment,G),E=!1},d(G){G&&(v(e),v(_),v(S),v($),v(T)),P&&P.d(),V(c),F&&F.d(),V(k,G),n[25](null),V(C,G),L=!1,R()}}}function _8(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new d8({props:s}),n[18](e),te.push(()=>ge(e,"totalCount",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 b8(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=M(),i=b("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),l||(s=K(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function y8(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function k8(n){let e,t,i;function l(r,a){return r[12]?y8:b8}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=M(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),y(e,t),y(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function v8(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function w8(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[h8,m8,p8],m=[];function g($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=g(n),t=m[e]=d[e](n);let h={};l=new Qa({props:h}),n[31](l);let _={};o=new B5({props:_}),n[32](o);let k={collection:n[2]};a=new tu({props:k}),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 RE({props:S}),n[37](f),f.$on("hide",n[38]),{c(){t.c(),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),B(f.$$.fragment)},m($,T){m[e].m($,T),w($,i,T),z(l,$,T),w($,s,T),z(o,$,T),w($,r,T),z(a,$,T),w($,u,T),z(f,$,T),c=!0},p($,T){let C=e;e=g($),e===C?m[e].p($,T):(re(),I(m[C],1,1,()=>{m[C]=null}),ae(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),A(t,1),t.m(i.parentNode,i));const D={};l.$set(D);const O={};o.$set(O);const E={};T[0]&4&&(E.collection=$[2]),a.$set(E);const L={};T[0]&4&&(L.collection=$[2]),f.$set(L)},i($){c||(A(t),A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(f.$$.fragment,$),c=!0)},o($){I(t),I(l.$$.fragment,$),I(o.$$.fragment,$),I(a.$$.fragment,$),I(f.$$.fragment,$),c=!1},d($){$&&(v(i),v(s),v(r),v(u)),m[e].d($),n[31](null),V(l,$),n[32](null),V(o,$),n[33](null),V(a,$),n[37](null),V(f,$)}}}function S8(n,e,t){let i,l,s,o,r,a,u;We(n,li,Ce=>t(2,l=Ce)),We(n,Et,Ce=>t(39,s=Ce)),We(n,Co,Ce=>t(3,o=Ce)),We(n,Uo,Ce=>t(16,r=Ce)),We(n,zn,Ce=>t(11,a=Ce)),We(n,Ml,Ce=>t(12,u=Ce));const f=new URLSearchParams(r);let c,d,m,g,h,_,k=f.get("filter")||"",S=f.get("sort")||"-created",$=f.get("collectionId")||(l==null?void 0:l.id),T=0;cv($);async function C(Ce){await Qt(),(l==null?void 0:l.type)==="view"?g.show(Ce):m==null||m.show(Ce)}function D(){t(14,$=l==null?void 0:l.id),t(0,k=""),t(1,S="-created"),E({recordId:null}),O()}async function O(){if(!S)return;const Ce=j.getAllCollectionIdentifiers(l),De=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);De.filter(ze=>Ce.includes(ze)).length!=De.length&&(Ce.includes("created")?t(1,S="-created"):t(1,S=""))}function E(Ce={}){const De=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:k,sort:S},Ce);j.replaceHashQueryParams(De)}const L=()=>c==null?void 0:c.show();function R(Ce){te[Ce?"unshift":"push"](()=>{_=Ce,t(9,_)})}function P(Ce){T=Ce,t(10,T)}const F=()=>c==null?void 0:c.show(l),N=()=>{h==null||h.load(),_==null||_.reload()},q=()=>d==null?void 0:d.show(l),W=()=>m==null?void 0:m.show(),G=Ce=>t(0,k=Ce.detail);function J(Ce){te[Ce?"unshift":"push"](()=>{h=Ce,t(8,h)})}function H(Ce){k=Ce,t(0,k)}function U(Ce){S=Ce,t(1,S)}const le=Ce=>{E({recordId:Ce.detail.id});let De=Ce.detail._partial?Ce.detail.id:Ce.detail;l.type==="view"?g==null||g.show(De):m==null||m.show(De)},ee=()=>{_==null||_.reload()},oe=()=>m==null?void 0:m.show();function Te(Ce){te[Ce?"unshift":"push"](()=>{c=Ce,t(4,c)})}function je(Ce){te[Ce?"unshift":"push"](()=>{d=Ce,t(5,d)})}function Ve(Ce){te[Ce?"unshift":"push"](()=>{m=Ce,t(6,m)})}const Qe=()=>{E({recordId:null})},tt=Ce=>{k?_==null||_.reload():Ce.detail.isNew&&t(10,T++,T),h==null||h.reloadLoadedPages()},Ge=Ce=>{(!k||h!=null&&h.hasRecord(Ce.detail.id))&&t(10,T--,T),h==null||h.reloadLoadedPages()};function Mt(Ce){te[Ce?"unshift":"push"](()=>{g=Ce,t(7,g)})}const Pt=()=>{E({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")!=$&&av(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&$!=l.id&&D(),n.$$.dirty[0]&4&&l!=null&&l.id&&O(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&C(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||k||l!=null&&l.id)&&E(),n.$$.dirty[0]&4&&tn(Et,s=(l==null?void 0:l.name)||"Collections",s)},[k,S,l,o,c,d,m,g,h,_,T,a,u,E,$,i,r,L,R,P,F,N,q,W,G,J,H,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt]}class T8 extends be{constructor(e){super(),_e(this,e,S8,w8,me,{},null,[-1,-1])}}function $8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;return{c(){e=b("div"),t=b("div"),t.textContent="System",i=M(),l=b("a"),l.innerHTML=' Application',s=M(),o=b("a"),o.innerHTML=' Mail settings',r=M(),a=b("a"),a.innerHTML=' Files storage',u=M(),f=b("a"),f.innerHTML=' Backups',c=M(),d=b("div"),d.innerHTML='Sync',m=M(),g=b("a"),g.innerHTML=' Export collections',h=M(),_=b("a"),_.innerHTML=' Import collections',k=M(),S=b("div"),S.textContent="Authentication",$=M(),T=b("a"),T.innerHTML=' Auth providers',C=M(),D=b("a"),D.innerHTML=' Token options',O=M(),E=b("a"),E.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(d,"class","sidebar-title"),p(g,"href","/settings/export-collections"),p(g,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(S,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(D,"href","/settings/tokens"),p(D,"class","sidebar-list-item"),p(E,"href","/settings/admins"),p(E,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(P,F){w(P,e,F),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),y(e,r),y(e,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),y(e,h),y(e,_),y(e,k),y(e,S),y(e,$),y(e,T),y(e,C),y(e,D),y(e,O),y(e,E),L||(R=[ve(Pn.call(null,l,{path:"/settings"})),ve(ln.call(null,l)),ve(Pn.call(null,o,{path:"/settings/mail/?.*"})),ve(ln.call(null,o)),ve(Pn.call(null,a,{path:"/settings/storage/?.*"})),ve(ln.call(null,a)),ve(Pn.call(null,f,{path:"/settings/backups/?.*"})),ve(ln.call(null,f)),ve(Pn.call(null,g,{path:"/settings/export-collections/?.*"})),ve(ln.call(null,g)),ve(Pn.call(null,_,{path:"/settings/import-collections/?.*"})),ve(ln.call(null,_)),ve(Pn.call(null,T,{path:"/settings/auth-providers/?.*"})),ve(ln.call(null,T)),ve(Pn.call(null,D,{path:"/settings/tokens/?.*"})),ve(ln.call(null,D)),ve(Pn.call(null,E,{path:"/settings/admins/?.*"})),ve(ln.call(null,E))],L=!0)},p:Q,d(P){P&&v(e),L=!1,we(R)}}}function C8(n){let e,t;return e=new Wb({props:{class:"settings-sidebar",$$slots:{default:[$8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&1&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}class bi extends be{constructor(e){super(),_e(this,e,null,C8,me,{})}}function Zh(n,e,t){const i=n.slice();return i[31]=e[t],i}function Gh(n){let e,t;return e=new he({props:{class:"form-field readonly",name:"id",$$slots:{default:[M8,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function M8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return a=new Qb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",o=M(),r=b("div"),B(a.$$.fragment),u=M(),f=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=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,h){w(g,e,h),y(e,t),y(e,i),y(e,l),w(g,o,h),w(g,r,h),z(a,r,null),w(g,u,h),w(g,f,h),m=!0},p(g,h){(!m||h[0]&1073741824&&s!==(s=g[30]))&&p(e,"for",s);const _={};h[0]&2&&(_.model=g[1]),a.$set(_),(!m||h[0]&1073741824&&c!==(c=g[30]))&&p(f,"id",c),(!m||h[0]&2&&d!==(d=g[1].id)&&f.value!==d)&&(f.value=d)},i(g){m||(A(a.$$.fragment,g),m=!0)},o(g){I(a.$$.fragment,g),m=!1},d(g){g&&(v(e),v(o),v(r),v(u),v(f)),V(a)}}}function Xh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=M(),nn(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",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(u,f){w(u,e,f),y(e,t),y(e,l),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(u){u&&v(e),o=!1,r()}}}function O8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=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),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[3]),u||(f=K(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),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&&(v(e),v(o),v(r)),u=!1,f()}}}function Qh(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",$$slots:{default:[D8,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function D8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function xh(n){let e,t,i,l,s,o,r,a,u;return l=new he({props:{class:"form-field required",name:"password",$$slots:{default:[E8,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[A8,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(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),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(t,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(t,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function E8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return c=new xb({}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),u=M(),f=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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(h,_){w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,o,_),w(h,r,_),ce(r,n[9]),w(h,u,_),w(h,f,_),z(c,f,null),d=!0,m||(g=K(r,"input",n[21]),m=!0)},p(h,_){(!d||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s),(!d||_[0]&1073741824&&a!==(a=h[30]))&&p(r,"id",a),_[0]&512&&r.value!==h[9]&&ce(r,h[9])},i(h){d||(A(c.$$.fragment,h),d=!0)},o(h){I(c.$$.fragment,h),d=!1},d(h){h&&(v(e),v(o),v(r),v(u),v(f)),V(c),m=!1,g()}}}function A8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[10]),u||(f=K(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),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&&(v(e),v(o),v(r)),u=!1,f()}}}function I8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g=!n[5]&&Gh(n),h=pe([0,1,2,3,4,5,6,7,8,9]),_=[];for(let $=0;$<10;$+=1)_[$]=Xh(Zh(n,h,$));a=new he({props:{class:"form-field required",name:"email",$$slots:{default:[O8,({uniqueId:$})=>({30:$}),({uniqueId:$})=>[$?1073741824:0]]},$$scope:{ctx:n}}});let k=!n[5]&&Qh(n),S=(n[5]||n[4])&&xh(n);return{c(){e=b("form"),g&&g.c(),t=M(),i=b("div"),l=b("p"),l.textContent="Avatar",s=M(),o=b("div");for(let $=0;$<10;$+=1)_[$].c();r=M(),B(a.$$.fragment),u=M(),k&&k.c(),f=M(),S&&S.c(),p(l,"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($,T){w($,e,T),g&&g.m(e,null),y(e,t),y(e,i),y(i,l),y(i,s),y(i,o);for(let C=0;C<10;C+=1)_[C]&&_[C].m(o,null);y(e,r),z(a,e,null),y(e,u),k&&k.m(e,null),y(e,f),S&&S.m(e,null),c=!0,d||(m=K(e,"submit",Ye(n[13])),d=!0)},p($,T){if($[5]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p($,T),T[0]&32&&A(g,1)):(g=Gh($),g.c(),A(g,1),g.m(e,t)),T[0]&4){h=pe([0,1,2,3,4,5,6,7,8,9]);let D;for(D=0;D<10;D+=1){const O=Zh($,h,D);_[D]?_[D].p(O,T):(_[D]=Xh(O),_[D].c(),_[D].m(o,null))}for(;D<10;D+=1)_[D].d(1)}const C={};T[0]&1073741832|T[1]&8&&(C.$$scope={dirty:T,ctx:$}),a.$set(C),$[5]?k&&(re(),I(k,1,1,()=>{k=null}),ae()):k?(k.p($,T),T[0]&32&&A(k,1)):(k=Qh($),k.c(),A(k,1),k.m(e,f)),$[5]||$[4]?S?(S.p($,T),T[0]&48&&A(S,1)):(S=xh($),S.c(),A(S,1),S.m(e,null)):S&&(re(),I(S,1,1,()=>{S=null}),ae())},i($){c||(A(g),A(a.$$.fragment,$),A(k),A(S),c=!0)},o($){I(g),I(a.$$.fragment,$),I(k),I(S),c=!1},d($){$&&v(e),g&&g.d(),at(_,$),V(a),k&&k.d(),S&&S.d(),d=!1,m()}}}function L8(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=Y(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&se(i,t)},d(l){l&&v(e)}}}function eg(n){let e,t,i,l,s,o,r,a,u;return o=new En({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[P8]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("span"),i=M(),l=b("i"),s=M(),B(o.$$.fragment),r=M(),a=b("div"),p(l,"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),y(e,t),y(e,i),y(e,l),y(e,s),z(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&&(v(e),v(r),v(a)),V(o)}}}function P8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function F8(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,m=!n[5]&&eg(n);return{c(){m&&m.c(),e=M(),t=b("button"),i=b("span"),i.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=Y(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=u=!n[11]||n[7],x(s,"btn-loading",n[7])},m(g,h){m&&m.m(g,h),w(g,e,h),w(g,t,h),y(t,i),w(g,l,h),w(g,s,h),y(s,o),y(o,a),f=!0,c||(d=K(t,"click",n[17]),c=!0)},p(g,h){g[5]?m&&(re(),I(m,1,1,()=>{m=null}),ae()):m?(m.p(g,h),h[0]&32&&A(m,1)):(m=eg(g),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||h[0]&128)&&(t.disabled=g[7]),(!f||h[0]&32)&&r!==(r=g[5]?"Create":"Save changes")&&se(a,r),(!f||h[0]&2176&&u!==(u=!g[11]||g[7]))&&(s.disabled=u),(!f||h[0]&128)&&x(s,"btn-loading",g[7])},i(g){f||(A(m),f=!0)},o(g){I(m),f=!1},d(g){g&&(v(e),v(t),v(l),v(s)),m&&m.d(g),c=!1,d()}}}function N8(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[F8],header:[L8],default:[I8]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function R8(n,e,t){let i,l;const s=rt(),o="admin_"+j.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",m="",g="",h=!1;function _(J){return S(J),t(8,f=!0),r==null?void 0:r.show()}function k(){return r==null?void 0:r.hide()}function S(J){t(1,a=structuredClone(J||{})),$()}function $(){t(4,h=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,g=""),Gt({})}function T(){if(u||!l)return;t(7,u=!0);const J={email:d,avatar:c};(i||h)&&(J.password=m,J.passwordConfirm=g);let H;i?H=ue.admins.create(J):H=ue.admins.update(a.id,J),H.then(async U=>{var le;t(8,f=!1),k(),It(i?"Successfully created admin.":"Successfully updated admin."),((le=ue.authStore.model)==null?void 0:le.id)===U.id&&ue.authStore.save(ue.authStore.token,U),s("save",U)}).catch(U=>{ue.error(U)}).finally(()=>{t(7,u=!1)})}function C(){a!=null&&a.id&&an("Do you really want to delete the selected admin?",()=>ue.admins.delete(a.id).then(()=>{t(8,f=!1),k(),It("Successfully deleted admin."),s("delete",a)}).catch(J=>{ue.error(J)}))}const D=()=>C(),O=()=>k(),E=J=>t(2,c=J);function L(){d=this.value,t(3,d)}function R(){h=this.checked,t(4,h)}function P(){m=this.value,t(9,m)}function F(){g=this.value,t(10,g)}const N=()=>l&&f?(an("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),k()}),!1):!0;function q(J){te[J?"unshift":"push"](()=>{r=J,t(6,r)})}function W(J){Ee.call(this,n,J)}function G(J){Ee.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||h||d!==a.email||c!==a.avatar)},[k,a,c,d,h,i,r,u,f,m,g,l,o,T,C,_,D,O,E,L,R,P,F,N,q,W,G]}class q8 extends be{constructor(e){super(),_e(this,e,R8,N8,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function tg(n,e,t){const i=n.slice();return i[24]=e[t],i}function j8(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function H8(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function z8(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function V8(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ng(n){let e;function t(s,o){return s[5]?U8:B8}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function B8(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&ig(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),o&&o.m(t,null),y(e,s)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=ig(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function U8(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ig(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function lg(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sg(n,e){let t,i,l,s,o,r,a,u,f,c,d,m=e[24].id+"",g,h,_,k,S,$=e[24].email+"",T,C,D,O,E,L,R,P,F,N,q,W,G,J;f=new rl({props:{value:e[24].id}});let H=e[24].id===e[7].id&&lg();E=new nl({props:{date:e[24].created}}),P=new nl({props:{date:e[24].updated}});function U(){return e[15](e[24])}function le(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=M(),a=b("td"),u=b("div"),B(f.$$.fragment),c=M(),d=b("span"),g=Y(m),h=M(),H&&H.c(),_=M(),k=b("td"),S=b("span"),T=Y($),D=M(),O=b("td"),B(E.$$.fragment),L=M(),R=b("td"),B(P.$$.fragment),F=M(),N=b("td"),N.innerHTML='',q=M(),nn(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"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",C=e[24].email),p(k,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(N,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,oe){w(ee,t,oe),y(t,i),y(i,l),y(l,s),y(t,r),y(t,a),y(a,u),z(f,u,null),y(u,c),y(u,d),y(d,g),y(a,h),H&&H.m(a,null),y(t,_),y(t,k),y(k,S),y(S,T),y(t,D),y(t,O),z(E,O,null),y(t,L),y(t,R),z(P,R,null),y(t,F),y(t,N),y(t,q),W=!0,G||(J=[K(t,"click",U),K(t,"keydown",le)],G=!0)},p(ee,oe){e=ee,(!W||oe&16&&!nn(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Te={};oe&16&&(Te.value=e[24].id),f.$set(Te),(!W||oe&16)&&m!==(m=e[24].id+"")&&se(g,m),e[24].id===e[7].id?H||(H=lg(),H.c(),H.m(a,null)):H&&(H.d(1),H=null),(!W||oe&16)&&$!==($=e[24].email+"")&&se(T,$),(!W||oe&16&&C!==(C=e[24].email))&&p(S,"title",C);const je={};oe&16&&(je.date=e[24].created),E.$set(je);const Ve={};oe&16&&(Ve.date=e[24].updated),P.$set(Ve)},i(ee){W||(A(f.$$.fragment,ee),A(E.$$.fragment,ee),A(P.$$.fragment,ee),W=!0)},o(ee){I(f.$$.fragment,ee),I(E.$$.fragment,ee),I(P.$$.fragment,ee),W=!1},d(ee){ee&&v(t),V(f),H&&H.d(),V(E),V(P),G=!1,we(J)}}}function W8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C=[],D=new Map,O;function E(U){n[11](U)}let L={class:"col-type-text",name:"id",$$slots:{default:[j8]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Tn({props:L}),te.push(()=>ge(o,"sort",E));function R(U){n[12](U)}let P={class:"col-type-email col-field-email",name:"email",$$slots:{default:[H8]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),u=new Tn({props:P}),te.push(()=>ge(u,"sort",R));function F(U){n[13](U)}let N={class:"col-type-date col-field-created",name:"created",$$slots:{default:[z8]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),d=new Tn({props:N}),te.push(()=>ge(d,"sort",F));function q(U){n[14](U)}let W={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[V8]},$$scope:{ctx:n}};n[2]!==void 0&&(W.sort=n[2]),h=new Tn({props:W}),te.push(()=>ge(h,"sort",q));let G=pe(n[4]);const J=U=>U[24].id;for(let U=0;Ur=!1)),o.$set(ee);const oe={};le&134217728&&(oe.$$scope={dirty:le,ctx:U}),!f&&le&4&&(f=!0,oe.sort=U[2],ye(()=>f=!1)),u.$set(oe);const Te={};le&134217728&&(Te.$$scope={dirty:le,ctx:U}),!m&&le&4&&(m=!0,Te.sort=U[2],ye(()=>m=!1)),d.$set(Te);const je={};le&134217728&&(je.$$scope={dirty:le,ctx:U}),!_&&le&4&&(_=!0,je.sort=U[2],ye(()=>_=!1)),h.$set(je),le&186&&(G=pe(U[4]),re(),C=dt(C,le,J,1,U,G,D,T,Lt,sg,null,tg),ae(),!G.length&&H?H.p(U,le):G.length?H&&(H.d(1),H=null):(H=ng(U),H.c(),H.m(T,null))),(!O||le&32)&&x(e,"table-loading",U[5])},i(U){if(!O){A(o.$$.fragment,U),A(u.$$.fragment,U),A(d.$$.fragment,U),A(h.$$.fragment,U);for(let le=0;le New admin',g=M(),B(h.$$.fragment),_=M(),k=b("div"),S=M(),B($.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(k,"class","clearfix m-b-base")},m(O,E){w(O,e,E),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(e,r),z(a,e,null),y(e,u),y(e,f),y(e,c),y(e,d),y(d,m),w(O,g,E),z(h,O,E),w(O,_,E),w(O,k,E),w(O,S,E),z($,O,E),T=!0,C||(D=K(m,"click",n[9]),C=!0)},p(O,E){(!T||E&64)&&se(o,O[6]);const L={};E&2&&(L.value=O[1]),h.$set(L);const R={};E&134217918&&(R.$$scope={dirty:E,ctx:O}),$.$set(R)},i(O){T||(A(a.$$.fragment,O),A(h.$$.fragment,O),A($.$$.fragment,O),T=!0)},o(O){I(a.$$.fragment,O),I(h.$$.fragment,O),I($.$$.fragment,O),T=!1},d(O){O&&(v(e),v(g),v(_),v(k),v(S)),V(a),V(h,O),V($,O),C=!1,D()}}}function K8(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=Y("Total found: "),l=Y(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),y(e,t),y(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&se(l,i)},d(s){s&&v(e)}}}function J8(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{footer:[K8],default:[Y8]},$$scope:{ctx:n}}});let r={};return s=new q8({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[18](null),V(s,a)}}}function Z8(n,e,t){let i,l,s;We(n,Uo,P=>t(21,i=P)),We(n,Et,P=>t(6,l=P)),We(n,Ia,P=>t(7,s=P)),tn(Et,l="Admins",l);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 ue.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),m(),ue.error(F,(F==null?void 0:F.status)!=400))})}function m(){t(4,a=[])}const g=()=>d(),h=()=>r==null?void 0:r.show(),_=P=>t(1,f=P.detail);function k(P){c=P,t(2,c)}function S(P){c=P,t(2,c)}function $(P){c=P,t(2,c)}function T(P){c=P,t(2,c)}const C=P=>r==null?void 0:r.show(P),D=(P,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(P))},O=()=>t(1,f="");function E(P){te[P?"unshift":"push"](()=>{r=P,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const P=new URLSearchParams({filter:f,sort:c}).toString();il("/settings/admins?"+P),d()}},[d,f,c,r,a,u,l,s,g,h,_,k,S,$,T,C,D,O,E,L,R]}class G8 extends be{constructor(e){super(),_e(this,e,Z8,J8,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function X8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Email"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0]),s.focus(),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0]&&ce(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Q8(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Password"),l=M(),s=b("input"),r=M(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ce(s,n[1]),w(d,r,m),w(d,a,m),y(a,u),f||(c=[K(s,"input",n[5]),ve(ln.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&ce(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),f=!1,we(c)}}}function x8(n){let e,t,i,l,s,o,r,a,u,f,c;return l=new he({props:{class:"form-field required",name:"identity",$$slots:{default:[X8,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:"password",$$slots:{default:[Q8,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),a=b("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"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),y(e,t),y(e,i),z(l,e,null),y(e,s),z(o,e,null),y(e,r),y(e,a),u=!0,f||(c=K(e,"submit",Ye(n[3])),f=!0)},p(d,m){const g={};m&769&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const h={};m&770&&(h.$$scope={dirty:m,ctx:d}),o.$set(h),(!u||m&4)&&x(a,"btn-disabled",d[2]),(!u||m&4)&&x(a,"btn-loading",d[2])},i(d){u||(A(l.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(l.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&v(e),V(l),V(o),f=!1,c()}}}function eA(n){let e,t;return e=new Z1({props:{$$slots:{default:[x8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function tA(n,e,t){let i;We(n,Uo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ue.admins.authWithPassword(s,o).then(()=>{Ea(),il("/")}).catch(()=>{hi("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){s=this.value,t(0,s)}function f(){o=this.value,t(1,o)}return[s,o,r,a,u,f]}class nA extends be{constructor(e){super(),_e(this,e,tA,eA,me,{})}}function iA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$;i=new he({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[sA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[oA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new he({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[rA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let T=n[3]&&og(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("div"),c=b("div"),d=M(),T&&T.c(),m=M(),g=b("button"),h=b("span"),h.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(h,"class","txt"),p(g,"type","submit"),p(g,"class","btn btn-expanded"),g.disabled=_=!n[3]||n[2],x(g,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,D){w(C,e,D),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),z(a,e,null),y(e,u),y(e,f),y(f,c),y(f,d),T&&T.m(f,null),y(f,m),y(f,g),y(g,h),k=!0,S||($=K(g,"click",n[12]),S=!0)},p(C,D){const O={};D&786433&&(O.$$scope={dirty:D,ctx:C}),i.$set(O);const E={};D&786433&&(E.$$scope={dirty:D,ctx:C}),o.$set(E);const L={};D&786433&&(L.$$scope={dirty:D,ctx:C}),a.$set(L),C[3]?T?T.p(C,D):(T=og(C),T.c(),T.m(f,m)):T&&(T.d(1),T=null),(!k||D&12&&_!==(_=!C[3]||C[2]))&&(g.disabled=_),(!k||D&4)&&x(g,"btn-loading",C[2])},i(C){k||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),k=!0)},o(C){I(i.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),k=!1},d(C){C&&v(e),V(i),V(o),V(a),T&&T.d(),S=!1,$()}}}function lA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function sA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Application name"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].meta.appName),r||(a=K(s,"input",n[8]),r=!0)},p(u,f){f&262144&&i!==(i=u[18])&&p(e,"for",i),f&262144&&o!==(o=u[18])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appName&&ce(s,u[0].meta.appName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function oA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Application URL"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].meta.appUrl),r||(a=K(s,"input",n[9]),r=!0)},p(u,f){f&262144&&i!==(i=u[18])&&p(e,"for",i),f&262144&&o!==(o=u[18])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appUrl&&ce(s,u[0].meta.appUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function rA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[10]),ve(Fe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function og(n){let e,t,i,l;return{c(){e=b("button"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function aA(n){let e,t,i,l,s,o,r,a,u;const f=[lA,iA],c=[];function d(m,g){return m[1]?0:1}return s=d(n),o=c[s]=f[s](n),{c(){e=b("header"),e.innerHTML='',t=M(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,g){w(m,e,g),w(m,t,g),w(m,i,g),y(i,l),c[s].m(l,null),r=!0,a||(u=K(l,"submit",Ye(n[4])),a=!0)},p(m,g){let h=s;s=d(m),s===h?c[s].p(m,g):(re(),I(c[h],1,1,()=>{c[h]=null}),ae(),o=c[s],o?o.p(m,g):(o=c[s]=f[s](m),o.c()),A(o,1),o.m(l,null))},i(m){r||(A(o),r=!0)},o(m){I(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,u()}}}function uA(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[aA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function fA(n,e,t){let i,l,s,o;We(n,Ml,C=>t(13,l=C)),We(n,Oo,C=>t(14,s=C)),We(n,Et,C=>t(15,o=C)),tn(Et,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await ue.settings.getAll()||{};g(C)}catch(C){ue.error(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await ue.settings.update(j.filterRedactedProps(a));g(C),It("Successfully saved application settings.")}catch(C){ue.error(C)}t(2,f=!1)}}function g(C={}){var D,O;tn(Oo,s=(D=C==null?void 0:C.meta)==null?void 0:D.appName,s),tn(Ml,l=!!((O=C==null?void 0:C.meta)!=null&&O.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>h(),T=()=>m();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,m,h,r,c,_,k,S,$,T]}class cA extends be{constructor(e){super(),_e(this,e,fA,uA,me,{})}}function dA(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=M(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),l.autofocus&&l.focus(),s||(o=[ve(Fe.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],s=!0)},p(u,f){ni(l,a=pt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(v(e),v(i),v(l)),s=!1,we(o)}}}function mA(n){let e;function t(s,o){return s[3]?pA:dA}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function hA(n,e,t){const i=["value","mask"];let l=Ze(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,s=""),t(3,a=!1),await Qt(),r==null||r.focus()}const f=()=>u();function c(m){te[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Pe(Pe({},e),Kt(m)),t(5,l=Ze(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,u,l,f,c,d]}class nu extends be{constructor(e){super(),_e(this,e,hA,mA,me,{value:0,mask:1})}}function gA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;return{c(){e=b("label"),t=Y("Subject"),l=M(),s=b("input"),r=M(),a=b("div"),u=Y(`Available placeholder parameters: + `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[55]),s[0]&60925|s[2]&2048&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[56](null),V(e,l)}}}const el="form",ks="providers";function dE(n,e,t){let i,l,s,o,r;const a=rt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d={},m={},g=null,h=!1,_=!1,k={},S={},$=JSON.stringify(d),T=$,C=el,D=!0,O=!0;function E(ce){return F(ce),t(12,_=!0),t(13,C=el),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function R(){t(12,_=!1),L()}async function P(ce){if(ce&&typeof ce=="string"){try{return await fe.collection(f.id).getOne(ce)}catch(Me){Me.isAbort||(R(),console.warn("resolveModel:",Me),hi(`Unable to load record with id "${ce}"`))}return null}return ce}async function F(ce){t(7,O=!0),Gt({}),t(4,k={}),t(5,S={}),t(2,d=typeof ce=="string"?{id:ce,collectionId:f==null?void 0:f.id,collectionName:f==null?void 0:f.name}:ce||{}),t(3,m=structuredClone(d)),t(2,d=await P(ce)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,g=W()),!g||H(m,g)?t(10,g=null):(delete g.password,delete g.passwordConfirm),t(28,$=JSON.stringify(m)),t(7,O=!1)}async function N(ce){var Xe,Jt;Gt({}),t(2,d=ce||{}),t(4,k={}),t(5,S={});const Me=((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 ce)Me.includes(nt)||t(3,m[nt]=ce[nt],m);await Qt(),t(28,$=JSON.stringify(m)),U()}function q(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function W(ce){try{const Me=window.localStorage.getItem(q());if(Me)return JSON.parse(Me)}catch{}return ce}function G(ce){try{window.localStorage.setItem(q(),ce)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(q())}}function J(){g&&(t(3,m=g),t(10,g=null))}function H(ce,Me){var Bn;const Xe=structuredClone(ce||{}),Jt=structuredClone(Me||{}),nt=(Bn=f==null?void 0:f.schema)==null?void 0:Bn.filter(oi=>oi.type==="file");for(let oi of nt)delete Xe[oi.name],delete Jt[oi.name];const en=["expand","password","passwordConfirm"];for(let oi of en)delete Xe[oi],delete Jt[oi];return JSON.stringify(Xe)==JSON.stringify(Jt)}function U(){t(10,g=null),window.localStorage.removeItem(q())}async function le(ce=!0){if(!(h||!r||!(f!=null&&f.id))){t(11,h=!0);try{const Me=oe();let Xe;D?Xe=await fe.collection(f.id).create(Me):Xe=await fe.collection(f.id).update(m.id,Me),It(D?"Successfully created record.":"Successfully updated record."),U(),ce?R():N(Xe),a("save",{isNew:D,record:Xe})}catch(Me){fe.error(Me)}t(11,h=!1)}}function ee(){d!=null&&d.id&&an("Do you really want to delete the selected record?",()=>fe.collection(d.collectionId).delete(d.id).then(()=>{L(),It("Successfully deleted record."),a("delete",d)}).catch(ce=>{fe.error(ce)}))}function oe(){const ce=structuredClone(m||{}),Me=new FormData,Xe={id:ce.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 ce)if(Xe[nt]){if(typeof ce[nt]>"u"&&(ce[nt]=null),Jt[nt]&&ce[nt]!=="")try{JSON.parse(ce[nt])}catch(en){const Bn={};throw Bn[nt]={code:"invalid_json",message:en.toString()},new qn({status:400,response:{data:Bn}})}j.addValueToFormData(Me,nt,ce[nt])}for(const nt in k){const en=j.toArray(k[nt]);for(const Bn of en)Me.append(nt,Bn)}for(const nt in S){const en=j.toArray(S[nt]);for(const Bn of en)Me.append(nt+"."+Bn,"")}return Me}function Te(){!(f!=null&&f.id)||!(d!=null&&d.email)||an(`Do you really want to sent verification email to ${d.email}?`,()=>fe.collection(f.id).requestVerification(d.email).then(()=>{It(`Successfully sent verification email to ${d.email}.`)}).catch(ce=>{fe.error(ce)}))}function je(){!(f!=null&&f.id)||!(d!=null&&d.email)||an(`Do you really want to sent password reset email to ${d.email}?`,()=>fe.collection(f.id).requestPasswordReset(d.email).then(()=>{It(`Successfully sent password reset email to ${d.email}.`)}).catch(ce=>{fe.error(ce)}))}function Ve(){o?an("You have unsaved changes. Do you really want to discard them?",()=>{Qe()}):Qe()}async function Qe(){let ce=d?structuredClone(d):null;if(ce){ce.id="",ce.created="",ce.updated="";const Me=(f==null?void 0:f.schema)||[];for(const Xe of Me)Xe.type==="file"&&delete ce[Xe.name]}U(),E(ce),await Qt(),t(28,$="")}function tt(ce){(ce.ctrlKey||ce.metaKey)&&ce.code=="KeyS"&&(ce.preventDefault(),ce.stopPropagation(),le(!1))}const Ge=()=>L(),Mt=()=>Te(),Pt=()=>je(),Ce=()=>Ve(),De=()=>ee(),ze=()=>t(13,C=el),_t=()=>t(13,C=ks),ne=()=>J(),Ne=()=>U();function Se(){m.id=this.value,t(3,m)}function mt(ce){m=ce,t(3,m)}function Bt(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function cn(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function on(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function Vn(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function Ni(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function al(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function yi(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function Ae(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function Ft(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function Ri(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}function Gn(ce,Me){n.$$.not_equal(k[Me.name],ce)&&(k[Me.name]=ce,t(4,k))}function ul(ce,Me){n.$$.not_equal(S[Me.name],ce)&&(S[Me.name]=ce,t(5,S))}function Nl(ce,Me){n.$$.not_equal(m[Me.name],ce)&&(m[Me.name]=ce,t(3,m))}const ki=()=>o&&_?(an("You have unsaved changes. Do you really want to close the panel?",()=>{R()}),!1):(Gt({}),U(),!0);function fl(ce){te[ce?"unshift":"push"](()=>{c=ce,t(9,c)})}function cl(ce){Ee.call(this,n,ce)}function bt(ce){Ee.call(this,n,ce)}return n.$$set=ce=>{"collection"in ce&&t(0,f=ce.collection)},n.$$.update=()=>{var ce;n.$$.dirty[0]&1&&t(14,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((ce=f==null?void 0:f.schema)!=null&&ce.find(Me=>Me.type==="editor"))),n.$$.dirty[0]&48&&t(30,s=j.hasNonEmptyProps(k)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,T=JSON.stringify(m)),n.$$.dirty[0]&1879048192&&t(8,o=s||$!=T),n.$$.dirty[0]&4&&t(6,D=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!O&&(D||o)),n.$$.dirty[0]&536871040&&(O||G(T))},[f,L,d,m,k,S,D,O,o,c,g,h,_,C,i,r,l,u,R,J,U,le,ee,Te,je,Ve,tt,E,$,T,s,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne,Se,mt,Bt,cn,on,Vn,Ni,al,yi,Ae,Ft,Ri,Gn,ul,Nl,ki,fl,cl,bt]}class nu extends _e{constructor(e){super(),ge(this,e,dE,cE,he,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function pE(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=Y(n[2]),l=M(),s=b("div"),o=Y(n[1]),r=Y(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),y(e,t),y(t,i),y(e,l),y(e,s),y(s,o),y(s,r),a||(u=ve(Pe.call(null,e,n[3])),a=!0)},p(f,c){c&4&&se(i,f[2]),c&2&&se(o,f[1])},d(f){f&&v(e),a=!1,u()}}}function hE(n){let e;function t(s,o){return s[0]?mE:pE}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function gE(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class nl extends _e{constructor(e){super(),ge(this,e,gE,hE,he,{date:0})}}function lh(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function sh(n,e,t){const i=n.slice();return i[13]=e[t],i}function oh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function rh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function _E(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 bE(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function yE(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function kE(n){let e,t;return{c(){e=b("div"),t=Y(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function vE(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),y(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&se(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function wE(n){let e,t=[],i=new Map,l,s,o=pe(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;un[17]&&uh();return{c(){var u;e=b("div");for(let f=0;fu[17]?a||(a=uh(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&x(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!s){for(let f=0;fn[11]&&dh();return{c(){e=b("div"),i.c(),l=M(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),y(e,l),u&&u.m(e,null),s=!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,l)),f[9].length>f[11]?u||(u=dh(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(A(i),s=!0)},o(f){I(i),s=!1},d(f){f&&v(e),r[t].d(),u&&u.d()}}}function TE(n){let e,t=[],i=new Map,l=pe(j.toArray(n[3]));const s=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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function ME(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=Y(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),y(e,i),l||(s=[ve(Pe.call(null,e,"Open in new tab")),K(e,"click",fn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,we(s)}}}function OE(n){let e,t;return{c(){e=b("span"),t=Y(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function DE(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function EE(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function AE(n){let e,t,i,l;const s=[RE,NE],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!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]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function ah(n,e){let t,i,l;return i=new eu({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function uh(n){let e;return{c(){e=Y("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function IE(n){let e,t=pe(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&mh(n);return{c(){e=b("span"),i=Y(t),l=M(),r&&r.c(),s=ke(),p(e,"class","txt")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),r&&r.m(a,u),w(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=mh(a),r.c(),A(r,1),r.m(s.parentNode,s)):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&&(v(e),v(l),v(s)),r&&r.d(a)}}}function RE(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function mh(n){let e,t;return e=new rl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},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,l,s;const o=[AE,EE,DE,OE,ME,CE,$E,TE,SE,wE,vE,kE],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?yE(f):c===8?bE(f):c===9?_E(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ke()},m(f,c){r[t].m(f,c),w(f,l,c),s=!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(l.parentNode,l))},i(f){s||(A(i),s=!0)},o(f){I(i),s=!1},d(f){f&&v(l),r[t].d(f)}}}function jE(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Ee.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class t0 extends _e{constructor(e){super(),ge(this,e,jE,qE,he,{record:0,field:1,short:2})}}function hh(n,e,t){const i=n.slice();return i[13]=e[t],i}function gh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new t0({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=Y(i),s=M(),o=b("td"),B(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),y(e,t),y(t,l),y(e,s),y(e,o),z(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&se(l,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&&v(e),V(r)}}}function _h(n){let e,t,i,l,s,o;return s=new nl({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),z(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),s.$set(u)},i(r){o||(A(s.$$.fragment,r),o=!0)},o(r){I(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function bh(n){let e,t,i,l,s,o;return s=new nl({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),z(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),s.$set(u)},i(r){o||(A(s.$$.fragment,r),o=!0)},o(r){I(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function HE(n){var D;let e,t,i,l,s,o,r,a,u,f,c=(n[3].id||"...")+"",d,m,g,h,_;a=new rl({props:{value:n[3].id}});let k=pe((D=n[0])==null?void 0:D.schema),S=[];for(let O=0;OI(S[O],1,1,()=>{S[O]=null});let T=n[3].created&&_h(n),C=n[3].updated&&bh(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),u=M(),f=b("span"),d=Y(c),m=M();for(let O=0;O{T=null}),ae()),O[3].updated?C?(C.p(O,E),E&8&&A(C,1)):(C=bh(O),C.c(),A(C,1),C.m(t,null)):C&&(re(),I(C,1,1,()=>{C=null}),ae()),(!_||E&16)&&x(e,"table-loading",O[4])},i(O){if(!_){A(a.$$.fragment,O);for(let E=0;EClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function BE(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[VE],header:[zE],default:[HE]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[8](null),V(e,l)}}}function UE(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(_){return f(_),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.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 fe.collection(l.id).getOne(_)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),hi(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function m(_){te[_?"unshift":"push"](()=>{s=_,t(2,s)})}function g(_){Ee.call(this,n,_)}function h(_){Ee.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,l=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=l==null?void 0:l.schema)!=null&&_.find(k=>k.type==="editor")))},[l,u,s,o,r,i,a,d,m,g,h]}class WE extends _e{constructor(e){super(),ge(this,e,UE,BE,he,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function yh(n,e,t){const i=n.slice();return i[63]=e[t],i}function kh(n,e,t){const i=n.slice();return i[66]=e[t],i}function vh(n,e,t){const i=n.slice();return i[66]=e[t],i}function wh(n,e,t){const i=n.slice();return i[59]=e[t],i}function Sh(n){let e;function t(s,o){return s[13]?KE:YE}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function YE(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),o||(r=K(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&&v(e),o=!1,r()}}}function KE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Th(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[JE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 JE(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $h(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&Ch(n),r=i&&Mh(n);return{c(){o&&o.c(),t=M(),r&&r.c(),l=ke()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,l,u),s=!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=Ch(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=Mh(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){s||(A(o),A(r),s=!0)},o(a){I(o),I(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function Ch(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[ZE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 ZE(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Mh(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[GE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function XE(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=M(),s=b("span"),r=Y(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),y(s,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+"")&&se(r,o)},d(a){a&&v(e)}}}function Oh(n,e){let t,i,l,s;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:[XE]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Tn({props:r}),te.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u[0]&1&&(l=!0,f.sort=e[0],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Dh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[QE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 QE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Eh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[xE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>be(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 xE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ah(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e),n[39](null)}}}function Ih(n){let e;function t(s,o){return s[13]?t8:e8}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function e8(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return i8;if(!a[10])return n8}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=M(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),r&&r.m(t,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function t8(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function n8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function i8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Lh(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=M(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=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,m){w(d,e,m),y(e,t),y(t,i),y(t,o),y(t,r),u||(f=[K(i,"change",c),K(t,"click",fn(n[30]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),u=!1,we(f)}}}function Ph(n){let e,t,i,l,s,o,r=n[63].id+"",a,u,f;l=new rl({props:{value:n[63].id}});let c=n[9]&&Fh(n);return{c(){e=b("td"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),a=Y(r),u=M(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),y(e,t),y(t,i),z(l,i,null),y(i,s),y(i,o),y(o,a),y(t,u),c&&c.m(t,null),f=!0},p(d,m){const g={};m[0]&8&&(g.value=d[63].id),l.$set(g),(!f||m[0]&8)&&r!==(r=d[63].id+"")&&se(a,r),d[9]?c?c.p(d,m):(c=Fh(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(l.$$.fragment,d),f=!0)},o(d){I(l.$$.fragment,d),f=!1},d(d){d&&v(e),V(l),c&&c.d()}}}function Fh(n){let e;function t(s,o){return s[63].verified?s8:l8}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function l8(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=ve(Pe.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function s8(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=ve(Pe.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function Nh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Rh(n),o=i&&qh(n);return{c(){s&&s.c(),t=M(),o&&o.c(),l=ke()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Rh(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=qh(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Rh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?r8:o8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function o8(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),y(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&se(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function r8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?u8:a8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function a8(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),y(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&se(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function u8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function jh(n,e){let t,i,l,s;return i=new t0({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),B(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),s=!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),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(A(i.$$.fragment,o),s=!0)},o(o){I(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function Hh(n){let e,t,i;return t=new nl({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function zh(n){let e,t,i;return t=new nl({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Vh(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,g,h,_,k,S=!e[10]&&Lh(e),$=l&&Ph(e),T=e[9]&&Nh(e),C=pe(e[19]);const D=P=>P[66].name;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),y(t,i),$&&$.m(t,null),y(t,s),T&&T.m(t,null),y(t,o);for(let N=0;N{$=null}),ae()),e[9]?T?T.p(e,F):(T=Nh(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),F[0]&524296&&(C=pe(e[19]),re(),r=dt(r,F,D,1,e,C,a,t,Lt,jh,u,kh),ae()),F[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?O?(O.p(e,F),F[0]&288&&A(O,1)):(O=Hh(e),O.c(),A(O,1),O.m(t,c)):O&&(re(),I(O,1,1,()=>{O=null}),ae()),F[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?E?(E.p(e,F),F[0]&160&&A(E,1)):(E=zh(e),E.c(),A(E,1),E.m(t,m)):E&&(re(),I(E,1,1,()=>{E=null}),ae())},i(P){if(!h){A($);for(let F=0;FH[66].name;for(let H=0;HH[10]?H[63]:H[63].id;for(let H=0;H{O=null}),ae()),H[9]?E?(E.p(H,U),U[0]&512&&A(E,1)):(E=$h(H),E.c(),A(E,1),E.m(i,r)):E&&(re(),I(E,1,1,()=>{E=null}),ae()),U[0]&524289&&(L=pe(H[19]),re(),a=dt(a,U,R,1,H,L,u,i,Lt,Oh,f,vh),ae()),U[0]&288&&(c=H[8]&&!H[5].includes("@created")),c?P?(P.p(H,U),U[0]&288&&A(P,1)):(P=Dh(H),P.c(),A(P,1),P.m(i,d)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),U[0]&160&&(m=H[7]&&!H[5].includes("@updated")),m?F?(F.p(H,U),U[0]&160&&A(F,1)):(F=Eh(H),F.c(),A(F,1),F.m(i,g)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),H[16].length?N?N.p(H,U):(N=Ah(H),N.c(),N.m(h,null)):N&&(N.d(1),N=null),U[0]&9971642&&(q=pe(H[3]),re(),S=dt(S,U,W,1,H,q,$,k,Lt,Vh,T,yh),ae(),!q.length&&G?G.p(H,U):q.length?G&&(G.d(1),G=null):(G=Ih(H),G.c(),G.m(k,T))),H[3].length&&H[18]?J?J.p(H,U):(J=Bh(H),J.c(),J.m(k,null)):J&&(J.d(1),J=null),(!C||U[0]&8192)&&x(e,"table-loading",H[13])},i(H){if(!C){A(O),A(E);for(let U=0;U({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function d8(n){let e,t,i=[],l=new Map,s,o,r=pe(n[16]);const a=u=>u[59].id+u[59].name;for(let u=0;u{i=null}),ae())},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Yh(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,g,h,_,k,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[6]),o=M(),a=Y(r),u=M(),f=b("button"),f.innerHTML='Reset',c=M(),d=b("div"),m=M(),g=b("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"),x(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-transparent btn-danger"),x(g,"btn-loading",n[14]),x(g,"btn-disabled",n[14]),p(e,"class","bulkbar")},m($,T){w($,e,T),y(e,t),y(t,i),y(t,l),y(l,s),y(t,o),y(t,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),_=!0,k||(S=[K(f,"click",n[47]),K(g,"click",n[48])],k=!0)},p($,T){(!_||T[0]&64)&&se(s,$[6]),(!_||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&se(a,r),(!_||T[0]&16384)&&x(f,"btn-disabled",$[14]),(!_||T[0]&16384)&&x(g,"btn-loading",$[14]),(!_||T[0]&16384)&&x(g,"btn-disabled",$[14])},i($){_||($&&Ke(()=>{_&&(h||(h=Le(e,jn,{duration:150,y:5},!0)),h.run(1))}),_=!0)},o($){$&&(h||(h=Le(e,jn,{duration:150,y:5},!1)),h.run(0)),_=!1},d($){$&&v(e),$&&h&&h.end(),k=!1,we(S)}}}function m8(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[p8],default:[f8]},$$scope:{ctx:n}};e=new Qo({props:s}),n[46](e);let o=n[6]&&Yh(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=ke()},m(r,a){z(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!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=Yh(r),o.c(),A(o,1),o.m(i.parentNode,i)):o&&(re(),I(o,1,1,()=>{o=null}),ae())},i(r){l||(A(e.$$.fragment,r),A(o),l=!0)},o(r){I(e.$$.fragment,r),I(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),V(e,r),o&&o.d(r)}}}const h8=/^([\+\-])?(\w+)$/,Kh=40;function g8(n,e,t){let i,l,s,o,r,a,u,f,c,d,m,g;We(n,zn,Ae=>t(53,g=Ae));const h=rt();let{collection:_}=e,{sort:k=""}=e,{filter:S=""}=e,$,T=[],C=1,D=0,O={},E=!0,L=!1,R=0,P,F=[],N=[],q="";function W(){_!=null&&_.id&&(F.length?localStorage.setItem(q,JSON.stringify(F)):localStorage.removeItem(q))}function G(){if(t(5,F=[]),!!(_!=null&&_.id))try{const Ae=localStorage.getItem(q);Ae&&t(5,F=JSON.parse(Ae)||[])}catch{}}function J(Ae){return!!T.find(Ft=>Ft.id)}async function H(){const Ae=C;for(let Ft=1;Ft<=Ae;Ft++)(Ft===1||u)&&await U(Ft,!1)}async function U(Ae=1,Ft=!0){var fl,cl,bt;if(!(_!=null&&_.id))return;t(13,E=!0);let Ri=k;const Gn=Ri.match(h8),ul=Gn?r.find(ce=>ce.name===Gn[2]):null;if(Gn&&ul){const ce=((bt=(cl=(fl=g==null?void 0:g.find(Xe=>{var Jt;return Xe.id==((Jt=ul.options)==null?void 0:Jt.collectionId)}))==null?void 0:fl.schema)==null?void 0:cl.filter(Xe=>Xe.presentable))==null?void 0:bt.map(Xe=>Xe.name))||[],Me=[];for(const Xe of ce)Me.push((Gn[1]||"")+Gn[2]+"."+Xe);Me.length>0&&(Ri=Me.join(","))}const Nl=j.getAllCollectionIdentifiers(_),ki=o.map(ce=>ce.name+":excerpt(200)").concat(r.map(ce=>"expand."+ce.name+".*:excerpt(200)"));return ki.length&&ki.unshift("*"),fe.collection(_.id).getList(Ae,Kh,{sort:Ri,skipTotal:1,filter:j.normalizeSearchFilter(S,Nl),expand:r.map(ce=>ce.name).join(","),fields:ki.join(","),requestKey:"records_list"}).then(async ce=>{var Me;if(Ae<=1&&le(),t(13,E=!1),t(12,C=ce.page),t(28,D=ce.items.length),h("load",T.concat(ce.items)),o.length)for(let Xe of ce.items)Xe._partial=!0;if(Ft){const Xe=++R;for(;(Me=ce.items)!=null&&Me.length&&R==Xe;){const Jt=ce.items.splice(0,20);for(let nt of Jt)j.pushOrReplaceByKey(T,nt);t(3,T),await j.yieldToMain()}}else{for(let Xe of ce.items)j.pushOrReplaceByKey(T,Xe);t(3,T)}}).catch(ce=>{ce!=null&&ce.isAbort||(t(13,E=!1),console.warn(ce),le(),fe.error(ce,(ce==null?void 0:ce.status)!=400))})}function le(){$==null||$.resetVerticalScroll(),t(3,T=[]),t(12,C=1),t(28,D=0),t(4,O={})}function ee(){c?oe():Te()}function oe(){t(4,O={})}function Te(){for(const Ae of T)t(4,O[Ae.id]=Ae,O);t(4,O)}function je(Ae){O[Ae.id]?delete O[Ae.id]:t(4,O[Ae.id]=Ae,O),t(4,O)}function Ve(){an(`Do you really want to delete the selected ${f===1?"record":"records"}?`,Qe)}async function Qe(){if(L||!f||!(_!=null&&_.id))return;let Ae=[];for(const Ft of Object.keys(O))Ae.push(fe.collection(_.id).delete(Ft));return t(14,L=!0),Promise.all(Ae).then(()=>{It(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",O),oe()}).catch(Ft=>{fe.error(Ft)}).finally(()=>(t(14,L=!1),H()))}function tt(Ae){Ee.call(this,n,Ae)}const Ge=(Ae,Ft)=>{Ft.target.checked?j.removeByValue(F,Ae.id):j.pushUnique(F,Ae.id),t(5,F)},Mt=()=>ee();function Pt(Ae){k=Ae,t(0,k)}function Ce(Ae){k=Ae,t(0,k)}function De(Ae){k=Ae,t(0,k)}function ze(Ae){k=Ae,t(0,k)}function _t(Ae){k=Ae,t(0,k)}function ne(Ae){k=Ae,t(0,k)}function Ne(Ae){te[Ae?"unshift":"push"](()=>{P=Ae,t(15,P)})}const Se=Ae=>je(Ae),mt=Ae=>h("select",Ae),Bt=(Ae,Ft)=>{Ft.code==="Enter"&&(Ft.preventDefault(),h("select",Ae))},cn=()=>t(1,S=""),on=()=>h("new"),Vn=()=>U(C+1);function Ni(Ae){te[Ae?"unshift":"push"](()=>{$=Ae,t(11,$)})}const al=()=>oe(),yi=()=>Ve();return n.$$set=Ae=>{"collection"in Ae&&t(25,_=Ae.collection),"sort"in Ae&&t(0,k=Ae.sort),"filter"in Ae&&t(1,S=Ae.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(q=_.id+"@hiddenColumns",G(),le()),n.$$.dirty[0]&33554432&&t(10,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(Ae=>Ae.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(Ae=>Ae.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(Ae=>!F.includes(Ae.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&k!==-1&&S!==-1&&U(1),n.$$.dirty[0]&268435456&&t(18,u=D>=Kh),n.$$.dirty[0]&16&&t(6,f=Object.keys(O).length),n.$$.dirty[0]&72&&t(17,c=T.length&&f===T.length),n.$$.dirty[0]&32&&F!==-1&&W(),n.$$.dirty[0]&1032&&t(8,d=!i||T.length>0&&typeof T[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||T.length>0&&typeof T[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,N=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(Ae=>({id:Ae.id,name:Ae.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[k,S,U,T,O,F,f,m,d,l,i,$,C,E,L,P,N,c,u,a,h,ee,oe,je,Ve,_,J,H,D,s,tt,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne,Se,mt,Bt,cn,on,Vn,Ni,al,yi]}class _8 extends _e{constructor(e){super(),ge(this,e,g8,m8,he,{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 b8(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=M(),l=b("span"),o=Y(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),y(e,t),y(e,i),y(e,l),y(l,o)},p(a,[u]){u&5&&s!==(s=(a[2]?"...":a[0])+"")&&se(o,s),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function y8(n,e,t){const i=rt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const f=j.getAllCollectionIdentifiers(l),c=await fe.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,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,l=f.collection),"filter"in f&&t(4,s=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&u()},[o,r,a,l,s,u]}class k8 extends _e{constructor(e){super(),ge(this,e,y8,b8,he,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function v8(n){let e,t,i,l;return e=new N5({}),i=new _n({props:{class:"flex-content",$$slots:{footer:[$8],default:[T8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function w8(n){let e,t;return e=new _n({props:{center:!0,$$slots:{default:[O8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function S8(n){let e,t;return e=new _n({props:{center:!0,$$slots:{default:[D8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Jh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[ve(Pe.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function Zh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function T8(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P=!n[12]&&Jh(n);c=new Xo({}),c.$on("refresh",n[21]);let F=n[2].type!=="view"&&Zh(n);k=new Os({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[24]);function N(G){n[26](G)}function q(G){n[27](G)}let W={collection:n[2]};return n[0]!==void 0&&(W.filter=n[0]),n[1]!==void 0&&(W.sort=n[1]),C=new _8({props:W}),n[25](C),te.push(()=>be(C,"filter",N)),te.push(()=>be(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=M(),s=b("div"),r=Y(o),a=M(),u=b("div"),P&&P.c(),f=M(),B(c.$$.fragment),d=M(),m=b("div"),g=b("button"),g.innerHTML=' API Preview',h=M(),F&&F.c(),_=M(),B(k.$$.fragment),S=M(),$=b("div"),T=M(),B(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"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(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(G,J){w(G,e,J),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),y(e,u),P&&P.m(u,null),y(u,f),z(c,u,null),y(e,d),y(e,m),y(m,g),y(m,h),F&&F.m(m,null),w(G,_,J),z(k,G,J),w(G,S,J),w(G,$,J),w(G,T,J),z(C,G,J),E=!0,L||(R=K(g,"click",n[22]),L=!0)},p(G,J){(!E||J[0]&4)&&o!==(o=G[2].name+"")&&se(r,o),G[12]?P&&(P.d(1),P=null):P?P.p(G,J):(P=Jh(G),P.c(),P.m(u,f)),G[2].type!=="view"?F?F.p(G,J):(F=Zh(G),F.c(),F.m(m,null)):F&&(F.d(1),F=null);const H={};J[0]&1&&(H.value=G[0]),J[0]&4&&(H.autocompleteCollection=G[2]),k.$set(H);const U={};J[0]&4&&(U.collection=G[2]),!D&&J[0]&1&&(D=!0,U.filter=G[0],ye(()=>D=!1)),!O&&J[0]&2&&(O=!0,U.sort=G[1],ye(()=>O=!1)),C.$set(U)},i(G){E||(A(c.$$.fragment,G),A(k.$$.fragment,G),A(C.$$.fragment,G),E=!0)},o(G){I(c.$$.fragment,G),I(k.$$.fragment,G),I(C.$$.fragment,G),E=!1},d(G){G&&(v(e),v(_),v(S),v($),v(T)),P&&P.d(),V(c),F&&F.d(),V(k,G),n[25](null),V(C,G),L=!1,R()}}}function $8(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new k8({props:s}),n[18](e),te.push(()=>be(e,"totalCount",l)),{c(){B(e.$$.fragment)},m(o,r){z(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],ye(()=>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 C8(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=M(),i=b("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),l||(s=K(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function M8(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function O8(n){let e,t,i;function l(r,a){return r[12]?M8:C8}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=M(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),y(e,t),y(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function D8(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function E8(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[S8,w8,v8],m=[];function g($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=g(n),t=m[e]=d[e](n);let h={};l=new xa({props:h}),n[31](l);let _={};o=new U5({props:_}),n[32](o);let k={collection:n[2]};a=new nu({props:k}),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 WE({props:S}),n[37](f),f.$on("hide",n[38]),{c(){t.c(),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),B(f.$$.fragment)},m($,T){m[e].m($,T),w($,i,T),z(l,$,T),w($,s,T),z(o,$,T),w($,r,T),z(a,$,T),w($,u,T),z(f,$,T),c=!0},p($,T){let C=e;e=g($),e===C?m[e].p($,T):(re(),I(m[C],1,1,()=>{m[C]=null}),ae(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),A(t,1),t.m(i.parentNode,i));const D={};l.$set(D);const O={};o.$set(O);const E={};T[0]&4&&(E.collection=$[2]),a.$set(E);const L={};T[0]&4&&(L.collection=$[2]),f.$set(L)},i($){c||(A(t),A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(f.$$.fragment,$),c=!0)},o($){I(t),I(l.$$.fragment,$),I(o.$$.fragment,$),I(a.$$.fragment,$),I(f.$$.fragment,$),c=!1},d($){$&&(v(i),v(s),v(r),v(u)),m[e].d($),n[31](null),V(l,$),n[32](null),V(o,$),n[33](null),V(a,$),n[37](null),V(f,$)}}}function A8(n,e,t){let i,l,s,o,r,a,u;We(n,li,Ce=>t(2,l=Ce)),We(n,Et,Ce=>t(39,s=Ce)),We(n,$o,Ce=>t(3,o=Ce)),We(n,Bo,Ce=>t(16,r=Ce)),We(n,zn,Ce=>t(11,a=Ce)),We(n,Cl,Ce=>t(12,u=Ce));const f=new URLSearchParams(r);let c,d,m,g,h,_,k=f.get("filter")||"",S=f.get("sort")||"-created",$=f.get("collectionId")||(l==null?void 0:l.id),T=0;dv($);async function C(Ce){await Qt(),(l==null?void 0:l.type)==="view"?g.show(Ce):m==null||m.show(Ce)}function D(){t(14,$=l==null?void 0:l.id),t(0,k=""),t(1,S="-created"),E({recordId:null}),O()}async function O(){if(!S)return;const Ce=j.getAllCollectionIdentifiers(l),De=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);De.filter(ze=>Ce.includes(ze)).length!=De.length&&(Ce.includes("created")?t(1,S="-created"):t(1,S=""))}function E(Ce={}){const De=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:k,sort:S},Ce);j.replaceHashQueryParams(De)}const L=()=>c==null?void 0:c.show();function R(Ce){te[Ce?"unshift":"push"](()=>{_=Ce,t(9,_)})}function P(Ce){T=Ce,t(10,T)}const F=()=>c==null?void 0:c.show(l),N=()=>{h==null||h.load(),_==null||_.reload()},q=()=>d==null?void 0:d.show(l),W=()=>m==null?void 0:m.show(),G=Ce=>t(0,k=Ce.detail);function J(Ce){te[Ce?"unshift":"push"](()=>{h=Ce,t(8,h)})}function H(Ce){k=Ce,t(0,k)}function U(Ce){S=Ce,t(1,S)}const le=Ce=>{E({recordId:Ce.detail.id});let De=Ce.detail._partial?Ce.detail.id:Ce.detail;l.type==="view"?g==null||g.show(De):m==null||m.show(De)},ee=()=>{_==null||_.reload()},oe=()=>m==null?void 0:m.show();function Te(Ce){te[Ce?"unshift":"push"](()=>{c=Ce,t(4,c)})}function je(Ce){te[Ce?"unshift":"push"](()=>{d=Ce,t(5,d)})}function Ve(Ce){te[Ce?"unshift":"push"](()=>{m=Ce,t(6,m)})}const Qe=()=>{E({recordId:null})},tt=Ce=>{k?_==null||_.reload():Ce.detail.isNew&&t(10,T++,T),h==null||h.reloadLoadedPages()},Ge=Ce=>{(!k||h!=null&&h.hasRecord(Ce.detail.id))&&t(10,T--,T),h==null||h.reloadLoadedPages()};function Mt(Ce){te[Ce?"unshift":"push"](()=>{g=Ce,t(7,g)})}const Pt=()=>{E({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")!=$&&uv(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&$!=l.id&&D(),n.$$.dirty[0]&4&&l!=null&&l.id&&O(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&C(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||k||l!=null&&l.id)&&E(),n.$$.dirty[0]&4&&tn(Et,s=(l==null?void 0:l.name)||"Collections",s)},[k,S,l,o,c,d,m,g,h,_,T,a,u,E,$,i,r,L,R,P,F,N,q,W,G,J,H,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt]}class I8 extends _e{constructor(e){super(),ge(this,e,A8,E8,he,{},null,[-1,-1])}}function L8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;return{c(){e=b("div"),t=b("div"),t.textContent="System",i=M(),l=b("a"),l.innerHTML=' Application',s=M(),o=b("a"),o.innerHTML=' Mail settings',r=M(),a=b("a"),a.innerHTML=' Files storage',u=M(),f=b("a"),f.innerHTML=' Backups',c=M(),d=b("div"),d.innerHTML='Sync',m=M(),g=b("a"),g.innerHTML=' Export collections',h=M(),_=b("a"),_.innerHTML=' Import collections',k=M(),S=b("div"),S.textContent="Authentication",$=M(),T=b("a"),T.innerHTML=' Auth providers',C=M(),D=b("a"),D.innerHTML=' Token options',O=M(),E=b("a"),E.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(d,"class","sidebar-title"),p(g,"href","/settings/export-collections"),p(g,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(S,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(D,"href","/settings/tokens"),p(D,"class","sidebar-list-item"),p(E,"href","/settings/admins"),p(E,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(P,F){w(P,e,F),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),y(e,r),y(e,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),y(e,h),y(e,_),y(e,k),y(e,S),y(e,$),y(e,T),y(e,C),y(e,D),y(e,O),y(e,E),L||(R=[ve(Pn.call(null,l,{path:"/settings"})),ve(ln.call(null,l)),ve(Pn.call(null,o,{path:"/settings/mail/?.*"})),ve(ln.call(null,o)),ve(Pn.call(null,a,{path:"/settings/storage/?.*"})),ve(ln.call(null,a)),ve(Pn.call(null,f,{path:"/settings/backups/?.*"})),ve(ln.call(null,f)),ve(Pn.call(null,g,{path:"/settings/export-collections/?.*"})),ve(ln.call(null,g)),ve(Pn.call(null,_,{path:"/settings/import-collections/?.*"})),ve(ln.call(null,_)),ve(Pn.call(null,T,{path:"/settings/auth-providers/?.*"})),ve(ln.call(null,T)),ve(Pn.call(null,D,{path:"/settings/tokens/?.*"})),ve(ln.call(null,D)),ve(Pn.call(null,E,{path:"/settings/admins/?.*"})),ve(ln.call(null,E))],L=!0)},p:Q,d(P){P&&v(e),L=!1,we(R)}}}function P8(n){let e,t;return e=new Yb({props:{class:"settings-sidebar",$$slots:{default:[L8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&1&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}class bi extends _e{constructor(e){super(),ge(this,e,null,P8,he,{})}}function Gh(n,e,t){const i=n.slice();return i[31]=e[t],i}function Xh(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[F8,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function F8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return a=new xb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",o=M(),r=b("div"),B(a.$$.fragment),u=M(),f=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=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,h){w(g,e,h),y(e,t),y(e,i),y(e,l),w(g,o,h),w(g,r,h),z(a,r,null),w(g,u,h),w(g,f,h),m=!0},p(g,h){(!m||h[0]&1073741824&&s!==(s=g[30]))&&p(e,"for",s);const _={};h[0]&2&&(_.model=g[1]),a.$set(_),(!m||h[0]&1073741824&&c!==(c=g[30]))&&p(f,"id",c),(!m||h[0]&2&&d!==(d=g[1].id)&&f.value!==d)&&(f.value=d)},i(g){m||(A(a.$$.fragment,g),m=!0)},o(g){I(a.$$.fragment,g),m=!1},d(g){g&&(v(e),v(o),v(r),v(u),v(f)),V(a)}}}function Qh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=M(),nn(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",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(u,f){w(u,e,f),y(e,t),y(e,l),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(u){u&&v(e),o=!1,r()}}}function N8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=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),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ue(r,n[3]),u||(f=K(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&ue(r,c[3])},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function xh(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[R8,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function R8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function eg(n){let e,t,i,l,s,o,r,a,u;return l=new me({props:{class:"form-field required",name:"password",$$slots:{default:[q8,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[j8,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(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),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(t,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(t,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function q8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return c=new e0({}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),u=M(),f=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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(h,_){w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,o,_),w(h,r,_),ue(r,n[9]),w(h,u,_),w(h,f,_),z(c,f,null),d=!0,m||(g=K(r,"input",n[21]),m=!0)},p(h,_){(!d||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s),(!d||_[0]&1073741824&&a!==(a=h[30]))&&p(r,"id",a),_[0]&512&&r.value!==h[9]&&ue(r,h[9])},i(h){d||(A(c.$$.fragment,h),d=!0)},o(h){I(c.$$.fragment,h),d=!1},d(h){h&&(v(e),v(o),v(r),v(u),v(f)),V(c),m=!1,g()}}}function j8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ue(r,n[10]),u||(f=K(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&ue(r,c[10])},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function H8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g=!n[5]&&Xh(n),h=pe([0,1,2,3,4,5,6,7,8,9]),_=[];for(let $=0;$<10;$+=1)_[$]=Qh(Gh(n,h,$));a=new me({props:{class:"form-field required",name:"email",$$slots:{default:[N8,({uniqueId:$})=>({30:$}),({uniqueId:$})=>[$?1073741824:0]]},$$scope:{ctx:n}}});let k=!n[5]&&xh(n),S=(n[5]||n[4])&&eg(n);return{c(){e=b("form"),g&&g.c(),t=M(),i=b("div"),l=b("p"),l.textContent="Avatar",s=M(),o=b("div");for(let $=0;$<10;$+=1)_[$].c();r=M(),B(a.$$.fragment),u=M(),k&&k.c(),f=M(),S&&S.c(),p(l,"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($,T){w($,e,T),g&&g.m(e,null),y(e,t),y(e,i),y(i,l),y(i,s),y(i,o);for(let C=0;C<10;C+=1)_[C]&&_[C].m(o,null);y(e,r),z(a,e,null),y(e,u),k&&k.m(e,null),y(e,f),S&&S.m(e,null),c=!0,d||(m=K(e,"submit",Ye(n[13])),d=!0)},p($,T){if($[5]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p($,T),T[0]&32&&A(g,1)):(g=Xh($),g.c(),A(g,1),g.m(e,t)),T[0]&4){h=pe([0,1,2,3,4,5,6,7,8,9]);let D;for(D=0;D<10;D+=1){const O=Gh($,h,D);_[D]?_[D].p(O,T):(_[D]=Qh(O),_[D].c(),_[D].m(o,null))}for(;D<10;D+=1)_[D].d(1)}const C={};T[0]&1073741832|T[1]&8&&(C.$$scope={dirty:T,ctx:$}),a.$set(C),$[5]?k&&(re(),I(k,1,1,()=>{k=null}),ae()):k?(k.p($,T),T[0]&32&&A(k,1)):(k=xh($),k.c(),A(k,1),k.m(e,f)),$[5]||$[4]?S?(S.p($,T),T[0]&48&&A(S,1)):(S=eg($),S.c(),A(S,1),S.m(e,null)):S&&(re(),I(S,1,1,()=>{S=null}),ae())},i($){c||(A(g),A(a.$$.fragment,$),A(k),A(S),c=!0)},o($){I(g),I(a.$$.fragment,$),I(k),I(S),c=!1},d($){$&&v(e),g&&g.d(),at(_,$),V(a),k&&k.d(),S&&S.d(),d=!1,m()}}}function z8(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=Y(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&se(i,t)},d(l){l&&v(e)}}}function tg(n){let e,t,i,l,s,o,r,a,u;return o=new En({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[V8]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("span"),i=M(),l=b("i"),s=M(),B(o.$$.fragment),r=M(),a=b("div"),p(l,"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),y(e,t),y(e,i),y(e,l),y(e,s),z(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&&(v(e),v(r),v(a)),V(o)}}}function V8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function B8(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,m=!n[5]&&tg(n);return{c(){m&&m.c(),e=M(),t=b("button"),i=b("span"),i.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=Y(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=u=!n[11]||n[7],x(s,"btn-loading",n[7])},m(g,h){m&&m.m(g,h),w(g,e,h),w(g,t,h),y(t,i),w(g,l,h),w(g,s,h),y(s,o),y(o,a),f=!0,c||(d=K(t,"click",n[17]),c=!0)},p(g,h){g[5]?m&&(re(),I(m,1,1,()=>{m=null}),ae()):m?(m.p(g,h),h[0]&32&&A(m,1)):(m=tg(g),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||h[0]&128)&&(t.disabled=g[7]),(!f||h[0]&32)&&r!==(r=g[5]?"Create":"Save changes")&&se(a,r),(!f||h[0]&2176&&u!==(u=!g[11]||g[7]))&&(s.disabled=u),(!f||h[0]&128)&&x(s,"btn-loading",g[7])},i(g){f||(A(m),f=!0)},o(g){I(m),f=!1},d(g){g&&(v(e),v(t),v(l),v(s)),m&&m.d(g),c=!1,d()}}}function U8(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[B8],header:[z8],default:[H8]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function W8(n,e,t){let i,l;const s=rt(),o="admin_"+j.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",m="",g="",h=!1;function _(J){return S(J),t(8,f=!0),r==null?void 0:r.show()}function k(){return r==null?void 0:r.hide()}function S(J){t(1,a=structuredClone(J||{})),$()}function $(){t(4,h=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,g=""),Gt({})}function T(){if(u||!l)return;t(7,u=!0);const J={email:d,avatar:c};(i||h)&&(J.password=m,J.passwordConfirm=g);let H;i?H=fe.admins.create(J):H=fe.admins.update(a.id,J),H.then(async U=>{var le;t(8,f=!1),k(),It(i?"Successfully created admin.":"Successfully updated admin."),((le=fe.authStore.model)==null?void 0:le.id)===U.id&&fe.authStore.save(fe.authStore.token,U),s("save",U)}).catch(U=>{fe.error(U)}).finally(()=>{t(7,u=!1)})}function C(){a!=null&&a.id&&an("Do you really want to delete the selected admin?",()=>fe.admins.delete(a.id).then(()=>{t(8,f=!1),k(),It("Successfully deleted admin."),s("delete",a)}).catch(J=>{fe.error(J)}))}const D=()=>C(),O=()=>k(),E=J=>t(2,c=J);function L(){d=this.value,t(3,d)}function R(){h=this.checked,t(4,h)}function P(){m=this.value,t(9,m)}function F(){g=this.value,t(10,g)}const N=()=>l&&f?(an("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),k()}),!1):!0;function q(J){te[J?"unshift":"push"](()=>{r=J,t(6,r)})}function W(J){Ee.call(this,n,J)}function G(J){Ee.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||h||d!==a.email||c!==a.avatar)},[k,a,c,d,h,i,r,u,f,m,g,l,o,T,C,_,D,O,E,L,R,P,F,N,q,W,G]}class Y8 extends _e{constructor(e){super(),ge(this,e,W8,U8,he,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function ng(n,e,t){const i=n.slice();return i[24]=e[t],i}function K8(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function J8(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Z8(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function G8(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ig(n){let e;function t(s,o){return s[5]?Q8:X8}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function X8(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&lg(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),o&&o.m(t,null),y(e,s)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=lg(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function Q8(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function lg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function sg(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function og(n,e){let t,i,l,s,o,r,a,u,f,c,d,m=e[24].id+"",g,h,_,k,S,$=e[24].email+"",T,C,D,O,E,L,R,P,F,N,q,W,G,J;f=new rl({props:{value:e[24].id}});let H=e[24].id===e[7].id&&sg();E=new nl({props:{date:e[24].created}}),P=new nl({props:{date:e[24].updated}});function U(){return e[15](e[24])}function le(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=M(),a=b("td"),u=b("div"),B(f.$$.fragment),c=M(),d=b("span"),g=Y(m),h=M(),H&&H.c(),_=M(),k=b("td"),S=b("span"),T=Y($),D=M(),O=b("td"),B(E.$$.fragment),L=M(),R=b("td"),B(P.$$.fragment),F=M(),N=b("td"),N.innerHTML='',q=M(),nn(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"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",C=e[24].email),p(k,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(N,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,oe){w(ee,t,oe),y(t,i),y(i,l),y(l,s),y(t,r),y(t,a),y(a,u),z(f,u,null),y(u,c),y(u,d),y(d,g),y(a,h),H&&H.m(a,null),y(t,_),y(t,k),y(k,S),y(S,T),y(t,D),y(t,O),z(E,O,null),y(t,L),y(t,R),z(P,R,null),y(t,F),y(t,N),y(t,q),W=!0,G||(J=[K(t,"click",U),K(t,"keydown",le)],G=!0)},p(ee,oe){e=ee,(!W||oe&16&&!nn(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Te={};oe&16&&(Te.value=e[24].id),f.$set(Te),(!W||oe&16)&&m!==(m=e[24].id+"")&&se(g,m),e[24].id===e[7].id?H||(H=sg(),H.c(),H.m(a,null)):H&&(H.d(1),H=null),(!W||oe&16)&&$!==($=e[24].email+"")&&se(T,$),(!W||oe&16&&C!==(C=e[24].email))&&p(S,"title",C);const je={};oe&16&&(je.date=e[24].created),E.$set(je);const Ve={};oe&16&&(Ve.date=e[24].updated),P.$set(Ve)},i(ee){W||(A(f.$$.fragment,ee),A(E.$$.fragment,ee),A(P.$$.fragment,ee),W=!0)},o(ee){I(f.$$.fragment,ee),I(E.$$.fragment,ee),I(P.$$.fragment,ee),W=!1},d(ee){ee&&v(t),V(f),H&&H.d(),V(E),V(P),G=!1,we(J)}}}function x8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C=[],D=new Map,O;function E(U){n[11](U)}let L={class:"col-type-text",name:"id",$$slots:{default:[K8]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Tn({props:L}),te.push(()=>be(o,"sort",E));function R(U){n[12](U)}let P={class:"col-type-email col-field-email",name:"email",$$slots:{default:[J8]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),u=new Tn({props:P}),te.push(()=>be(u,"sort",R));function F(U){n[13](U)}let N={class:"col-type-date col-field-created",name:"created",$$slots:{default:[Z8]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),d=new Tn({props:N}),te.push(()=>be(d,"sort",F));function q(U){n[14](U)}let W={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[G8]},$$scope:{ctx:n}};n[2]!==void 0&&(W.sort=n[2]),h=new Tn({props:W}),te.push(()=>be(h,"sort",q));let G=pe(n[4]);const J=U=>U[24].id;for(let U=0;Ur=!1)),o.$set(ee);const oe={};le&134217728&&(oe.$$scope={dirty:le,ctx:U}),!f&&le&4&&(f=!0,oe.sort=U[2],ye(()=>f=!1)),u.$set(oe);const Te={};le&134217728&&(Te.$$scope={dirty:le,ctx:U}),!m&&le&4&&(m=!0,Te.sort=U[2],ye(()=>m=!1)),d.$set(Te);const je={};le&134217728&&(je.$$scope={dirty:le,ctx:U}),!_&&le&4&&(_=!0,je.sort=U[2],ye(()=>_=!1)),h.$set(je),le&186&&(G=pe(U[4]),re(),C=dt(C,le,J,1,U,G,D,T,Lt,og,null,ng),ae(),!G.length&&H?H.p(U,le):G.length?H&&(H.d(1),H=null):(H=ig(U),H.c(),H.m(T,null))),(!O||le&32)&&x(e,"table-loading",U[5])},i(U){if(!O){A(o.$$.fragment,U),A(u.$$.fragment,U),A(d.$$.fragment,U),A(h.$$.fragment,U);for(let le=0;le New admin',g=M(),B(h.$$.fragment),_=M(),k=b("div"),S=M(),B($.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(k,"class","clearfix m-b-base")},m(O,E){w(O,e,E),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(e,r),z(a,e,null),y(e,u),y(e,f),y(e,c),y(e,d),y(d,m),w(O,g,E),z(h,O,E),w(O,_,E),w(O,k,E),w(O,S,E),z($,O,E),T=!0,C||(D=K(m,"click",n[9]),C=!0)},p(O,E){(!T||E&64)&&se(o,O[6]);const L={};E&2&&(L.value=O[1]),h.$set(L);const R={};E&134217918&&(R.$$scope={dirty:E,ctx:O}),$.$set(R)},i(O){T||(A(a.$$.fragment,O),A(h.$$.fragment,O),A($.$$.fragment,O),T=!0)},o(O){I(a.$$.fragment,O),I(h.$$.fragment,O),I($.$$.fragment,O),T=!1},d(O){O&&(v(e),v(g),v(_),v(k),v(S)),V(a),V(h,O),V($,O),C=!1,D()}}}function tA(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=Y("Total found: "),l=Y(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),y(e,t),y(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&se(l,i)},d(s){s&&v(e)}}}function nA(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{footer:[tA],default:[eA]},$$scope:{ctx:n}}});let r={};return s=new Y8({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[18](null),V(s,a)}}}function iA(n,e,t){let i,l,s;We(n,Bo,P=>t(21,i=P)),We(n,Et,P=>t(6,l=P)),We(n,La,P=>t(7,s=P)),tn(Et,l="Admins",l);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 fe.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),m(),fe.error(F,(F==null?void 0:F.status)!=400))})}function m(){t(4,a=[])}const g=()=>d(),h=()=>r==null?void 0:r.show(),_=P=>t(1,f=P.detail);function k(P){c=P,t(2,c)}function S(P){c=P,t(2,c)}function $(P){c=P,t(2,c)}function T(P){c=P,t(2,c)}const C=P=>r==null?void 0:r.show(P),D=(P,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(P))},O=()=>t(1,f="");function E(P){te[P?"unshift":"push"](()=>{r=P,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const P=new URLSearchParams({filter:f,sort:c}).toString();il("/settings/admins?"+P),d()}},[d,f,c,r,a,u,l,s,g,h,_,k,S,$,T,C,D,O,E,L,R]}class lA extends _e{constructor(e){super(),ge(this,e,iA,nA,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function sA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Email"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0]),s.focus(),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0]&&ue(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function oA(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Password"),l=M(),s=b("input"),r=M(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ue(s,n[1]),w(d,r,m),w(d,a,m),y(a,u),f||(c=[K(s,"input",n[5]),ve(ln.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&ue(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),f=!1,we(c)}}}function rA(n){let e,t,i,l,s,o,r,a,u,f,c;return l=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[sA,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[oA,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),a=b("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"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),y(e,t),y(e,i),z(l,e,null),y(e,s),z(o,e,null),y(e,r),y(e,a),u=!0,f||(c=K(e,"submit",Ye(n[3])),f=!0)},p(d,m){const g={};m&769&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const h={};m&770&&(h.$$scope={dirty:m,ctx:d}),o.$set(h),(!u||m&4)&&x(a,"btn-disabled",d[2]),(!u||m&4)&&x(a,"btn-loading",d[2])},i(d){u||(A(l.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(l.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&v(e),V(l),V(o),f=!1,c()}}}function aA(n){let e,t;return e=new G1({props:{$$slots:{default:[rA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function uA(n,e,t){let i;We(n,Bo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),fe.admins.authWithPassword(s,o).then(()=>{Aa(),il("/")}).catch(()=>{hi("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){s=this.value,t(0,s)}function f(){o=this.value,t(1,o)}return[s,o,r,a,u,f]}class fA extends _e{constructor(e){super(),ge(this,e,uA,aA,he,{})}}function cA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[pA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[mA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[hA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let T=n[3]&&rg(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("div"),c=b("div"),d=M(),T&&T.c(),m=M(),g=b("button"),h=b("span"),h.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(h,"class","txt"),p(g,"type","submit"),p(g,"class","btn btn-expanded"),g.disabled=_=!n[3]||n[2],x(g,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,D){w(C,e,D),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),z(a,e,null),y(e,u),y(e,f),y(f,c),y(f,d),T&&T.m(f,null),y(f,m),y(f,g),y(g,h),k=!0,S||($=K(g,"click",n[12]),S=!0)},p(C,D){const O={};D&786433&&(O.$$scope={dirty:D,ctx:C}),i.$set(O);const E={};D&786433&&(E.$$scope={dirty:D,ctx:C}),o.$set(E);const L={};D&786433&&(L.$$scope={dirty:D,ctx:C}),a.$set(L),C[3]?T?T.p(C,D):(T=rg(C),T.c(),T.m(f,m)):T&&(T.d(1),T=null),(!k||D&12&&_!==(_=!C[3]||C[2]))&&(g.disabled=_),(!k||D&4)&&x(g,"btn-loading",C[2])},i(C){k||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),k=!0)},o(C){I(i.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),k=!1},d(C){C&&v(e),V(i),V(o),V(a),T&&T.d(),S=!1,$()}}}function dA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function pA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Application name"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].meta.appName),r||(a=K(s,"input",n[8]),r=!0)},p(u,f){f&262144&&i!==(i=u[18])&&p(e,"for",i),f&262144&&o!==(o=u[18])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appName&&ue(s,u[0].meta.appName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function mA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Application URL"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].meta.appUrl),r||(a=K(s,"input",n[9]),r=!0)},p(u,f){f&262144&&i!==(i=u[18])&&p(e,"for",i),f&262144&&o!==(o=u[18])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appUrl&&ue(s,u[0].meta.appUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function hA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[10]),ve(Pe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function rg(n){let e,t,i,l;return{c(){e=b("button"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function gA(n){let e,t,i,l,s,o,r,a,u;const f=[dA,cA],c=[];function d(m,g){return m[1]?0:1}return s=d(n),o=c[s]=f[s](n),{c(){e=b("header"),e.innerHTML='',t=M(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,g){w(m,e,g),w(m,t,g),w(m,i,g),y(i,l),c[s].m(l,null),r=!0,a||(u=K(l,"submit",Ye(n[4])),a=!0)},p(m,g){let h=s;s=d(m),s===h?c[s].p(m,g):(re(),I(c[h],1,1,()=>{c[h]=null}),ae(),o=c[s],o?o.p(m,g):(o=c[s]=f[s](m),o.c()),A(o,1),o.m(l,null))},i(m){r||(A(o),r=!0)},o(m){I(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,u()}}}function _A(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[gA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function bA(n,e,t){let i,l,s,o;We(n,Cl,C=>t(13,l=C)),We(n,Mo,C=>t(14,s=C)),We(n,Et,C=>t(15,o=C)),tn(Et,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await fe.settings.getAll()||{};g(C)}catch(C){fe.error(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await fe.settings.update(j.filterRedactedProps(a));g(C),It("Successfully saved application settings.")}catch(C){fe.error(C)}t(2,f=!1)}}function g(C={}){var D,O;tn(Mo,s=(D=C==null?void 0:C.meta)==null?void 0:D.appName,s),tn(Cl,l=!!((O=C==null?void 0:C.meta)!=null&&O.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>h(),T=()=>m();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,m,h,r,c,_,k,S,$,T]}class yA extends _e{constructor(e){super(),ge(this,e,bA,_A,he,{})}}function kA(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=M(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),l.autofocus&&l.focus(),s||(o=[ve(Pe.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],s=!0)},p(u,f){ni(l,a=pt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(v(e),v(i),v(l)),s=!1,we(o)}}}function wA(n){let e;function t(s,o){return s[3]?vA:kA}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function SA(n,e,t){const i=["value","mask"];let l=Ze(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,s=""),t(3,a=!1),await Qt(),r==null||r.focus()}const f=()=>u();function c(m){te[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Fe(Fe({},e),Kt(m)),t(5,l=Ze(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,u,l,f,c,d]}class iu extends _e{constructor(e){super(),ge(this,e,SA,wA,he,{value:0,mask:1})}}function TA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;return{c(){e=b("label"),t=Y("Subject"),l=M(),s=b("input"),r=M(),a=b("div"),u=Y(`Available placeholder parameters: `),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`, - `),d=b("button"),d.textContent="{APP_URL} ",m=Y("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.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(_,k){w(_,e,k),y(e,t),w(_,l,k),w(_,s,k),ce(s,n[0].subject),w(_,r,k),w(_,a,k),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),g||(h=[K(s,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],g=!0)},p(_,k){k[1]&1&&i!==(i=_[31])&&p(e,"for",i),k[1]&1&&o!==(o=_[31])&&p(s,"id",o),k[0]&1&&s.value!==_[0].subject&&ce(s,_[0].subject)},d(_){_&&(v(e),v(l),v(s),v(r),v(a)),g=!1,we(h)}}}function _A(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k;return{c(){e=b("label"),t=Y("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),u=Y(`Available placeholder parameters: + `),d=b("button"),d.textContent="{APP_URL} ",m=Y("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.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(_,k){w(_,e,k),y(e,t),w(_,l,k),w(_,s,k),ue(s,n[0].subject),w(_,r,k),w(_,a,k),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),g||(h=[K(s,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],g=!0)},p(_,k){k[1]&1&&i!==(i=_[31])&&p(e,"for",i),k[1]&1&&o!==(o=_[31])&&p(s,"id",o),k[0]&1&&s.value!==_[0].subject&&ue(s,_[0].subject)},d(_){_&&(v(e),v(l),v(s),v(r),v(a)),g=!1,we(h)}}}function $A(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k;return{c(){e=b("label"),t=Y("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),u=Y(`Available placeholder parameters: `),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`, `),d=b("button"),d.textContent="{APP_URL} ",m=Y(`, - `),g=b("button"),g.textContent="{TOKEN} ",h=Y("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.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,$){w(S,e,$),y(e,t),w(S,l,$),w(S,s,$),ce(s,n[0].actionUrl),w(S,r,$),w(S,a,$),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,g),y(a,h),_||(k=[K(s,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(g,"click",n[19])],_=!0)},p(S,$){$[1]&1&&i!==(i=S[31])&&p(e,"for",i),$[1]&1&&o!==(o=S[31])&&p(s,"id",o),$[0]&1&&s.value!==S[0].actionUrl&&ce(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),_=!1,we(k)}}}function bA(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),ce(e,n[0].body),i||(l=K(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&ce(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function yA(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>ge(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!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=Dt(o,r(a)),te.push(()=>ge(e,"value",s)),B(e.$$.fragment),A(e.$$.fragment,1),z(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,ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function kA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T;const C=[yA,bA],D=[];function O(E,L){return E[4]&&!E[5]?0:1}return s=O(n),o=D[s]=C[s](n),{c(){e=b("label"),t=Y("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),u=Y(`Available placeholder parameters: + `),g=b("button"),g.textContent="{TOKEN} ",h=Y("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.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,$){w(S,e,$),y(e,t),w(S,l,$),w(S,s,$),ue(s,n[0].actionUrl),w(S,r,$),w(S,a,$),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,g),y(a,h),_||(k=[K(s,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(g,"click",n[19])],_=!0)},p(S,$){$[1]&1&&i!==(i=S[31])&&p(e,"for",i),$[1]&1&&o!==(o=S[31])&&p(s,"id",o),$[0]&1&&s.value!==S[0].actionUrl&&ue(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),_=!1,we(k)}}}function CA(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),ue(e,n[0].body),i||(l=K(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&ue(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function MA(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!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=Dt(o,r(a)),te.push(()=>be(e,"value",s)),B(e.$$.fragment),A(e.$$.fragment,1),z(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,ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function OA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T;const C=[MA,CA],D=[];function O(E,L){return E[4]&&!E[5]?0:1}return s=O(n),o=D[s]=C[s](n),{c(){e=b("label"),t=Y("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),u=Y(`Available placeholder parameters: `),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`, `),d=b("button"),d.textContent="{APP_URL} ",m=Y(`, `),g=b("button"),g.textContent="{TOKEN} ",h=Y(`, - `),_=b("button"),_.textContent="{ACTION_URL} ",k=Y("."),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(E,L){w(E,e,L),y(e,t),w(E,l,L),D[s].m(E,L),w(E,r,L),w(E,a,L),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,g),y(a,h),y(a,_),y(a,k),S=!0,$||(T=[K(f,"click",n[22]),K(d,"click",n[23]),K(g,"click",n[24]),K(_,"click",n[25])],$=!0)},p(E,L){(!S||L[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let R=s;s=O(E),s===R?D[s].p(E,L):(re(),I(D[R],1,1,()=>{D[R]=null}),ae(),o=D[s],o?o.p(E,L):(o=D[s]=C[s](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){S||(A(o),S=!0)},o(E){I(o),S=!1},d(E){E&&(v(e),v(l),v(r),v(a)),D[s].d(E),$=!1,we(T)}}}function vA(n){let e,t,i,l,s,o;return e=new he({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[gA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new he({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[_A,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new he({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[kA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,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}),s.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function rg(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function wA(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&rg();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=Y(n[2]),o=M(),r=b("div"),a=M(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),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&&se(s,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=rg(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function SA(n){let e,t;const i=[n[8]];let l={$$slots:{header:[wA],default:[vA]},$$scope:{ctx:n}};for(let s=0;st(12,o=U));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=ag,d=!1;function m(){f==null||f.expand()}function g(){f==null||f.collapse()}function h(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await st(()=>import("./CodeEditor-80667d26.js"),["./CodeEditor-80667d26.js","./index-102ce751.js"],import.meta.url)).default),ag=c,t(5,d=!1))}function k(U){j.copyToClipboard(U),$o(`Copied ${U} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function C(){u.actionUrl=this.value,t(0,u)}const D=()=>k("{APP_NAME}"),O=()=>k("{APP_URL}"),E=()=>k("{TOKEN}");function L(U){n.$$.not_equal(u.body,U)&&(u.body=U,t(0,u))}function R(){u.body=this.value,t(0,u)}const P=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),N=()=>k("{TOKEN}"),q=()=>k("{ACTION_URL}");function W(U){te[U?"unshift":"push"](()=>{f=U,t(3,f)})}function G(U){Ee.call(this,n,U)}function J(U){Ee.call(this,n,U)}function H(U){Ee.call(this,n,U)}return n.$$set=U=>{e=Pe(Pe({},e),Kt(U)),t(8,s=Ze(e,l)),"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||ii(r))},[u,r,a,f,c,d,i,k,s,m,g,h,o,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J,H]}class jr extends be{constructor(e){super(),_e(this,e,TA,SA,me,{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 ug(n,e,t){const i=n.slice();return i[21]=e[t],i}function fg(n,e){let t,i,l,s,o,r=e[21].label+"",a,u,f,c,d,m;return c=v0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=Y(r),f=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=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,h){w(g,t,h),y(t,i),i.checked=i.__value===e[2],y(t,s),y(t,o),y(o,a),y(t,f),d||(m=K(i,"change",e[10]),d=!0)},p(g,h){e=g,h&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),h&4&&(i.checked=i.__value===e[2]),h&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(g){g&&v(t),c.r(),d=!1,m()}}}function $A(n){let e=[],t=new Map,i,l=pe(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new he({props:{class:"form-field required m-0",name:"email",$$slots:{default:[CA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),z(t,e,null),y(e,i),z(l,e,null),s=!0,o||(r=K(e,"submit",Ye(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}),l.$set(c)},i(a){s||(A(t.$$.fragment,a),A(l.$$.fragment,a),s=!0)},o(a){I(t.$$.fragment,a),I(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function OA(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function DA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function EA(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:[DA],header:[OA],default:[MA]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Hr="last_email_test",cg="email_test_request";function AA(n,e,t){let i;const l=rt(),s="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(Hr),u=o[0].value,f=!1,c=null;function d(O="",E=""){t(1,a=O||localStorage.getItem(Hr)),t(2,u=E||o[0].value),Gt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Hr,a),clearTimeout(c),c=setTimeout(()=>{ue.cancelRequest(cg),hi("Test email send timeout.")},3e4);try{await ue.settings.testEmail(a,u,{$cancelKey:cg}),It("Successfully sent test email."),l("submit"),t(4,f=!1),await Qt(),m()}catch(O){t(4,f=!1),ue.error(O)}clearTimeout(c)}}const h=[[]];function _(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const S=()=>g(),$=()=>!f;function T(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function C(O){Ee.call(this,n,O)}function D(O){Ee.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,s,o,g,d,_,h,k,S,$,T,C,D]}class IA extends be{constructor(e){super(),_e(this,e,AA,EA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function LA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;i=new he({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[FA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[NA,({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 jr({props:F}),te.push(()=>ge(u,"config",P));function N(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 jr({props:q}),te.push(()=>ge(d,"config",N));function W(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),h=new jr({props:G}),te.push(()=>ge(h,"config",W)),T=new he({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[RA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});let J=n[0].smtp.enabled&&dg(n);function H(ee,oe){return ee[5]?JA:KA}let U=H(n),le=U(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),c=M(),B(d.$$.fragment),g=M(),B(h.$$.fragment),k=M(),S=b("hr"),$=M(),B(T.$$.fragment),C=M(),J&&J.c(),D=M(),O=b("div"),E=b("div"),L=M(),le.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(E,"class","flex-fill"),p(O,"class","flex")},m(ee,oe){w(ee,e,oe),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),w(ee,r,oe),w(ee,a,oe),z(u,a,null),y(a,c),z(d,a,null),y(a,g),z(h,a,null),w(ee,k,oe),w(ee,S,oe),w(ee,$,oe),z(T,ee,oe),w(ee,C,oe),J&&J.m(ee,oe),w(ee,D,oe),w(ee,O,oe),y(O,E),y(O,L),le.m(O,null),R=!0},p(ee,oe){const Te={};oe[0]&1|oe[1]&24&&(Te.$$scope={dirty:oe,ctx:ee}),i.$set(Te);const je={};oe[0]&1|oe[1]&24&&(je.$$scope={dirty:oe,ctx:ee}),o.$set(je);const Ve={};!f&&oe[0]&1&&(f=!0,Ve.config=ee[0].meta.verificationTemplate,ye(()=>f=!1)),u.$set(Ve);const Qe={};!m&&oe[0]&1&&(m=!0,Qe.config=ee[0].meta.resetPasswordTemplate,ye(()=>m=!1)),d.$set(Qe);const tt={};!_&&oe[0]&1&&(_=!0,tt.config=ee[0].meta.confirmEmailChangeTemplate,ye(()=>_=!1)),h.$set(tt);const Ge={};oe[0]&1|oe[1]&24&&(Ge.$$scope={dirty:oe,ctx:ee}),T.$set(Ge),ee[0].smtp.enabled?J?(J.p(ee,oe),oe[0]&1&&A(J,1)):(J=dg(ee),J.c(),A(J,1),J.m(D.parentNode,D)):J&&(re(),I(J,1,1,()=>{J=null}),ae()),U===(U=H(ee))&&le?le.p(ee,oe):(le.d(1),le=U(ee),le&&(le.c(),le.m(O,null)))},i(ee){R||(A(i.$$.fragment,ee),A(o.$$.fragment,ee),A(u.$$.fragment,ee),A(d.$$.fragment,ee),A(h.$$.fragment,ee),A(T.$$.fragment,ee),A(J),R=!0)},o(ee){I(i.$$.fragment,ee),I(o.$$.fragment,ee),I(u.$$.fragment,ee),I(d.$$.fragment,ee),I(h.$$.fragment,ee),I(T.$$.fragment,ee),I(J),R=!1},d(ee){ee&&(v(e),v(r),v(a),v(k),v(S),v($),v(C),v(D),v(O)),V(i),V(o),V(u),V(d),V(h),V(T,ee),J&&J.d(ee),le.d()}}}function PA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function FA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].meta.senderName),r||(a=K(s,"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(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderName&&ce(s,u[0].meta.senderName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function NA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].meta.senderAddress),r||(a=K(s,"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(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderAddress&&ce(s,u[0].meta.senderAddress)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function RA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[18]),ve(Fe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function dg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T;l=new he({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[qA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[jA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),f=new he({props:{class:"form-field",name:"smtp.username",$$slots:{default:[HA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new he({props:{class:"form-field",name:"smtp.password",$$slots:{default:[zA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?BA:VA}let D=C(n),O=D(n),E=n[4]&&pg(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),g=M(),h=b("button"),O.c(),_=M(),E&&E.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(h,"type","button"),p(h,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),y(t,a),y(t,u),z(f,u,null),y(t,c),y(t,d),z(m,d,null),y(e,g),y(e,h),O.m(h,null),y(e,_),E&&E.m(e,null),S=!0,$||(T=K(h,"click",Ye(n[23])),$=!0)},p(L,R){const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),l.$set(P);const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),r.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),f.$set(N);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),D!==(D=C(L))&&(O.d(1),O=D(L),O&&(O.c(),O.m(h,null))),L[4]?E?(E.p(L,R),R[0]&16&&A(E,1)):(E=pg(L),E.c(),A(E,1),E.m(e,null)):E&&(re(),I(E,1,1,()=>{E=null}),ae())},i(L){S||(A(l.$$.fragment,L),A(r.$$.fragment,L),A(f.$$.fragment,L),A(m.$$.fragment,L),A(E),L&&Ke(()=>{S&&(k||(k=Le(e,et,{duration:150},!0)),k.run(1))}),S=!0)},o(L){I(l.$$.fragment,L),I(r.$$.fragment,L),I(f.$$.fragment,L),I(m.$$.fragment,L),I(E),L&&(k||(k=Le(e,et,{duration:150},!1)),k.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(f),V(m),O.d(),E&&E.d(),L&&k&&k.end(),$=!1,T()}}}function qA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].smtp.host),r||(a=K(s,"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(s,"id",o),f[0]&1&&s.value!==u[0].smtp.host&&ce(s,u[0].smtp.host)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function jA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].smtp.port),r||(a=K(s,"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(s,"id",o),f[0]&1&&ut(s.value)!==u[0].smtp.port&&ce(s,u[0].smtp.port)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function HA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].smtp.username),r||(a=K(s,"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(s,"id",o),f[0]&1&&s.value!==u[0].smtp.username&&ce(s,u[0].smtp.username)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function zA(n){let e,t,i,l,s,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),s=new nu({props:u}),te.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=Y("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function VA(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function BA(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function pg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new he({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[UA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[WA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),u=new he({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[YA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),f=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(g,h){w(g,e,h),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),y(e,f),y(e,c),m=!0},p(g,h){const _={};h[0]&1|h[1]&24&&(_.$$scope={dirty:h,ctx:g}),i.$set(_);const k={};h[0]&1|h[1]&24&&(k.$$scope={dirty:h,ctx:g}),o.$set(k);const S={};h[0]&1|h[1]&24&&(S.$$scope={dirty:h,ctx:g}),u.$set(S)},i(g){m||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),g&&Ke(()=>{m&&(d||(d=Le(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(g){I(i.$$.fragment,g),I(o.$$.fragment,g),I(u.$$.fragment,g),g&&(d||(d=Le(e,et,{duration:150},!1)),d.run(0)),m=!1},d(g){g&&v(e),V(i),V(o),V(u),g&&d&&d.end()}}}function UA(n){let e,t,i,l,s,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),s=new _i({props:u}),te.push(()=>ge(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function WA(n){let e,t,i,l,s,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),s=new _i({props:u}),te.push(()=>ge(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function YA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=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),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[0].smtp.localName),u||(f=[ve(Fe.call(null,l,{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"})),K(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),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&&(v(e),v(o),v(r)),u=!1,we(f)}}}function KA(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function JA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=[K(e,"click",n[27]),K(l,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f[0]&8&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,we(a)}}}function ZA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[PA,LA],S=[];function $(T,C){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[6]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[30])),h=!0)},p(T,C){(!g||C[0]&64)&&se(o,T[6]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function GA(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{default:[ZA]},$$scope:{ctx:n}}});let r={};return s=new IA({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,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={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function XA(n,e,t){let i,l,s;We(n,Et,ee=>t(6,s=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];tn(Et,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1;g();async function g(){t(2,c=!0);try{const ee=await ue.settings.getAll()||{};_(ee)}catch(ee){ue.error(ee)}t(2,c=!1)}async function h(){if(!(d||!l)){t(3,d=!0);try{const ee=await ue.settings.update(j.filterRedactedProps(f));_(ee),Gt({}),It("Successfully saved mail settings.")}catch(ee){ue.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 k(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function $(){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 C(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function D(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=ut(this.value),t(0,f)}function R(){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,m=!m)};function N(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 W(){f.smtp.localName=this.value,t(0,f)}const G=()=>k(),J=()=>h(),H=()=>a==null?void 0:a.show(),U=()=>h();function le(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,l=i!=JSON.stringify(f))},[f,a,c,d,m,l,s,o,r,h,k,u,i,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J,H,U,le]}class QA extends be{constructor(e){super(),_e(this,e,XA,GA,me,{},null,[-1,-1])}}const xA=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),mg=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function eI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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&&se(s,u[4]),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function hg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D;return i=new he({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[tI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[nI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),u=new he({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[iI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),d=new he({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[lI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),h=new he({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[sI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),S=new he({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[oI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),f=M(),c=b("div"),B(d.$$.fragment),m=M(),g=b("div"),B(h.$$.fragment),_=M(),k=b("div"),B(S.$$.fragment),$=M(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),y(e,f),y(e,c),z(d,c,null),y(e,m),y(e,g),z(h,g,null),y(e,_),y(e,k),z(S,k,null),y(e,$),y(e,T),D=!0},p(O,E){const L={};E&8&&(L.name=O[3]+".endpoint"),E&1081345&&(L.$$scope={dirty:E,ctx:O}),i.$set(L);const R={};E&8&&(R.name=O[3]+".bucket"),E&1081345&&(R.$$scope={dirty:E,ctx:O}),o.$set(R);const P={};E&8&&(P.name=O[3]+".region"),E&1081345&&(P.$$scope={dirty:E,ctx:O}),u.$set(P);const F={};E&8&&(F.name=O[3]+".accessKey"),E&1081345&&(F.$$scope={dirty:E,ctx:O}),d.$set(F);const N={};E&8&&(N.name=O[3]+".secret"),E&1081345&&(N.$$scope={dirty:E,ctx:O}),h.$set(N);const q={};E&8&&(q.name=O[3]+".forcePathStyle"),E&1081345&&(q.$$scope={dirty:E,ctx:O}),S.$set(q)},i(O){D||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(h.$$.fragment,O),A(S.$$.fragment,O),O&&Ke(()=>{D&&(C||(C=Le(e,et,{duration:150},!0)),C.run(1))}),D=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(u.$$.fragment,O),I(d.$$.fragment,O),I(h.$$.fragment,O),I(S.$$.fragment,O),O&&(C||(C=Le(e,et,{duration:150},!1)),C.run(0)),D=!1},d(O){O&&v(e),V(i),V(o),V(u),V(d),V(h),V(S),O&&C&&C.end()}}}function tI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].endpoint),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].endpoint&&ce(s,u[0].endpoint)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function nI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].bucket),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].bucket&&ce(s,u[0].bucket)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function iI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].region),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].region&&ce(s,u[0].region)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function lI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].accessKey),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].accessKey&&ce(s,u[0].accessKey)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function sI(n){let e,t,i,l,s,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),s=new nu({props:u}),te.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=Y("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function oI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[14]),ve(Fe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function rI(n){let e,t,i,l,s;e=new he({props:{class:"form-field form-field-toggle",$$slots:{default:[eI,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=vt(o,n,n[15],mg);let a=n[0].enabled&&hg(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ke()},m(u,f){z(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,l,f),s=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!s||f&32775)&&St(r,o,u,u[15],s?wt(o,u[15],f,xA):Tt(u[15]),mg),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=hg(u),a.c(),A(a,1),a.m(l.parentNode,l)):a&&(re(),I(a,1,1,()=>{a=null}),ae())},i(u){s||(A(e.$$.fragment,u),A(r,u),A(a),s=!0)},o(u){I(e.$$.fragment,u),I(r,u),I(a),s=!1},d(u){u&&(v(t),v(i),v(l)),V(e,u),r&&r.d(u),a&&a.d(u)}}}const zr="s3_test_request";function aI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=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,m=null;function g(O){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{h()},O)}async function h(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;ue.cancelRequest(zr),clearTimeout(d),d=setTimeout(()=>{ue.cancelRequest(zr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let O;try{await ue.settings.testS3(u,{$cancelKey:zr})}catch(E){O=E}return O!=null&&O.isAbort||(t(1,f=O),t(2,c=!1),clearTimeout(d)),f}Vt(()=>()=>{clearTimeout(d),clearTimeout(m)});function _(){o.enabled=this.checked,t(0,o)}function k(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function $(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function C(O){n.$$.not_equal(o.secret,O)&&(o.secret=O,t(0,o))}function D(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=O=>{"originalConfig"in O&&t(5,s=O.originalConfig),"config"in O&&t(0,o=O.config),"configKey"in O&&t(3,r=O.configKey),"toggleLabel"in O&&t(4,a=O.toggleLabel),"testFilesystem"in O&&t(6,u=O.testFilesystem),"testError"in O&&t(1,f=O.testError),"isTesting"in O&&t(2,c=O.isTesting),"$$scope"in O&&t(15,l=O.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&g(100),n.$$.dirty&9&&(o.enabled||ii(r))},[o,f,c,r,a,s,u,i,_,k,S,$,T,C,D,l]}class t0 extends be{constructor(e){super(),_e(this,e,aI,rI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function uI(n){var O;let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;function k(E){n[11](E)}function S(E){n[12](E)}function $(E){n[13](E)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[cI]},$$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 t0({props:T}),te.push(()=>ge(e,"config",k)),te.push(()=>ge(e,"isTesting",S)),te.push(()=>ge(e,"testError",$));let C=((O=n[1].s3)==null?void 0:O.enabled)&&!n[6]&&!n[3]&&_g(n),D=n[6]&&bg(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),u=M(),D&&D.c(),f=M(),c=b("button"),d=b("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=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(E,L){z(e,E,L),w(E,s,L),w(E,o,L),y(o,r),y(o,a),C&&C.m(o,null),y(o,u),D&&D.m(o,null),y(o,f),y(o,c),y(c,d),g=!0,h||(_=K(c,"click",n[15]),h=!0)},p(E,L){var P;const R={};L&1&&(R.originalConfig=E[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:E}),!t&&L&2&&(t=!0,R.config=E[1].s3,ye(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=E[4],ye(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=E[5],ye(()=>l=!1)),e.$set(R),(P=E[1].s3)!=null&&P.enabled&&!E[6]&&!E[3]?C?C.p(E,L):(C=_g(E),C.c(),C.m(o,u)):C&&(C.d(1),C=null),E[6]?D?D.p(E,L):(D=bg(E),D.c(),D.m(o,f)):D&&(D.d(1),D=null),(!g||L&72&&m!==(m=!E[6]||E[3]))&&(c.disabled=m),(!g||L&8)&&x(c,"btn-loading",E[3])},i(E){g||(A(e.$$.fragment,E),g=!0)},o(E){I(e.$$.fragment,E),g=!1},d(E){E&&(v(s),v(o)),V(e,E),C&&C.d(),D&&D.d(),h=!1,_()}}}function fI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function gg(n){var L;let e,t,i,l,s,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",m,g,h,_,k,S,$,T,C,D,O,E;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=Y(`If you have existing uploaded files, you'll have to migrate them manually + `),_=b("button"),_.textContent="{ACTION_URL} ",k=Y("."),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(E,L){w(E,e,L),y(e,t),w(E,l,L),D[s].m(E,L),w(E,r,L),w(E,a,L),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,g),y(a,h),y(a,_),y(a,k),S=!0,$||(T=[K(f,"click",n[22]),K(d,"click",n[23]),K(g,"click",n[24]),K(_,"click",n[25])],$=!0)},p(E,L){(!S||L[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let R=s;s=O(E),s===R?D[s].p(E,L):(re(),I(D[R],1,1,()=>{D[R]=null}),ae(),o=D[s],o?o.p(E,L):(o=D[s]=C[s](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){S||(A(o),S=!0)},o(E){I(o),S=!1},d(E){E&&(v(e),v(l),v(r),v(a)),D[s].d(E),$=!1,we(T)}}}function DA(n){let e,t,i,l,s,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[TA,({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:[$A,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[OA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,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}),s.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function ag(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function EA(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&ag();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=Y(n[2]),o=M(),r=b("div"),a=M(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),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&&se(s,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=ag(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function AA(n){let e,t;const i=[n[8]];let l={$$slots:{header:[EA],default:[DA]},$$scope:{ctx:n}};for(let s=0;st(12,o=U));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=ug,d=!1;function m(){f==null||f.expand()}function g(){f==null||f.collapse()}function h(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await st(()=>import("./CodeEditor-6ddcf228.js"),["./CodeEditor-6ddcf228.js","./index-102ce751.js"],import.meta.url)).default),ug=c,t(5,d=!1))}function k(U){j.copyToClipboard(U),To(`Copied ${U} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function C(){u.actionUrl=this.value,t(0,u)}const D=()=>k("{APP_NAME}"),O=()=>k("{APP_URL}"),E=()=>k("{TOKEN}");function L(U){n.$$.not_equal(u.body,U)&&(u.body=U,t(0,u))}function R(){u.body=this.value,t(0,u)}const P=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),N=()=>k("{TOKEN}"),q=()=>k("{ACTION_URL}");function W(U){te[U?"unshift":"push"](()=>{f=U,t(3,f)})}function G(U){Ee.call(this,n,U)}function J(U){Ee.call(this,n,U)}function H(U){Ee.call(this,n,U)}return n.$$set=U=>{e=Fe(Fe({},e),Kt(U)),t(8,s=Ze(e,l)),"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||ii(r))},[u,r,a,f,c,d,i,k,s,m,g,h,o,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J,H]}class Hr extends _e{constructor(e){super(),ge(this,e,IA,AA,he,{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 fg(n,e,t){const i=n.slice();return i[21]=e[t],i}function cg(n,e){let t,i,l,s,o,r=e[21].label+"",a,u,f,c,d,m;return c=w0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=Y(r),f=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,ue(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,h){w(g,t,h),y(t,i),i.checked=i.__value===e[2],y(t,s),y(t,o),y(o,a),y(t,f),d||(m=K(i,"change",e[10]),d=!0)},p(g,h){e=g,h&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),h&4&&(i.checked=i.__value===e[2]),h&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(g){g&&v(t),c.r(),d=!1,m()}}}function LA(n){let e=[],t=new Map,i,l=pe(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[PA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),z(t,e,null),y(e,i),z(l,e,null),s=!0,o||(r=K(e,"submit",Ye(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}),l.$set(c)},i(a){s||(A(t.$$.fragment,a),A(l.$$.fragment,a),s=!0)},o(a){I(t.$$.fragment,a),I(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function NA(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function RA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),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:[RA],header:[NA],default:[FA]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const zr="last_email_test",dg="email_test_request";function jA(n,e,t){let i;const l=rt(),s="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(zr),u=o[0].value,f=!1,c=null;function d(O="",E=""){t(1,a=O||localStorage.getItem(zr)),t(2,u=E||o[0].value),Gt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(zr,a),clearTimeout(c),c=setTimeout(()=>{fe.cancelRequest(dg),hi("Test email send timeout.")},3e4);try{await fe.settings.testEmail(a,u,{$cancelKey:dg}),It("Successfully sent test email."),l("submit"),t(4,f=!1),await Qt(),m()}catch(O){t(4,f=!1),fe.error(O)}clearTimeout(c)}}const h=[[]];function _(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const S=()=>g(),$=()=>!f;function T(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function C(O){Ee.call(this,n,O)}function D(O){Ee.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,s,o,g,d,_,h,k,S,$,T,C,D]}class HA extends _e{constructor(e){super(),ge(this,e,jA,qA,he,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function zA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[BA,({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:[UA,({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 Hr({props:F}),te.push(()=>be(u,"config",P));function N(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 Hr({props:q}),te.push(()=>be(d,"config",N));function W(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),h=new Hr({props:G}),te.push(()=>be(h,"config",W)),T=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[WA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});let J=n[0].smtp.enabled&&pg(n);function H(ee,oe){return ee[5]?nI:tI}let U=H(n),le=U(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),c=M(),B(d.$$.fragment),g=M(),B(h.$$.fragment),k=M(),S=b("hr"),$=M(),B(T.$$.fragment),C=M(),J&&J.c(),D=M(),O=b("div"),E=b("div"),L=M(),le.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(E,"class","flex-fill"),p(O,"class","flex")},m(ee,oe){w(ee,e,oe),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),w(ee,r,oe),w(ee,a,oe),z(u,a,null),y(a,c),z(d,a,null),y(a,g),z(h,a,null),w(ee,k,oe),w(ee,S,oe),w(ee,$,oe),z(T,ee,oe),w(ee,C,oe),J&&J.m(ee,oe),w(ee,D,oe),w(ee,O,oe),y(O,E),y(O,L),le.m(O,null),R=!0},p(ee,oe){const Te={};oe[0]&1|oe[1]&24&&(Te.$$scope={dirty:oe,ctx:ee}),i.$set(Te);const je={};oe[0]&1|oe[1]&24&&(je.$$scope={dirty:oe,ctx:ee}),o.$set(je);const Ve={};!f&&oe[0]&1&&(f=!0,Ve.config=ee[0].meta.verificationTemplate,ye(()=>f=!1)),u.$set(Ve);const Qe={};!m&&oe[0]&1&&(m=!0,Qe.config=ee[0].meta.resetPasswordTemplate,ye(()=>m=!1)),d.$set(Qe);const tt={};!_&&oe[0]&1&&(_=!0,tt.config=ee[0].meta.confirmEmailChangeTemplate,ye(()=>_=!1)),h.$set(tt);const Ge={};oe[0]&1|oe[1]&24&&(Ge.$$scope={dirty:oe,ctx:ee}),T.$set(Ge),ee[0].smtp.enabled?J?(J.p(ee,oe),oe[0]&1&&A(J,1)):(J=pg(ee),J.c(),A(J,1),J.m(D.parentNode,D)):J&&(re(),I(J,1,1,()=>{J=null}),ae()),U===(U=H(ee))&&le?le.p(ee,oe):(le.d(1),le=U(ee),le&&(le.c(),le.m(O,null)))},i(ee){R||(A(i.$$.fragment,ee),A(o.$$.fragment,ee),A(u.$$.fragment,ee),A(d.$$.fragment,ee),A(h.$$.fragment,ee),A(T.$$.fragment,ee),A(J),R=!0)},o(ee){I(i.$$.fragment,ee),I(o.$$.fragment,ee),I(u.$$.fragment,ee),I(d.$$.fragment,ee),I(h.$$.fragment,ee),I(T.$$.fragment,ee),I(J),R=!1},d(ee){ee&&(v(e),v(r),v(a),v(k),v(S),v($),v(C),v(D),v(O)),V(i),V(o),V(u),V(d),V(h),V(T,ee),J&&J.d(ee),le.d()}}}function VA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function BA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].meta.senderName),r||(a=K(s,"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(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderName&&ue(s,u[0].meta.senderName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function UA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].meta.senderAddress),r||(a=K(s,"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(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderAddress&&ue(s,u[0].meta.senderAddress)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function WA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[18]),ve(Pe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function pg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T;l=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[YA,({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:[KA,({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:[JA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[ZA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?XA:GA}let D=C(n),O=D(n),E=n[4]&&mg(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),g=M(),h=b("button"),O.c(),_=M(),E&&E.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(h,"type","button"),p(h,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),y(t,a),y(t,u),z(f,u,null),y(t,c),y(t,d),z(m,d,null),y(e,g),y(e,h),O.m(h,null),y(e,_),E&&E.m(e,null),S=!0,$||(T=K(h,"click",Ye(n[23])),$=!0)},p(L,R){const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),l.$set(P);const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),r.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),f.$set(N);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),D!==(D=C(L))&&(O.d(1),O=D(L),O&&(O.c(),O.m(h,null))),L[4]?E?(E.p(L,R),R[0]&16&&A(E,1)):(E=mg(L),E.c(),A(E,1),E.m(e,null)):E&&(re(),I(E,1,1,()=>{E=null}),ae())},i(L){S||(A(l.$$.fragment,L),A(r.$$.fragment,L),A(f.$$.fragment,L),A(m.$$.fragment,L),A(E),L&&Ke(()=>{S&&(k||(k=Le(e,et,{duration:150},!0)),k.run(1))}),S=!0)},o(L){I(l.$$.fragment,L),I(r.$$.fragment,L),I(f.$$.fragment,L),I(m.$$.fragment,L),I(E),L&&(k||(k=Le(e,et,{duration:150},!1)),k.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(f),V(m),O.d(),E&&E.d(),L&&k&&k.end(),$=!1,T()}}}function YA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].smtp.host),r||(a=K(s,"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(s,"id",o),f[0]&1&&s.value!==u[0].smtp.host&&ue(s,u[0].smtp.host)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function KA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].smtp.port),r||(a=K(s,"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(s,"id",o),f[0]&1&&ut(s.value)!==u[0].smtp.port&&ue(s,u[0].smtp.port)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function JA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].smtp.username),r||(a=K(s,"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(s,"id",o),f[0]&1&&s.value!==u[0].smtp.username&&ue(s,u[0].smtp.username)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function ZA(n){let e,t,i,l,s,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),s=new iu({props:u}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=Y("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function GA(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function XA(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function mg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new me({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[QA,({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:[xA,({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:[eI,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),f=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(g,h){w(g,e,h),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),y(e,f),y(e,c),m=!0},p(g,h){const _={};h[0]&1|h[1]&24&&(_.$$scope={dirty:h,ctx:g}),i.$set(_);const k={};h[0]&1|h[1]&24&&(k.$$scope={dirty:h,ctx:g}),o.$set(k);const S={};h[0]&1|h[1]&24&&(S.$$scope={dirty:h,ctx:g}),u.$set(S)},i(g){m||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),g&&Ke(()=>{m&&(d||(d=Le(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(g){I(i.$$.fragment,g),I(o.$$.fragment,g),I(u.$$.fragment,g),g&&(d||(d=Le(e,et,{duration:150},!1)),d.run(0)),m=!1},d(g){g&&v(e),V(i),V(o),V(u),g&&d&&d.end()}}}function QA(n){let e,t,i,l,s,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),s=new _i({props:u}),te.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function xA(n){let e,t,i,l,s,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),s=new _i({props:u}),te.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function eI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=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),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ue(r,n[0].smtp.localName),u||(f=[ve(Pe.call(null,l,{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"})),K(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&ue(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),u=!1,we(f)}}}function tI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function nI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=[K(e,"click",n[27]),K(l,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f[0]&8&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,we(a)}}}function iI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[VA,zA],S=[];function $(T,C){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[6]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[30])),h=!0)},p(T,C){(!g||C[0]&64)&&se(o,T[6]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function lI(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{default:[iI]},$$scope:{ctx:n}}});let r={};return s=new HA({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,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={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function sI(n,e,t){let i,l,s;We(n,Et,ee=>t(6,s=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];tn(Et,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1;g();async function g(){t(2,c=!0);try{const ee=await fe.settings.getAll()||{};_(ee)}catch(ee){fe.error(ee)}t(2,c=!1)}async function h(){if(!(d||!l)){t(3,d=!0);try{const ee=await fe.settings.update(j.filterRedactedProps(f));_(ee),Gt({}),It("Successfully saved mail settings.")}catch(ee){fe.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 k(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function $(){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 C(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function D(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=ut(this.value),t(0,f)}function R(){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,m=!m)};function N(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 W(){f.smtp.localName=this.value,t(0,f)}const G=()=>k(),J=()=>h(),H=()=>a==null?void 0:a.show(),U=()=>h();function le(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,l=i!=JSON.stringify(f))},[f,a,c,d,m,l,s,o,r,h,k,u,i,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J,H,U,le]}class oI extends _e{constructor(e){super(),ge(this,e,sI,lI,he,{},null,[-1,-1])}}const rI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),hg=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function aI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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&&se(s,u[4]),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function gg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D;return i=new me({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[uI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[fI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[cI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[dI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[pI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),S=new me({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[mI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),f=M(),c=b("div"),B(d.$$.fragment),m=M(),g=b("div"),B(h.$$.fragment),_=M(),k=b("div"),B(S.$$.fragment),$=M(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),y(e,f),y(e,c),z(d,c,null),y(e,m),y(e,g),z(h,g,null),y(e,_),y(e,k),z(S,k,null),y(e,$),y(e,T),D=!0},p(O,E){const L={};E&8&&(L.name=O[3]+".endpoint"),E&1081345&&(L.$$scope={dirty:E,ctx:O}),i.$set(L);const R={};E&8&&(R.name=O[3]+".bucket"),E&1081345&&(R.$$scope={dirty:E,ctx:O}),o.$set(R);const P={};E&8&&(P.name=O[3]+".region"),E&1081345&&(P.$$scope={dirty:E,ctx:O}),u.$set(P);const F={};E&8&&(F.name=O[3]+".accessKey"),E&1081345&&(F.$$scope={dirty:E,ctx:O}),d.$set(F);const N={};E&8&&(N.name=O[3]+".secret"),E&1081345&&(N.$$scope={dirty:E,ctx:O}),h.$set(N);const q={};E&8&&(q.name=O[3]+".forcePathStyle"),E&1081345&&(q.$$scope={dirty:E,ctx:O}),S.$set(q)},i(O){D||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(h.$$.fragment,O),A(S.$$.fragment,O),O&&Ke(()=>{D&&(C||(C=Le(e,et,{duration:150},!0)),C.run(1))}),D=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(u.$$.fragment,O),I(d.$$.fragment,O),I(h.$$.fragment,O),I(S.$$.fragment,O),O&&(C||(C=Le(e,et,{duration:150},!1)),C.run(0)),D=!1},d(O){O&&v(e),V(i),V(o),V(u),V(d),V(h),V(S),O&&C&&C.end()}}}function uI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].endpoint),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].endpoint&&ue(s,u[0].endpoint)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function fI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].bucket),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].bucket&&ue(s,u[0].bucket)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function cI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].region),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].region&&ue(s,u[0].region)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function dI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].accessKey),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0].accessKey&&ue(s,u[0].accessKey)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function pI(n){let e,t,i,l,s,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),s=new iu({props:u}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=Y("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function mI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[14]),ve(Pe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function hI(n){let e,t,i,l,s;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[aI,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=vt(o,n,n[15],hg);let a=n[0].enabled&&gg(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ke()},m(u,f){z(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,l,f),s=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!s||f&32775)&&St(r,o,u,u[15],s?wt(o,u[15],f,rI):Tt(u[15]),hg),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=gg(u),a.c(),A(a,1),a.m(l.parentNode,l)):a&&(re(),I(a,1,1,()=>{a=null}),ae())},i(u){s||(A(e.$$.fragment,u),A(r,u),A(a),s=!0)},o(u){I(e.$$.fragment,u),I(r,u),I(a),s=!1},d(u){u&&(v(t),v(i),v(l)),V(e,u),r&&r.d(u),a&&a.d(u)}}}const Vr="s3_test_request";function gI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=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,m=null;function g(O){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{h()},O)}async function h(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;fe.cancelRequest(Vr),clearTimeout(d),d=setTimeout(()=>{fe.cancelRequest(Vr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let O;try{await fe.settings.testS3(u,{$cancelKey:Vr})}catch(E){O=E}return O!=null&&O.isAbort||(t(1,f=O),t(2,c=!1),clearTimeout(d)),f}Vt(()=>()=>{clearTimeout(d),clearTimeout(m)});function _(){o.enabled=this.checked,t(0,o)}function k(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function $(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function C(O){n.$$.not_equal(o.secret,O)&&(o.secret=O,t(0,o))}function D(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=O=>{"originalConfig"in O&&t(5,s=O.originalConfig),"config"in O&&t(0,o=O.config),"configKey"in O&&t(3,r=O.configKey),"toggleLabel"in O&&t(4,a=O.toggleLabel),"testFilesystem"in O&&t(6,u=O.testFilesystem),"testError"in O&&t(1,f=O.testError),"isTesting"in O&&t(2,c=O.isTesting),"$$scope"in O&&t(15,l=O.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&g(100),n.$$.dirty&9&&(o.enabled||ii(r))},[o,f,c,r,a,s,u,i,_,k,S,$,T,C,D,l]}class n0 extends _e{constructor(e){super(),ge(this,e,gI,hI,he,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function _I(n){var O;let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;function k(E){n[11](E)}function S(E){n[12](E)}function $(E){n[13](E)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[yI]},$$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 n0({props:T}),te.push(()=>be(e,"config",k)),te.push(()=>be(e,"isTesting",S)),te.push(()=>be(e,"testError",$));let C=((O=n[1].s3)==null?void 0:O.enabled)&&!n[6]&&!n[3]&&bg(n),D=n[6]&&yg(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),u=M(),D&&D.c(),f=M(),c=b("button"),d=b("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=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(E,L){z(e,E,L),w(E,s,L),w(E,o,L),y(o,r),y(o,a),C&&C.m(o,null),y(o,u),D&&D.m(o,null),y(o,f),y(o,c),y(c,d),g=!0,h||(_=K(c,"click",n[15]),h=!0)},p(E,L){var P;const R={};L&1&&(R.originalConfig=E[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:E}),!t&&L&2&&(t=!0,R.config=E[1].s3,ye(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=E[4],ye(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=E[5],ye(()=>l=!1)),e.$set(R),(P=E[1].s3)!=null&&P.enabled&&!E[6]&&!E[3]?C?C.p(E,L):(C=bg(E),C.c(),C.m(o,u)):C&&(C.d(1),C=null),E[6]?D?D.p(E,L):(D=yg(E),D.c(),D.m(o,f)):D&&(D.d(1),D=null),(!g||L&72&&m!==(m=!E[6]||E[3]))&&(c.disabled=m),(!g||L&8)&&x(c,"btn-loading",E[3])},i(E){g||(A(e.$$.fragment,E),g=!0)},o(E){I(e.$$.fragment,E),g=!1},d(E){E&&(v(s),v(o)),V(e,E),C&&C.d(),D&&D.d(),h=!1,_()}}}function bI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function _g(n){var L;let e,t,i,l,s,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",m,g,h,_,k,S,$,T,C,D,O,E;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=Y(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),u=Y(a),f=Y(` to the @@ -136,26 +136,26 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t `),k=b("a"),k.textContent=`rclone `,S=Y(`, `),$=b("a"),$.textContent=`s5cmd - `,T=Y(", etc."),C=M(),D=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(R,P){w(R,e,P),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(r,u),y(s,f),y(s,c),y(c,m),y(s,g),y(s,h),y(s,_),y(s,k),y(s,S),y(s,$),y(s,T),y(e,C),y(e,D),E=!0},p(R,P){var F;(!E||P&1)&&a!==(a=(F=R[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&se(u,a),(!E||P&2)&&d!==(d=R[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(R){E||(R&&Ke(()=>{E&&(O||(O=Le(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(R){R&&(O||(O=Le(e,et,{duration:150},!1)),O.run(0)),E=!1},d(R){R&&v(e),R&&O&&O.end()}}}function cI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&gg(n);return{c(){t&&t.c(),e=ke()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&A(t,1)):(t=gg(l),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(re(),I(t,1,1,()=>{t=null}),ae())},d(l){l&&v(e),t&&t.d(l)}}}function _g(n){let e;function t(s,o){return s[4]?mI:s[5]?pI:dI}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function dI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function pI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=ve(t=Fe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&$t(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function mI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function bg(n){let e,t,i,l;return{c(){e=b("button"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function hI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[fI,uI],S=[];function $(T,C){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[7]),r=M(),a=b("div"),u=b("form"),f=b("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=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[16])),h=!0)},p(T,C){(!g||C&128)&&se(o,T[7]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function gI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[hI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}const _I="s3_test_request";function bI(n,e,t){let i,l,s;We(n,Et,D=>t(7,s=D)),tn(Et,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const D=await ue.settings.getAll()||{};g(D)}catch(D){ue.error(D)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{ue.cancelRequest(_I);const D=await ue.settings.update(j.filterRedactedProps(r));Gt({}),await g(D),Ea(),c?rv("Successfully saved but failed to establish S3 connection."):It("Successfully saved files storage settings.")}catch(D){ue.error(D)}t(3,u=!1)}}async function g(D={}){t(1,r={s3:(D==null?void 0:D.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(D){n.$$.not_equal(r.s3,D)&&(r.s3=D,t(1,r))}function k(D){f=D,t(4,f)}function S(D){c=D,t(5,c)}const $=()=>h(),T=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,h,i,_,k,S,$,T,C]}class yI extends be{constructor(e){super(),_e(this,e,bI,gI,me,{})}}function kI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ce(s,n[1].clientId),a||(u=K(s,"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(s,"id",o),c&2&&r!==(r=f[1].enabled)&&(s.required=r),c&2&&s.value!==f[1].clientId&&ce(s,f[1].clientId)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function wI(n){let e,t,i,l,s,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),s=new nu({props:u}),te.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=Y("Client secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function yg(n){let e,t,i,l;const s=[{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=pt(s,[{key:u[3].key},Ct(u[3].optionsComponentProps||{})]);else for(let d=0;dge(t,"config",o))),{c(){e=b("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&z(t,e,null),l=!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=Dt(r,a(u,f)),te.push(()=>ge(t,"config",o)),B(t.$$.fragment),A(t.$$.fragment,1),z(t,e,null)):t=null}else if(r){const c=f&8?pt(s,[{key:u[3].key},Ct(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],ye(()=>i=!1)),t.$set(c)}},i(u){l||(t&&A(t.$$.fragment,u),l=!0)},o(u){t&&I(t.$$.fragment,u),l=!1},d(u){u&&v(e),t&&V(t)}}}function SI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new he({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[kI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[vI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),u=new he({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[wI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}});let g=n[3].optionsComponent&&yg(n);return{c(){e=b("form"),t=b("div"),B(i.$$.fragment),l=M(),s=b("button"),s.innerHTML='Clear all fields',o=M(),B(r.$$.fragment),a=M(),B(u.$$.fragment),f=M(),g&&g.c(),p(s,"type","button"),p(s,"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(h,_){w(h,e,_),y(e,t),z(i,t,null),y(t,l),y(t,s),y(e,o),z(r,e,null),y(e,a),z(u,e,null),y(e,f),g&&g.m(e,null),c=!0,d||(m=[K(s,"click",n[8]),K(e,"submit",Ye(n[15]))],d=!0)},p(h,_){const k={};_&8&&(k.name=h[3].key+".enabled"),_&3145730&&(k.$$scope={dirty:_,ctx:h}),i.$set(k);const S={};_&2&&(S.class="form-field "+(h[1].enabled?"required":"")),_&8&&(S.name=h[3].key+".clientId"),_&3145730&&(S.$$scope={dirty:_,ctx:h}),r.$set(S);const $={};_&2&&($.class="form-field "+(h[1].enabled?"required":"")),_&8&&($.name=h[3].key+".clientSecret"),_&3145730&&($.$$scope={dirty:_,ctx:h}),u.$set($),h[3].optionsComponent?g?(g.p(h,_),_&8&&A(g,1)):(g=yg(h),g.c(),A(g,1),g.m(e,null)):g&&(re(),I(g,1,1,()=>{g=null}),ae())},i(h){c||(A(i.$$.fragment,h),A(r.$$.fragment,h),A(u.$$.fragment,h),A(g),c=!0)},o(h){I(i.$$.fragment,h),I(r.$$.fragment,h),I(u.$$.fragment,h),I(g),c=!1},d(h){h&&v(e),V(i),V(r),V(u),g&&g.d(),d=!1,we(m)}}}function TI(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=Y(t),l=Y(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&se(i,t)},d(s){s&&v(e)}}}function $I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function CI(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[$I],header:[TI],default:[SI]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[16](null),V(e,l)}}}function MI(n,e,t){let i;const l=rt(),s="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function c(O,E){Gt({}),t(3,r=Object.assign({},O)),t(1,a=Object.assign({enabled:!0},E)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,u=!0);try{const O={};O[r.key]=j.filterRedactedProps(a);const E=await ue.settings.update(O);Gt({}),It("Successfully updated provider settings."),l("submit",E),d()}catch(O){ue.error(O)}t(4,u=!1)}function g(){for(let O in a)t(1,a[O]="",a);t(1,a.enabled=!1,a)}function h(){a.enabled=this.checked,t(1,a)}function _(){a.clientId=this.value,t(1,a)}function k(O){n.$$.not_equal(a.clientSecret,O)&&(a.clientSecret=O,t(1,a))}function S(O){a=O,t(1,a)}const $=()=>m();function T(O){te[O?"unshift":"push"](()=>{o=O,t(2,o)})}function C(O){Ee.call(this,n,O)}function D(O){Ee.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,s,m,g,c,f,h,_,k,S,$,T,C,D]}class OI extends be{constructor(e){super(),_e(this,e,MI,CI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function kg(n){let e,t,i;return{c(){e=b("img"),nn(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!nn(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function vg(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function DI(n){let e,t,i,l,s=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,m,g,h,_,k,S,$,T,C=n[1].logo&&kg(n),D=n[0].enabled&&vg(),O={};return k=new OI({props:O}),n[4](k),k.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=M(),l=b("div"),o=Y(s),r=M(),a=b("em"),u=Y("("),c=Y(f),d=Y(")"),m=M(),D&&D.c(),g=M(),h=b("button"),h.innerHTML='',_=M(),B(k.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(h,"type","button"),p(h,"class","btn btn-circle btn-hint btn-transparent"),p(h,"aria-label","Provider settings"),p(e,"class","provider-card")},m(E,L){w(E,e,L),y(e,t),C&&C.m(t,null),y(e,i),y(e,l),y(l,o),y(e,r),y(e,a),y(a,u),y(a,c),y(a,d),y(e,m),D&&D.m(e,null),y(e,g),y(e,h),w(E,_,L),z(k,E,L),S=!0,$||(T=K(h,"click",n[3]),$=!0)},p(E,[L]){E[1].logo?C?C.p(E,L):(C=kg(E),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=E[1].title+"")&&se(o,s),(!S||L&2)&&f!==(f=E[1].key.slice(0,-4)+"")&&se(c,f),E[0].enabled?D||(D=vg(),D.c(),D.m(e,g)):D&&(D.d(1),D=null);const R={};k.$set(R)},i(E){S||(A(k.$$.fragment,E),S=!0)},o(E){I(k.$$.fragment,E),S=!1},d(E){E&&(v(e),v(_)),C&&C.d(),D&&D.d(),n[4](null),V(k,E),$=!1,T()}}}function EI(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{u.detail[i.key]&&t(0,l=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class n0 extends be{constructor(e){super(),_e(this,e,EI,DI,me,{provider:1,config:0})}}function wg(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Sg(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function AI(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,u,f=pe(n[3]);const c=h=>h[9].key;for(let h=0;h0&&n[2].length>0&&$g(),m=pe(n[2]);const g=h=>h[9].key;for(let h=0;h0&&h[2].length>0?d||(d=$g(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&5&&(m=pe(h[2]),re(),r=dt(r,_,g,1,h,m,a,o,Lt,Cg,null,wg),ae())},i(h){if(!u){for(let _=0;_ge(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),z(i,t,null),y(t,s),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!l&&f&9&&(l=!0,c.config=e[0][e[9].key],ye(()=>l=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i)}}}function $g(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Cg(n,e){let t,i,l,s,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 n0({props:a}),te.push(()=>ge(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),z(i,t,null),y(t,s),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!l&&f&5&&(l=!0,c.config=e[0][e[9].key],ye(()=>l=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i)}}}function LI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;const h=[II,AI],_=[];function k(S,$){return S[1]?0:1}return d=k(n),m=_[d]=h[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[4]),r=M(),a=b("div"),u=b("div"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,$){w(S,e,$),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(S,r,$),w(S,a,$),y(a,u),y(u,f),y(u,c),_[d].m(u,null),g=!0},p(S,$){(!g||$&16)&&se(o,S[4]);let T=d;d=k(S),d===T?_[d].p(S,$):(re(),I(_[T],1,1,()=>{_[T]=null}),ae(),m=_[d],m?m.p(S,$):(m=_[d]=h[d](S),m.c()),A(m,1),m.m(u,null))},i(S){g||(A(m),g=!0)},o(S){I(m),g=!1},d(S){S&&(v(e),v(r),v(a)),_[d].d()}}}function PI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[LI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function FI(n,e,t){let i,l,s;We(n,Et,d=>t(4,s=d)),tn(Et,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ue.settings.getAll()||{};u(d)}catch(d){ue.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const m of yo)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function f(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=yo.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=yo.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,f,c]}class NI extends be{constructor(e){super(),_e(this,e,FI,PI,me,{})}}function RI(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=Y(n[3]),i=Y(" duration (in seconds)"),s=M(),o=b("input"),a=M(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,g){w(m,e,g),y(e,t),y(e,i),w(m,s,g),w(m,o,g),ce(o,n[0]),w(m,a,g),w(m,u,g),y(u,f),c||(d=[K(o,"input",n[4]),K(f,"click",n[5])],c=!0)},p(m,g){g&8&&se(t,m[3]),g&64&&l!==(l=m[6])&&p(e,"for",l),g&64&&r!==(r=m[6])&&p(o,"id",r),g&1&&ut(o.value)!==m[0]&&ce(o,m[0]),g&2&&x(f,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(u)),c=!1,we(d)}}}function qI(n){let e,t;return e=new he({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[RI,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function jI(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=ut(this.value),t(0,s)}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,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class i0 extends be{constructor(e){super(),_e(this,e,jI,qI,me,{key:2,label:3,duration:0,secret:1})}}function Mg(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Og(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=[],l=new Map,s,o,r,a,u,f=[],c=new Map,d,m,g,h,_,k,S,$,T,C,D,O=pe(n[5]);const E=F=>F[19].key;for(let F=0;FF[19].key;for(let F=0;Fge(i,"duration",r)),te.push(()=>ge(i,"secret",a)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),z(i,f,c),o=!0},p(f,c){e=f;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ye(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ye(()=>s=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i,f)}}}function Eg(n,e){let t,i,l,s,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 i0({props:u}),te.push(()=>ge(i,"duration",r)),te.push(()=>ge(i,"secret",a)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),z(i,f,c),o=!0},p(f,c){e=f;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ye(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ye(()=>s=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i,f)}}}function Ag(n){let e,t,i,l;return{c(){e=b("button"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function VI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[zI,HI],S=[];function $(T,C){return T[1]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[4]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Adjust common token options.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[7])),h=!0)},p(T,C){(!g||C&16)&&se(o,T[4]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function BI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[VI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function UI(n,e,t){let i,l,s;We(n,Et,D=>t(4,s=D));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"}];tn(Et,s="Token options",s);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const D=await ue.settings.getAll()||{};g(D)}catch(D){ue.error(D)}t(1,f=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const D=await ue.settings.update(j.filterRedactedProps(u));g(D),It("Successfully saved tokens options.")}catch(D){ue.error(D)}t(2,c=!1)}}function g(D){var E;D=D||{},t(0,u={});const O=o.concat(r);for(const L of O)t(0,u[L.key]={duration:((E=D[L.key])==null?void 0:E.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function h(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function _(D,O){n.$$.not_equal(u[O.key].duration,D)&&(u[O.key].duration=D,t(0,u))}function k(D,O){n.$$.not_equal(u[O.key].secret,D)&&(u[O.key].secret=D,t(0,u))}function S(D,O){n.$$.not_equal(u[O.key].duration,D)&&(u[O.key].duration=D,t(0,u))}function $(D,O){n.$$.not_equal(u[O.key].secret,D)&&(u[O.key].secret=D,t(0,u))}const T=()=>h(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(u))},[u,f,c,l,s,o,r,m,h,a,i,_,k,S,$,T,C]}class WI extends be{constructor(e){super(),_e(this,e,UI,BI,me,{})}}function YI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return o=new Vb({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`

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

    `,t=M(),i=b("div"),l=b("button"),l.innerHTML='Copy',s=M(),B(o.$$.fragment),r=M(),a=b("div"),u=b("div"),f=M(),c=b("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(l,"type","button"),p(l,"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(h,_){w(h,e,_),w(h,t,_),w(h,i,_),y(i,l),y(i,s),z(o,i,null),n[8](i),w(h,r,_),w(h,a,_),y(a,u),y(a,f),y(a,c),d=!0,m||(g=[K(l,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(h,_){const k={};_&4&&(k.content=h[2]),o.$set(k)},i(h){d||(A(o.$$.fragment,h),d=!0)},o(h){I(o.$$.fragment,h),d=!1},d(h){h&&(v(e),v(t),v(i),v(r),v(a)),V(o),n[8](null),m=!1,we(g)}}}function KI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function JI(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[KI,YI],g=[];function h(_,k){return _[1]?0:1}return f=h(n),c=g[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[3]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),g[f].m(u,null),d=!0},p(_,k){(!d||k&8)&&se(o,_[3]);let S=f;f=h(_),f===S?g[f].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,k):(c=g[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(v(e),v(r),v(a)),g[f].d()}}}function ZI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[JI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function GI(n,e,t){let i,l;We(n,Et,_=>t(3,l=_)),tn(Et,l="Export collections",l);const s="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ue.collections.getFullList(100,{$cancelKey:s,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){ue.error(_)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),$o("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const k=window.getSelection(),S=document.createRange();S.selectNodeContents(o),k.removeAllRanges(),k.addRange(S)}},h=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,l,f,c,r,d,m,g,h]}class XI extends be{constructor(e){super(),_e(this,e,GI,ZI,me,{})}}function Ig(n,e,t){const i=n.slice();return i[14]=e[t],i}function Lg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Pg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Fg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Ng(n,e,t){const i=n.slice();return i[14]=e[t],i}function Rg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function qg(n,e,t){const i=n.slice();return i[30]=e[t],i}function QI(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&jg(),a=n[0].name!==n[1].name&&Hg(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=Y(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),y(e,t),a&&a.m(e,null),y(e,i),y(e,l),y(l,o)},p(u,f){u[9]?r||(r=jg(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Hg(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&se(o,s)},d(u){u&&v(e),r&&r.d(),a&&a.d()}}}function xI(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=M(),i=b("strong"),s=Y(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),y(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function eL(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=M(),i=b("strong"),s=Y(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),y(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function jg(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Hg(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=Y(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),y(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function zg(n){var g,h;let e,t,i,l,s,o,r=n[12]((g=n[0])==null?void 0:g[n[30]])+"",a,u,f,c,d=n[12]((h=n[1])==null?void 0:h[n[30]])+"",m;return{c(){var _,k,S,$,T,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=M(),s=b("td"),o=b("pre"),a=Y(r),u=M(),f=b("td"),c=b("pre"),m=Y(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&mn((_=n[0])==null?void 0:_[n[30]],(k=n[1])==null?void 0:k[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),x(f,"changed-new-col",!n[5]&&mn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),x(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",mn((T=n[0])==null?void 0:T[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(_,k){w(_,e,k),y(e,t),y(t,i),y(e,l),y(e,s),y(s,o),y(o,a),y(e,u),y(e,f),y(f,c),y(c,m)},p(_,k){var S,$,T,C,D,O,E,L;k[0]&1&&r!==(r=_[12]((S=_[0])==null?void 0:S[_[30]])+"")&&se(a,r),k[0]&3075&&x(s,"changed-old-col",!_[10]&&mn(($=_[0])==null?void 0:$[_[30]],(T=_[1])==null?void 0:T[_[30]])),k[0]&1024&&x(s,"changed-none-col",_[10]),k[0]&2&&d!==(d=_[12]((C=_[1])==null?void 0:C[_[30]])+"")&&se(m,d),k[0]&2083&&x(f,"changed-new-col",!_[5]&&mn((D=_[0])==null?void 0:D[_[30]],(O=_[1])==null?void 0:O[_[30]])),k[0]&32&&x(f,"changed-none-col",_[5]),k[0]&2051&&x(e,"txt-primary",mn((E=_[0])==null?void 0:E[_[30]],(L=_[1])==null?void 0:L[_[30]]))},d(_){_&&v(e)}}}function Vg(n){let e,t=pe(n[6]),i=[];for(let l=0;lProps Old New',s=M(),o=b("tbody");for(let T=0;T!["schema","created","updated"].includes(k));function h(){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(k=>!f.find(S=>k.id==S.id))))}function _(k){return typeof k>"u"?"":j.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!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")&&h(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,s,l,g,_]}class iL extends be{constructor(e){super(),_e(this,e,nL,tL,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Gg(n,e,t){const i=n.slice();return i[17]=e[t],i}function Xg(n){let e,t;return e=new iL({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lL(n){let e,t,i=pe(n[2]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{E&&(O||(O=Le(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(R){R&&(O||(O=Le(e,et,{duration:150},!1)),O.run(0)),E=!1},d(R){R&&v(e),R&&O&&O.end()}}}function yI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&_g(n);return{c(){t&&t.c(),e=ke()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&A(t,1)):(t=_g(l),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(re(),I(t,1,1,()=>{t=null}),ae())},d(l){l&&v(e),t&&t.d(l)}}}function bg(n){let e;function t(s,o){return s[4]?wI:s[5]?vI:kI}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function kI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function vI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=ve(t=Pe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&$t(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function wI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yg(n){let e,t,i,l;return{c(){e=b("button"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function SI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[bI,_I],S=[];function $(T,C){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[7]),r=M(),a=b("div"),u=b("form"),f=b("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=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[16])),h=!0)},p(T,C){(!g||C&128)&&se(o,T[7]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function TI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[SI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}const $I="s3_test_request";function CI(n,e,t){let i,l,s;We(n,Et,D=>t(7,s=D)),tn(Et,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const D=await fe.settings.getAll()||{};g(D)}catch(D){fe.error(D)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{fe.cancelRequest($I);const D=await fe.settings.update(j.filterRedactedProps(r));Gt({}),await g(D),Aa(),c?av("Successfully saved but failed to establish S3 connection."):It("Successfully saved files storage settings.")}catch(D){fe.error(D)}t(3,u=!1)}}async function g(D={}){t(1,r={s3:(D==null?void 0:D.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(D){n.$$.not_equal(r.s3,D)&&(r.s3=D,t(1,r))}function k(D){f=D,t(4,f)}function S(D){c=D,t(5,c)}const $=()=>h(),T=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,h,i,_,k,S,$,T,C]}class MI extends _e{constructor(e){super(),ge(this,e,CI,TI,he,{})}}function OI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function DI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ue(s,n[1].clientId),a||(u=K(s,"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(s,"id",o),c&2&&r!==(r=f[1].enabled)&&(s.required=r),c&2&&s.value!==f[1].clientId&&ue(s,f[1].clientId)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function EI(n){let e,t,i,l,s,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),s=new iu({props:u}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=Y("Client secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,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,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function kg(n){let e,t,i,l;const s=[{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=pt(s,[{key:u[3].key},Ct(u[3].optionsComponentProps||{})]);else for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&z(t,e,null),l=!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=Dt(r,a(u,f)),te.push(()=>be(t,"config",o)),B(t.$$.fragment),A(t.$$.fragment,1),z(t,e,null)):t=null}else if(r){const c=f&8?pt(s,[{key:u[3].key},Ct(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],ye(()=>i=!1)),t.$set(c)}},i(u){l||(t&&A(t.$$.fragment,u),l=!0)},o(u){t&&I(t.$$.fragment,u),l=!1},d(u){u&&v(e),t&&V(t)}}}function AI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new me({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[OI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[DI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[EI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}});let g=n[3].optionsComponent&&kg(n);return{c(){e=b("form"),t=b("div"),B(i.$$.fragment),l=M(),s=b("button"),s.innerHTML='Clear all fields',o=M(),B(r.$$.fragment),a=M(),B(u.$$.fragment),f=M(),g&&g.c(),p(s,"type","button"),p(s,"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(h,_){w(h,e,_),y(e,t),z(i,t,null),y(t,l),y(t,s),y(e,o),z(r,e,null),y(e,a),z(u,e,null),y(e,f),g&&g.m(e,null),c=!0,d||(m=[K(s,"click",n[8]),K(e,"submit",Ye(n[15]))],d=!0)},p(h,_){const k={};_&8&&(k.name=h[3].key+".enabled"),_&3145730&&(k.$$scope={dirty:_,ctx:h}),i.$set(k);const S={};_&2&&(S.class="form-field "+(h[1].enabled?"required":"")),_&8&&(S.name=h[3].key+".clientId"),_&3145730&&(S.$$scope={dirty:_,ctx:h}),r.$set(S);const $={};_&2&&($.class="form-field "+(h[1].enabled?"required":"")),_&8&&($.name=h[3].key+".clientSecret"),_&3145730&&($.$$scope={dirty:_,ctx:h}),u.$set($),h[3].optionsComponent?g?(g.p(h,_),_&8&&A(g,1)):(g=kg(h),g.c(),A(g,1),g.m(e,null)):g&&(re(),I(g,1,1,()=>{g=null}),ae())},i(h){c||(A(i.$$.fragment,h),A(r.$$.fragment,h),A(u.$$.fragment,h),A(g),c=!0)},o(h){I(i.$$.fragment,h),I(r.$$.fragment,h),I(u.$$.fragment,h),I(g),c=!1},d(h){h&&v(e),V(i),V(r),V(u),g&&g.d(),d=!1,we(m)}}}function II(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=Y(t),l=Y(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&se(i,t)},d(s){s&&v(e)}}}function LI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function PI(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[LI],header:[II],default:[AI]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[16](null),V(e,l)}}}function FI(n,e,t){let i;const l=rt(),s="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function c(O,E){Gt({}),t(3,r=Object.assign({},O)),t(1,a=Object.assign({enabled:!0},E)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,u=!0);try{const O={};O[r.key]=j.filterRedactedProps(a);const E=await fe.settings.update(O);Gt({}),It("Successfully updated provider settings."),l("submit",E),d()}catch(O){fe.error(O)}t(4,u=!1)}function g(){for(let O in a)t(1,a[O]="",a);t(1,a.enabled=!1,a)}function h(){a.enabled=this.checked,t(1,a)}function _(){a.clientId=this.value,t(1,a)}function k(O){n.$$.not_equal(a.clientSecret,O)&&(a.clientSecret=O,t(1,a))}function S(O){a=O,t(1,a)}const $=()=>m();function T(O){te[O?"unshift":"push"](()=>{o=O,t(2,o)})}function C(O){Ee.call(this,n,O)}function D(O){Ee.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,s,m,g,c,f,h,_,k,S,$,T,C,D]}class NI extends _e{constructor(e){super(),ge(this,e,FI,PI,he,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function vg(n){let e,t,i;return{c(){e=b("img"),nn(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!nn(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function wg(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function RI(n){let e,t,i,l,s=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,m,g,h,_,k,S,$,T,C=n[1].logo&&vg(n),D=n[0].enabled&&wg(),O={};return k=new NI({props:O}),n[4](k),k.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=M(),l=b("div"),o=Y(s),r=M(),a=b("em"),u=Y("("),c=Y(f),d=Y(")"),m=M(),D&&D.c(),g=M(),h=b("button"),h.innerHTML='',_=M(),B(k.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(h,"type","button"),p(h,"class","btn btn-circle btn-hint btn-transparent"),p(h,"aria-label","Provider settings"),p(e,"class","provider-card")},m(E,L){w(E,e,L),y(e,t),C&&C.m(t,null),y(e,i),y(e,l),y(l,o),y(e,r),y(e,a),y(a,u),y(a,c),y(a,d),y(e,m),D&&D.m(e,null),y(e,g),y(e,h),w(E,_,L),z(k,E,L),S=!0,$||(T=K(h,"click",n[3]),$=!0)},p(E,[L]){E[1].logo?C?C.p(E,L):(C=vg(E),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=E[1].title+"")&&se(o,s),(!S||L&2)&&f!==(f=E[1].key.slice(0,-4)+"")&&se(c,f),E[0].enabled?D||(D=wg(),D.c(),D.m(e,g)):D&&(D.d(1),D=null);const R={};k.$set(R)},i(E){S||(A(k.$$.fragment,E),S=!0)},o(E){I(k.$$.fragment,E),S=!1},d(E){E&&(v(e),v(_)),C&&C.d(),D&&D.d(),n[4](null),V(k,E),$=!1,T()}}}function qI(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{u.detail[i.key]&&t(0,l=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class i0 extends _e{constructor(e){super(),ge(this,e,qI,RI,he,{provider:1,config:0})}}function Sg(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Tg(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function jI(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,u,f=pe(n[3]);const c=h=>h[9].key;for(let h=0;h0&&n[2].length>0&&Cg(),m=pe(n[2]);const g=h=>h[9].key;for(let h=0;h0&&h[2].length>0?d||(d=Cg(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&5&&(m=pe(h[2]),re(),r=dt(r,_,g,1,h,m,a,o,Lt,Mg,null,Sg),ae())},i(h){if(!u){for(let _=0;_be(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),z(i,t,null),y(t,s),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!l&&f&9&&(l=!0,c.config=e[0][e[9].key],ye(()=>l=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i)}}}function Cg(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Mg(n,e){let t,i,l,s,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 i0({props:a}),te.push(()=>be(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),z(i,t,null),y(t,s),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!l&&f&5&&(l=!0,c.config=e[0][e[9].key],ye(()=>l=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i)}}}function zI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;const h=[HI,jI],_=[];function k(S,$){return S[1]?0:1}return d=k(n),m=_[d]=h[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[4]),r=M(),a=b("div"),u=b("div"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,$){w(S,e,$),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(S,r,$),w(S,a,$),y(a,u),y(u,f),y(u,c),_[d].m(u,null),g=!0},p(S,$){(!g||$&16)&&se(o,S[4]);let T=d;d=k(S),d===T?_[d].p(S,$):(re(),I(_[T],1,1,()=>{_[T]=null}),ae(),m=_[d],m?m.p(S,$):(m=_[d]=h[d](S),m.c()),A(m,1),m.m(u,null))},i(S){g||(A(m),g=!0)},o(S){I(m),g=!1},d(S){S&&(v(e),v(r),v(a)),_[d].d()}}}function VI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[zI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function BI(n,e,t){let i,l,s;We(n,Et,d=>t(4,s=d)),tn(Et,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await fe.settings.getAll()||{};u(d)}catch(d){fe.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const m of bo)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function f(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=bo.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=bo.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,f,c]}class UI extends _e{constructor(e){super(),ge(this,e,BI,VI,he,{})}}function WI(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=Y(n[3]),i=Y(" duration (in seconds)"),s=M(),o=b("input"),a=M(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,g){w(m,e,g),y(e,t),y(e,i),w(m,s,g),w(m,o,g),ue(o,n[0]),w(m,a,g),w(m,u,g),y(u,f),c||(d=[K(o,"input",n[4]),K(f,"click",n[5])],c=!0)},p(m,g){g&8&&se(t,m[3]),g&64&&l!==(l=m[6])&&p(e,"for",l),g&64&&r!==(r=m[6])&&p(o,"id",r),g&1&&ut(o.value)!==m[0]&&ue(o,m[0]),g&2&&x(f,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(u)),c=!1,we(d)}}}function YI(n){let e,t;return e=new me({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[WI,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function KI(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=ut(this.value),t(0,s)}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,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class l0 extends _e{constructor(e){super(),ge(this,e,KI,YI,he,{key:2,label:3,duration:0,secret:1})}}function Og(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Dg(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function JI(n){let e,t,i=[],l=new Map,s,o,r,a,u,f=[],c=new Map,d,m,g,h,_,k,S,$,T,C,D,O=pe(n[5]);const E=F=>F[19].key;for(let F=0;FF[19].key;for(let F=0;Fbe(i,"duration",r)),te.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),z(i,f,c),o=!0},p(f,c){e=f;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ye(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ye(()=>s=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i,f)}}}function Ag(n,e){let t,i,l,s,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 l0({props:u}),te.push(()=>be(i,"duration",r)),te.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),z(i,f,c),o=!0},p(f,c){e=f;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ye(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ye(()=>s=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i,f)}}}function Ig(n){let e,t,i,l;return{c(){e=b("button"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function GI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[ZI,JI],S=[];function $(T,C){return T[1]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[4]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Adjust common token options.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[7])),h=!0)},p(T,C){(!g||C&16)&&se(o,T[4]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function XI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[GI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function QI(n,e,t){let i,l,s;We(n,Et,D=>t(4,s=D));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"}];tn(Et,s="Token options",s);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const D=await fe.settings.getAll()||{};g(D)}catch(D){fe.error(D)}t(1,f=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const D=await fe.settings.update(j.filterRedactedProps(u));g(D),It("Successfully saved tokens options.")}catch(D){fe.error(D)}t(2,c=!1)}}function g(D){var E;D=D||{},t(0,u={});const O=o.concat(r);for(const L of O)t(0,u[L.key]={duration:((E=D[L.key])==null?void 0:E.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function h(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function _(D,O){n.$$.not_equal(u[O.key].duration,D)&&(u[O.key].duration=D,t(0,u))}function k(D,O){n.$$.not_equal(u[O.key].secret,D)&&(u[O.key].secret=D,t(0,u))}function S(D,O){n.$$.not_equal(u[O.key].duration,D)&&(u[O.key].duration=D,t(0,u))}function $(D,O){n.$$.not_equal(u[O.key].secret,D)&&(u[O.key].secret=D,t(0,u))}const T=()=>h(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(u))},[u,f,c,l,s,o,r,m,h,a,i,_,k,S,$,T,C]}class xI extends _e{constructor(e){super(),ge(this,e,QI,XI,he,{})}}function eL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return o=new Bb({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`

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

    `,t=M(),i=b("div"),l=b("button"),l.innerHTML='Copy',s=M(),B(o.$$.fragment),r=M(),a=b("div"),u=b("div"),f=M(),c=b("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(l,"type","button"),p(l,"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(h,_){w(h,e,_),w(h,t,_),w(h,i,_),y(i,l),y(i,s),z(o,i,null),n[8](i),w(h,r,_),w(h,a,_),y(a,u),y(a,f),y(a,c),d=!0,m||(g=[K(l,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(h,_){const k={};_&4&&(k.content=h[2]),o.$set(k)},i(h){d||(A(o.$$.fragment,h),d=!0)},o(h){I(o.$$.fragment,h),d=!1},d(h){h&&(v(e),v(t),v(i),v(r),v(a)),V(o),n[8](null),m=!1,we(g)}}}function tL(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function nL(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[tL,eL],g=[];function h(_,k){return _[1]?0:1}return f=h(n),c=g[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[3]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),g[f].m(u,null),d=!0},p(_,k){(!d||k&8)&&se(o,_[3]);let S=f;f=h(_),f===S?g[f].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,k):(c=g[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(v(e),v(r),v(a)),g[f].d()}}}function iL(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[nL]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function lL(n,e,t){let i,l;We(n,Et,_=>t(3,l=_)),tn(Et,l="Export collections",l);const s="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await fe.collections.getFullList(100,{$cancelKey:s,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){fe.error(_)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),To("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const k=window.getSelection(),S=document.createRange();S.selectNodeContents(o),k.removeAllRanges(),k.addRange(S)}},h=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,l,f,c,r,d,m,g,h]}class sL extends _e{constructor(e){super(),ge(this,e,lL,iL,he,{})}}function Lg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Pg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Fg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ng(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Rg(n,e,t){const i=n.slice();return i[14]=e[t],i}function qg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function jg(n,e,t){const i=n.slice();return i[30]=e[t],i}function oL(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&Hg(),a=n[0].name!==n[1].name&&zg(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=Y(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),y(e,t),a&&a.m(e,null),y(e,i),y(e,l),y(l,o)},p(u,f){u[9]?r||(r=Hg(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=zg(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&se(o,s)},d(u){u&&v(e),r&&r.d(),a&&a.d()}}}function rL(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=M(),i=b("strong"),s=Y(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),y(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function aL(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=M(),i=b("strong"),s=Y(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),y(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function Hg(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function zg(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=Y(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),y(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function Vg(n){var g,h;let e,t,i,l,s,o,r=n[12]((g=n[0])==null?void 0:g[n[30]])+"",a,u,f,c,d=n[12]((h=n[1])==null?void 0:h[n[30]])+"",m;return{c(){var _,k,S,$,T,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=M(),s=b("td"),o=b("pre"),a=Y(r),u=M(),f=b("td"),c=b("pre"),m=Y(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&mn((_=n[0])==null?void 0:_[n[30]],(k=n[1])==null?void 0:k[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),x(f,"changed-new-col",!n[5]&&mn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),x(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",mn((T=n[0])==null?void 0:T[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(_,k){w(_,e,k),y(e,t),y(t,i),y(e,l),y(e,s),y(s,o),y(o,a),y(e,u),y(e,f),y(f,c),y(c,m)},p(_,k){var S,$,T,C,D,O,E,L;k[0]&1&&r!==(r=_[12]((S=_[0])==null?void 0:S[_[30]])+"")&&se(a,r),k[0]&3075&&x(s,"changed-old-col",!_[10]&&mn(($=_[0])==null?void 0:$[_[30]],(T=_[1])==null?void 0:T[_[30]])),k[0]&1024&&x(s,"changed-none-col",_[10]),k[0]&2&&d!==(d=_[12]((C=_[1])==null?void 0:C[_[30]])+"")&&se(m,d),k[0]&2083&&x(f,"changed-new-col",!_[5]&&mn((D=_[0])==null?void 0:D[_[30]],(O=_[1])==null?void 0:O[_[30]])),k[0]&32&&x(f,"changed-none-col",_[5]),k[0]&2051&&x(e,"txt-primary",mn((E=_[0])==null?void 0:E[_[30]],(L=_[1])==null?void 0:L[_[30]]))},d(_){_&&v(e)}}}function Bg(n){let e,t=pe(n[6]),i=[];for(let l=0;lProps Old New',s=M(),o=b("tbody");for(let T=0;T!["schema","created","updated"].includes(k));function h(){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(k=>!f.find(S=>k.id==S.id))))}function _(k){return typeof k>"u"?"":j.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!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")&&h(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,s,l,g,_]}class cL extends _e{constructor(e){super(),ge(this,e,fL,uL,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Xg(n,e,t){const i=n.slice();return i[17]=e[t],i}function Qg(n){let e,t;return e=new cL({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function dL(n){let e,t,i=pe(n[2]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await ue.collections.import(o,a),It("Successfully imported collections configuration."),i("submit")}catch(T){ue.error(T)}t(4,u=!1),c()}}const h=()=>m(),_=()=>!u;function k(T){te[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Ee.call(this,n,T)}function $(T){Ee.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,h,_,k,S,$]}class uL extends be{constructor(e){super(),_e(this,e,aL,rL,me,{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 xg(n,e,t){const i=n.slice();return i[35]=e[t],i}function e_(n,e,t){const i=n.slice();return i[32]=e[t],i}function fL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O;a=new he({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[dL,({uniqueId:N})=>({40:N}),({uniqueId:N})=>[0,N?512:0]]},$$scope:{ctx:n}}});let E=!1,L=n[6]&&n[1].length&&!n[7]&&n_(),R=n[6]&&n[1].length&&n[7]&&i_(n),P=n[13].length&&m_(n),F=!!n[0]&&h_(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=Y(`Paste below the collections configuration you want to import or - `),o=b("button"),o.innerHTML='Load from JSON file',r=M(),B(a.$$.fragment),u=M(),f=M(),L&&L.c(),c=M(),R&&R.c(),d=M(),P&&P.c(),m=M(),g=b("div"),F&&F.c(),h=M(),_=b("div"),k=M(),S=b("button"),$=b("span"),$.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"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p($,"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(N,q){w(N,e,q),n[19](e),w(N,t,q),w(N,i,q),y(i,l),y(l,s),y(l,o),w(N,r,q),z(a,N,q),w(N,u,q),w(N,f,q),L&&L.m(N,q),w(N,c,q),R&&R.m(N,q),w(N,d,q),P&&P.m(N,q),w(N,m,q),w(N,g,q),F&&F.m(g,null),y(g,h),y(g,_),y(g,k),y(g,S),y(S,$),C=!0,D||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],D=!0)},p(N,q){(!C||q[0]&4096)&&x(o,"btn-loading",N[12]);const W={};q[0]&64&&(W.class="form-field "+(N[6]?"":"field-error")),q[0]&65|q[1]&1536&&(W.$$scope={dirty:q,ctx:N}),a.$set(W),N[6]&&N[1].length&&!N[7]?L||(L=n_(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),N[6]&&N[1].length&&N[7]?R?R.p(N,q):(R=i_(N),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),N[13].length?P?P.p(N,q):(P=m_(N),P.c(),P.m(m.parentNode,m)):P&&(P.d(1),P=null),N[0]?F?F.p(N,q):(F=h_(N),F.c(),F.m(g,h)):F&&(F.d(1),F=null),(!C||q[0]&16384&&T!==(T=!N[14]))&&(S.disabled=T)},i(N){C||(A(a.$$.fragment,N),A(E),C=!0)},o(N){I(a.$$.fragment,N),I(E),C=!1},d(N){N&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(g)),n[19](null),V(a,N),L&&L.d(N),R&&R.d(N),P&&P.d(N),F&&F.d(),D=!1,we(O)}}}function cL(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function t_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function dL(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&t_();return{c(){e=b("label"),t=Y("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ke(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(s,"id",o=n[40]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ce(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=K(s,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(s,"id",o),m[0]&1&&ce(s,d[0]),d[0]&&!d[6]?c||(c=t_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function n_(n){let e;return{c(){e=b("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&&v(e)}}}function i_(n){let e,t,i,l,s,o=n[9].length&&l_(n),r=n[4].length&&r_(n),a=n[8].length&&c_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),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),y(i,l),r&&r.m(i,null),y(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=l_(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=r_(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=c_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function l_(n){let e=[],t=new Map,i,l=pe(n[9]);const s=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=M(),l=b("div"),l.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 fe.collections.import(o,a),It("Successfully imported collections configuration."),i("submit")}catch(T){fe.error(T)}t(4,u=!1),c()}}const h=()=>m(),_=()=>!u;function k(T){te[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Ee.call(this,n,T)}function $(T){Ee.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,h,_,k,S,$]}class _L extends _e{constructor(e){super(),ge(this,e,gL,hL,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function xg(n,e,t){const i=n.slice();return i[32]=e[t],i}function e_(n,e,t){const i=n.slice();return i[35]=e[t],i}function t_(n,e,t){const i=n.slice();return i[32]=e[t],i}function bL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[kL,({uniqueId:N})=>({40:N}),({uniqueId:N})=>[0,N?512:0]]},$$scope:{ctx:n}}});let E=!1,L=n[6]&&n[1].length&&!n[7]&&i_(),R=n[6]&&n[1].length&&n[7]&&l_(n),P=n[13].length&&h_(n),F=!!n[0]&&g_(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=Y(`Paste below the collections configuration you want to import or + `),o=b("button"),o.innerHTML='Load from JSON file',r=M(),B(a.$$.fragment),u=M(),f=M(),L&&L.c(),c=M(),R&&R.c(),d=M(),P&&P.c(),m=M(),g=b("div"),F&&F.c(),h=M(),_=b("div"),k=M(),S=b("button"),$=b("span"),$.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"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p($,"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(N,q){w(N,e,q),n[19](e),w(N,t,q),w(N,i,q),y(i,l),y(l,s),y(l,o),w(N,r,q),z(a,N,q),w(N,u,q),w(N,f,q),L&&L.m(N,q),w(N,c,q),R&&R.m(N,q),w(N,d,q),P&&P.m(N,q),w(N,m,q),w(N,g,q),F&&F.m(g,null),y(g,h),y(g,_),y(g,k),y(g,S),y(S,$),C=!0,D||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],D=!0)},p(N,q){(!C||q[0]&4096)&&x(o,"btn-loading",N[12]);const W={};q[0]&64&&(W.class="form-field "+(N[6]?"":"field-error")),q[0]&65|q[1]&1536&&(W.$$scope={dirty:q,ctx:N}),a.$set(W),N[6]&&N[1].length&&!N[7]?L||(L=i_(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),N[6]&&N[1].length&&N[7]?R?R.p(N,q):(R=l_(N),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),N[13].length?P?P.p(N,q):(P=h_(N),P.c(),P.m(m.parentNode,m)):P&&(P.d(1),P=null),N[0]?F?F.p(N,q):(F=g_(N),F.c(),F.m(g,h)):F&&(F.d(1),F=null),(!C||q[0]&16384&&T!==(T=!N[14]))&&(S.disabled=T)},i(N){C||(A(a.$$.fragment,N),A(E),C=!0)},o(N){I(a.$$.fragment,N),I(E),C=!1},d(N){N&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(g)),n[19](null),V(a,N),L&&L.d(N),R&&R.d(N),P&&P.d(N),F&&F.d(),D=!1,we(O)}}}function yL(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function n_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function kL(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&n_();return{c(){e=b("label"),t=Y("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ke(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(s,"id",o=n[40]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ue(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=K(s,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(s,"id",o),m[0]&1&&ue(s,d[0]),d[0]&&!d[6]?c||(c=n_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function i_(n){let e;return{c(){e=b("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&&v(e)}}}function l_(n){let e,t,i,l,s,o=n[9].length&&s_(n),r=n[4].length&&a_(n),a=n[8].length&&d_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),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),y(i,l),r&&r.m(i,null),y(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=s_(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=a_(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=d_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function s_(n){let e=[],t=new Map,i,l=pe(n[9]);const s=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=M(),l=b("div"),l.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.`,s=M(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"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),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:Q,d(u){u&&v(e),r=!1,a()}}}function h_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function pL(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[cL,fL],g=[];function h(_,k){return _[5]?0:1}return f=h(n),c=g[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[15]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),g[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&se(o,_[15]);let S=f;f=h(_),f===S?g[f].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,k):(c=g[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(v(e),v(r),v(a)),g[f].d()}}}function mL(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{default:[pL]},$$scope:{ctx:n}}});let r={};return s=new uL({props:r}),n[27](s),s.$on("submit",n[28]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,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={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[27](null),V(s,a)}}}function hL(n,e,t){let i,l,s,o,r,a,u;We(n,Et,U=>t(15,u=U)),tn(Et,u="Import collections",u);let f,c,d="",m=!1,g=[],h=[],_=!0,k=[],S=!1;$();async function $(){t(5,S=!0);try{t(2,h=await ue.collections.getFullList(200));for(let U of h)delete U.created,delete U.updated}catch(U){ue.error(U)}t(5,S=!1)}function T(){if(t(4,k=[]),!!i)for(let U of g){const le=j.findByKey(h,"id",U.id);!(le!=null&&le.id)||!j.hasCollectionChanges(le,U,_)||k.push({new:U,old:le})}}function C(){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 D(){var U,le;for(let ee of g){const oe=j.findByKey(h,"name",ee.name)||j.findByKey(h,"id",ee.id);if(!oe)continue;const Te=ee.id,je=oe.id;ee.id=je;const Ve=Array.isArray(oe.schema)?oe.schema:[],Qe=Array.isArray(ee.schema)?ee.schema:[];for(const tt of Qe){const Ge=j.findByKey(Ve,"name",tt.name);Ge&&Ge.id&&(tt.id=Ge.id)}for(let tt of g)if(Array.isArray(tt.schema))for(let Ge of tt.schema)(U=Ge.options)!=null&&U.collectionId&&((le=Ge.options)==null?void 0:le.collectionId)===Te&&(Ge.options.collectionId=je)}t(0,d=JSON.stringify(g,null,4))}function O(U){t(12,m=!0);const le=new FileReader;le.onload=async ee=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ee.target.result),await Qt(),g.length||(hi("Invalid collections configuration."),E())},le.onerror=ee=>{console.warn(ee),hi("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},le.readAsText(U)}function E(){t(0,d=""),t(10,f.value="",f),Gt({})}function L(U){te[U?"unshift":"push"](()=>{f=U,t(10,f)})}const R=()=>{f.files.length&&O(f.files[0])},P=()=>{f.click()};function F(){d=this.value,t(0,d)}function N(){_=this.checked,t(3,_)}const q=()=>D(),W=()=>E(),G=()=>c==null?void 0:c.show(h,g,_);function J(U){te[U?"unshift":"push"](()=>{c=U,t(11,c)})}const H=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&C(),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,l=h.filter(U=>i&&_&&!j.findByKey(g,"id",U.id))),n.$$.dirty[0]&70&&t(8,s=g.filter(U=>i&&!j.findByKey(h,"id",U.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof _<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(l.length||s.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(U=>{let le=j.findByKey(h,"name",U.name)||j.findByKey(h,"id",U.id);if(!le)return!1;if(le.id!=U.id)return!0;const ee=Array.isArray(le.schema)?le.schema:[],oe=Array.isArray(U.schema)?U.schema:[];for(const Te of oe){if(j.findByKey(ee,"id",Te.id))continue;const Ve=j.findByKey(ee,"name",Te.name);if(Ve&&Te.id!=Ve.id)return!0}return!1}))},[d,g,h,_,k,S,i,o,s,l,f,c,m,a,r,u,D,O,E,L,R,P,F,N,q,W,G,J,H]}class gL extends be{constructor(e){super(),_e(this,e,hL,mL,me,{},null,[-1,-1])}}function _L(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Backup name"),l=M(),s=b("input"),r=M(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[2]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&4&&s.value!==c[2]&&ce(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function bL(n){let e,t,i,l,s,o,r;return l=new he({props:{class:"form-field m-0",name:"name",$$slots:{default:[_L,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + to.`,s=M(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"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),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:Q,d(u){u&&v(e),r=!1,a()}}}function g_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function vL(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[yL,bL],g=[];function h(_,k){return _[5]?0:1}return f=h(n),c=g[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[15]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),g[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&se(o,_[15]);let S=f;f=h(_),f===S?g[f].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,k):(c=g[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(v(e),v(r),v(a)),g[f].d()}}}function wL(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{default:[vL]},$$scope:{ctx:n}}});let r={};return s=new _L({props:r}),n[27](s),s.$on("submit",n[28]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,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={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[27](null),V(s,a)}}}function SL(n,e,t){let i,l,s,o,r,a,u;We(n,Et,U=>t(15,u=U)),tn(Et,u="Import collections",u);let f,c,d="",m=!1,g=[],h=[],_=!0,k=[],S=!1;$();async function $(){t(5,S=!0);try{t(2,h=await fe.collections.getFullList(200));for(let U of h)delete U.created,delete U.updated}catch(U){fe.error(U)}t(5,S=!1)}function T(){if(t(4,k=[]),!!i)for(let U of g){const le=j.findByKey(h,"id",U.id);!(le!=null&&le.id)||!j.hasCollectionChanges(le,U,_)||k.push({new:U,old:le})}}function C(){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 D(){var U,le;for(let ee of g){const oe=j.findByKey(h,"name",ee.name)||j.findByKey(h,"id",ee.id);if(!oe)continue;const Te=ee.id,je=oe.id;ee.id=je;const Ve=Array.isArray(oe.schema)?oe.schema:[],Qe=Array.isArray(ee.schema)?ee.schema:[];for(const tt of Qe){const Ge=j.findByKey(Ve,"name",tt.name);Ge&&Ge.id&&(tt.id=Ge.id)}for(let tt of g)if(Array.isArray(tt.schema))for(let Ge of tt.schema)(U=Ge.options)!=null&&U.collectionId&&((le=Ge.options)==null?void 0:le.collectionId)===Te&&(Ge.options.collectionId=je)}t(0,d=JSON.stringify(g,null,4))}function O(U){t(12,m=!0);const le=new FileReader;le.onload=async ee=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ee.target.result),await Qt(),g.length||(hi("Invalid collections configuration."),E())},le.onerror=ee=>{console.warn(ee),hi("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},le.readAsText(U)}function E(){t(0,d=""),t(10,f.value="",f),Gt({})}function L(U){te[U?"unshift":"push"](()=>{f=U,t(10,f)})}const R=()=>{f.files.length&&O(f.files[0])},P=()=>{f.click()};function F(){d=this.value,t(0,d)}function N(){_=this.checked,t(3,_)}const q=()=>D(),W=()=>E(),G=()=>c==null?void 0:c.show(h,g,_);function J(U){te[U?"unshift":"push"](()=>{c=U,t(11,c)})}const H=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&C(),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,l=h.filter(U=>i&&_&&!j.findByKey(g,"id",U.id))),n.$$.dirty[0]&70&&t(8,s=g.filter(U=>i&&!j.findByKey(h,"id",U.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof _<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(l.length||s.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(U=>{let le=j.findByKey(h,"name",U.name)||j.findByKey(h,"id",U.id);if(!le)return!1;if(le.id!=U.id)return!0;const ee=Array.isArray(le.schema)?le.schema:[],oe=Array.isArray(U.schema)?U.schema:[];for(const Te of oe){if(j.findByKey(ee,"id",Te.id))continue;const Ve=j.findByKey(ee,"name",Te.name);if(Ve&&Te.id!=Ve.id)return!0}return!1}))},[d,g,h,_,k,S,i,o,s,l,f,c,m,a,r,u,D,O,E,L,R,P,F,N,q,W,G,J,H]}class TL extends _e{constructor(e){super(),ge(this,e,SL,wL,he,{},null,[-1,-1])}}function $L(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Backup name"),l=M(),s=b("input"),r=M(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[2]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&4&&s.value!==c[2]&&ue(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function CL(n){let e,t,i,l,s,o,r;return l=new me({props:{class:"form-field m-0",name:"name",$$slots:{default:[$L,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("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=M(),i=b("form"),B(l.$$.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),z(l,i,null),s=!0,o||(r=K(i,"submit",Ye(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(A(l.$$.fragment,a),s=!0)},o(a){I(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),V(l),o=!1,r()}}}function yL(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function kL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,u){w(a,e,u),y(e,t),w(a,i,u),w(a,l,u),y(l,s),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&x(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function vL(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[kL],header:[yL],default:[bL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function wL(n,e,t){const i=rt(),l="backup_create_"+j.randomString(5);let s,o="",r=!1,a;function u(S){Gt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await ue.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),It("Successfully generated new backup.")}catch(S){S.isAbort||ue.error(S)}clearTimeout(a),t(3,r=!1)}}Ts(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?($o("A backup has already been started, please wait."),!1):!0,g=()=>(r&&$o("The backup was started but may take a while to complete. You can come back later.",4500),!0);function h(S){te[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Ee.call(this,n,S)}function k(S){Ee.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,g,h,_,k]}class SL extends be{constructor(e){super(),_e(this,e,wL,vL,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function TL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Backup name"),l=M(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function $L(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;return u=new rl({props:{value:n[1]}}),m=new he({props:{class:"form-field required m-0",name:"name",$$slots:{default:[TL,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

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

    `,t=M(),i=b("form"),B(l.$$.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),z(l,i,null),s=!0,o||(r=K(i,"submit",Ye(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(A(l.$$.fragment,a),s=!0)},o(a){I(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),V(l),o=!1,r()}}}function ML(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,u){w(a,e,u),y(e,t),w(a,i,u),w(a,l,u),y(l,s),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&x(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function DL(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[OL],header:[ML],default:[CL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function EL(n,e,t){const i=rt(),l="backup_create_"+j.randomString(5);let s,o="",r=!1,a;function u(S){Gt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await fe.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),It("Successfully generated new backup.")}catch(S){S.isAbort||fe.error(S)}clearTimeout(a),t(3,r=!1)}}Ss(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(To("A backup has already been started, please wait."),!1):!0,g=()=>(r&&To("The backup was started but may take a while to complete. You can come back later.",4500),!0);function h(S){te[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Ee.call(this,n,S)}function k(S){Ee.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,g,h,_,k]}class AL extends _e{constructor(e){super(),ge(this,e,EL,DL,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function IL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Backup name"),l=M(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ue(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function LL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;return u=new rl({props:{value:n[1]}}),m=new me({props:{class:"form-field required m-0",name:"name",$$slots:{default:[IL,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("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=M(),i=b("div"),l=Y(`Type the backup name `),s=b("div"),o=b("span"),r=Y(n[1]),a=M(),B(u.$$.fragment),f=Y(` - to confirm:`),c=M(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){w(k,e,S),w(k,t,S),w(k,i,S),y(i,l),y(i,s),y(s,o),y(o,r),y(s,a),z(u,s,null),y(i,f),w(k,c,S),w(k,d,S),z(m,d,null),g=!0,h||(_=K(d,"submit",Ye(n[7])),h=!0)},p(k,S){(!g||S&2)&&se(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){g||(A(u.$$.fragment,k),A(m.$$.fragment,k),g=!0)},o(k){I(u.$$.fragment,k),I(m.$$.fragment,k),g=!1},d(k){k&&(v(e),v(t),v(i),v(c),v(d)),V(u),V(m),h=!1,_()}}}function CL(n){let e,t,i,l;return{c(){e=b("h4"),t=Y("Restore "),i=b("strong"),l=Y(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),y(e,t),y(e,i),y(i,l)},p(s,o){o&2&&se(l,s[1])},d(s){s&&v(e)}}}function ML(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function OL(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[ML],header:[CL],default:[$L]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function DL(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Gt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await ue.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),hi(((S=$.response)==null?void 0:S.message)||$.message))}}}Ts(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const g=()=>!a;function h(S){te[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Ee.call(this,n,S)}function k(S){Ee.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,g,h,_,k]}class EL extends be{constructor(e){super(),_e(this,e,DL,OL,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function g_(n,e,t){const i=n.slice();return i[22]=e[t],i}function __(n,e,t){const i=n.slice();return i[19]=e[t],i}function AL(n){let e=[],t=new Map,i,l,s=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:Q,d(t){t&&v(e)}}}function y_(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=j.formattedFileSize(e[22].size)+"",g,h,_,k,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J;function H(){return e[10](e[22])}function U(){return e[11](e[22])}function le(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=M(),s=b("div"),o=b("span"),a=Y(r),f=M(),c=b("span"),d=Y("("),g=Y(m),h=Y(")"),_=M(),k=b("div"),S=b("button"),$=b("i"),C=M(),D=b("button"),O=b("i"),L=M(),R=b("button"),P=b("i"),N=M(),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(s,"class","content"),p($,"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"),x(S,"btn-loading",e[5][e[22].key]),p(O,"class","ri-restart-line"),p(D,"type","button"),p(D,"class","btn btn-sm btn-circle btn-hint btn-transparent"),D.disabled=E=e[6][e[22].key],p(D,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=F=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,oe){w(ee,t,oe),y(t,i),y(t,l),y(t,s),y(s,o),y(o,a),y(s,f),y(s,c),y(c,d),y(c,g),y(c,h),y(t,_),y(t,k),y(k,S),y(S,$),y(k,C),y(k,D),y(D,O),y(k,L),y(k,R),y(R,P),y(t,N),W=!0,G||(J=[ve(Fe.call(null,S,"Download")),K(S,"click",Ye(H)),ve(Fe.call(null,D,"Restore")),K(D,"click",Ye(U)),ve(Fe.call(null,R,"Delete")),K(R,"click",Ye(le))],G=!0)},p(ee,oe){e=ee,(!W||oe&8)&&r!==(r=e[22].key+"")&&se(a,r),(!W||oe&8&&u!==(u=e[22].key))&&p(o,"title",u),(!W||oe&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&se(g,m),(!W||oe&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!W||oe&40)&&x(S,"btn-loading",e[5][e[22].key]),(!W||oe&72&&E!==(E=e[6][e[22].key]))&&(D.disabled=E),(!W||oe&72&&F!==(F=e[6][e[22].key]))&&(R.disabled=F),(!W||oe&72)&&x(R,"btn-loading",e[6][e[22].key])},i(ee){W||(ee&&Ke(()=>{W&&(q||(q=Le(t,et,{duration:150},!0)),q.run(1))}),W=!0)},o(ee){ee&&(q||(q=Le(t,et,{duration:150},!1)),q.run(0)),W=!1},d(ee){ee&&v(t),ee&&q&&q.end(),G=!1,we(J)}}}function k_(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LL(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function PL(n){let e,t,i;return{c(){e=b("i"),t=M(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function FL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;const _=[IL,AL],k=[];function S(E,L){return E[4]?0:1}i=S(n),l=k[i]=_[i](n);function $(E,L){return E[7]?PL:LL}let T=$(n),C=T(n),D={};f=new SL({props:D}),n[14](f),f.$on("submit",n[15]);let O={};return d=new EL({props:O}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=M(),o=b("div"),r=b("button"),C.c(),u=M(),B(f.$$.fragment),c=M(),B(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(E,L){w(E,e,L),y(e,t),k[i].m(t,null),y(e,s),y(e,o),y(o,r),C.m(r,null),w(E,u,L),z(f,E,L),w(E,c,L),z(d,E,L),m=!0,g||(h=K(r,"click",n[13]),g=!0)},p(E,[L]){let R=i;i=S(E),i===R?k[i].p(E,L):(re(),I(k[R],1,1,()=>{k[R]=null}),ae(),l=k[i],l?l.p(E,L):(l=k[i]=_[i](E),l.c()),A(l,1),l.m(t,null)),T!==(T=$(E))&&(C.d(1),C=T(E),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=E[4]||!E[7]))&&(r.disabled=a);const P={};f.$set(P);const F={};d.$set(F)},i(E){m||(A(l),A(f.$$.fragment,E),A(d.$$.fragment,E),m=!0)},o(E){I(l),I(f.$$.fragment,E),I(d.$$.fragment,E),m=!1},d(E){E&&(v(e),v(u),v(c)),k[i].d(),C.d(),n[14](null),V(f,E),n[16](null),V(d,E),g=!1,h()}}}function NL(n,e,t){let i,l,s=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,s=await ue.backups.getFullList()),s.sort((D,O)=>D.modifiedO.modified?-1:0),t(4,o=!1)}catch(D){D.isAbort||(ue.error(D),t(4,o=!1))}}async function c(D){if(!r[D]){t(5,r[D]=!0,r);try{const O=await ue.getAdminFileToken(),E=ue.backups.getDownloadUrl(O,D);j.download(E)}catch(O){O.isAbort||ue.error(O)}delete r[D],t(5,r)}}function d(D){an(`Do you really want to delete ${D}?`,()=>m(D))}async function m(D){if(!a[D]){t(6,a[D]=!0,a);try{await ue.backups.delete(D),j.removeByKey(s,"name",D),f(),It(`Successfully deleted ${D}.`)}catch(O){O.isAbort||ue.error(O)}delete a[D],t(6,a)}}async function g(){var D;try{const O=await ue.health.check({$autoCancel:!1}),E=u;t(7,u=((D=O==null?void 0:O.data)==null?void 0:D.canBackup)||!1),E!=u&&u&&f()}catch{}}Vt(()=>{let D=setInterval(()=>{g()},3e3);return()=>{clearInterval(D)}});const h=D=>c(D.key),_=D=>l.show(D.key),k=D=>d(D.key),S=()=>i==null?void 0:i.show();function $(D){te[D?"unshift":"push"](()=>{i=D,t(1,i)})}const T=()=>{f()};function C(D){te[D?"unshift":"push"](()=>{l=D,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,h,_,k,S,$,T,C]}class RL extends be{constructor(e){super(),_e(this,e,NL,FL,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function qL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=M(),s=b("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"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){w(a,e,u),y(e,t),w(a,l,u),w(a,s,u),n[5](s),o||(r=[ve(Fe.call(null,e,"Upload backup")),K(e,"click",n[4]),K(s,"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&&x(e,"btn-loading",a[2]),u&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,we(r)}}}const v_="upload_backup";function jL(n,e,t){const i=rt();let{class:l=""}=e,s,o=!1;async function r(f){var d,m,g,h,_;if(o||!((m=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await ue.backups.upload(c,{requestKey:v_}),t(2,o=!1),i("success"),It("Successfully uploaded a new backup.")}catch(k){k.isAbort||(t(2,o=!1),(_=(h=(g=k.response)==null?void 0:g.data)==null?void 0:h.file)!=null&&_.message?hi(k.response.data.file.message):ue.error(k))}}Ts(()=>{ue.cancelRequest(v_)});const a=()=>s==null?void 0:s.click();function u(f){te[f?"unshift":"push"](()=>{s=f,t(1,s)})}return n.$$set=f=>{"class"in f&&t(0,l=f.class)},[l,s,o,r,a,u]}class HL extends be{constructor(e){super(),_e(this,e,jL,qL,me,{class:0})}}function zL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function VL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function w_(n){var W,G,J;let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O;t=new he({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[BL,({uniqueId:H})=>({31:H}),({uniqueId:H})=>[0,H?1:0]]},$$scope:{ctx:n}}});let E=n[2]&&S_(n);function L(H){n[24](H)}function R(H){n[25](H)}function P(H){n[26](H)}let F={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(W=n[0].backups)==null?void 0:W.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 t0({props:F}),te.push(()=>ge(r,"config",L)),te.push(()=>ge(r,"isTesting",R)),te.push(()=>ge(r,"testError",P));let N=((J=(G=n[1].backups)==null?void 0:G.s3)==null?void 0:J.enabled)&&!n[9]&&!n[5]&&T_(n),q=n[9]&&$_(n);return{c(){e=b("form"),B(t.$$.fragment),i=M(),E&&E.c(),l=M(),s=b("div"),o=M(),B(r.$$.fragment),c=M(),d=b("div"),m=b("div"),g=M(),N&&N.c(),h=M(),q&&q.c(),_=M(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],x(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(H,U){w(H,e,U),z(t,e,null),y(e,i),E&&E.m(e,null),y(e,l),y(e,s),y(e,o),z(r,e,null),y(e,c),y(e,d),y(d,m),y(d,g),N&&N.m(d,null),y(d,h),q&&q.m(d,null),y(d,_),y(d,k),y(k,S),C=!0,D||(O=[K(k,"click",n[28]),K(e,"submit",Ye(n[11]))],D=!0)},p(H,U){var oe,Te,je;const le={};U[0]&4|U[1]&3&&(le.$$scope={dirty:U,ctx:H}),t.$set(le),H[2]?E?(E.p(H,U),U[0]&4&&A(E,1)):(E=S_(H),E.c(),A(E,1),E.m(e,l)):E&&(re(),I(E,1,1,()=>{E=null}),ae());const ee={};U[0]&1&&(ee.originalConfig=(oe=H[0].backups)==null?void 0:oe.s3),!a&&U[0]&2&&(a=!0,ee.config=H[1].backups.s3,ye(()=>a=!1)),!u&&U[0]&128&&(u=!0,ee.isTesting=H[7],ye(()=>u=!1)),!f&&U[0]&256&&(f=!0,ee.testError=H[8],ye(()=>f=!1)),r.$set(ee),(je=(Te=H[1].backups)==null?void 0:Te.s3)!=null&&je.enabled&&!H[9]&&!H[5]?N?N.p(H,U):(N=T_(H),N.c(),N.m(d,h)):N&&(N.d(1),N=null),H[9]?q?q.p(H,U):(q=$_(H),q.c(),q.m(d,_)):q&&(q.d(1),q=null),(!C||U[0]&544&&$!==($=!H[9]||H[5]))&&(k.disabled=$),(!C||U[0]&32)&&x(k,"btn-loading",H[5])},i(H){C||(A(t.$$.fragment,H),A(E),A(r.$$.fragment,H),H&&Ke(()=>{C&&(T||(T=Le(e,et,{duration:150},!0)),T.run(1))}),C=!0)},o(H){I(t.$$.fragment,H),I(E),I(r.$$.fragment,H),H&&(T||(T=Le(e,et,{duration:150},!1)),T.run(0)),C=!1},d(H){H&&v(e),V(t),E&&E.d(),V(r),N&&N.d(),q&&q.d(),H&&T&&T.end(),D=!1,we(O)}}}function BL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function S_(n){let e,t,i,l,s,o,r,a,u;return l=new he({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[WL,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new he({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=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(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),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function UL(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=M(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=M(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=M(),r=b("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(s,"type","button"),p(s,"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,l,c),w(f,s,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[19]),K(i,"click",n[20]),K(s,"click",n[21]),K(r,"click",n[22])],a=!0)},p:Q,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,we(u)}}}function WL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;return h=new En({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[UL]},$$scope:{ctx:n}}}),{c(){var P,F;e=b("label"),t=Y("Cron expression"),l=M(),s=b("input"),a=M(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=M(),m=b("i"),g=M(),B(h.$$.fragment),_=M(),k=b("div"),S=b("p"),$=Y(`Supports numeric list, steps, ranges or + to confirm:`),c=M(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){w(k,e,S),w(k,t,S),w(k,i,S),y(i,l),y(i,s),y(s,o),y(o,r),y(s,a),z(u,s,null),y(i,f),w(k,c,S),w(k,d,S),z(m,d,null),g=!0,h||(_=K(d,"submit",Ye(n[7])),h=!0)},p(k,S){(!g||S&2)&&se(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){g||(A(u.$$.fragment,k),A(m.$$.fragment,k),g=!0)},o(k){I(u.$$.fragment,k),I(m.$$.fragment,k),g=!1},d(k){k&&(v(e),v(t),v(i),v(c),v(d)),V(u),V(m),h=!1,_()}}}function PL(n){let e,t,i,l;return{c(){e=b("h4"),t=Y("Restore "),i=b("strong"),l=Y(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),y(e,t),y(e,i),y(i,l)},p(s,o){o&2&&se(l,s[1])},d(s){s&&v(e)}}}function FL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),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:[FL],header:[PL],default:[LL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function RL(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Gt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await fe.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),hi(((S=$.response)==null?void 0:S.message)||$.message))}}}Ss(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const g=()=>!a;function h(S){te[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Ee.call(this,n,S)}function k(S){Ee.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,g,h,_,k]}class qL extends _e{constructor(e){super(),ge(this,e,RL,NL,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function __(n,e,t){const i=n.slice();return i[22]=e[t],i}function b_(n,e,t){const i=n.slice();return i[19]=e[t],i}function jL(n){let e=[],t=new Map,i,l,s=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:Q,d(t){t&&v(e)}}}function k_(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=j.formattedFileSize(e[22].size)+"",g,h,_,k,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J;function H(){return e[10](e[22])}function U(){return e[11](e[22])}function le(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=M(),s=b("div"),o=b("span"),a=Y(r),f=M(),c=b("span"),d=Y("("),g=Y(m),h=Y(")"),_=M(),k=b("div"),S=b("button"),$=b("i"),C=M(),D=b("button"),O=b("i"),L=M(),R=b("button"),P=b("i"),N=M(),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(s,"class","content"),p($,"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"),x(S,"btn-loading",e[5][e[22].key]),p(O,"class","ri-restart-line"),p(D,"type","button"),p(D,"class","btn btn-sm btn-circle btn-hint btn-transparent"),D.disabled=E=e[6][e[22].key],p(D,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=F=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,oe){w(ee,t,oe),y(t,i),y(t,l),y(t,s),y(s,o),y(o,a),y(s,f),y(s,c),y(c,d),y(c,g),y(c,h),y(t,_),y(t,k),y(k,S),y(S,$),y(k,C),y(k,D),y(D,O),y(k,L),y(k,R),y(R,P),y(t,N),W=!0,G||(J=[ve(Pe.call(null,S,"Download")),K(S,"click",Ye(H)),ve(Pe.call(null,D,"Restore")),K(D,"click",Ye(U)),ve(Pe.call(null,R,"Delete")),K(R,"click",Ye(le))],G=!0)},p(ee,oe){e=ee,(!W||oe&8)&&r!==(r=e[22].key+"")&&se(a,r),(!W||oe&8&&u!==(u=e[22].key))&&p(o,"title",u),(!W||oe&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&se(g,m),(!W||oe&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!W||oe&40)&&x(S,"btn-loading",e[5][e[22].key]),(!W||oe&72&&E!==(E=e[6][e[22].key]))&&(D.disabled=E),(!W||oe&72&&F!==(F=e[6][e[22].key]))&&(R.disabled=F),(!W||oe&72)&&x(R,"btn-loading",e[6][e[22].key])},i(ee){W||(ee&&Ke(()=>{W&&(q||(q=Le(t,et,{duration:150},!0)),q.run(1))}),W=!0)},o(ee){ee&&(q||(q=Le(t,et,{duration:150},!1)),q.run(0)),W=!1},d(ee){ee&&v(t),ee&&q&&q.end(),G=!1,we(J)}}}function v_(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function zL(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function VL(n){let e,t,i;return{c(){e=b("i"),t=M(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function BL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;const _=[HL,jL],k=[];function S(E,L){return E[4]?0:1}i=S(n),l=k[i]=_[i](n);function $(E,L){return E[7]?VL:zL}let T=$(n),C=T(n),D={};f=new AL({props:D}),n[14](f),f.$on("submit",n[15]);let O={};return d=new qL({props:O}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=M(),o=b("div"),r=b("button"),C.c(),u=M(),B(f.$$.fragment),c=M(),B(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(E,L){w(E,e,L),y(e,t),k[i].m(t,null),y(e,s),y(e,o),y(o,r),C.m(r,null),w(E,u,L),z(f,E,L),w(E,c,L),z(d,E,L),m=!0,g||(h=K(r,"click",n[13]),g=!0)},p(E,[L]){let R=i;i=S(E),i===R?k[i].p(E,L):(re(),I(k[R],1,1,()=>{k[R]=null}),ae(),l=k[i],l?l.p(E,L):(l=k[i]=_[i](E),l.c()),A(l,1),l.m(t,null)),T!==(T=$(E))&&(C.d(1),C=T(E),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=E[4]||!E[7]))&&(r.disabled=a);const P={};f.$set(P);const F={};d.$set(F)},i(E){m||(A(l),A(f.$$.fragment,E),A(d.$$.fragment,E),m=!0)},o(E){I(l),I(f.$$.fragment,E),I(d.$$.fragment,E),m=!1},d(E){E&&(v(e),v(u),v(c)),k[i].d(),C.d(),n[14](null),V(f,E),n[16](null),V(d,E),g=!1,h()}}}function UL(n,e,t){let i,l,s=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,s=await fe.backups.getFullList()),s.sort((D,O)=>D.modifiedO.modified?-1:0),t(4,o=!1)}catch(D){D.isAbort||(fe.error(D),t(4,o=!1))}}async function c(D){if(!r[D]){t(5,r[D]=!0,r);try{const O=await fe.getAdminFileToken(),E=fe.backups.getDownloadUrl(O,D);j.download(E)}catch(O){O.isAbort||fe.error(O)}delete r[D],t(5,r)}}function d(D){an(`Do you really want to delete ${D}?`,()=>m(D))}async function m(D){if(!a[D]){t(6,a[D]=!0,a);try{await fe.backups.delete(D),j.removeByKey(s,"name",D),f(),It(`Successfully deleted ${D}.`)}catch(O){O.isAbort||fe.error(O)}delete a[D],t(6,a)}}async function g(){var D;try{const O=await fe.health.check({$autoCancel:!1}),E=u;t(7,u=((D=O==null?void 0:O.data)==null?void 0:D.canBackup)||!1),E!=u&&u&&f()}catch{}}Vt(()=>{let D=setInterval(()=>{g()},3e3);return()=>{clearInterval(D)}});const h=D=>c(D.key),_=D=>l.show(D.key),k=D=>d(D.key),S=()=>i==null?void 0:i.show();function $(D){te[D?"unshift":"push"](()=>{i=D,t(1,i)})}const T=()=>{f()};function C(D){te[D?"unshift":"push"](()=>{l=D,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,h,_,k,S,$,T,C]}class WL extends _e{constructor(e){super(),ge(this,e,UL,BL,he,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function YL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=M(),s=b("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"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){w(a,e,u),y(e,t),w(a,l,u),w(a,s,u),n[5](s),o||(r=[ve(Pe.call(null,e,"Upload backup")),K(e,"click",n[4]),K(s,"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&&x(e,"btn-loading",a[2]),u&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,we(r)}}}const w_="upload_backup";function KL(n,e,t){const i=rt();let{class:l=""}=e,s,o=!1;async function r(f){var d,m,g,h,_;if(o||!((m=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await fe.backups.upload(c,{requestKey:w_}),t(2,o=!1),i("success"),It("Successfully uploaded a new backup.")}catch(k){k.isAbort||(t(2,o=!1),(_=(h=(g=k.response)==null?void 0:g.data)==null?void 0:h.file)!=null&&_.message?hi(k.response.data.file.message):fe.error(k))}}Ss(()=>{fe.cancelRequest(w_)});const a=()=>s==null?void 0:s.click();function u(f){te[f?"unshift":"push"](()=>{s=f,t(1,s)})}return n.$$set=f=>{"class"in f&&t(0,l=f.class)},[l,s,o,r,a,u]}class JL extends _e{constructor(e){super(),ge(this,e,KL,YL,he,{class:0})}}function ZL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function GL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function S_(n){var W,G,J;let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O;t=new me({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[XL,({uniqueId:H})=>({31:H}),({uniqueId:H})=>[0,H?1:0]]},$$scope:{ctx:n}}});let E=n[2]&&T_(n);function L(H){n[24](H)}function R(H){n[25](H)}function P(H){n[26](H)}let F={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(W=n[0].backups)==null?void 0:W.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 n0({props:F}),te.push(()=>be(r,"config",L)),te.push(()=>be(r,"isTesting",R)),te.push(()=>be(r,"testError",P));let N=((J=(G=n[1].backups)==null?void 0:G.s3)==null?void 0:J.enabled)&&!n[9]&&!n[5]&&$_(n),q=n[9]&&C_(n);return{c(){e=b("form"),B(t.$$.fragment),i=M(),E&&E.c(),l=M(),s=b("div"),o=M(),B(r.$$.fragment),c=M(),d=b("div"),m=b("div"),g=M(),N&&N.c(),h=M(),q&&q.c(),_=M(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],x(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(H,U){w(H,e,U),z(t,e,null),y(e,i),E&&E.m(e,null),y(e,l),y(e,s),y(e,o),z(r,e,null),y(e,c),y(e,d),y(d,m),y(d,g),N&&N.m(d,null),y(d,h),q&&q.m(d,null),y(d,_),y(d,k),y(k,S),C=!0,D||(O=[K(k,"click",n[28]),K(e,"submit",Ye(n[11]))],D=!0)},p(H,U){var oe,Te,je;const le={};U[0]&4|U[1]&3&&(le.$$scope={dirty:U,ctx:H}),t.$set(le),H[2]?E?(E.p(H,U),U[0]&4&&A(E,1)):(E=T_(H),E.c(),A(E,1),E.m(e,l)):E&&(re(),I(E,1,1,()=>{E=null}),ae());const ee={};U[0]&1&&(ee.originalConfig=(oe=H[0].backups)==null?void 0:oe.s3),!a&&U[0]&2&&(a=!0,ee.config=H[1].backups.s3,ye(()=>a=!1)),!u&&U[0]&128&&(u=!0,ee.isTesting=H[7],ye(()=>u=!1)),!f&&U[0]&256&&(f=!0,ee.testError=H[8],ye(()=>f=!1)),r.$set(ee),(je=(Te=H[1].backups)==null?void 0:Te.s3)!=null&&je.enabled&&!H[9]&&!H[5]?N?N.p(H,U):(N=$_(H),N.c(),N.m(d,h)):N&&(N.d(1),N=null),H[9]?q?q.p(H,U):(q=C_(H),q.c(),q.m(d,_)):q&&(q.d(1),q=null),(!C||U[0]&544&&$!==($=!H[9]||H[5]))&&(k.disabled=$),(!C||U[0]&32)&&x(k,"btn-loading",H[5])},i(H){C||(A(t.$$.fragment,H),A(E),A(r.$$.fragment,H),H&&Ke(()=>{C&&(T||(T=Le(e,et,{duration:150},!0)),T.run(1))}),C=!0)},o(H){I(t.$$.fragment,H),I(E),I(r.$$.fragment,H),H&&(T||(T=Le(e,et,{duration:150},!1)),T.run(0)),C=!1},d(H){H&&v(e),V(t),E&&E.d(),V(r),N&&N.d(),q&&q.d(),H&&T&&T.end(),D=!1,we(O)}}}function XL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function T_(n){let e,t,i,l,s,o,r,a,u;return l=new me({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[xL,({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:[eP,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(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),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function QL(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=M(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=M(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=M(),r=b("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(s,"type","button"),p(s,"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,l,c),w(f,s,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[19]),K(i,"click",n[20]),K(s,"click",n[21]),K(r,"click",n[22])],a=!0)},p:Q,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,we(u)}}}function xL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;return h=new En({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[QL]},$$scope:{ctx:n}}}),{c(){var P,F;e=b("label"),t=Y("Cron expression"),l=M(),s=b("input"),a=M(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=M(),m=b("i"),g=M(),B(h.$$.fragment),_=M(),k=b("div"),S=b("p"),$=Y(`Supports numeric list, steps, ranges or `),T=b("span"),T.textContent="macros",C=Y(`. `),D=b("br"),O=Y(` - The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((F=(P=n[0])==null?void 0:P.backups)!=null&&F.cron),p(c,"class","txt"),p(m,"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(k,"class","help-block")},m(P,F){var N,q;w(P,e,F),y(e,t),w(P,l,F),w(P,s,F),ce(s,n[1].backups.cron),w(P,a,F),w(P,u,F),y(u,f),y(f,c),y(f,d),y(f,m),y(f,g),z(h,f,null),w(P,_,F),w(P,k,F),y(k,S),y(S,$),y(S,T),y(S,C),y(S,D),y(S,O),E=!0,(q=(N=n[0])==null?void 0:N.backups)!=null&&q.cron||s.focus(),L||(R=[K(s,"input",n[18]),ve(Fe.call(null,T,`@yearly + The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((F=(P=n[0])==null?void 0:P.backups)!=null&&F.cron),p(c,"class","txt"),p(m,"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(k,"class","help-block")},m(P,F){var N,q;w(P,e,F),y(e,t),w(P,l,F),w(P,s,F),ue(s,n[1].backups.cron),w(P,a,F),w(P,u,F),y(u,f),y(f,c),y(f,d),y(f,m),y(f,g),z(h,f,null),w(P,_,F),w(P,k,F),y(k,S),y(S,$),y(S,T),y(S,C),y(S,D),y(S,O),E=!0,(q=(N=n[0])==null?void 0:N.backups)!=null&&q.cron||s.focus(),L||(R=[K(s,"input",n[18]),ve(Pe.call(null,T,`@yearly @annually @monthly @weekly @daily @midnight -@hourly`))],L=!0)},p(P,F){var q,W;(!E||F[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!E||F[1]&1&&o!==(o=P[31]))&&p(s,"id",o),(!E||F[0]&1&&r!==(r=!((W=(q=P[0])==null?void 0:q.backups)!=null&&W.cron)))&&(s.autofocus=r),F[0]&2&&s.value!==P[1].backups.cron&&ce(s,P[1].backups.cron);const N={};F[0]&2|F[1]&2&&(N.$$scope={dirty:F,ctx:P}),h.$set(N)},i(P){E||(A(h.$$.fragment,P),E=!0)},o(P){I(h.$$.fragment,P),E=!1},d(P){P&&(v(e),v(l),v(s),v(a),v(u),v(_),v(k)),V(h),L=!1,we(R)}}}function YL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[1].backups.cronMaxKeep),r||(a=K(s,"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(s,"id",o),f[0]&2&&ut(s.value)!==u[1].backups.cronMaxKeep&&ce(s,u[1].backups.cronMaxKeep)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function T_(n){let e;function t(s,o){return s[7]?ZL:s[8]?JL:KL}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function KL(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JL(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=ve(t=Fe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&$t(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function ZL(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $_(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("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),y(e,t),l||(s=K(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function GL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;m=new Qo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),h=new HL({props:{class:"btn-sm"}}),h.$on("success",n[13]);let F={};k=new RL({props:F}),n[15](k);function N(J,H){return J[6]?VL:zL}let q=N(n),W=q(n),G=n[6]&&!n[4]&&w_(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[10]),r=M(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),g=M(),B(h.$$.fragment),_=M(),B(k.$$.fragment),S=M(),$=b("hr"),T=M(),C=b("button"),D=b("span"),D.textContent="Backups options",O=M(),W.c(),E=M(),G&&G.c(),p(i,"class","breadcrumb-item"),p(s,"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(D,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(J,H){w(J,e,H),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(J,r,H),w(J,a,H),y(a,u),y(u,f),y(f,c),y(f,d),z(m,f,null),y(f,g),z(h,f,null),y(u,_),z(k,u,null),y(u,S),y(u,$),y(u,T),y(u,C),y(C,D),y(C,O),W.m(C,null),y(u,E),G&&G.m(u,null),L=!0,R||(P=[K(C,"click",n[16]),K(u,"submit",Ye(n[11]))],R=!0)},p(J,H){(!L||H[0]&1024)&&se(o,J[10]);const U={};k.$set(U),q!==(q=N(J))&&(W.d(1),W=q(J),W&&(W.c(),W.m(C,null))),(!L||H[0]&16)&&(C.disabled=J[4]),(!L||H[0]&16)&&x(C,"btn-loading",J[4]),J[6]&&!J[4]?G?(G.p(J,H),H[0]&80&&A(G,1)):(G=w_(J),G.c(),A(G,1),G.m(u,null)):G&&(re(),I(G,1,1,()=>{G=null}),ae())},i(J){L||(A(m.$$.fragment,J),A(h.$$.fragment,J),A(k.$$.fragment,J),A(G),L=!0)},o(J){I(m.$$.fragment,J),I(h.$$.fragment,J),I(k.$$.fragment,J),I(G),L=!1},d(J){J&&(v(e),v(r),v(a)),V(m),V(h),n[15](null),V(k),W.d(),G&&G.d(),R=!1,we(P)}}}function XL(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[GL]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function QL(n,e,t){let i,l;We(n,Et,H=>t(10,l=H)),tn(Et,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,g=null;h();async function h(){t(4,a=!0);try{const H=await ue.settings.getAll()||{};k(H)}catch(H){ue.error(H)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const H=await ue.settings.update(j.filterRedactedProps(r));await $(),k(H),It("Successfully saved application settings.")}catch(H){ue.error(H)}t(5,u=!1)}}function k(H={}){t(1,r={backups:(H==null?void 0:H.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 $(){return s==null?void 0:s.loadBackups()}function T(H){te[H?"unshift":"push"](()=>{s=H,t(3,s)})}const C=()=>t(6,d=!d);function D(){c=this.checked,t(2,c)}function O(){r.backups.cron=this.value,t(1,r),t(2,c)}const E=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{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=ut(this.value),t(1,r),t(2,c)}function N(H){n.$$.not_equal(r.backups.s3,H)&&(r.backups.s3=H,t(1,r),t(2,c))}function q(H){m=H,t(7,m)}function W(H){g=H,t(8,g)}const G=()=>S(),J=()=>_();return n.$$.update=()=>{var H;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(H=r==null?void 0:r.backups)!=null&&H.cron&&(ii("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,s,a,u,d,m,g,i,l,_,S,$,f,T,C,D,O,E,L,R,P,F,N,q,W,G,J]}class xL extends be{constructor(e){super(),_e(this,e,QL,XL,me,{},null,[-1,-1])}}const Ht=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?il("/"):!0}],eP={"/login":Nt({component:nA,conditions:Ht.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Nt({asyncComponent:()=>st(()=>import("./PageAdminRequestPasswordReset-077da760.js"),[],import.meta.url),conditions:Ht.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageAdminConfirmPasswordReset-b115c254.js"),[],import.meta.url),conditions:Ht.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Nt({component:T8,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Nt({component:AT,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Nt({component:cA,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Nt({component:G8,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Nt({component:QA,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Nt({component:yI,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Nt({component:NI,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Nt({component:WI,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Nt({component:XI,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Nt({component:gL,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Nt({component:xL,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmPasswordReset-b5c0cfd9.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmPasswordReset-b5c0cfd9.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmVerification-8a6a1ed8.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmVerification-8a6a1ed8.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmEmailChange-a2506d7e.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmEmailChange-a2506d7e.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Nt({asyncComponent:()=>st(()=>import("./PageOAuth2Redirect-9b9788d9.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"*":Nt({component:Pv,userData:{showAppSidebar:!1}})};function tP(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.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=m=>Math.sqrt(m)*120,easing:d=Xo}=i;return{delay:f,duration:$t(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,g)=>{const h=g*a,_=g*u,k=m+g*e.width/t.width,S=m+g*e.height/t.height;return`transform: ${s} translate(${h}px, ${_}px) scale(${k}, ${S});`}}}function C_(n,e,t){const i=n.slice();return i[2]=e[t],i}function nP(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function iP(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function lP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sP(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function M_(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,g=Q,h,_,k;function S(D,O){return D[2].type==="info"?sP:D[2].type==="success"?lP:D[2].type==="warning"?iP:nP}let $=S(e),T=$(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=M(),s=b("div"),r=Y(o),a=M(),u=b("button"),u.innerHTML='',f=M(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(D,O){w(D,t,O),y(t,i),T.m(i,null),y(t,l),y(t,s),y(s,r),y(t,a),y(t,u),y(t,f),h=!0,_||(k=K(u,"click",Ye(C)),_=!0)},p(D,O){e=D,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!h||O&1)&&o!==(o=e[2].message+"")&&se(r,o),(!h||O&1)&&x(t,"alert-info",e[2].type=="info"),(!h||O&1)&&x(t,"alert-success",e[2].type=="success"),(!h||O&1)&&x(t,"alert-danger",e[2].type=="error"),(!h||O&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){O0(t),g(),N_(t,m)},a(){g(),g=M0(t,m,tP,{duration:150})},i(D){h||(D&&Ke(()=>{h&&(d&&d.end(1),c=j_(t,et,{duration:150}),c.start())}),h=!0)},o(D){c&&c.invalidate(),D&&(d=ya(t,ds,{duration:150})),h=!1},d(D){D&&v(t),T.d(),D&&d&&d.end(),_=!1,k()}}}function oP(n){let e,t=[],i=new Map,l,s=pe(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>K1(s)]}class aP extends be{constructor(e){super(),_e(this,e,rP,oP,me,{})}}function uP(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=Y(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),y(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&se(i,t)},d(s){s&&v(e)}}}function fP(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.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(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,u){w(a,e,u),y(e,t),w(a,i,u),w(a,l,u),y(l,s),e.focus(),o||(r=[K(e,"click",n[4]),K(l,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(l.disabled=a[2]),u&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,we(r)}}}function cP(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:[fP],header:[uP]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function dP(n,e,t){let i;We(n,Ga,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){te[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Yb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class pP extends be{constructor(e){super(),_e(this,e,dP,cP,me,{})}}function O_(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S;return h=new En({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[mP]},$$scope:{ctx:n}}}),{c(){var $;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),u=b("a"),u.innerHTML='',f=M(),c=b("figure"),d=b("img"),g=M(),B(h.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"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(l,"class","main-menu"),nn(d.src,m="./images/avatars/avatar"+((($=n[0])==null?void 0:$.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m($,T){w($,e,T),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),y(l,r),y(l,a),y(l,u),y(e,f),y(e,c),y(c,d),y(c,g),z(h,c,null),_=!0,k||(S=[ve(ln.call(null,t)),ve(ln.call(null,s)),ve(Pn.call(null,s,{path:"/collections/?.*",className:"current-route"})),ve(Fe.call(null,s,{text:"Collections",position:"right"})),ve(ln.call(null,r)),ve(Pn.call(null,r,{path:"/logs/?.*",className:"current-route"})),ve(Fe.call(null,r,{text:"Logs",position:"right"})),ve(ln.call(null,u)),ve(Pn.call(null,u,{path:"/settings/?.*",className:"current-route"})),ve(Fe.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p($,T){var D;(!_||T&1&&!nn(d.src,m="./images/avatars/avatar"+(((D=$[0])==null?void 0:D.avatar)||0)+".svg"))&&p(d,"src",m);const C={};T&4096&&(C.$$scope={dirty:T,ctx:$}),h.$set(C)},i($){_||(A(h.$$.fragment,$),_=!0)},o($){I(h.$$.fragment,$),_=!1},d($){$&&v(e),V(h),k=!1,we(S)}}}function mP(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),w(a,s,u),o||(r=[ve(ln.call(null,e)),K(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,we(r)}}}function D_(n){let e,t,i;return t=new eu({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function hP(n){var _;let e,t,i,l,s,o,r,a,u,f,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((_=n[0])==null?void 0:_.id)&&n[1]&&O_(n);o=new V0({props:{routes:eP}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new aP({}),f=new pP({});let h=n[1]&&!n[2]&&D_(n);return{c(){t=M(),i=b("div"),g&&g.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),B(f.$$.fragment),c=M(),h&&h.c(),d=ke(),p(s,"class","app-body"),p(i,"class","app-layout")},m(k,S){w(k,t,S),w(k,i,S),g&&g.m(i,null),y(i,l),y(i,s),z(o,s,null),y(s,r),z(a,s,null),w(k,u,S),z(f,k,S),w(k,c,S),h&&h.m(k,S),w(k,d,S),m=!0},p(k,[S]){var $;(!m||S&24)&&e!==(e=j.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),($=k[0])!=null&&$.id&&k[1]?g?(g.p(k,S),S&3&&A(g,1)):(g=O_(k),g.c(),A(g,1),g.m(i,l)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),k[1]&&!k[2]?h?(h.p(k,S),S&6&&A(h,1)):(h=D_(k),h.c(),A(h,1),h.m(d.parentNode,d)):h&&(re(),I(h,1,1,()=>{h=null}),ae())},i(k){m||(A(g),A(o.$$.fragment,k),A(a.$$.fragment,k),A(f.$$.fragment,k),A(h),m=!0)},o(k){I(g),I(o.$$.fragment,k),I(a.$$.fragment,k),I(f.$$.fragment,k),I(h),m=!1},d(k){k&&(v(t),v(i),v(u),v(c),v(d)),g&&g.d(),V(o),V(a),V(f,k),h&&h.d(k)}}}function gP(n,e,t){let i,l,s,o;We(n,Ml,h=>t(10,i=h)),We(n,Oo,h=>t(3,l=h)),We(n,Ia,h=>t(0,s=h)),We(n,Et,h=>t(4,o=h));let r,a=!1,u=!1;function f(h){var _,k,S,$;((_=h==null?void 0:h.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=h==null?void 0:h.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=h==null?void 0:h.detail)==null?void 0:$.location,tn(Et,o="",o),Gt({}),Yb())}function c(){il("/")}async function d(){var h,_;if(s!=null&&s.id)try{const k=await ue.settings.getAll({$cancelKey:"initialAppSettings"});tn(Oo,l=((h=k==null?void 0:k.meta)==null?void 0:h.appName)||"",l),tn(Ml,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){ue.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,g]}class _P extends be{constructor(e){super(),_e(this,e,gP,hP,me,{})}}new _P({target:document.getElementById("app")});export{we as A,It as B,j as C,il as D,ke as E,Z1 as F,Wo as G,uo as H,Vt as I,We as J,zn as K,rt as L,te as M,Vb as N,pe as O,dt as P,Pi as Q,Lt as R,be as S,at as T,S0 as U,I as a,M as b,B as c,V as d,b as e,p as f,w as g,y as h,_e as i,ve as j,re as k,ln as l,z as m,ae as n,v as o,ue as p,he as q,x as r,me as s,A as t,K as u,Ye as v,Y as w,se as x,Q as y,ce as z}; +@hourly`))],L=!0)},p(P,F){var q,W;(!E||F[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!E||F[1]&1&&o!==(o=P[31]))&&p(s,"id",o),(!E||F[0]&1&&r!==(r=!((W=(q=P[0])==null?void 0:q.backups)!=null&&W.cron)))&&(s.autofocus=r),F[0]&2&&s.value!==P[1].backups.cron&&ue(s,P[1].backups.cron);const N={};F[0]&2|F[1]&2&&(N.$$scope={dirty:F,ctx:P}),h.$set(N)},i(P){E||(A(h.$$.fragment,P),E=!0)},o(P){I(h.$$.fragment,P),E=!1},d(P){P&&(v(e),v(l),v(s),v(a),v(u),v(_),v(k)),V(h),L=!1,we(R)}}}function eP(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[1].backups.cronMaxKeep),r||(a=K(s,"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(s,"id",o),f[0]&2&&ut(s.value)!==u[1].backups.cronMaxKeep&&ue(s,u[1].backups.cronMaxKeep)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function $_(n){let e;function t(s,o){return s[7]?iP:s[8]?nP:tP}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function tP(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nP(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=ve(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&$t(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function iP(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function C_(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("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),y(e,t),l||(s=K(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function lP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;m=new Xo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),h=new JL({props:{class:"btn-sm"}}),h.$on("success",n[13]);let F={};k=new WL({props:F}),n[15](k);function N(J,H){return J[6]?GL:ZL}let q=N(n),W=q(n),G=n[6]&&!n[4]&&S_(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[10]),r=M(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),g=M(),B(h.$$.fragment),_=M(),B(k.$$.fragment),S=M(),$=b("hr"),T=M(),C=b("button"),D=b("span"),D.textContent="Backups options",O=M(),W.c(),E=M(),G&&G.c(),p(i,"class","breadcrumb-item"),p(s,"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(D,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(J,H){w(J,e,H),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(J,r,H),w(J,a,H),y(a,u),y(u,f),y(f,c),y(f,d),z(m,f,null),y(f,g),z(h,f,null),y(u,_),z(k,u,null),y(u,S),y(u,$),y(u,T),y(u,C),y(C,D),y(C,O),W.m(C,null),y(u,E),G&&G.m(u,null),L=!0,R||(P=[K(C,"click",n[16]),K(u,"submit",Ye(n[11]))],R=!0)},p(J,H){(!L||H[0]&1024)&&se(o,J[10]);const U={};k.$set(U),q!==(q=N(J))&&(W.d(1),W=q(J),W&&(W.c(),W.m(C,null))),(!L||H[0]&16)&&(C.disabled=J[4]),(!L||H[0]&16)&&x(C,"btn-loading",J[4]),J[6]&&!J[4]?G?(G.p(J,H),H[0]&80&&A(G,1)):(G=S_(J),G.c(),A(G,1),G.m(u,null)):G&&(re(),I(G,1,1,()=>{G=null}),ae())},i(J){L||(A(m.$$.fragment,J),A(h.$$.fragment,J),A(k.$$.fragment,J),A(G),L=!0)},o(J){I(m.$$.fragment,J),I(h.$$.fragment,J),I(k.$$.fragment,J),I(G),L=!1},d(J){J&&(v(e),v(r),v(a)),V(m),V(h),n[15](null),V(k),W.d(),G&&G.d(),R=!1,we(P)}}}function sP(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[lP]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function oP(n,e,t){let i,l;We(n,Et,H=>t(10,l=H)),tn(Et,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,g=null;h();async function h(){t(4,a=!0);try{const H=await fe.settings.getAll()||{};k(H)}catch(H){fe.error(H)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const H=await fe.settings.update(j.filterRedactedProps(r));await $(),k(H),It("Successfully saved application settings.")}catch(H){fe.error(H)}t(5,u=!1)}}function k(H={}){t(1,r={backups:(H==null?void 0:H.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 $(){return s==null?void 0:s.loadBackups()}function T(H){te[H?"unshift":"push"](()=>{s=H,t(3,s)})}const C=()=>t(6,d=!d);function D(){c=this.checked,t(2,c)}function O(){r.backups.cron=this.value,t(1,r),t(2,c)}const E=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{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=ut(this.value),t(1,r),t(2,c)}function N(H){n.$$.not_equal(r.backups.s3,H)&&(r.backups.s3=H,t(1,r),t(2,c))}function q(H){m=H,t(7,m)}function W(H){g=H,t(8,g)}const G=()=>S(),J=()=>_();return n.$$.update=()=>{var H;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(H=r==null?void 0:r.backups)!=null&&H.cron&&(ii("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,s,a,u,d,m,g,i,l,_,S,$,f,T,C,D,O,E,L,R,P,F,N,q,W,G,J]}class rP extends _e{constructor(e){super(),ge(this,e,oP,sP,he,{},null,[-1,-1])}}const Ht=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?il("/"):!0}],aP={"/login":Nt({component:fA,conditions:Ht.concat([n=>!fe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Nt({asyncComponent:()=>st(()=>import("./PageAdminRequestPasswordReset-2ec1893c.js"),[],import.meta.url),conditions:Ht.concat([n=>!fe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageAdminConfirmPasswordReset-708df40e.js"),[],import.meta.url),conditions:Ht.concat([n=>!fe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Nt({component:I8,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Nt({component:IT,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Nt({component:yA,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Nt({component:lA,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Nt({component:oI,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Nt({component:MI,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Nt({component:UI,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Nt({component:xI,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Nt({component:sL,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Nt({component:TL,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Nt({component:rP,conditions:Ht.concat([n=>fe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmPasswordReset-b9fe5282.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmPasswordReset-b9fe5282.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmVerification-392dea19.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmVerification-392dea19.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmEmailChange-9b4c683c.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmEmailChange-9b4c683c.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Nt({asyncComponent:()=>st(()=>import("./PageOAuth2Redirect-f3233468.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"*":Nt({component:Fv,userData:{showAppSidebar:!1}})};function uP(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.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=m=>Math.sqrt(m)*120,easing:d=Go}=i;return{delay:f,duration:$t(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,g)=>{const h=g*a,_=g*u,k=m+g*e.width/t.width,S=m+g*e.height/t.height;return`transform: ${s} translate(${h}px, ${_}px) scale(${k}, ${S});`}}}function M_(n,e,t){const i=n.slice();return i[2]=e[t],i}function fP(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cP(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function dP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function pP(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function O_(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,g=Q,h,_,k;function S(D,O){return D[2].type==="info"?pP:D[2].type==="success"?dP:D[2].type==="warning"?cP:fP}let $=S(e),T=$(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=M(),s=b("div"),r=Y(o),a=M(),u=b("button"),u.innerHTML='',f=M(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(D,O){w(D,t,O),y(t,i),T.m(i,null),y(t,l),y(t,s),y(s,r),y(t,a),y(t,u),y(t,f),h=!0,_||(k=K(u,"click",Ye(C)),_=!0)},p(D,O){e=D,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!h||O&1)&&o!==(o=e[2].message+"")&&se(r,o),(!h||O&1)&&x(t,"alert-info",e[2].type=="info"),(!h||O&1)&&x(t,"alert-success",e[2].type=="success"),(!h||O&1)&&x(t,"alert-danger",e[2].type=="error"),(!h||O&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){D0(t),g(),R_(t,m)},a(){g(),g=O0(t,m,uP,{duration:150})},i(D){h||(D&&Ke(()=>{h&&(d&&d.end(1),c=H_(t,et,{duration:150}),c.start())}),h=!0)},o(D){c&&c.invalidate(),D&&(d=ka(t,cs,{duration:150})),h=!1},d(D){D&&v(t),T.d(),D&&d&&d.end(),_=!1,k()}}}function mP(n){let e,t=[],i=new Map,l,s=pe(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>J1(s)]}class gP extends _e{constructor(e){super(),ge(this,e,hP,mP,he,{})}}function _P(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=Y(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),y(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&se(i,t)},d(s){s&&v(e)}}}function bP(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.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(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,u){w(a,e,u),y(e,t),w(a,i,u),w(a,l,u),y(l,s),e.focus(),o||(r=[K(e,"click",n[4]),K(l,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(l.disabled=a[2]),u&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,we(r)}}}function yP(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:[bP],header:[_P]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function kP(n,e,t){let i;We(n,Xa,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){te[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Kb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class vP extends _e{constructor(e){super(),ge(this,e,kP,yP,he,{})}}function D_(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S;return h=new En({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[wP]},$$scope:{ctx:n}}}),{c(){var $;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),u=b("a"),u.innerHTML='',f=M(),c=b("figure"),d=b("img"),g=M(),B(h.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"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(l,"class","main-menu"),nn(d.src,m="./images/avatars/avatar"+((($=n[0])==null?void 0:$.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m($,T){w($,e,T),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),y(l,r),y(l,a),y(l,u),y(e,f),y(e,c),y(c,d),y(c,g),z(h,c,null),_=!0,k||(S=[ve(ln.call(null,t)),ve(ln.call(null,s)),ve(Pn.call(null,s,{path:"/collections/?.*",className:"current-route"})),ve(Pe.call(null,s,{text:"Collections",position:"right"})),ve(ln.call(null,r)),ve(Pn.call(null,r,{path:"/logs/?.*",className:"current-route"})),ve(Pe.call(null,r,{text:"Logs",position:"right"})),ve(ln.call(null,u)),ve(Pn.call(null,u,{path:"/settings/?.*",className:"current-route"})),ve(Pe.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p($,T){var D;(!_||T&1&&!nn(d.src,m="./images/avatars/avatar"+(((D=$[0])==null?void 0:D.avatar)||0)+".svg"))&&p(d,"src",m);const C={};T&4096&&(C.$$scope={dirty:T,ctx:$}),h.$set(C)},i($){_||(A(h.$$.fragment,$),_=!0)},o($){I(h.$$.fragment,$),_=!1},d($){$&&v(e),V(h),k=!1,we(S)}}}function wP(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),w(a,s,u),o||(r=[ve(ln.call(null,e)),K(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,we(r)}}}function E_(n){let e,t,i;return t=new tu({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function SP(n){var _;let e,t,i,l,s,o,r,a,u,f,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((_=n[0])==null?void 0:_.id)&&n[1]&&D_(n);o=new B0({props:{routes:aP}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new gP({}),f=new vP({});let h=n[1]&&!n[2]&&E_(n);return{c(){t=M(),i=b("div"),g&&g.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),B(f.$$.fragment),c=M(),h&&h.c(),d=ke(),p(s,"class","app-body"),p(i,"class","app-layout")},m(k,S){w(k,t,S),w(k,i,S),g&&g.m(i,null),y(i,l),y(i,s),z(o,s,null),y(s,r),z(a,s,null),w(k,u,S),z(f,k,S),w(k,c,S),h&&h.m(k,S),w(k,d,S),m=!0},p(k,[S]){var $;(!m||S&24)&&e!==(e=j.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),($=k[0])!=null&&$.id&&k[1]?g?(g.p(k,S),S&3&&A(g,1)):(g=D_(k),g.c(),A(g,1),g.m(i,l)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),k[1]&&!k[2]?h?(h.p(k,S),S&6&&A(h,1)):(h=E_(k),h.c(),A(h,1),h.m(d.parentNode,d)):h&&(re(),I(h,1,1,()=>{h=null}),ae())},i(k){m||(A(g),A(o.$$.fragment,k),A(a.$$.fragment,k),A(f.$$.fragment,k),A(h),m=!0)},o(k){I(g),I(o.$$.fragment,k),I(a.$$.fragment,k),I(f.$$.fragment,k),I(h),m=!1},d(k){k&&(v(t),v(i),v(u),v(c),v(d)),g&&g.d(),V(o),V(a),V(f,k),h&&h.d(k)}}}function TP(n,e,t){let i,l,s,o;We(n,Cl,h=>t(10,i=h)),We(n,Mo,h=>t(3,l=h)),We(n,La,h=>t(0,s=h)),We(n,Et,h=>t(4,o=h));let r,a=!1,u=!1;function f(h){var _,k,S,$;((_=h==null?void 0:h.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=h==null?void 0:h.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=h==null?void 0:h.detail)==null?void 0:$.location,tn(Et,o="",o),Gt({}),Kb())}function c(){il("/")}async function d(){var h,_;if(s!=null&&s.id)try{const k=await fe.settings.getAll({$cancelKey:"initialAppSettings"});tn(Mo,l=((h=k==null?void 0:k.meta)==null?void 0:h.appName)||"",l),tn(Cl,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){fe.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,g]}class $P extends _e{constructor(e){super(),ge(this,e,TP,SP,he,{})}}new $P({target:document.getElementById("app")});export{we as A,It as B,j as C,il as D,ke as E,G1 as F,Uo as G,ao as H,Vt as I,We as J,zn as K,rt as L,te as M,Bb as N,pe as O,dt as P,Pi as Q,Lt as R,_e as S,at as T,T0 as U,I as a,M as b,B as c,V as d,b as e,p as f,w as g,y as h,ge as i,ve as j,re as k,ln as l,z as m,ae as n,v as o,fe as p,me as q,x as r,he as s,A as t,K as u,Ye as v,Y as w,se as x,Q as y,ue as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index eaf3faa7..ffa0a9b4 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/src/components/records/PageOAuth2Redirect.svelte b/ui/src/components/records/PageOAuth2Redirect.svelte index fd349a9c..4725364c 100644 --- a/ui/src/components/records/PageOAuth2Redirect.svelte +++ b/ui/src/components/records/PageOAuth2Redirect.svelte @@ -8,5 +8,5 @@

    Auth completed.

    -
    You can go back to the app if this window is not automatically closed.
    +
    You can close this window and go back to the app.
    diff --git a/ui/src/components/settings/providers/OIDCOptions.svelte b/ui/src/components/settings/providers/OIDCOptions.svelte new file mode 100644 index 00000000..42ab77fb --- /dev/null +++ b/ui/src/components/settings/providers/OIDCOptions.svelte @@ -0,0 +1,48 @@ + + + + + + + +
    Endpoints
    + + + + + + + + + + + + + + + + diff --git a/ui/src/providers.js b/ui/src/providers.js index 3ac5322a..52c9a63f 100644 --- a/ui/src/providers.js +++ b/ui/src/providers.js @@ -1,4 +1,5 @@ import SelfHostedOptions from "@/components/settings/providers/SelfHostedOptions.svelte"; +import OIDCOptions from "@/components/settings/providers/OIDCOptions.svelte"; import MicrosoftOptions from "@/components/settings/providers/MicrosoftOptions.svelte"; import AppleOptions from "@/components/settings/providers/AppleOptions.svelte"; @@ -126,21 +127,18 @@ export default [ key: "oidcAuth", title: "OpenID Connect", logo: "oidc.svg", - optionsComponent: SelfHostedOptions, - optionsComponentProps: { required: true }, + optionsComponent: OIDCOptions, }, { key: "oidc2Auth", title: "(2) OpenID Connect", logo: "oidc.svg", - optionsComponent: SelfHostedOptions, - optionsComponentProps: { required: true }, + optionsComponent: OIDCOptions, }, { key: "oidc3Auth", title: "(3) OpenID Connect", logo: "oidc.svg", - optionsComponent: SelfHostedOptions, - optionsComponentProps: { required: true }, + optionsComponent: OIDCOptions, }, ];