meged apple-oauth2

This commit is contained in:
Gani Georgiev committed 2023-03-06 15:30:35 +02:00
commit 6a60bc1df3
69 files changed
+1194 -323

No files matched your search

+12 -3
View File
@@ -129,6 +129,16 @@ func (api *recordAuthApi) authMethods(c echo.Context) error {
codeVerifier := security.RandomString(43) codeVerifier := security.RandomString(43)
codeChallenge := security.S256Challenge(codeVerifier) codeChallenge := security.S256Challenge(codeVerifier)
codeChallengeMethod := "S256" codeChallengeMethod := "S256"
urlOpts := []oauth2.AuthCodeOption{
oauth2.SetAuthURLParam("code_challenge", codeChallenge),
oauth2.SetAuthURLParam("code_challenge_method", codeChallengeMethod),
}
if name == 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"))
}
result.AuthProviders = append(result.AuthProviders, providerInfo{ result.AuthProviders = append(result.AuthProviders, providerInfo{
Name: name, Name: name,
State: state, State: state,
@@ -137,9 +147,8 @@ func (api *recordAuthApi) authMethods(c echo.Context) error {
CodeChallengeMethod: codeChallengeMethod, CodeChallengeMethod: codeChallengeMethod,
AuthUrl: provider.BuildAuthUrl( AuthUrl: provider.BuildAuthUrl(
state, state,
oauth2.SetAuthURLParam("code_challenge", codeChallenge), urlOpts...,
oauth2.SetAuthURLParam("code_challenge_method", codeChallengeMethod), ) + "&redirect_uri=", // empty redirect_uri so that users can append their redirect url
) + "&redirect_uri=", // empty redirect_uri so that users can append their url
}) })
} }
+27 -1
View File
@@ -22,6 +22,7 @@ func bindSettingsApi(app core.App, rg *echo.Group) {
subGroup.PATCH("", api.set) subGroup.PATCH("", api.set)
subGroup.POST("/test/s3", api.testS3) subGroup.POST("/test/s3", api.testS3)
subGroup.POST("/test/email", api.testEmail) subGroup.POST("/test/email", api.testEmail)
subGroup.POST("/apple/generate-client-secret", api.generateAppleClientSecret)
} }
type settingsApi struct { type settingsApi struct {
@@ -121,8 +122,8 @@ func (api *settingsApi) testEmail(c echo.Context) error {
// send // send
if err := form.Submit(); err != nil { if err := form.Submit(); err != nil {
// form error
if fErr, ok := err.(validation.Errors); ok { if fErr, ok := err.(validation.Errors); ok {
// form error
return NewBadRequestError("Failed to send the test email.", fErr) return NewBadRequestError("Failed to send the test email.", fErr)
} }
@@ -132,3 +133,28 @@ func (api *settingsApi) testEmail(c echo.Context) error {
return c.NoContent(http.StatusNoContent) return c.NoContent(http.StatusNoContent)
} }
func (api *settingsApi) generateAppleClientSecret(c echo.Context) error {
form := forms.NewAppleClientSecretCreate(api.app)
// load request
if err := c.Bind(form); err != nil {
return NewBadRequestError("An error occurred while loading the submitted data.", err)
}
// generate
secret, err := form.Submit()
if err != nil {
// form error
if fErr, ok := err.(validation.Errors); ok {
return NewBadRequestError("Invalid client secret data.", fErr)
}
// secret generation error
return NewBadRequestError("Failed to generate client secret. Raw error: \n"+err.Error(), nil)
}
return c.JSON(http.StatusOK, map[string]any{
"secret": secret,
})
}
+122
View File
@@ -1,6 +1,12 @@
package apis_test package apis_test
import ( import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/x509"
"encoding/pem"
"fmt"
"net/http" "net/http"
"strings" "strings"
"testing" "testing"
@@ -65,6 +71,7 @@ func TestSettingsList(t *testing.T) {
`"oidcAuth":{`, `"oidcAuth":{`,
`"oidc2Auth":{`, `"oidc2Auth":{`,
`"oidc3Auth":{`, `"oidc3Auth":{`,
`"appleAuth":{`,
`"secret":"******"`, `"secret":"******"`,
`"clientSecret":"******"`, `"clientSecret":"******"`,
}, },
@@ -139,6 +146,7 @@ func TestSettingsSet(t *testing.T) {
`"oidcAuth":{`, `"oidcAuth":{`,
`"oidc2Auth":{`, `"oidc2Auth":{`,
`"oidc3Auth":{`, `"oidc3Auth":{`,
`"appleAuth":{`,
`"secret":"******"`, `"secret":"******"`,
`"clientSecret":"******"`, `"clientSecret":"******"`,
`"appName":"acme_test"`, `"appName":"acme_test"`,
@@ -202,6 +210,7 @@ func TestSettingsSet(t *testing.T) {
`"oidcAuth":{`, `"oidcAuth":{`,
`"oidc2Auth":{`, `"oidc2Auth":{`,
`"oidc3Auth":{`, `"oidc3Auth":{`,
`"appleAuth":{`,
`"secret":"******"`, `"secret":"******"`,
`"clientSecret":"******"`, `"clientSecret":"******"`,
`"appName":"update_test"`, `"appName":"update_test"`,
@@ -419,3 +428,116 @@ func TestSettingsTestEmail(t *testing.T) {
scenario.Test(t) scenario.Test(t)
} }
} }
func TestGenerateAppleClientSecret(t *testing.T) {
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
t.Fatal(err)
}
encodedKey, err := x509.MarshalPKCS8PrivateKey(key)
if err != nil {
t.Fatal(err)
}
privatePem := pem.EncodeToMemory(
&pem.Block{
Type: "PRIVATE KEY",
Bytes: encodedKey,
},
)
scenarios := []tests.ApiScenario{
{
Name: "unauthorized",
Method: http.MethodPost,
Url: "/api/settings/apple/generate-client-secret",
ExpectedStatus: 401,
ExpectedContent: []string{`"data":{}`},
},
{
Name: "authorized as auth record",
Method: http.MethodPost,
Url: "/api/settings/apple/generate-client-secret",
RequestHeaders: map[string]string{
"Authorization": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6IjRxMXhsY2xtZmxva3UzMyIsInR5cGUiOiJhdXRoUmVjb3JkIiwiY29sbGVjdGlvbklkIjoiX3BiX3VzZXJzX2F1dGhfIiwiZXhwIjoyMjA4OTg1MjYxfQ.UwD8JvkbQtXpymT09d7J6fdA0aP9g4FJ1GPh_ggEkzc",
},
ExpectedStatus: 401,
ExpectedContent: []string{`"data":{}`},
},
{
Name: "authorized as admin (invalid body)",
Method: http.MethodPost,
Url: "/api/settings/apple/generate-client-secret",
Body: strings.NewReader(`{`),
RequestHeaders: map[string]string{
"Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8",
},
ExpectedStatus: 400,
ExpectedContent: []string{`"data":{}`},
},
{
Name: "authorized as admin (empty json)",
Method: http.MethodPost,
Url: "/api/settings/apple/generate-client-secret",
Body: strings.NewReader(`{}`),
RequestHeaders: map[string]string{
"Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8",
},
ExpectedStatus: 400,
ExpectedContent: []string{
`"clientId":{"code":"validation_required"`,
`"teamId":{"code":"validation_required"`,
`"keyId":{"code":"validation_required"`,
`"privateKey":{"code":"validation_required"`,
`"duration":{"code":"validation_required"`,
},
},
{
Name: "authorized as admin (invalid data)",
Method: http.MethodPost,
Url: "/api/settings/apple/generate-client-secret",
Body: strings.NewReader(`{
"clientId": "",
"teamId": "123456789",
"keyId": "123456789",
"privateKey": "invalid",
"duration": -1
}`),
RequestHeaders: map[string]string{
"Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8",
},
ExpectedStatus: 400,
ExpectedContent: []string{
`"clientId":{"code":"validation_required"`,
`"teamId":{"code":"validation_length_invalid"`,
`"keyId":{"code":"validation_length_invalid"`,
`"privateKey":{"code":"validation_match_invalid"`,
`"duration":{"code":"validation_min_greater_equal_than_required"`,
},
},
{
Name: "authorized as admin",
Method: http.MethodPost,
Url: "/api/settings/apple/generate-client-secret",
Body: strings.NewReader(fmt.Sprintf(`{
"clientId": "123",
"teamId": "1234567890",
"keyId": "1234567891",
"privateKey": %q,
"duration": 1
}`, privatePem)),
RequestHeaders: map[string]string{
"Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8",
},
ExpectedStatus: 200,
ExpectedContent: []string{
`"secret":"`,
},
},
}
for _, scenario := range scenarios {
scenario.Test(t)
}
}
+1 -2
View File
@@ -1,6 +1,7 @@
package core package core
import ( import (
"github.com/labstack/echo/v5"
"github.com/pocketbase/pocketbase/daos" "github.com/pocketbase/pocketbase/daos"
"github.com/pocketbase/pocketbase/models" "github.com/pocketbase/pocketbase/models"
"github.com/pocketbase/pocketbase/models/schema" "github.com/pocketbase/pocketbase/models/schema"
@@ -11,8 +12,6 @@ import (
"github.com/pocketbase/pocketbase/tools/mailer" "github.com/pocketbase/pocketbase/tools/mailer"
"github.com/pocketbase/pocketbase/tools/search" "github.com/pocketbase/pocketbase/tools/search"
"github.com/pocketbase/pocketbase/tools/subscriptions" "github.com/pocketbase/pocketbase/tools/subscriptions"
"github.com/labstack/echo/v5"
) )
type BaseCollectionEvent struct { type BaseCollectionEvent struct {
+87
View File
@@ -0,0 +1,87 @@
package forms
import (
"regexp"
"strings"
"time"
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/golang-jwt/jwt/v4"
"github.com/pocketbase/pocketbase/core"
)
var privateKeyRegex = regexp.MustCompile(`(?m)-----BEGIN PRIVATE KEY----[\s\S]+-----END PRIVATE KEY-----`)
// AppleClientSecretCreate is a [models.Admin] upsert (create/update) form.
//
// Reference: https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens
type AppleClientSecretCreate struct {
app core.App
// ClientId is the identifier of your app (aka. Service ID).
ClientId string `form:"clientId" json:"clientId"`
// TeamId is a 10-character string associated with your developer account
// (usually could be found next to your name in the Apple Developer site).
TeamId string `form:"teamId" json:"teamId"`
// KeyId is a 10-character key identifier generated for the "Sign in with Apple"
// private key associated with your developer account.
KeyId string `form:"keyId" json:"keyId"`
// PrivateKey is the private key associated to your app.
// Usually wrapped within -----BEGIN PRIVATE KEY----- X -----END PRIVATE KEY-----.
PrivateKey string `form:"privateKey" json:"privateKey"`
// Duration specifies how long the generated JWT token should be considered valid
// The specified value must be in seconds and max 15777000 (~6months).
Duration int `form:"duration" json:"duration"`
}
// NewAppleClientSecretCreate creates a new [AppleClientSecretCreate] form with initializer
// config created from the provided [core.App] instances.
func NewAppleClientSecretCreate(app core.App) *AppleClientSecretCreate {
form := &AppleClientSecretCreate{
app: app,
}
return form
}
// Validate makes the form validatable by implementing [validation.Validatable] interface.
func (form *AppleClientSecretCreate) Validate() error {
return validation.ValidateStruct(form,
validation.Field(&form.ClientId, validation.Required),
validation.Field(&form.TeamId, validation.Required, validation.Length(10, 10)),
validation.Field(&form.KeyId, validation.Required, validation.Length(10, 10)),
validation.Field(&form.PrivateKey, validation.Required, validation.Match(privateKeyRegex)),
validation.Field(&form.Duration, validation.Required, validation.Min(1), validation.Max(15777000)),
)
}
// Submit validates the form and returns a new Apple Client Secret JWT.
func (form *AppleClientSecretCreate) Submit() (string, error) {
if err := form.Validate(); err != nil {
return "", err
}
signKey, err := jwt.ParseECPrivateKeyFromPEM([]byte(strings.TrimSpace(form.PrivateKey)))
if err != nil {
return "", err
}
now := time.Now()
claims := &jwt.StandardClaims{
Audience: "https://appleid.apple.com",
Subject: form.ClientId,
Issuer: form.TeamId,
IssuedAt: now.Unix(),
ExpiresAt: now.Add(time.Duration(form.Duration) * time.Second).Unix(),
}
token := jwt.NewWithClaims(jwt.SigningMethodES256, claims)
token.Header["kid"] = form.KeyId
return token.SignedString(signKey)
}
+117
View File
@@ -0,0 +1,117 @@
package forms_test
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/x509"
"encoding/json"
"encoding/pem"
"testing"
"github.com/golang-jwt/jwt/v4"
"github.com/pocketbase/pocketbase/forms"
"github.com/pocketbase/pocketbase/tests"
)
func TestAppleClientSecretCreateValidateAndSubmit(t *testing.T) {
app, _ := tests.NewTestApp()
defer app.Cleanup()
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
t.Fatal(err)
}
encodedKey, err := x509.MarshalPKCS8PrivateKey(key)
if err != nil {
t.Fatal(err)
}
privatePem := pem.EncodeToMemory(
&pem.Block{
Type: "PRIVATE KEY",
Bytes: encodedKey,
},
)
scenarios := []struct {
name string
formData map[string]any
expectError bool
}{
{
"empty data",
map[string]any{},
true,
},
{
"invalid data",
map[string]any{
"clientId": "",
"teamId": "123456789",
"keyId": "123456789",
"privateKey": "-----BEGIN PRIVATE KEY----- invalid -----END PRIVATE KEY-----",
"duration": -1,
},
true,
},
{
"valid data",
map[string]any{
"clientId": "123",
"teamId": "1234567890",
"keyId": "1234567891",
"privateKey": string(privatePem),
"duration": 1,
},
false,
},
}
for _, s := range scenarios {
form := forms.NewAppleClientSecretCreate(app)
rawData, marshalErr := json.Marshal(s.formData)
if marshalErr != nil {
t.Errorf("[%s] Failed to marshalize the scenario data: %v", s.name, marshalErr)
continue
}
// load data
loadErr := json.Unmarshal(rawData, form)
if loadErr != nil {
t.Errorf("[%s] Failed to load form data: %v", s.name, loadErr)
continue
}
secret, err := form.Submit()
hasErr := err != nil
if hasErr != s.expectError {
t.Errorf("[%s] Expected hasErr %v, got %v (%v)", s.name, s.expectError, hasErr, err)
}
if hasErr {
continue
}
if secret == "" {
t.Errorf("[%s] Expected non-empty secret", s.name)
}
claims := jwt.MapClaims{}
token, _, err := jwt.NewParser().ParseUnverified(secret, claims)
if err != nil {
t.Errorf("[%s] Failed to parse token: %v", s.name, err)
}
if alg := token.Header["alg"]; alg != "ES256" {
t.Errorf("[%s] Expected %q alg header, got %q", s.name, "ES256", alg)
}
if kid := token.Header["kid"]; kid != form.KeyId {
t.Errorf("[%s] Expected %q kid header, got %q", s.name, form.KeyId, kid)
}
}
}
+7
View File
@@ -1,8 +1,10 @@
package forms package forms
import ( import (
"context"
"errors" "errors"
"fmt" "fmt"
"time"
validation "github.com/go-ozzo/ozzo-validation/v4" validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/go-ozzo/ozzo-validation/v4/is" "github.com/go-ozzo/ozzo-validation/v4/is"
@@ -127,6 +129,11 @@ func (form *RecordOAuth2Login) Submit(
return nil, nil, err return nil, nil, err
} }
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(30*time.Second))
defer cancel()
provider.SetContext(ctx)
// load provider configuration // load provider configuration
providerConfig := form.app.Settings().NamedAuthProviderConfigs()[form.Provider] providerConfig := form.app.Settings().NamedAuthProviderConfigs()[form.Provider]
if err := providerConfig.SetupProvider(provider); err != nil { if err := providerConfig.SetupProvider(provider); err != nil {
+4 -4
View File
@@ -4,7 +4,7 @@ go 1.18
require ( require (
github.com/AlecAivazis/survey/v2 v2.3.6 github.com/AlecAivazis/survey/v2 v2.3.6
github.com/aws/aws-sdk-go v1.44.209 github.com/aws/aws-sdk-go v1.44.212
github.com/disintegration/imaging v1.6.2 github.com/disintegration/imaging v1.6.2
github.com/domodwyer/mailyak/v3 v3.4.0 github.com/domodwyer/mailyak/v3 v3.4.0
github.com/dop251/goja v0.0.0-20221118162653-d4bf6fde1b86 github.com/dop251/goja v0.0.0-20221118162653-d4bf6fde1b86
@@ -27,7 +27,7 @@ require (
) )
require ( require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2 v1.17.5 // indirect github.com/aws/aws-sdk-go-v2 v1.17.5 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.15 // indirect github.com/aws/aws-sdk-go-v2/config v1.18.15 // indirect
@@ -74,9 +74,9 @@ require (
golang.org/x/time v0.3.0 // indirect golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect golang.org/x/tools v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.110.0 // indirect google.golang.org/api v0.111.0 // indirect
google.golang.org/appengine v1.6.7 // indirect google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // indirect google.golang.org/genproto v0.0.0-20230301171018-9ab4bdc49ad5 // indirect
google.golang.org/grpc v1.53.0 // indirect google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect google.golang.org/protobuf v1.28.1 // indirect
lukechampine.com/uint128 v1.2.0 // indirect lukechampine.com/uint128 v1.2.0 // indirect
+11 -10
View File
@@ -36,8 +36,8 @@ cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+
cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU=
cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA=
cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM=
cloud.google.com/go v0.107.0 h1:qkj22L7bgkl6vIeZDlOY2po43Mx/TIa2Wsa7VR+PEww=
cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I=
cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys=
cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4=
cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw=
cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o=
@@ -202,7 +202,7 @@ cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp
cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc=
cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc=
cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg=
cloud.google.com/go/iam v0.11.0 h1:kwCWfKwB6ePZoZnGLwrd3B6Ru/agoHANTUBWpVNIdnM= cloud.google.com/go/iam v0.12.0 h1:DRtTY29b75ciH6Ov1PHb4/iat2CLCvrOm40Q0a6DFpE=
cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc=
cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A=
cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM=
@@ -219,8 +219,8 @@ cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEy
cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8=
cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08=
cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE=
cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs=
cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc=
cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM=
cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE=
cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM=
cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4=
@@ -506,8 +506,9 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ=
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
@@ -517,8 +518,8 @@ github.com/aws/aws-sdk-go v1.43.11/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4
github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.44.128/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.128/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.44.151/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go v1.44.151/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.209 h1:wZuiaA4eaqYZmoZXqGgNHqVD7y7kUGFvACDGBgowTps= github.com/aws/aws-sdk-go v1.44.212 h1:IRstlErdeKeQ8qBsCwWt4MG2RihUOcUJVqYwbvqpE28=
github.com/aws/aws-sdk-go v1.44.209/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go v1.44.212/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw= github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw=
github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4= github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4=
@@ -2458,8 +2459,8 @@ google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91
google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70=
google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo=
google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0=
google.golang.org/api v0.110.0 h1:l+rh0KYUooe9JGbGVx71tbFo4SMbMTXK3I3ia2QSEeU= google.golang.org/api v0.111.0 h1:bwKi+z2BsdwYFRKrqwutM+axAlYLz83gt5pDSXCJT+0=
google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -2593,8 +2594,8 @@ google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZV
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 h1:znp6mq/drrY+6khTAlJUDNFFcDGV2ENLYKpMq8SyCds= google.golang.org/genproto v0.0.0-20230301171018-9ab4bdc49ad5 h1:/cadn7taPtPlCgiWNetEPsle7jgnlad2R7gR5MXB6dM=
google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= google.golang.org/genproto v0.0.0-20230301171018-9ab4bdc49ad5/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+14 -6
View File
@@ -55,6 +55,7 @@ type Settings struct {
OIDCAuth AuthProviderConfig `form:"oidcAuth" json:"oidcAuth"` OIDCAuth AuthProviderConfig `form:"oidcAuth" json:"oidcAuth"`
OIDC2Auth AuthProviderConfig `form:"oidc2Auth" json:"oidc2Auth"` OIDC2Auth AuthProviderConfig `form:"oidc2Auth" json:"oidc2Auth"`
OIDC3Auth AuthProviderConfig `form:"oidc3Auth" json:"oidc3Auth"` OIDC3Auth AuthProviderConfig `form:"oidc3Auth" json:"oidc3Auth"`
AppleAuth AuthProviderConfig `form:"appleAuth" json:"appleAuth"`
} }
// New creates and returns a new default Settings instance. // New creates and returns a new default Settings instance.
@@ -156,6 +157,9 @@ func New() *Settings {
OIDC3Auth: AuthProviderConfig{ OIDC3Auth: AuthProviderConfig{
Enabled: false, Enabled: false,
}, },
AppleAuth: AuthProviderConfig{
Enabled: false,
},
} }
} }
@@ -192,6 +196,7 @@ func (s *Settings) Validate() error {
validation.Field(&s.OIDCAuth), validation.Field(&s.OIDCAuth),
validation.Field(&s.OIDC2Auth), validation.Field(&s.OIDC2Auth),
validation.Field(&s.OIDC3Auth), validation.Field(&s.OIDC3Auth),
validation.Field(&s.AppleAuth),
) )
} }
@@ -251,6 +256,7 @@ func (s *Settings) RedactClone() (*Settings, error) {
&clone.OIDCAuth.ClientSecret, &clone.OIDCAuth.ClientSecret,
&clone.OIDC2Auth.ClientSecret, &clone.OIDC2Auth.ClientSecret,
&clone.OIDC3Auth.ClientSecret, &clone.OIDC3Auth.ClientSecret,
&clone.AppleAuth.ClientSecret,
} }
// mask all sensitive fields // mask all sensitive fields
@@ -287,6 +293,7 @@ func (s *Settings) NamedAuthProviderConfigs() map[string]AuthProviderConfig {
auth.NameOIDC: s.OIDCAuth, auth.NameOIDC: s.OIDCAuth,
auth.NameOIDC + "2": s.OIDC2Auth, auth.NameOIDC + "2": s.OIDC2Auth,
auth.NameOIDC + "3": s.OIDC3Auth, auth.NameOIDC + "3": s.OIDC3Auth,
auth.NameApple: s.AppleAuth,
} }
} }
@@ -496,12 +503,13 @@ func (c LogsConfig) Validate() error {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
type AuthProviderConfig struct { type AuthProviderConfig struct {
Enabled bool `form:"enabled" json:"enabled"` Enabled bool `form:"enabled" json:"enabled"`
ClientId string `form:"clientId" json:"clientId"` ClientId string `form:"clientId" json:"clientId"`
ClientSecret string `form:"clientSecret" json:"clientSecret"` ClientSecret string `form:"clientSecret" json:"clientSecret"`
AuthUrl string `form:"authUrl" json:"authUrl"` AuthUrl string `form:"authUrl" json:"authUrl"`
TokenUrl string `form:"tokenUrl" json:"tokenUrl"` TokenUrl string `form:"tokenUrl" json:"tokenUrl"`
UserApiUrl string `form:"userApiUrl" json:"userApiUrl"` UserApiUrl string `form:"userApiUrl" json:"userApiUrl"`
Meta map[string]any `form:"meta" json:"meta"`
} }
// Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface. // Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface.
+8
View File
@@ -63,6 +63,8 @@ func TestSettingsValidate(t *testing.T) {
s.OIDC2Auth.ClientId = "" s.OIDC2Auth.ClientId = ""
s.OIDC3Auth.Enabled = true s.OIDC3Auth.Enabled = true
s.OIDC3Auth.ClientId = "" s.OIDC3Auth.ClientId = ""
s.AppleAuth.Enabled = true
s.AppleAuth.ClientId = ""
// check if Validate() is triggering the members validate methods. // check if Validate() is triggering the members validate methods.
err := s.Validate() err := s.Validate()
@@ -98,6 +100,7 @@ func TestSettingsValidate(t *testing.T) {
`"oidcAuth":{`, `"oidcAuth":{`,
`"oidc2Auth":{`, `"oidc2Auth":{`,
`"oidc3Auth":{`, `"oidc3Auth":{`,
`"appleAuth":{`,
} }
errBytes, _ := json.Marshal(err) errBytes, _ := json.Marshal(err)
@@ -160,6 +163,8 @@ func TestSettingsMerge(t *testing.T) {
s2.OIDC2Auth.ClientId = "oidc2_test" s2.OIDC2Auth.ClientId = "oidc2_test"
s2.OIDC3Auth.Enabled = true s2.OIDC3Auth.Enabled = true
s2.OIDC3Auth.ClientId = "oidc3_test" s2.OIDC3Auth.ClientId = "oidc3_test"
s2.AppleAuth.Enabled = true
s2.AppleAuth.ClientId = "apple_test"
if err := s1.Merge(s2); err != nil { if err := s1.Merge(s2); err != nil {
t.Fatal(err) t.Fatal(err)
@@ -243,6 +248,7 @@ func TestSettingsRedactClone(t *testing.T) {
s1.OIDCAuth.ClientSecret = testSecret s1.OIDCAuth.ClientSecret = testSecret
s1.OIDC2Auth.ClientSecret = testSecret s1.OIDC2Auth.ClientSecret = testSecret
s1.OIDC3Auth.ClientSecret = testSecret s1.OIDC3Auth.ClientSecret = testSecret
s1.AppleAuth.ClientSecret = testSecret
s1Bytes, err := json.Marshal(s1) s1Bytes, err := json.Marshal(s1)
if err != nil { if err != nil {
@@ -297,6 +303,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) {
s.OIDCAuth.ClientId = "oidc_test" s.OIDCAuth.ClientId = "oidc_test"
s.OIDC2Auth.ClientId = "oidc2_test" s.OIDC2Auth.ClientId = "oidc2_test"
s.OIDC3Auth.ClientId = "oidc3_test" s.OIDC3Auth.ClientId = "oidc3_test"
s.AppleAuth.ClientId = "apple_test"
result := s.NamedAuthProviderConfigs() result := s.NamedAuthProviderConfigs()
@@ -324,6 +331,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) {
`"oidc":{"enabled":false,"clientId":"oidc_test"`, `"oidc":{"enabled":false,"clientId":"oidc_test"`,
`"oidc2":{"enabled":false,"clientId":"oidc2_test"`, `"oidc2":{"enabled":false,"clientId":"oidc2_test"`,
`"oidc3":{"enabled":false,"clientId":"oidc3_test"`, `"oidc3":{"enabled":false,"clientId":"oidc3_test"`,
`"apple":{"enabled":false,"clientId":"apple_test"`,
} }
for _, p := range expectedParts { for _, p := range expectedParts {
if !strings.Contains(encodedStr, p) { if !strings.Contains(encodedStr, p) {
+221
View File
@@ -0,0 +1,221 @@
package auth
import (
"context"
"crypto/rsa"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"math/big"
"net/http"
"strings"
"github.com/golang-jwt/jwt/v4"
"github.com/spf13/cast"
"golang.org/x/oauth2"
)
var _ Provider = (*Apple)(nil)
// NameApple is the unique name of the Apple provider.
const NameApple string = "apple"
// Apple allows authentication via Apple OAuth2.
//
// [OIDC differences]: https://bitbucket.org/openid/connect/src/master/How-Sign-in-with-Apple-differs-from-OpenID-Connect.md
type Apple struct {
*baseProvider
jwksUrl string
}
// NewAppleProvider creates a new Apple provider instance with some defaults.
func NewAppleProvider() *Apple {
return &Apple{
baseProvider: &baseProvider{
ctx: context.Background(),
authUrl: "https://appleid.apple.com/auth/authorize",
tokenUrl: "https://appleid.apple.com/auth/token",
},
jwksUrl: "https://appleid.apple.com/auth/keys",
}
}
// FetchAuthUser returns an AuthUser instance based on the provided token.
//
// API reference: https://developer.apple.com/documentation/sign_in_with_apple/tokenresponse.
func (p *Apple) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) {
data, err := p.FetchRawUserData(token)
if err != nil {
return nil, err
}
rawUser := map[string]any{}
if err := json.Unmarshal(data, &rawUser); err != nil {
return nil, err
}
extracted := struct {
Id string `json:"sub"`
Email string `json:"email"`
EmailVerified any `json:"email_verified"` // could be string or bool
}{}
if err := json.Unmarshal(data, &extracted); err != nil {
return nil, err
}
user := &AuthUser{
Id: extracted.Id,
RawUser: rawUser,
AccessToken: token.AccessToken,
RefreshToken: token.RefreshToken,
}
if cast.ToBool(extracted.EmailVerified) {
user.Email = extracted.Email
}
return user, nil
}
// FetchRawUserData implements Provider.FetchRawUserData interface.
//
// Apple doesn't have a UserInfo endpoint and claims about users
// are instead included in the "id_token" (https://openid.net/specs/openid-connect-core-1_0.html#id_tokenExample)
func (p *Apple) FetchRawUserData(token *oauth2.Token) ([]byte, error) {
idToken, _ := token.Extra("id_token").(string)
claims, err := p.parseAndVerifyIdToken(idToken)
if err != nil {
return nil, err
}
return json.Marshal(claims)
}
// -------------------------------------------------------------------
func (p *Apple) parseAndVerifyIdToken(idToken string) (jwt.MapClaims, error) {
if idToken == "" {
return nil, errors.New("empty id_token")
}
// extract the token header params and claims
// ---
claims := jwt.MapClaims{}
t, _, err := jwt.NewParser().ParseUnverified(idToken, claims)
if err != nil {
return nil, err
}
// validate common claims per https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/verifying_a_user#3383769
// ---
if !claims.VerifyIssuer("https://appleid.apple.com", true) {
return nil, errors.New("iss must be https://appleid.apple.com")
}
if !claims.VerifyAudience(p.clientId, true) {
return nil, errors.New("aud must be the developer's client_id")
}
// fetch the public key set
// ---
kid, _ := t.Header["kid"].(string)
if kid == "" {
return nil, errors.New("missing kid header value")
}
key, err := p.fetchJWK(kid)
if err != nil {
return nil, err
}
// decode the key params per RFC 7518 (https://tools.ietf.org/html/rfc7518#section-6.3)
// and construct a valid publicKey from them
// ---
exponent, err := base64.RawURLEncoding.DecodeString(strings.TrimRight(key.E, "="))
if err != nil {
return nil, err
}
modulus, err := base64.RawURLEncoding.DecodeString(strings.TrimRight(key.N, "="))
if err != nil {
return nil, err
}
publicKey := &rsa.PublicKey{
// https://tools.ietf.org/html/rfc7517#appendix-A.1
E: int(big.NewInt(0).SetBytes(exponent).Uint64()),
N: big.NewInt(0).SetBytes(modulus),
}
// verify the id_token
// ---
parser := jwt.NewParser(jwt.WithValidMethods([]string{key.Alg}))
parsedToken, err := parser.Parse(idToken, func(t *jwt.Token) (any, error) {
return publicKey, nil
})
if err != nil {
return nil, err
}
if claims, ok := parsedToken.Claims.(jwt.MapClaims); ok && parsedToken.Valid {
return claims, nil
}
return nil, errors.New("the parsed id_token is invalid")
}
type jwk struct {
Kty string
Kid string
Use string
Alg string
N string
E string
}
func (p *Apple) fetchJWK(kid string) (*jwk, error) {
req, err := http.NewRequestWithContext(p.ctx, "GET", p.jwksUrl, nil)
if err != nil {
return nil, err
}
res, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
rawBody, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}
// http.Client.Get doesn't treat non 2xx responses as error
if res.StatusCode >= 400 {
return nil, fmt.Errorf(
"failed to verify the provided id_token (%d):\n%s",
res.StatusCode,
string(rawBody),
)
}
jwks := struct {
Keys []*jwk
}{}
if err := json.Unmarshal(rawBody, &jwks); err != nil {
return nil, err
}
for _, key := range jwks.Keys {
if key.Kid == kid {
return key, nil
}
}
return nil, fmt.Errorf("jwk with kid %q was not found", kid)
}
+9
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"errors" "errors"
"net/http" "net/http"
@@ -21,6 +22,12 @@ type AuthUser struct {
// Provider defines a common interface for an OAuth2 client. // Provider defines a common interface for an OAuth2 client.
type Provider interface { type Provider interface {
// Scopes returns the context associated with the provider (if any).
Context() context.Context
// SetContext assigns the specified context to the current provider.
SetContext(ctx context.Context)
// Scopes returns the provider access permissions that will be requested. // Scopes returns the provider access permissions that will be requested.
Scopes() []string Scopes() []string
@@ -120,6 +127,8 @@ func NewProviderByName(name string) (Provider, error) {
return NewOIDCProvider(), nil return NewOIDCProvider(), nil
case NameOIDC + "3": case NameOIDC + "3":
return NewOIDCProvider(), nil return NewOIDCProvider(), nil
case NameApple:
return NewAppleProvider(), nil
default: default:
return nil, errors.New("Missing provider " + name) return nil, errors.New("Missing provider " + name)
} }
+9
View File
@@ -171,4 +171,13 @@ func TestNewProviderByName(t *testing.T) {
if _, ok := p.(*auth.OIDC); !ok { if _, ok := p.(*auth.OIDC); !ok {
t.Error("Expected to be instance of *auth.OIDC") t.Error("Expected to be instance of *auth.OIDC")
} }
// apple
p, err = auth.NewProviderByName(auth.NameApple)
if err != nil {
t.Errorf("Expected nil, got error %v", err)
}
if _, ok := p.(*auth.Apple); !ok {
t.Error("Expected to be instance of *auth.Apple")
}
} }
+38 -27
View File
@@ -11,6 +11,7 @@ import (
// baseProvider defines common fields and methods used by OAuth2 client providers. // baseProvider defines common fields and methods used by OAuth2 client providers.
type baseProvider struct { type baseProvider struct {
ctx context.Context
scopes []string scopes []string
clientId string clientId string
clientSecret string clientSecret string
@@ -20,94 +21,104 @@ type baseProvider struct {
userApiUrl string userApiUrl string
} }
// Scopes implements Provider.Scopes interface. // Context implements Provider.Context() interface method.
func (p *baseProvider) Context() context.Context {
return p.ctx
}
// SetContext implements Provider.SetContext() interface method.
func (p *baseProvider) SetContext(ctx context.Context) {
p.ctx = ctx
}
// Scopes implements Provider.Scopes() interface method.
func (p *baseProvider) Scopes() []string { func (p *baseProvider) Scopes() []string {
return p.scopes return p.scopes
} }
// SetScopes implements Provider.SetScopes interface. // SetScopes implements Provider.SetScopes() interface method.
func (p *baseProvider) SetScopes(scopes []string) { func (p *baseProvider) SetScopes(scopes []string) {
p.scopes = scopes p.scopes = scopes
} }
// ClientId implements Provider.ClientId interface. // ClientId implements Provider.ClientId() interface method.
func (p *baseProvider) ClientId() string { func (p *baseProvider) ClientId() string {
return p.clientId return p.clientId
} }
// SetClientId implements Provider.SetClientId interface. // SetClientId implements Provider.SetClientId() interface method.
func (p *baseProvider) SetClientId(clientId string) { func (p *baseProvider) SetClientId(clientId string) {
p.clientId = clientId p.clientId = clientId
} }
// ClientSecret implements Provider.ClientSecret interface. // ClientSecret implements Provider.ClientSecret() interface method.
func (p *baseProvider) ClientSecret() string { func (p *baseProvider) ClientSecret() string {
return p.clientSecret return p.clientSecret
} }
// SetClientSecret implements Provider.SetClientSecret interface. // SetClientSecret implements Provider.SetClientSecret() interface method.
func (p *baseProvider) SetClientSecret(secret string) { func (p *baseProvider) SetClientSecret(secret string) {
p.clientSecret = secret p.clientSecret = secret
} }
// RedirectUrl implements Provider.RedirectUrl interface. // RedirectUrl implements Provider.RedirectUrl() interface method.
func (p *baseProvider) RedirectUrl() string { func (p *baseProvider) RedirectUrl() string {
return p.redirectUrl return p.redirectUrl
} }
// SetRedirectUrl implements Provider.SetRedirectUrl interface. // SetRedirectUrl implements Provider.SetRedirectUrl() interface method.
func (p *baseProvider) SetRedirectUrl(url string) { func (p *baseProvider) SetRedirectUrl(url string) {
p.redirectUrl = url p.redirectUrl = url
} }
// AuthUrl implements Provider.AuthUrl interface. // AuthUrl implements Provider.AuthUrl() interface method.
func (p *baseProvider) AuthUrl() string { func (p *baseProvider) AuthUrl() string {
return p.authUrl return p.authUrl
} }
// SetAuthUrl implements Provider.SetAuthUrl interface. // SetAuthUrl implements Provider.SetAuthUrl() interface method.
func (p *baseProvider) SetAuthUrl(url string) { func (p *baseProvider) SetAuthUrl(url string) {
p.authUrl = url p.authUrl = url
} }
// TokenUrl implements Provider.TokenUrl interface. // TokenUrl implements Provider.TokenUrl() interface method.
func (p *baseProvider) TokenUrl() string { func (p *baseProvider) TokenUrl() string {
return p.tokenUrl return p.tokenUrl
} }
// SetTokenUrl implements Provider.SetTokenUrl interface. // SetTokenUrl implements Provider.SetTokenUrl() interface method.
func (p *baseProvider) SetTokenUrl(url string) { func (p *baseProvider) SetTokenUrl(url string) {
p.tokenUrl = url p.tokenUrl = url
} }
// UserApiUrl implements Provider.UserApiUrl interface. // UserApiUrl implements Provider.UserApiUrl() interface method.
func (p *baseProvider) UserApiUrl() string { func (p *baseProvider) UserApiUrl() string {
return p.userApiUrl return p.userApiUrl
} }
// SetUserApiUrl implements Provider.SetUserApiUrl interface. // SetUserApiUrl implements Provider.SetUserApiUrl() interface method.
func (p *baseProvider) SetUserApiUrl(url string) { func (p *baseProvider) SetUserApiUrl(url string) {
p.userApiUrl = url p.userApiUrl = url
} }
// BuildAuthUrl implements Provider.BuildAuthUrl interface. // BuildAuthUrl implements Provider.BuildAuthUrl() interface method.
func (p *baseProvider) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string { func (p *baseProvider) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string {
return p.oauth2Config().AuthCodeURL(state, opts...) return p.oauth2Config().AuthCodeURL(state, opts...)
} }
// FetchToken implements Provider.FetchToken interface. // FetchToken implements Provider.FetchToken() interface method.
func (p *baseProvider) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) { func (p *baseProvider) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) {
return p.oauth2Config().Exchange(context.Background(), code, opts...) return p.oauth2Config().Exchange(p.ctx, code, opts...)
} }
// Client implements Provider.Client interface. // Client implements Provider.Client() interface method.
func (p *baseProvider) Client(token *oauth2.Token) *http.Client { func (p *baseProvider) Client(token *oauth2.Token) *http.Client {
return p.oauth2Config().Client(context.Background(), token) return p.oauth2Config().Client(p.ctx, token)
} }
// FetchRawUserData implements Provider.FetchRawUserData interface. // FetchRawUserData implements Provider.FetchRawUserData() interface method.
func (p *baseProvider) FetchRawUserData(token *oauth2.Token) ([]byte, error) { func (p *baseProvider) FetchRawUserData(token *oauth2.Token) ([]byte, error) {
req, err := http.NewRequest("GET", p.userApiUrl, nil) req, err := http.NewRequestWithContext(p.ctx, "GET", p.userApiUrl, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -119,23 +130,23 @@ func (p *baseProvider) FetchRawUserData(token *oauth2.Token) ([]byte, error) {
func (p *baseProvider) sendRawUserDataRequest(req *http.Request, token *oauth2.Token) ([]byte, error) { func (p *baseProvider) sendRawUserDataRequest(req *http.Request, token *oauth2.Token) ([]byte, error) {
client := p.Client(token) client := p.Client(token)
response, err := client.Do(req) res, err := client.Do(req)
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer response.Body.Close() defer res.Body.Close()
result, err := io.ReadAll(response.Body) result, err := io.ReadAll(res.Body)
if err != nil { if err != nil {
return nil, err return nil, err
} }
// http.Client.Get doesn't treat non 2xx responses as error // http.Client.Get doesn't treat non 2xx responses as error
if response.StatusCode >= 400 { if res.StatusCode >= 400 {
return nil, fmt.Errorf( return nil, fmt.Errorf(
"Failed to fetch OAuth2 user profile via %s (%d):\n%s", "failed to fetch OAuth2 user profile via %s (%d):\n%s",
p.userApiUrl, p.userApiUrl,
response.StatusCode, res.StatusCode,
string(result), string(result),
) )
} }
+17
View File
@@ -1,11 +1,28 @@
package auth package auth
import ( import (
"context"
"testing" "testing"
"golang.org/x/oauth2" "golang.org/x/oauth2"
) )
func TestContext(t *testing.T) {
b := baseProvider{}
before := b.Scopes()
if before != nil {
t.Errorf("Expected nil context, got %v", before)
}
b.SetContext(context.Background())
after := b.Scopes()
if after != nil {
t.Error("Expected non-nil context")
}
}
func TestScopes(t *testing.T) { func TestScopes(t *testing.T) {
b := baseProvider{} b := baseProvider{}
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"fmt" "fmt"
@@ -22,6 +23,7 @@ func NewDiscordProvider() *Discord {
// https://discord.com/developers/docs/topics/oauth2 // https://discord.com/developers/docs/topics/oauth2
// https://discord.com/developers/docs/resources/user#get-current-user // https://discord.com/developers/docs/resources/user#get-current-user
return &Discord{&baseProvider{ return &Discord{&baseProvider{
ctx: context.Background(),
scopes: []string{"identify", "email"}, scopes: []string{"identify", "email"},
authUrl: "https://discord.com/api/oauth2/authorize", authUrl: "https://discord.com/api/oauth2/authorize",
tokenUrl: "https://discord.com/api/oauth2/token", tokenUrl: "https://discord.com/api/oauth2/token",
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@@ -20,6 +21,7 @@ type Facebook struct {
// NewFacebookProvider creates new Facebook provider instance with some defaults. // NewFacebookProvider creates new Facebook provider instance with some defaults.
func NewFacebookProvider() *Facebook { func NewFacebookProvider() *Facebook {
return &Facebook{&baseProvider{ return &Facebook{&baseProvider{
ctx: context.Background(),
scopes: []string{"email"}, scopes: []string{"email"},
authUrl: facebook.Endpoint.AuthURL, authUrl: facebook.Endpoint.AuthURL,
tokenUrl: facebook.Endpoint.TokenURL, tokenUrl: facebook.Endpoint.TokenURL,
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"strconv" "strconv"
@@ -20,6 +21,7 @@ type Gitea struct {
// NewGiteaProvider creates new Gitea provider instance with some defaults. // NewGiteaProvider creates new Gitea provider instance with some defaults.
func NewGiteaProvider() *Gitea { func NewGiteaProvider() *Gitea {
return &Gitea{&baseProvider{ return &Gitea{&baseProvider{
ctx: context.Background(),
scopes: []string{"read:user", "user:email"}, scopes: []string{"read:user", "user:email"},
authUrl: "https://gitea.com/login/oauth/authorize", authUrl: "https://gitea.com/login/oauth/authorize",
tokenUrl: "https://gitea.com/login/oauth/access_token", tokenUrl: "https://gitea.com/login/oauth/access_token",
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"io" "io"
"strconv" "strconv"
@@ -22,6 +23,7 @@ type Gitee struct {
// NewGiteeProvider creates new Gitee provider instance with some defaults. // NewGiteeProvider creates new Gitee provider instance with some defaults.
func NewGiteeProvider() *Gitee { func NewGiteeProvider() *Gitee {
return &Gitee{&baseProvider{ return &Gitee{&baseProvider{
ctx: context.Background(),
scopes: []string{"user_info", "emails"}, scopes: []string{"user_info", "emails"},
authUrl: "https://gitee.com/oauth/authorize", authUrl: "https://gitee.com/oauth/authorize",
tokenUrl: "https://gitee.com/oauth/token", tokenUrl: "https://gitee.com/oauth/token",
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"io" "io"
"strconv" "strconv"
@@ -22,6 +23,7 @@ type Github struct {
// NewGithubProvider creates new Github provider instance with some defaults. // NewGithubProvider creates new Github provider instance with some defaults.
func NewGithubProvider() *Github { func NewGithubProvider() *Github {
return &Github{&baseProvider{ return &Github{&baseProvider{
ctx: context.Background(),
scopes: []string{"read:user", "user:email"}, scopes: []string{"read:user", "user:email"},
authUrl: github.Endpoint.AuthURL, authUrl: github.Endpoint.AuthURL,
tokenUrl: github.Endpoint.TokenURL, tokenUrl: github.Endpoint.TokenURL,
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"strconv" "strconv"
@@ -20,6 +21,7 @@ type Gitlab struct {
// NewGitlabProvider creates new Gitlab provider instance with some defaults. // NewGitlabProvider creates new Gitlab provider instance with some defaults.
func NewGitlabProvider() *Gitlab { func NewGitlabProvider() *Gitlab {
return &Gitlab{&baseProvider{ return &Gitlab{&baseProvider{
ctx: context.Background(),
scopes: []string{"read_user"}, scopes: []string{"read_user"},
authUrl: "https://gitlab.com/oauth/authorize", authUrl: "https://gitlab.com/oauth/authorize",
tokenUrl: "https://gitlab.com/oauth/token", tokenUrl: "https://gitlab.com/oauth/token",
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@@ -19,6 +20,7 @@ type Google struct {
// NewGoogleProvider creates new Google provider instance with some defaults. // NewGoogleProvider creates new Google provider instance with some defaults.
func NewGoogleProvider() *Google { func NewGoogleProvider() *Google {
return &Google{&baseProvider{ return &Google{&baseProvider{
ctx: context.Background(),
scopes: []string{ scopes: []string{
"https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.email",
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"strconv" "strconv"
@@ -21,6 +22,7 @@ type Kakao struct {
// NewKakaoProvider creates a new Kakao provider instance with some defaults. // NewKakaoProvider creates a new Kakao provider instance with some defaults.
func NewKakaoProvider() *Kakao { func NewKakaoProvider() *Kakao {
return &Kakao{&baseProvider{ return &Kakao{&baseProvider{
ctx: context.Background(),
scopes: []string{"account_email", "profile_nickname", "profile_image"}, scopes: []string{"account_email", "profile_nickname", "profile_image"},
authUrl: kakao.Endpoint.AuthURL, authUrl: kakao.Endpoint.AuthURL,
tokenUrl: kakao.Endpoint.TokenURL, tokenUrl: kakao.Endpoint.TokenURL,
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@@ -19,6 +20,7 @@ type Livechat struct {
// NewLivechatProvider creates new Livechat provider instance with some defaults. // NewLivechatProvider creates new Livechat provider instance with some defaults.
func NewLivechatProvider() *Livechat { func NewLivechatProvider() *Livechat {
return &Livechat{&baseProvider{ return &Livechat{&baseProvider{
ctx: context.Background(),
scopes: []string{}, // default scopes are specified from the provider dashboard scopes: []string{}, // default scopes are specified from the provider dashboard
authUrl: "https://accounts.livechat.com/", authUrl: "https://accounts.livechat.com/",
tokenUrl: "https://accounts.livechat.com/token", tokenUrl: "https://accounts.livechat.com/token",
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@@ -21,6 +22,7 @@ type Microsoft struct {
func NewMicrosoftProvider() *Microsoft { func NewMicrosoftProvider() *Microsoft {
endpoints := microsoft.AzureADEndpoint("") endpoints := microsoft.AzureADEndpoint("")
return &Microsoft{&baseProvider{ return &Microsoft{&baseProvider{
ctx: context.Background(),
scopes: []string{"User.Read"}, scopes: []string{"User.Read"},
authUrl: endpoints.AuthURL, authUrl: endpoints.AuthURL,
tokenUrl: endpoints.TokenURL, tokenUrl: endpoints.TokenURL,
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@@ -19,6 +20,7 @@ type OIDC struct {
// NewOIDCProvider creates new OpenID Connect (OIDC) provider instance with some defaults. // NewOIDCProvider creates new OpenID Connect (OIDC) provider instance with some defaults.
func NewOIDCProvider() *OIDC { func NewOIDCProvider() *OIDC {
return &OIDC{&baseProvider{ return &OIDC{&baseProvider{
ctx: context.Background(),
scopes: []string{ scopes: []string{
"openid", // minimal requirement to return the id "openid", // minimal requirement to return the id
"email", "email",
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@@ -20,6 +21,7 @@ type Spotify struct {
// NewSpotifyProvider creates a new Spotify provider instance with some defaults. // NewSpotifyProvider creates a new Spotify provider instance with some defaults.
func NewSpotifyProvider() *Spotify { func NewSpotifyProvider() *Spotify {
return &Spotify{&baseProvider{ return &Spotify{&baseProvider{
ctx: context.Background(),
scopes: []string{ scopes: []string{
"user-read-private", "user-read-private",
// currently Spotify doesn't return information whether the email is verified or not // currently Spotify doesn't return information whether the email is verified or not
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"strconv" "strconv"
@@ -20,6 +21,7 @@ type Strava struct {
// NewStravaProvider creates new Strava provider instance with some defaults. // NewStravaProvider creates new Strava provider instance with some defaults.
func NewStravaProvider() *Strava { func NewStravaProvider() *Strava {
return &Strava{&baseProvider{ return &Strava{&baseProvider{
ctx: context.Background(),
scopes: []string{ scopes: []string{
"profile:read_all", "profile:read_all",
}, },
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"errors" "errors"
"net/http" "net/http"
@@ -22,6 +23,7 @@ type Twitch struct {
// NewTwitchProvider creates new Twitch provider instance with some defaults. // NewTwitchProvider creates new Twitch provider instance with some defaults.
func NewTwitchProvider() *Twitch { func NewTwitchProvider() *Twitch {
return &Twitch{&baseProvider{ return &Twitch{&baseProvider{
ctx: context.Background(),
scopes: []string{"user:read:email"}, scopes: []string{"user:read:email"},
authUrl: twitch.Endpoint.AuthURL, authUrl: twitch.Endpoint.AuthURL,
tokenUrl: twitch.Endpoint.TokenURL, tokenUrl: twitch.Endpoint.TokenURL,
+2
View File
@@ -1,6 +1,7 @@
package auth package auth
import ( import (
"context"
"encoding/json" "encoding/json"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@@ -19,6 +20,7 @@ type Twitter struct {
// NewTwitterProvider creates new Twitter provider instance with some defaults. // NewTwitterProvider creates new Twitter provider instance with some defaults.
func NewTwitterProvider() *Twitter { func NewTwitterProvider() *Twitter {
return &Twitter{&baseProvider{ return &Twitter{&baseProvider{
ctx: context.Background(),
scopes: []string{ scopes: []string{
"users.read", "users.read",
@@ -1,4 +1,4 @@
import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as me,f as k,g as h,h as n,m as _e,x as G,O as re,P as we,k as ve,Q as Ce,n as Pe,t as L,a as Y,o as m,d as pe,R as Me,C as Se,p as $e,r as H,u as je,N as Ae}from"./index-04665dfb.js";import{S as Be}from"./SdkTabs-aab7d363.js";function ue(a,l,o){const s=a.slice();return s[5]=l[o],s}function de(a,l,o){const s=a.slice();return s[5]=l[o],s}function fe(a,l){let o,s=l[5].code+"",_,f,i,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){o=r("button"),_=b(s),f=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(v,C){h(v,o,C),n(o,_),n(o,f),i||(u=je(o,"click",d),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&H(o,"active",l[1]===l[5].code)},d(v){v&&m(o),i=!1,u()}}}function he(a,l){let o,s,_,f;return s=new Ae({props:{content:l[5].body}}),{key:a,first:null,c(){o=r("div"),me(s.$$.fragment),_=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(i,u){h(i,o,u),_e(s,o,null),n(o,_),f=!0},p(i,u){l=i;const d={};u&4&&(d.content=l[5].body),s.$set(d),(!f||u&6)&&H(o,"active",l[1]===l[5].code)},i(i){f||(L(s.$$.fragment,i),f=!0)},o(i){Y(s.$$.fragment,i),f=!1},d(i){i&&m(o),pe(s)}}}function Oe(a){var ae,ne;let l,o,s=a[0].name+"",_,f,i,u,d,v,C,F=a[0].name+"",U,R,q,P,D,j,W,M,K,X,Q,A,Z,V,y=a[0].name+"",E,x,I,B,J,S,O,w=[],ee=new Map,te,T,p=[],le=new Map,$;P=new Be({props:{js:` import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as me,f as k,g as h,h as n,m as _e,x as G,O as re,P as we,k as ve,Q as Ce,n as Pe,t as L,a as Y,o as m,d as pe,R as Me,C as Se,p as $e,r as H,u as je,N as Ae}from"./index-e5419a23.js";import{S as Be}from"./SdkTabs-b7dd00a7.js";function ue(a,l,o){const s=a.slice();return s[5]=l[o],s}function de(a,l,o){const s=a.slice();return s[5]=l[o],s}function fe(a,l){let o,s=l[5].code+"",_,f,i,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){o=r("button"),_=b(s),f=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(v,C){h(v,o,C),n(o,_),n(o,f),i||(u=je(o,"click",d),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&H(o,"active",l[1]===l[5].code)},d(v){v&&m(o),i=!1,u()}}}function he(a,l){let o,s,_,f;return s=new Ae({props:{content:l[5].body}}),{key:a,first:null,c(){o=r("div"),me(s.$$.fragment),_=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(i,u){h(i,o,u),_e(s,o,null),n(o,_),f=!0},p(i,u){l=i;const d={};u&4&&(d.content=l[5].body),s.$set(d),(!f||u&6)&&H(o,"active",l[1]===l[5].code)},i(i){f||(L(s.$$.fragment,i),f=!0)},o(i){Y(s.$$.fragment,i),f=!1},d(i){i&&m(o),pe(s)}}}function Oe(a){var ae,ne;let l,o,s=a[0].name+"",_,f,i,u,d,v,C,F=a[0].name+"",U,R,q,P,D,j,W,M,K,X,Q,A,Z,V,y=a[0].name+"",E,x,I,B,J,S,O,w=[],ee=new Map,te,T,p=[],le=new Map,$;P=new Be({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}'); const pb = new PocketBase('${a[3]}');
@@ -1,4 +1,4 @@
import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as c,h as o,m as ne,x as re,O as qe,P as xe,k as Je,Q as Ke,n as Qe,t as U,a as j,o as d,d as ie,R as Ie,C as He,p as We,r as x,u as Ge}from"./index-04665dfb.js";import{S as Xe}from"./SdkTabs-aab7d363.js";function Ee(r,l,s){const n=r.slice();return n[5]=l[s],n}function Fe(r,l,s){const n=r.slice();return n[5]=l[s],n}function Le(r,l){let s,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){s=a("button"),m=k(n),_=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(g,w){c(g,s,w),o(s,m),o(s,_),i||(f=Ge(s,"click",v),i=!0)},p(g,w){l=g,w&4&&n!==(n=l[5].code+"")&&re(m,n),w&6&&x(s,"active",l[1]===l[5].code)},d(g){g&&d(s),i=!1,f()}}}function Ne(r,l){let s,n,m,_;return n=new Ve({props:{content:l[5].body}}),{key:r,first:null,c(){s=a("div"),ae(n.$$.fragment),m=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(i,f){c(i,s,f),ne(n,s,null),o(s,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&x(s,"active",l[1]===l[5].code)},i(i){_||(U(n.$$.fragment,i),_=!0)},o(i){j(n.$$.fragment,i),_=!1},d(i){i&&d(s),ie(n)}}}function Ye(r){var Be,Me;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,B,J,S,F,ce,L,M,de,K,N=r[0].name+"",Q,ue,pe,V,I,D,W,T,G,fe,X,C,Y,he,Z,be,h,me,P,_e,ke,ve,ee,ge,te,ye,Se,$e,oe,we,le,O,se,R,q,$=[],Te=new Map,Ce,H,y=[],Re=new Map,A;g=new Xe({props:{js:` import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as c,h as o,m as ne,x as re,O as qe,P as xe,k as Je,Q as Ke,n as Qe,t as U,a as j,o as d,d as ie,R as Ie,C as He,p as We,r as x,u as Ge}from"./index-e5419a23.js";import{S as Xe}from"./SdkTabs-b7dd00a7.js";function Ee(r,l,s){const n=r.slice();return n[5]=l[s],n}function Fe(r,l,s){const n=r.slice();return n[5]=l[s],n}function Le(r,l){let s,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){s=a("button"),m=k(n),_=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(g,w){c(g,s,w),o(s,m),o(s,_),i||(f=Ge(s,"click",v),i=!0)},p(g,w){l=g,w&4&&n!==(n=l[5].code+"")&&re(m,n),w&6&&x(s,"active",l[1]===l[5].code)},d(g){g&&d(s),i=!1,f()}}}function Ne(r,l){let s,n,m,_;return n=new Ve({props:{content:l[5].body}}),{key:r,first:null,c(){s=a("div"),ae(n.$$.fragment),m=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(i,f){c(i,s,f),ne(n,s,null),o(s,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&x(s,"active",l[1]===l[5].code)},i(i){_||(U(n.$$.fragment,i),_=!0)},o(i){j(n.$$.fragment,i),_=!1},d(i){i&&d(s),ie(n)}}}function Ye(r){var Be,Me;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,B,J,S,F,ce,L,M,de,K,N=r[0].name+"",Q,ue,pe,V,I,D,W,T,G,fe,X,C,Y,he,Z,be,h,me,P,_e,ke,ve,ee,ge,te,ye,Se,$e,oe,we,le,O,se,R,q,$=[],Te=new Map,Ce,H,y=[],Re=new Map,A;g=new Xe({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${r[3]}'); const pb = new PocketBase('${r[3]}');
@@ -1,4 +1,4 @@
import{S as je,i as He,s as Je,N as We,e as s,w as v,b as p,c as re,f as h,g as r,h as a,m as ce,x as de,O as Ve,P as Ne,k as Qe,Q as ze,n as Ke,t as j,a as H,o as c,d as ue,R as Ye,C as Be,p as Ge,r as J,u as Xe}from"./index-04665dfb.js";import{S as Ze}from"./SdkTabs-aab7d363.js";function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function Le(i,l,o){const n=i.slice();return n[5]=l[o],n}function xe(i,l){let o,n=l[5].code+"",m,_,d,b;function g(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=v(n),_=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(k,R){r(k,o,R),a(o,m),a(o,_),d||(b=Xe(o,"click",g),d=!0)},p(k,R){l=k,R&4&&n!==(n=l[5].code+"")&&de(m,n),R&6&&J(o,"active",l[1]===l[5].code)},d(k){k&&c(o),d=!1,b()}}}function Me(i,l){let o,n,m,_;return n=new We({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),ce(n,o,null),a(o,m),_=!0},p(d,b){l=d;const g={};b&4&&(g.content=l[5].body),n.$set(g),(!_||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){_||(j(n.$$.fragment,d),_=!0)},o(d){H(n.$$.fragment,d),_=!1},d(d){d&&c(o),ue(n)}}}function et(i){var qe,Ie;let l,o,n=i[0].name+"",m,_,d,b,g,k,R,C,N,y,L,pe,x,D,he,Q,M=i[0].name+"",z,be,K,q,Y,I,G,P,X,O,Z,fe,ee,$,te,me,ae,_e,f,ve,E,ge,ke,we,le,Se,oe,Re,ye,Oe,se,$e,ne,U,ie,A,V,S=[],Ae=new Map,Ee,B,w=[],Te=new Map,T;k=new Ze({props:{js:` import{S as je,i as He,s as Je,N as We,e as s,w as v,b as p,c as re,f as h,g as r,h as a,m as ce,x as de,O as Ve,P as Ne,k as Qe,Q as ze,n as Ke,t as j,a as H,o as c,d as ue,R as Ye,C as Be,p as Ge,r as J,u as Xe}from"./index-e5419a23.js";import{S as Ze}from"./SdkTabs-b7dd00a7.js";function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function Le(i,l,o){const n=i.slice();return n[5]=l[o],n}function xe(i,l){let o,n=l[5].code+"",m,_,d,b;function g(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=v(n),_=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(k,R){r(k,o,R),a(o,m),a(o,_),d||(b=Xe(o,"click",g),d=!0)},p(k,R){l=k,R&4&&n!==(n=l[5].code+"")&&de(m,n),R&6&&J(o,"active",l[1]===l[5].code)},d(k){k&&c(o),d=!1,b()}}}function Me(i,l){let o,n,m,_;return n=new We({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),ce(n,o,null),a(o,m),_=!0},p(d,b){l=d;const g={};b&4&&(g.content=l[5].body),n.$set(g),(!_||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){_||(j(n.$$.fragment,d),_=!0)},o(d){H(n.$$.fragment,d),_=!1},d(d){d&&c(o),ue(n)}}}function et(i){var qe,Ie;let l,o,n=i[0].name+"",m,_,d,b,g,k,R,C,N,y,L,pe,x,D,he,Q,M=i[0].name+"",z,be,K,q,Y,I,G,P,X,O,Z,fe,ee,$,te,me,ae,_e,f,ve,E,ge,ke,we,le,Se,oe,Re,ye,Oe,se,$e,ne,U,ie,A,V,S=[],Ae=new Map,Ee,B,w=[],Te=new Map,T;k=new Ze({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}'); const pb = new PocketBase('${i[3]}');
@@ -1,4 +1,4 @@
import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as r,h as o,m as At,x as Tt,O as ce,P as ye,k as ge,Q as Pe,n as Re,t as tt,a as et,o as c,d as Ut,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-04665dfb.js";import{S as Ae}from"./SdkTabs-aab7d363.js";function ue(n,e,l){const i=n.slice();return i[8]=e[l],i}function fe(n,e,l){const i=n.slice();return i[8]=e[l],i}function Te(n){let e;return{c(){e=f("email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Me(n){let e;return{c(){e=f("username/email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function pe(n){let e;return{c(){e=s("strong"),e.textContent="username"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function be(n){let e;return{c(){e=f("or")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function me(n){let e;return{c(){e=s("strong"),e.textContent="email"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function he(n,e){let l,i=e[8].code+"",S,m,p,d;function _(){return e[7](e[8])}return{key:n,first:null,c(){l=s("button"),S=f(i),m=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m($,C){r($,l,C),o(l,S),o(l,m),p||(d=Oe(l,"click",_),p=!0)},p($,C){e=$,C&16&&i!==(i=e[8].code+"")&&Tt(S,i),C&24&&lt(l,"active",e[3]===e[8].code)},d($){$&&c(l),p=!1,d()}}}function _e(n,e){let l,i,S,m;return i=new ke({props:{content:e[8].body}}),{key:n,first:null,c(){l=s("div"),Ot(i.$$.fragment),S=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m(p,d){r(p,l,d),At(i,l,null),o(l,S),m=!0},p(p,d){e=p;const _={};d&16&&(_.content=e[8].body),i.$set(_),(!m||d&24)&&lt(l,"active",e[3]===e[8].code)},i(p){m||(tt(i.$$.fragment,p),m=!0)},o(p){et(i.$$.fragment,p),m=!1},d(p){p&&c(l),Ut(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Mt,ot,T,at,F,st,U,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,M,dt,Lt,V,D,ut,Bt,ft,Ht,g,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Qt,gt,Kt,Pt,zt,Gt,Xt,Rt,Zt,$t,J,Ct,L,Q,A=[],xt=new Map,te,K,P=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Me;if(t[1])return Ue;if(t[2])return Te}let q=le(n),R=q&&q(n);T=new Ae({props:{js:` import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as r,h as o,m as At,x as Tt,O as ce,P as ye,k as ge,Q as Pe,n as Re,t as tt,a as et,o as c,d as Ut,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-e5419a23.js";import{S as Ae}from"./SdkTabs-b7dd00a7.js";function ue(n,e,l){const i=n.slice();return i[8]=e[l],i}function fe(n,e,l){const i=n.slice();return i[8]=e[l],i}function Te(n){let e;return{c(){e=f("email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Me(n){let e;return{c(){e=f("username/email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function pe(n){let e;return{c(){e=s("strong"),e.textContent="username"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function be(n){let e;return{c(){e=f("or")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function me(n){let e;return{c(){e=s("strong"),e.textContent="email"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function he(n,e){let l,i=e[8].code+"",S,m,p,d;function _(){return e[7](e[8])}return{key:n,first:null,c(){l=s("button"),S=f(i),m=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m($,C){r($,l,C),o(l,S),o(l,m),p||(d=Oe(l,"click",_),p=!0)},p($,C){e=$,C&16&&i!==(i=e[8].code+"")&&Tt(S,i),C&24&&lt(l,"active",e[3]===e[8].code)},d($){$&&c(l),p=!1,d()}}}function _e(n,e){let l,i,S,m;return i=new ke({props:{content:e[8].body}}),{key:n,first:null,c(){l=s("div"),Ot(i.$$.fragment),S=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m(p,d){r(p,l,d),At(i,l,null),o(l,S),m=!0},p(p,d){e=p;const _={};d&16&&(_.content=e[8].body),i.$set(_),(!m||d&24)&&lt(l,"active",e[3]===e[8].code)},i(p){m||(tt(i.$$.fragment,p),m=!0)},o(p){et(i.$$.fragment,p),m=!1},d(p){p&&c(l),Ut(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Mt,ot,T,at,F,st,U,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,M,dt,Lt,V,D,ut,Bt,ft,Ht,g,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Qt,gt,Kt,Pt,zt,Gt,Xt,Rt,Zt,$t,J,Ct,L,Q,A=[],xt=new Map,te,K,P=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Me;if(t[1])return Ue;if(t[2])return Te}let q=le(n),R=q&&q(n);T=new Ae({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${n[6]}'); const pb = new PocketBase('${n[6]}');
@@ -1,4 +1,4 @@
import{S as ut,i as St,s as ft,e as dt,f as $t,T as I,g as gt,y as jO,o as Pt,I as mt,J as bt,K as Xt,L as Zt,C as xt,M as yt}from"./index-04665dfb.js";import{P as kt,N as vt,u as Yt,D as wt,v as vO,T as B,I as xe,w as rO,x as l,y as Tt,L as iO,z as sO,A as R,B as nO,F as ye,G as lO,H as _,J as ke,K as ve,E as w,M as z,O as Wt,Q as Vt,R as Ye,U as b,V as Ut,W as _t,X as Ct,a as C,h as qt,b as jt,c as Gt,d as Rt,e as zt,s as At,f as It,g as Et,i as Nt,r as Bt,j as Dt,k as Lt,l as Jt,m as Mt,n as Ht,o as Ft,p as Kt,q as Oa,t as GO,C as E}from"./index-a6ccb683.js";class M{constructor(O,a,t,r,i,s,n,o,Q,p=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=i,this.score=s,this.buffer=n,this.bufferBase=o,this.curContext=Q,this.lookAhead=p,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new M(O,[],a,t,t,0,[],0,r?new RO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:i}=this.p,s=i.dynamicPrecedence(r);if(s&&(this.score+=s),t==0){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,4,!0),this.reduceContext(r,this.reducePos);return}let n=this.stack.length-(t-1)*3-(O&262144?6:0),o=n?this.stack[n-2]:this.p.ranges[0].from,Q=this.reducePos-o;Q>=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.lastBigReductionSize<Q&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=o,this.p.lastBigReductionSize=Q));let p=n?this.stack[n-1]:0,c=this.bufferBase+this.buffer.length-p;if(r<i.minRepeatTerm||O&131072){let u=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,o,u,c+4,!0)}if(O&262144)this.state=this.stack[n];else{let u=this.stack[n-3];this.state=i.getGoto(u,r,!0)}for(;this.stack.length>n;)this.stack.pop();this.reduceContext(r,o)}storeNode(O,a,t,r=4,i=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,n=this.buffer.length;if(n==0&&s.parent&&(n=s.bufferBase-s.parent.bufferBase,s=s.parent),n>0&&s.buffer[n-4]==0&&s.buffer[n-1]>-1){if(a==t)return;if(s.buffer[n-2]>=a){s.buffer[n-2]=t;return}}}if(!i||this.pos==t)this.buffer.push(O,a,t,r);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>t;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=O,this.buffer[s+1]=a,this.buffer[s+2]=t,this.buffer[s+3]=r}}shift(O,a,t){let r=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let i=O,{parser:s}=this.p;(t>this.pos||a<=s.maxNode)&&(this.pos=t,s.stateFlag(i,1)||(this.reducePos=t)),this.pushState(i,r),this.shiftContext(a,r),a<=s.maxNode&&this.buffer.push(a,r,t,4)}}apply(O,a,t){O&65536?this.reduce(O):this.shift(O,a,t)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new M(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new ea(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>4<<1||this.stack.length>=120){let r=[];for(let i=0,s;i<a.length;i+=2)(s=a[i+1])!=this.state&&this.p.parser.hasAction(s,O)&&r.push(a[i],s);if(this.stack.length<120)for(let i=0;r.length<4<<1&&i<a.length;i+=2){let s=a[i+1];r.some((n,o)=>o&1&&n==s)||r.push(a[i],s)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let i=a[r+1];if(i==this.state)continue;let s=this.split();s.pushState(i,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(a[r],this.pos),s.score-=200,t.push(s)}return t}forceReduce(){let O=this.p.parser.stateSlot(this.state,5);if(!(O&65536))return!1;let{parser:a}=this.p;if(!a.validAction(this.state,O)){let t=O>>19,Line truncated import{S as ut,i as St,s as ft,e as dt,f as $t,T as I,g as gt,y as jO,o as Pt,I as mt,J as bt,K as Xt,L as Zt,C as xt,M as yt}from"./index-e5419a23.js";import{P as kt,N as vt,u as Yt,D as wt,v as vO,T as B,I as xe,w as rO,x as l,y as Tt,L as iO,z as sO,A as R,B as nO,F as ye,G as lO,H as _,J as ke,K as ve,E as w,M as z,O as Wt,Q as Vt,R as Ye,U as b,V as Ut,W as _t,X as Ct,a as C,h as qt,b as jt,c as Gt,d as Rt,e as zt,s as At,f as It,g as Et,i as Nt,r as Bt,j as Dt,k as Lt,l as Jt,m as Mt,n as Ht,o as Ft,p as Kt,q as Oa,t as GO,C as E}from"./index-a6ccb683.js";class M{constructor(O,a,t,r,i,s,n,o,Q,p=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=i,this.score=s,this.buffer=n,this.bufferBase=o,this.curContext=Q,this.lookAhead=p,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new M(O,[],a,t,t,0,[],0,r?new RO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:i}=this.p,s=i.dynamicPrecedence(r);if(s&&(this.score+=s),t==0){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,4,!0),this.reduceContext(r,this.reducePos);return}let n=this.stack.length-(t-1)*3-(O&262144?6:0),o=n?this.stack[n-2]:this.p.ranges[0].from,Q=this.reducePos-o;Q>=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.lastBigReductionSize<Q&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=o,this.p.lastBigReductionSize=Q));let p=n?this.stack[n-1]:0,c=this.bufferBase+this.buffer.length-p;if(r<i.minRepeatTerm||O&131072){let u=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,o,u,c+4,!0)}if(O&262144)this.state=this.stack[n];else{let u=this.stack[n-3];this.state=i.getGoto(u,r,!0)}for(;this.stack.length>n;)this.stack.pop();this.reduceContext(r,o)}storeNode(O,a,t,r=4,i=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,n=this.buffer.length;if(n==0&&s.parent&&(n=s.bufferBase-s.parent.bufferBase,s=s.parent),n>0&&s.buffer[n-4]==0&&s.buffer[n-1]>-1){if(a==t)return;if(s.buffer[n-2]>=a){s.buffer[n-2]=t;return}}}if(!i||this.pos==t)this.buffer.push(O,a,t,r);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>t;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=O,this.buffer[s+1]=a,this.buffer[s+2]=t,this.buffer[s+3]=r}}shift(O,a,t){let r=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let i=O,{parser:s}=this.p;(t>this.pos||a<=s.maxNode)&&(this.pos=t,s.stateFlag(i,1)||(this.reducePos=t)),this.pushState(i,r),this.shiftContext(a,r),a<=s.maxNode&&this.buffer.push(a,r,t,4)}}apply(O,a,t){O&65536?this.reduce(O):this.shift(O,a,t)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new M(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new ea(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>4<<1||this.stack.length>=120){let r=[];for(let i=0,s;i<a.length;i+=2)(s=a[i+1])!=this.state&&this.p.parser.hasAction(s,O)&&r.push(a[i],s);if(this.stack.length<120)for(let i=0;r.length<4<<1&&i<a.length;i+=2){let s=a[i+1];r.some((n,o)=>o&1&&n==s)||r.push(a[i],s)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let i=a[r+1];if(i==this.state)continue;let s=this.split();s.pushState(i,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(a[r],this.pos),s.score-=200,t.push(s)}return t}forceReduce(){let O=this.p.parser.stateSlot(this.state,5);if(!(O&65536))return!1;let{parser:a}=this.p;if(!a.validAction(this.state,O)){let t=O>>19,Line truncated
\${} \${}
} catch (\${error}) { } catch (\${error}) {
\${} \${}
@@ -1,4 +1,4 @@
import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n,m as ve,x as Y,O as pe,P as Pe,k as Se,Q as Oe,n as Re,t as Z,a as x,o as f,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,N as qe}from"./index-04665dfb.js";import{S as Ae}from"./SdkTabs-aab7d363.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){r(C,s,$),n(s,_),n(s,u),i||(d=Be(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&f(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){r(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(s),ge(a)}}}function Ue(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,w,I,R,L,P,N,te,K,T,le,Q,M=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,g=[],ae=new Map,oe,A,k=[],ne=new Map,O;w=new Ae({props:{js:` import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n,m as ve,x as Y,O as pe,P as Pe,k as Se,Q as Oe,n as Re,t as Z,a as x,o as f,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,N as qe}from"./index-e5419a23.js";import{S as Ae}from"./SdkTabs-b7dd00a7.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){r(C,s,$),n(s,_),n(s,u),i||(d=Be(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&f(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){r(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(s),ge(a)}}}function Ue(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,w,I,R,L,P,N,te,K,T,le,Q,M=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,g=[],ae=new Map,oe,A,k=[],ne=new Map,O;w=new Ae({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}'); const pb = new PocketBase('${o[3]}');
@@ -1,4 +1,4 @@
import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as K,O as me,P as Oe,k as Ne,Q as Ce,n as We,t as Z,a as x,o as d,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,N as Ae}from"./index-04665dfb.js";import{S as De}from"./SdkTabs-aab7d363.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=c("button"),_=w(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){r(S,l,h),n(l,_),n(l,u),i||(p=ge(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&d(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=c("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&d(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,q=o[0].name+"",j,ee,H,R,L,W,Q,O,B,te,M,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,P=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new De({props:{js:` import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as K,O as me,P as Oe,k as Ne,Q as Ce,n as We,t as Z,a as x,o as d,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,N as Ae}from"./index-e5419a23.js";import{S as De}from"./SdkTabs-b7dd00a7.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=c("button"),_=w(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){r(S,l,h),n(l,_),n(l,u),i||(p=ge(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&d(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=c("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&d(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,q=o[0].name+"",j,ee,H,R,L,W,Q,O,B,te,M,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,P=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new De({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}'); const pb = new PocketBase('${o[3]}');
@@ -1,4 +1,4 @@
import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n,m as he,x as D,O as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as f,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,N as Ne}from"./index-04665dfb.js";import{S as Ve}from"./SdkTabs-aab7d363.js";function ue(i,l,s){const o=i.slice();return o[5]=l[s],o}function be(i,l,s){const o=i.slice();return o[5]=l[s],o}function _e(i,l){let s,o=l[5].code+"",_,u,a,p;function d(){return l[4](l[5])}return{key:i,first:null,c(){s=c("button"),_=h(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){r(w,s,C),n(s,_),n(s,u),a||(p=Ee(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&D(_,o),C&6&&H(s,"active",l[1]===l[5].code)},d(w){w&&f(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Ne({props:{content:l[5].body}}),{key:i,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){r(a,s,p),he(o,s,null),n(s,_),u=!0},p(a,p){l=a;const d={};p&4&&(d.content=l[5].body),o.$set(d),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(a){u||(Z(o.$$.fragment,a),u=!0)},o(a){x(o.$$.fragment,a),u=!1},d(a){a&&f(s),$e(o)}}}function Ke(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,M=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,R,q,le,z,U=i[0].name+"",G,se,J,O,W,S,X,E,Y,g,N,$=[],oe=new Map,ie,V,k=[],ne=new Map,y;P=new Ve({props:{js:` import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n,m as he,x as D,O as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as f,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,N as Ne}from"./index-e5419a23.js";import{S as Ve}from"./SdkTabs-b7dd00a7.js";function ue(i,l,s){const o=i.slice();return o[5]=l[s],o}function be(i,l,s){const o=i.slice();return o[5]=l[s],o}function _e(i,l){let s,o=l[5].code+"",_,u,a,p;function d(){return l[4](l[5])}return{key:i,first:null,c(){s=c("button"),_=h(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){r(w,s,C),n(s,_),n(s,u),a||(p=Ee(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&D(_,o),C&6&&H(s,"active",l[1]===l[5].code)},d(w){w&&f(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Ne({props:{content:l[5].body}}),{key:i,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){r(a,s,p),he(o,s,null),n(s,_),u=!0},p(a,p){l=a;const d={};p&4&&(d.content=l[5].body),o.$set(d),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(a){u||(Z(o.$$.fragment,a),u=!0)},o(a){x(o.$$.fragment,a),u=!1},d(a){a&&f(s),$e(o)}}}function Ke(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,M=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,R,q,le,z,U=i[0].name+"",G,se,J,O,W,S,X,E,Y,g,N,$=[],oe=new Map,ie,V,k=[],ne=new Map,y;P=new Ve({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}'); const pb = new PocketBase('${i[3]}');
@@ -1,4 +1,4 @@
import{S as Ht,i as Lt,s as Pt,C as Q,N as At,e as a,w as k,b as m,c as Pe,f as h,g as r,h as n,m as Re,x,O as Le,P as ht,k as Rt,Q as Bt,n as Ft,t as fe,a as pe,o as d,d as Be,R as gt,p as jt,r as ue,u as Dt,y as le}from"./index-04665dfb.js";import{S as Nt}from"./SdkTabs-aab7d363.js";function wt(o,e,l){const s=o.slice();return s[7]=e[l],s}function Ct(o,e,l){const s=o.slice();return s[7]=e[l],s}function St(o,e,l){const s=o.slice();return s[12]=e[l],s}function $t(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Tt(o){let e,l,s,b,p,c,f,y,T,w,O,g,D,V,L,J,j,B,S,N,q,C,_;function M(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Jt:Vt}let z=M(o),P=z(o);return{c(){e=a("tr"),e.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=a("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span> import{S as Ht,i as Lt,s as Pt,C as Q,N as At,e as a,w as k,b as m,c as Pe,f as h,g as r,h as n,m as Re,x,O as Le,P as ht,k as Rt,Q as Bt,n as Ft,t as fe,a as pe,o as d,d as Be,R as gt,p as jt,r as ue,u as Dt,y as le}from"./index-e5419a23.js";import{S as Nt}from"./SdkTabs-b7dd00a7.js";function wt(o,e,l){const s=o.slice();return s[7]=e[l],s}function Ct(o,e,l){const s=o.slice();return s[7]=e[l],s}function St(o,e,l){const s=o.slice();return s[12]=e[l],s}function $t(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Tt(o){let e,l,s,b,p,c,f,y,T,w,O,g,D,V,L,J,j,B,S,N,q,C,_;function M(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Jt:Vt}let z=M(o),P=z(o);return{c(){e=a("tr"),e.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=a("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>username</span></div></td> <span>username</span></div></td>
<td><span class="label">String</span></td> <td><span class="label">String</span></td>
<td>The username of the auth record. <td>The username of the auth record.
@@ -1,4 +1,4 @@
import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n,m as we,x,O as _e,P as Ee,k as Oe,Q as Te,n as Be,t as ee,a as te,o as f,d as ge,R as Ie,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-04665dfb.js";import{S as He}from"./SdkTabs-aab7d363.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){let l;return{c(){l=c("p"),l.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",m(l,"class","txt-hint txt-sm txt-right")},m(s,a){d(s,l,a)},d(s){s&&f(l)}}}function ye(o,l){let s,a=l[6].code+"",h,i,r,u;function $(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),h=D(a),i=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){d(b,s,g),n(s,h),n(s,i),r||(u=Se(s,"click",$),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&f(s),r=!1,u()}}}function De(o,l){let s,a,h,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){d(r,s,u),we(a,s,null),n(s,h),i=!0},p(r,u){l=r,(!i||u&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&f(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",h,i,r,u,$,b,g,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,A,w=[],ie=new Map,re,M,v=[],ce=new Map,P;C=new He({props:{js:` import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n,m as we,x,O as _e,P as Ee,k as Oe,Q as Te,n as Be,t as ee,a as te,o as f,d as ge,R as Ie,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-e5419a23.js";import{S as He}from"./SdkTabs-b7dd00a7.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){let l;return{c(){l=c("p"),l.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",m(l,"class","txt-hint txt-sm txt-right")},m(s,a){d(s,l,a)},d(s){s&&f(l)}}}function ye(o,l){let s,a=l[6].code+"",h,i,r,u;function $(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),h=D(a),i=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){d(b,s,g),n(s,h),n(s,i),r||(u=Se(s,"click",$),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&f(s),r=!1,u()}}}function De(o,l){let s,a,h,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){d(r,s,u),we(a,s,null),n(s,h),i=!0},p(r,u){l=r,(!i||u&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&f(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",h,i,r,u,$,b,g,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,A,w=[],ie=new Map,re,M,v=[],ce=new Map,P;C=new He({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}'); const pb = new PocketBase('${o[3]}');
@@ -1 +1 @@
import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as M,o as de,I as he,J as ge,K as pe,L as ye,C as q,M as me}from"./index-04665dfb.js";import{C as E,E as S,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as qe,f as Se,g as we,i as Le,r as Ie,j as Ee,k as Re,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Me,t as Y,S as De}from"./index-a6ccb683.js";function He(e){Z(e,"start");var i={},n=e.languageData||{},g=!1;for(var p in e)if(p!=n&&e.hasOwnProperty(p))for(var d=i[p]=[],o=e[p],s=0;s<o.length;s++){var l=o[s];d.push(new Ue(l,e)),(l.indent||l.dedent)&&(g=!0)}return{name:n.name,startState:function(){return{state:"start",pending:null,indent:g?[]:null}},copyState:function(a){var b={state:a.state,pending:a.pending,indent:a.indent&&a.indent.slice(0)};return a.stack&&(b.stack=a.stack.slice(0)),b},token:We(i),indent:Ne(i,n),languageData:n}}function Z(e,i){if(!e.hasOwnProperty(i))throw new Error("Undefined state "+i+" in simple mode")}function Fe(e,i){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((i===!1?"":"^")+"(?:"+e+")",n)}function Te(e){if(!e)return null;if(e.apply)return e;if(typeof e=="string")return e.replace(/\./g," ");for(var i=[],n=0;n<e.length;n++)i.push(e[n]&&e[n].replace(/\./g," "));return i}function Ue(e,i){(e.next||e.push)&&Z(i,e.next||e.push),this.regex=Fe(e.regex),this.token=Te(e.token),this.data=e}function We(e){return function(i,n){if(n.pending){var g=n.pending.shift();return n.pending.length==0&&(n.pending=null),i.pos+=g.text.length,g.token}for(var p=e[n.state],d=0;d<p.length;d++){var o=p[d],s=(!o.data.sol||i.sol())&&i.match(o.regex);if(s){o.data.next?n.state=o.data.next:o.data.push?((n.stack||(n.stack=[])).push(n.state),n.state=o.data.push):o.data.pop&&n.stack&&n.stack.length&&(n.state=n.stack.pop()),o.data.indent&&n.indent.push(i.indentation()+i.indentUnit),o.data.dedent&&n.indent.pop();var l=o.token;if(l&&l.apply&&(l=l(s)),s.length>2&&o.token&&typeof o.token!="string"){n.pending=[];for(var a=2;a<s.length;a++)s[a]&&n.pending.push({text:s[a],token:o.token[a-1]});return i.backUp(s[0].length-(s[1]?s[1].length:0)),l[0]}else return l&&l.join?l[0]:l}}return i.next(),null}}function Ne(e,i){return function(n,g){if(n.indent==null||i.dontIndentStates&&i.doneIndentState.indexOf(n.state)>-1)return null;var p=n.indent.length-1,d=e[n.state];e:for(;;){for(var o=0;o<d.length;o++){var s=d[o];if(s.data.dedent&&s.data.dedentIfLineStart!==!1){var l=s.regex.exec(g);if(l&&l[0]){p--,(s.next||s.push)&&(d=e[s.next||s.push]),g=g.slice(l[0].length);continue e}}}break}return p<0?0:n.indent[p]}}function Je(e){let i;return{c(){i=ue("div"),ce(i,"class","code-editor")},m(n,g){fe(n,i,g),e[15](i)},p:M,i:M,o:M,d(n){n&&de(i),e[15](null)}}}function Pe(e){return JSON.stringify([e==null?void 0:e.name,e==null?void 0:e.type,e==null?void 0:e.schema])}function Ve(e,i,n){let g;he(e,ge,t=>n(21,g=t));const p=pe();let{id:d=""}=i,{value:o=""}=i,{disabled:s=!1}=i,{placeholder:l=""}=i,{baseCollection:a=null}=i,{singleLine:b=!1}=i,{extraAutocompleteKeys:R=[]}=i,{disableRequestKeys:x=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,k,A=s,D=new E,H=new E,F=new E,T=new E,L=[],U=[],W=[],N=[],I="",B="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{L=$(g),N=ee(),U=x?[]:te(),W=K?[]:ne()},300)}function $(t){let r=t.slice();return a&&q.pushOrReplaceByKey(r,a,"id"),r}function J(){k==null||k.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function P(){if(!d)return;const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.removeEventListener("click",O)}function V(){if(!d)return;P();const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.addEventListener("click",O)}function C(t,r="",c=0){var m,z,Q;let h=L.find(y=>y.name==t||y.id==t);if(!h||c>=4)return[];let u=q.getAllCollectionIdentifiers(h,r);for(const y of h.schema){const v=r+y.name;if(y.type==="relation"&&((m=y.options)!=null&&m.collectionId)){const X=C(y.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}y.type==="select"&&((z=y.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=y.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(y.type)&&u.push(v+":length")}return u}function ee(){return C(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 r=L.filter(h=>h.isAuth);for(const h of r){const u=C(h.id,"@request.auth.");for(const m of u)q.pushUnique(t,m)}const c=["created","updated"];if(a!=null&&a.id){const h=C(a.name,"@request.data.");for(const u of h){t.push(u);const m=u.split(".");m.length===3&&m[2].indLine truncated import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as M,o as de,I as he,J as ge,K as pe,L as ye,C as q,M as me}from"./index-e5419a23.js";import{C as E,E as S,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as qe,f as Se,g as we,i as Le,r as Ie,j as Ee,k as Re,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Me,t as Y,S as De}from"./index-a6ccb683.js";function He(e){Z(e,"start");var i={},n=e.languageData||{},g=!1;for(var p in e)if(p!=n&&e.hasOwnProperty(p))for(var d=i[p]=[],o=e[p],s=0;s<o.length;s++){var l=o[s];d.push(new Ue(l,e)),(l.indent||l.dedent)&&(g=!0)}return{name:n.name,startState:function(){return{state:"start",pending:null,indent:g?[]:null}},copyState:function(a){var b={state:a.state,pending:a.pending,indent:a.indent&&a.indent.slice(0)};return a.stack&&(b.stack=a.stack.slice(0)),b},token:We(i),indent:Ne(i,n),languageData:n}}function Z(e,i){if(!e.hasOwnProperty(i))throw new Error("Undefined state "+i+" in simple mode")}function Fe(e,i){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((i===!1?"":"^")+"(?:"+e+")",n)}function Te(e){if(!e)return null;if(e.apply)return e;if(typeof e=="string")return e.replace(/\./g," ");for(var i=[],n=0;n<e.length;n++)i.push(e[n]&&e[n].replace(/\./g," "));return i}function Ue(e,i){(e.next||e.push)&&Z(i,e.next||e.push),this.regex=Fe(e.regex),this.token=Te(e.token),this.data=e}function We(e){return function(i,n){if(n.pending){var g=n.pending.shift();return n.pending.length==0&&(n.pending=null),i.pos+=g.text.length,g.token}for(var p=e[n.state],d=0;d<p.length;d++){var o=p[d],s=(!o.data.sol||i.sol())&&i.match(o.regex);if(s){o.data.next?n.state=o.data.next:o.data.push?((n.stack||(n.stack=[])).push(n.state),n.state=o.data.push):o.data.pop&&n.stack&&n.stack.length&&(n.state=n.stack.pop()),o.data.indent&&n.indent.push(i.indentation()+i.indentUnit),o.data.dedent&&n.indent.pop();var l=o.token;if(l&&l.apply&&(l=l(s)),s.length>2&&o.token&&typeof o.token!="string"){n.pending=[];for(var a=2;a<s.length;a++)s[a]&&n.pending.push({text:s[a],token:o.token[a-1]});return i.backUp(s[0].length-(s[1]?s[1].length:0)),l[0]}else return l&&l.join?l[0]:l}}return i.next(),null}}function Ne(e,i){return function(n,g){if(n.indent==null||i.dontIndentStates&&i.doneIndentState.indexOf(n.state)>-1)return null;var p=n.indent.length-1,d=e[n.state];e:for(;;){for(var o=0;o<d.length;o++){var s=d[o];if(s.data.dedent&&s.data.dedentIfLineStart!==!1){var l=s.regex.exec(g);if(l&&l[0]){p--,(s.next||s.push)&&(d=e[s.next||s.push]),g=g.slice(l[0].length);continue e}}}break}return p<0?0:n.indent[p]}}function Je(e){let i;return{c(){i=ue("div"),ce(i,"class","code-editor")},m(n,g){fe(n,i,g),e[15](i)},p:M,i:M,o:M,d(n){n&&de(i),e[15](null)}}}function Pe(e){return JSON.stringify([e==null?void 0:e.name,e==null?void 0:e.type,e==null?void 0:e.schema])}function Ve(e,i,n){let g;he(e,ge,t=>n(21,g=t));const p=pe();let{id:d=""}=i,{value:o=""}=i,{disabled:s=!1}=i,{placeholder:l=""}=i,{baseCollection:a=null}=i,{singleLine:b=!1}=i,{extraAutocompleteKeys:R=[]}=i,{disableRequestKeys:x=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,k,A=s,D=new E,H=new E,F=new E,T=new E,L=[],U=[],W=[],N=[],I="",B="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{L=$(g),N=ee(),U=x?[]:te(),W=K?[]:ne()},300)}function $(t){let r=t.slice();return a&&q.pushOrReplaceByKey(r,a,"id"),r}function J(){k==null||k.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function P(){if(!d)return;const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.removeEventListener("click",O)}function V(){if(!d)return;P();const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.addEventListener("click",O)}function C(t,r="",c=0){var m,z,Q;let h=L.find(y=>y.name==t||y.id==t);if(!h||c>=4)return[];let u=q.getAllCollectionIdentifiers(h,r);for(const y of h.schema){const v=r+y.name;if(y.type==="relation"&&((m=y.options)!=null&&m.collectionId)){const X=C(y.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}y.type==="select"&&((z=y.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=y.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(y.type)&&u.push(v+":length")}return u}function ee(){return C(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 r=L.filter(h=>h.isAuth);for(const h of r){const u=C(h.id,"@request.auth.");for(const m of u)q.pushUnique(t,m)}const c=["created","updated"];if(a!=null&&a.id){const h=C(a.name,"@request.data.");for(const u of h){t.push(u);const m=u.split(".");m.length===3&&m[2].indLine truncated
@@ -1,4 +1,4 @@
import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o as m,w as _,h as t,N as he,c as Yt,m as Zt,x as we,O as Le,P as Me,k as Be,Q as Ie,n as Ge,t as Bt,a as It,d as te,R as Ue,C as _e,p as je,r as xe}from"./index-04665dfb.js";import{S as Qe}from"./SdkTabs-aab7d363.js";function ze(d){let n,a,r;return{c(){n=e("span"),n.textContent="Show details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-down-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Je(d){let n,a,r;return{c(){n=e("span"),n.textContent="Hide details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-up-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Ae(d){let n,a,r,f,p,b,x,$,h,w,c,V,bt,Gt,R,Ut,q,it,F,W,ee,I,G,le,at,ht,X,xt,se,rt,ct,Y,O,jt,wt,y,Z,_t,Qt,$t,U,tt,Ct,zt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,j,pt,ie,H,Ft,lt,Lt,st,At,nt,Q,E,Jt,Tt,Kt,Pt,C,z,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,S,Nt,fe,T,k,pe,N,v,ot,ue,P,qt,me,Dt,be,Ht,Xt,Mt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o as m,w as _,h as t,N as he,c as Yt,m as Zt,x as we,O as Le,P as Me,k as Be,Q as Ie,n as Ge,t as Bt,a as It,d as te,R as Ue,C as _e,p as je,r as xe}from"./index-e5419a23.js";import{S as Qe}from"./SdkTabs-b7dd00a7.js";function ze(d){let n,a,r;return{c(){n=e("span"),n.textContent="Show details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-down-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Je(d){let n,a,r;return{c(){n=e("span"),n.textContent="Hide details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-up-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Ae(d){let n,a,r,f,p,b,x,$,h,w,c,V,bt,Gt,R,Ut,q,it,F,W,ee,I,G,le,at,ht,X,xt,se,rt,ct,Y,O,jt,wt,y,Z,_t,Qt,$t,U,tt,Ct,zt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,j,pt,ie,H,Ft,lt,Lt,st,At,nt,Q,E,Jt,Tt,Kt,Pt,C,z,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,S,Nt,fe,T,k,pe,N,v,ot,ue,P,qt,me,Dt,be,Ht,Xt,Mt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span> <code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span> <span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,a=s(),r=e("ul"),f=e("li"),f.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single <span class="txt-success">OPERAND</span></code>, where:`,a=s(),r=e("ul"),f=e("li"),f.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single
@@ -1,4 +1,4 @@
import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s,m as Ee,x as U,O as Pe,P as Le,k as Me,Q as Re,n as We,t as te,a as le,o as d,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,N as je}from"./index-04665dfb.js";import{S as Ne}from"./SdkTabs-aab7d363.js";function ye(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ae(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ce(a,l){let o,n=l[5].code+"",f,h,c,u;function m(){return l[4](l[5])}return{key:a,first:null,c(){o=i("button"),f=v(n),h=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(g,P){r(g,o,P),s(o,f),s(o,h),c||(u=Ue(o,"click",m),c=!0)},p(g,P){l=g,P&4&&n!==(n=l[5].code+"")&&U(f,n),P&6&&j(o,"active",l[1]===l[5].code)},d(g){g&&d(o),c=!1,u()}}}function Te(a,l){let o,n,f,h;return n=new je({props:{content:l[5].body}}),{key:a,first:null,c(){o=i("div"),Se(n.$$.fragment),f=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Ee(n,o,null),s(o,f),h=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),n.$set(m),(!h||u&6)&&j(o,"active",l[1]===l[5].code)},i(c){h||(te(n.$$.fragment,c),h=!0)},o(c){le(n.$$.fragment,c),h=!1},d(c){c&&d(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,u,m,g,P,M=a[0].name+"",N,oe,se,G,K,y,Q,S,F,w,R,ae,W,A,ne,J,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,$=[],de=new Map,ue,O,k=[],pe=new Map,T;y=new Ne({props:{js:` import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s,m as Ee,x as U,O as Pe,P as Le,k as Me,Q as Re,n as We,t as te,a as le,o as d,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,N as je}from"./index-e5419a23.js";import{S as Ne}from"./SdkTabs-b7dd00a7.js";function ye(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ae(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ce(a,l){let o,n=l[5].code+"",f,h,c,u;function m(){return l[4](l[5])}return{key:a,first:null,c(){o=i("button"),f=v(n),h=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(g,P){r(g,o,P),s(o,f),s(o,h),c||(u=Ue(o,"click",m),c=!0)},p(g,P){l=g,P&4&&n!==(n=l[5].code+"")&&U(f,n),P&6&&j(o,"active",l[1]===l[5].code)},d(g){g&&d(o),c=!1,u()}}}function Te(a,l){let o,n,f,h;return n=new je({props:{content:l[5].body}}),{key:a,first:null,c(){o=i("div"),Se(n.$$.fragment),f=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Ee(n,o,null),s(o,f),h=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),n.$set(m),(!h||u&6)&&j(o,"active",l[1]===l[5].code)},i(c){h||(te(n.$$.fragment,c),h=!0)},o(c){le(n.$$.fragment,c),h=!1},d(c){c&&d(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,u,m,g,P,M=a[0].name+"",N,oe,se,G,K,y,Q,S,F,w,R,ae,W,A,ne,J,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,$=[],de=new Map,ue,O,k=[],pe=new Map,T;y=new Ne({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}'); const pb = new PocketBase('${a[3]}');
@@ -1,2 +1,2 @@
import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,u as h,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 S}from"./index-04665dfb.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,P,v,k,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,u as h,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 S}from"./index-e5419a23.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,P,v,k,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
`),m&&m.c(),t=C(),A(r.$$.fragment),p=C(),A(d.$$.fragment),n=C(),i=c("button"),g=c("span"),g.textContent="Set new password",R=C(),P=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(P,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,P,$),_(P,v),k=!0,F||(j=[h(e,"submit",O(f[4])),Q(U.call(null,v))],F=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!k||$&4)&&(i.disabled=a[2]),(!k||$&4)&&L(i,"btn-loading",a[2])},i(a){k||(H(r.$$.fragment,a),H(d.$$.fragment,a),k=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),k=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(P),F=!1,V(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.errorResponseHandler(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; `),m&&m.c(),t=C(),A(r.$$.fragment),p=C(),A(d.$$.fragment),n=C(),i=c("button"),g=c("span"),g.textContent="Set new password",R=C(),P=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(P,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,P,$),_(P,v),k=!0,F||(j=[h(e,"submit",O(f[4])),Q(U.call(null,v))],F=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!k||$&4)&&(i.disabled=a[2]),(!k||$&4)&&L(i,"btn-loading",a[2])},i(a){k||(H(r.$$.fragment,a),H(d.$$.fragment,a),k=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),k=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(P),F=!1,V(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.errorResponseHandler(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default};
@@ -1,2 +1,2 @@
import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index-04665dfb.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4> import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index-e5419a23.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4>
<p>Enter the email associated with your account and we’ll send you a recovery link:</p>`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=E(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),(!a||$&2)&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='<i class="ri-checkbox-circle-line"></i>',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=E(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),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(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){H(e.$$.fragment)},m(n,l){L(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){S(e,n)}}}function W(c,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.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; <p>Enter the email associated with your account and we’ll send you a recovery link:</p>`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=E(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),(!a||$&2)&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='<i class="ri-checkbox-circle-line"></i>',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=E(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),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(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){H(e.$$.fragment)},m(n,l){L(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){S(e,n)}}}function W(c,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.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default};
@@ -1,4 +1,4 @@
import{S as z,i as G,s as I,F as J,c as S,m as L,t as v,a as y,d as R,C as M,E as N,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 C,b as h,f as d,r as H,h as k,u as P,v as K,y as E,x as O,z as T}from"./index-04665dfb.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&F(r);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),l=m("h5"),s=C(`Type your password to confirm changing your email address import{S as z,i as G,s as I,F as J,c as S,m as L,t as v,a as y,d as R,C as M,E as N,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 C,b as h,f as d,r as H,h as k,u as P,v as K,y as E,x as O,z as T}from"./index-e5419a23.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&F(r);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),l=m("h5"),s=C(`Type your password to confirm changing your email address
`),p&&p.c(),n=h(),S(o.$$.fragment),c=h(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","content txt-center m-b-base"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,t),k(t,l),k(l,s),p&&p.m(l,null),k(e,n),L(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||($=P(e,"submit",K(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=F(f),p.c(),p.m(l,null)):p&&(p.d(1),p=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:f}),o.$set(q),(!u||w&2)&&(a.disabled=f[1]),(!u||w&2)&&H(a,"btn-loading",f[1])},i(f){u||(v(o.$$.fragment,f),u=!0)},o(f){y(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),R(o),g=!1,$()}}}function U(r){let e,t,l,s,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div> `),p&&p.c(),n=h(),S(o.$$.fragment),c=h(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","content txt-center m-b-base"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,t),k(t,l),k(l,s),p&&p.m(l,null),k(e,n),L(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||($=P(e,"submit",K(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=F(f),p.c(),p.m(l,null)):p&&(p.d(1),p=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:f}),o.$set(q),(!u||w&2)&&(a.disabled=f[1]),(!u||w&2)&&H(a,"btn-loading",f[1])},i(f){u||(v(o.$$.fragment,f),u=!0)},o(f){y(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),R(o),g=!1,$()}}}function U(r){let e,t,l,s,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully changed the user email address.</p> <div class="content txt-bold"><p>Successfully changed the user email address.</p>
<p>You can now sign in with your new email address.</p></div>`,t=h(),l=m("button"),l.textContent="Close",d(e,"class","alert alert-success"),d(l,"type","button"),d(l,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,t,c),_(o,l,c),s||(n=P(l,"click",r[6]),s=!0)},p:E,i:E,o:E,d(o){o&&b(e),o&&b(t),o&&b(l),s=!1,n()}}}function F(r){let e,t,l;return{c(){e=C("to "),t=m("strong"),l=C(r[3]),d(t,"class","txt-nowrap")},m(s,n){_(s,e,n),_(s,t,n),k(t,l)},p(s,n){n&8&&O(l,s[3])},d(s){s&&b(e),s&&b(t)}}}function V(r){let e,t,l,s,n,o,c,a;return{c(){e=m("label"),t=C("Password"),s=h(),n=m("input"),d(e,"for",l=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,t),_(i,s,u),_(i,n,u),T(n,r[0]),n.focus(),c||(a=P(n,"input",r[7]),c=!0)},p(i,u){u&256&&l!==(l=i[8])&&d(e,"for",l),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&T(n,i[0])},d(i){i&&b(e),i&&b(s),i&&b(n),c=!1,a()}}}function X(r){let e,t,l,s;const n=[U,Q],o=[];function c(a,i){return a[2]?0:1}return e=c(r),t=o[e]=n[e](r),{c(){t.c(),l=N()},m(a,i){o[e].m(a,i),_(a,l,i),s=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(W(),y(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,i):(t=o[e]=n[e](a),t.c()),v(t,1),t.m(l.parentNode,l))},i(a){s||(v(t),s=!0)},o(a){y(t),s=!1},d(a){o[e].d(a),a&&b(l)}}}function Z(r){let e,t;return e=new J({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(l,s){L(e,l,s),t=!0},p(l,[s]){const n={};s&527&&(n.$$scope={dirty:s,ctx:l}),e.$set(n)},i(l){t||(v(e.$$.fragment,l),t=!0)},o(l){y(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function x(r,e,t){let l,{params:s}=e,n="",o=!1,c=!1;async function a(){if(o)return;t(1,o=!0);const g=new j("../");try{const $=A(s==null?void 0:s.token);await g.collection($.collectionId).confirmEmailChange(s==null?void 0:s.token,n),t(2,c=!0)}catch($){B.errorResponseHandler($)}t(1,o=!1)}const i=()=>window.close();function u(){n=this.value,t(0,n)}return r.$$set=g=>{"params"in g&&t(5,s=g.params)},r.$$.update=()=>{r.$$.dirty&32&&t(3,l=M.getJWTPayload(s==null?void 0:s.token).newEmail||"")},[n,o,c,l,a,s,i,u]}class te extends z{constructor(e){super(),G(this,e,x,Z,I,{params:5})}}export{te as default}; <p>You can now sign in with your new email address.</p></div>`,t=h(),l=m("button"),l.textContent="Close",d(e,"class","alert alert-success"),d(l,"type","button"),d(l,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,t,c),_(o,l,c),s||(n=P(l,"click",r[6]),s=!0)},p:E,i:E,o:E,d(o){o&&b(e),o&&b(t),o&&b(l),s=!1,n()}}}function F(r){let e,t,l;return{c(){e=C("to "),t=m("strong"),l=C(r[3]),d(t,"class","txt-nowrap")},m(s,n){_(s,e,n),_(s,t,n),k(t,l)},p(s,n){n&8&&O(l,s[3])},d(s){s&&b(e),s&&b(t)}}}function V(r){let e,t,l,s,n,o,c,a;return{c(){e=m("label"),t=C("Password"),s=h(),n=m("input"),d(e,"for",l=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,t),_(i,s,u),_(i,n,u),T(n,r[0]),n.focus(),c||(a=P(n,"input",r[7]),c=!0)},p(i,u){u&256&&l!==(l=i[8])&&d(e,"for",l),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&T(n,i[0])},d(i){i&&b(e),i&&b(s),i&&b(n),c=!1,a()}}}function X(r){let e,t,l,s;const n=[U,Q],o=[];function c(a,i){return a[2]?0:1}return e=c(r),t=o[e]=n[e](r),{c(){t.c(),l=N()},m(a,i){o[e].m(a,i),_(a,l,i),s=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(W(),y(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,i):(t=o[e]=n[e](a),t.c()),v(t,1),t.m(l.parentNode,l))},i(a){s||(v(t),s=!0)},o(a){y(t),s=!1},d(a){o[e].d(a),a&&b(l)}}}function Z(r){let e,t;return e=new J({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(l,s){L(e,l,s),t=!0},p(l,[s]){const n={};s&527&&(n.$$scope={dirty:s,ctx:l}),e.$set(n)},i(l){t||(v(e.$$.fragment,l),t=!0)},o(l){y(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function x(r,e,t){let l,{params:s}=e,n="",o=!1,c=!1;async function a(){if(o)return;t(1,o=!0);const g=new j("../");try{const $=A(s==null?void 0:s.token);await g.collection($.collectionId).confirmEmailChange(s==null?void 0:s.token,n),t(2,c=!0)}catch($){B.errorResponseHandler($)}t(1,o=!1)}const i=()=>window.close();function u(){n=this.value,t(0,n)}return r.$$set=g=>{"params"in g&&t(5,s=g.params)},r.$$.update=()=>{r.$$.dirty&32&&t(3,l=M.getJWTPayload(s==null?void 0:s.token).newEmail||"")},[n,o,c,l,a,s,i,u]}class te extends z{constructor(e){super(),G(this,e,x,Z,I,{params:5})}}export{te as default};
@@ -1,4 +1,4 @@
import{S as J,i as M,s as W,F as Y,c as F,m as N,t as y,a as q,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 R,b as P,f as p,r as G,h as w,u as H,v as U,y as S,x as V,z as h}from"./index-04665dfb.js";function X(r){let e,l,s,n,t,o,c,a,i,u,v,k,g,C,d=r[4]&&I(r);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:r}}}),a=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=R(`Reset your user password import{S as J,i as M,s as W,F as Y,c as F,m as N,t as y,a as q,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 R,b as P,f as p,r as G,h as w,u as H,v as U,y as S,x as V,z as h}from"./index-e5419a23.js";function X(r){let e,l,s,n,t,o,c,a,i,u,v,k,g,C,d=r[4]&&I(r);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:r}}}),a=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=R(`Reset your user password
`),d&&d.c(),t=P(),F(o.$$.fragment),c=P(),F(a.$$.fragment),i=P(),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=r[2],G(u,"btn-loading",r[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(a,e,null),w(e,i),w(e,u),w(u,v),k=!0,g||(C=H(e,"submit",U(r[5])),g=!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}),a.$set(z),(!k||$&4)&&(u.disabled=f[2]),(!k||$&4)&&G(u,"btn-loading",f[2])},i(f){k||(y(o.$$.fragment,f),y(a.$$.fragment,f),k=!0)},o(f){q(o.$$.fragment,f),q(a.$$.fragment,f),k=!1},d(f){f&&m(e),d&&d.d(),T(o),T(a),g=!1,C()}}}function Z(r){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div> `),d&&d.c(),t=P(),F(o.$$.fragment),c=P(),F(a.$$.fragment),i=P(),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=r[2],G(u,"btn-loading",r[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(a,e,null),w(e,i),w(e,u),w(u,v),k=!0,g||(C=H(e,"submit",U(r[5])),g=!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}),a.$set(z),(!k||$&4)&&(u.disabled=f[2]),(!k||$&4)&&G(u,"btn-loading",f[2])},i(f){k||(y(o.$$.fragment,f),y(a.$$.fragment,f),k=!0)},o(f){q(o.$$.fragment,f),q(a.$$.fragment,f),k=!1},d(f){f&&m(e),d&&d.d(),T(o),T(a),g=!1,C()}}}function Z(r){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully changed the user password.</p> <div class="content txt-bold"><p>Successfully changed the user password.</p>
<p>You can now sign in with your new password.</p></div>`,l=P(),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=H(s,"click",r[7]),n=!0)},p:S,i:S,o:S,d(o){o&&m(e),o&&m(l),o&&m(s),n=!1,t()}}}function I(r){let e,l,s;return{c(){e=R("for "),l=b("strong"),s=R(r[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),n&&m(l)}}}function x(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("New password"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[0]),t.focus(),c||(a=H(t,"input",r[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]&&h(t,i[0])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function ee(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("New password confirm"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[1]),c||(a=H(t,"input",r[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]&&h(t,i[1])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function te(r){let e,l,s,n;const t=[Z,X],o=[];function c(a,i){return a[3]?0:1}return e=c(r),l=o[e]=t[e](r),{c(){l.c(),s=A()},m(a,i){o[e].m(a,i),_(a,s,i),n=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(B(),q(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(a,i):(l=o[e]=t[e](a),l.c()),y(l,1),l.m(s.parentNode,s))},i(a){n||(y(l),n=!0)},o(a){q(l),n=!1},d(a){o[e].d(a),a&&m(s)}}}function se(r){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){F(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||(y(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(r,e,l){let s,{params:n}=e,t="",o="",c=!1,a=!1;async function i(){if(c)return;l(2,c=!0);const g=new K("../");try{const C=O(n==null?void 0:n.token);await g.collection(C.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,a=!0)}catch(C){Q.errorResponseHandler(C)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function k(){o=this.value,l(1,o)}return r.$$set=g=>{"params"in g&&l(6,n=g.params)},r.$$.update=()=>{r.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,a,s,i,n,u,v,k]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default}; <p>You can now sign in with your new password.</p></div>`,l=P(),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=H(s,"click",r[7]),n=!0)},p:S,i:S,o:S,d(o){o&&m(e),o&&m(l),o&&m(s),n=!1,t()}}}function I(r){let e,l,s;return{c(){e=R("for "),l=b("strong"),s=R(r[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),n&&m(l)}}}function x(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("New password"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[0]),t.focus(),c||(a=H(t,"input",r[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]&&h(t,i[0])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function ee(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("New password confirm"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[1]),c||(a=H(t,"input",r[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]&&h(t,i[1])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function te(r){let e,l,s,n;const t=[Z,X],o=[];function c(a,i){return a[3]?0:1}return e=c(r),l=o[e]=t[e](r),{c(){l.c(),s=A()},m(a,i){o[e].m(a,i),_(a,s,i),n=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(B(),q(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(a,i):(l=o[e]=t[e](a),l.c()),y(l,1),l.m(s.parentNode,s))},i(a){n||(y(l),n=!0)},o(a){q(l),n=!1},d(a){o[e].d(a),a&&m(s)}}}function se(r){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){F(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||(y(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(r,e,l){let s,{params:n}=e,t="",o="",c=!1,a=!1;async function i(){if(c)return;l(2,c=!0);const g=new K("../");try{const C=O(n==null?void 0:n.token);await g.collection(C.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,a=!0)}catch(C){Q.errorResponseHandler(C)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function k(){o=this.value,l(1,o)}return r.$$set=g=>{"params"in g&&l(6,n=g.params)},r.$$.update=()=>{r.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,a,s,i,n,u,v,k]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default};
@@ -1,3 +1,3 @@
import{S as v,i as y,s as w,F as C,c as g,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-04665dfb.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div> import{S as v,i as y,s as w,F as C,c as g,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-e5419a23.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
<div class="content txt-bold"><p>Invalid or expired verification token.</p></div>`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[4]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function F(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div> <div class="content txt-bold"><p>Invalid or expired verification token.</p></div>`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[4]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function F(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully verified email address.</p></div>`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[3]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function I(o){let t;return{c(){t=u("div"),t.innerHTML='<div class="loader loader-lg"><em>Please wait...</em></div>',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function V(o){let t;function s(l,i){return l[1]?I:l[0]?F:S}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),r(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){n.d(l),l&&a(t)}}}function q(o){let t,s;return t=new C({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:o}}}),{c(){g(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 E(o,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const d=new P("../");try{const m=T(e==null?void 0:e.token);await d.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const c=()=>window.close(),k=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,l,e,c,k]}class N extends v{constructor(t){super(),y(this,t,E,q,w,{params:2})}}export{N as default}; <div class="content txt-bold"><p>Successfully verified email address.</p></div>`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[3]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function I(o){let t;return{c(){t=u("div"),t.innerHTML='<div class="loader loader-lg"><em>Please wait...</em></div>',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function V(o){let t;function s(l,i){return l[1]?I:l[0]?F:S}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),r(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){n.d(l),l&&a(t)}}}function q(o){let t,s;return t=new C({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:o}}}),{c(){g(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 E(o,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const d=new P("../");try{const m=T(e==null?void 0:e.token);await d.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const c=()=>window.close(),k=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,l,e,c,k]}class N extends v{constructor(t){super(),y(this,t,E,q,w,{params:2})}}export{N as default};
@@ -1,4 +1,4 @@
import{S as re,i as ae,s as be,N as ue,C as P,e as u,w as y,b as a,c as te,f as p,g as t,h as I,m as ne,x as pe,t as ie,a as le,o as n,d as ce,R as me,p as de}from"./index-04665dfb.js";import{S as fe}from"./SdkTabs-aab7d363.js";function $e(o){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,l=o[0].name+"",b,d,h,f,_,$,k,c,S,v,w,R,C,g,E,r,D;return c=new fe({props:{js:` import{S as re,i as ae,s as be,N as ue,C as P,e as u,w as y,b as a,c as te,f as p,g as t,h as I,m as ne,x as pe,t as ie,a as le,o as n,d as ce,R as me,p as de}from"./index-e5419a23.js";import{S as fe}from"./SdkTabs-b7dd00a7.js";function $e(o){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,l=o[0].name+"",b,d,h,f,_,$,k,c,S,v,w,R,C,g,E,r,D;return c=new fe({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[1]}'); const pb = new PocketBase('${o[1]}');
@@ -1,4 +1,4 @@
import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as Ce,x as L,O as ve,P as Se,k as Re,Q as Me,n as Ae,t as x,a as ee,o as m,d as ye,R as We,C as ze,p as He,r as N,u as Oe,N as Ue}from"./index-04665dfb.js";import{S as je}from"./SdkTabs-aab7d363.js";function we(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 $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),b=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){r($,s,q),n(s,_),n(s,b),i||(p=Oe(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&L(_,a),q&6&&N(s,"active",l[1]===l[5].code)},d($){$&&m(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Pe(a.$$.fragment),_=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){r(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&N(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&m(s),ye(a)}}}function De(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,w,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,R,Z,C,M,g=[],ne=new Map,ie,A,k=[],ce=new Map,y;P=new je({props:{js:` import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as Ce,x as L,O as ve,P as Se,k as Re,Q as Me,n as Ae,t as x,a as ee,o as m,d as ye,R as We,C as ze,p as He,r as N,u as Oe,N as Ue}from"./index-e5419a23.js";import{S as je}from"./SdkTabs-b7dd00a7.js";function we(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 $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),b=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){r($,s,q),n(s,_),n(s,b),i||(p=Oe(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&L(_,a),q&6&&N(s,"active",l[1]===l[5].code)},d($){$&&m(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Pe(a.$$.fragment),_=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){r(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&N(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&m(s),ye(a)}}}function De(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,w,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,R,Z,C,M,g=[],ne=new Map,ie,A,k=[],ce=new Map,y;P=new je({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}'); const pb = new PocketBase('${o[3]}');
@@ -1,4 +1,4 @@
import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as I,O as me,P as Re,k as ge,Q as ye,n as Be,t as Z,a as x,o as d,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,N as Ae}from"./index-04665dfb.js";import{S as Ue}from"./SdkTabs-aab7d363.js";function ue(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:a,first:null,c(){l=c("button"),_=w(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){r(P,l,$),n(l,_),n(l,u),i||(p=Me(l,"click",m),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&I(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&d(l),i=!1,p()}}}function ke(a,s){let l,o,_,u;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=c("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(o,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),o.$set(m),(!u||p&6)&&L(l,"active",s[1]===s[5].code)},i(i){u||(Z(o.$$.fragment,i),u=!0)},o(i){x(o.$$.fragment,i),u=!1},d(i){i&&d(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,u,i,p,m,P,$,D=a[0].name+"",N,ee,Q,q,z,B,G,R,H,te,O,C,se,J,E=a[0].name+"",K,le,V,S,W,T,X,M,Y,g,A,h=[],oe=new Map,ae,U,k=[],ne=new Map,y;q=new Ue({props:{js:` import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as I,O as me,P as Re,k as ge,Q as ye,n as Be,t as Z,a as x,o as d,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,N as Ae}from"./index-e5419a23.js";import{S as Ue}from"./SdkTabs-b7dd00a7.js";function ue(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:a,first:null,c(){l=c("button"),_=w(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){r(P,l,$),n(l,_),n(l,u),i||(p=Me(l,"click",m),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&I(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&d(l),i=!1,p()}}}function ke(a,s){let l,o,_,u;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=c("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(o,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),o.$set(m),(!u||p&6)&&L(l,"active",s[1]===s[5].code)},i(i){u||(Z(o.$$.fragment,i),u=!0)},o(i){x(o.$$.fragment,i),u=!1},d(i){i&&d(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,u,i,p,m,P,$,D=a[0].name+"",N,ee,Q,q,z,B,G,R,H,te,O,C,se,J,E=a[0].name+"",K,le,V,S,W,T,X,M,Y,g,A,h=[],oe=new Map,ae,U,k=[],ne=new Map,y;q=new Ue({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}'); const pb = new PocketBase('${a[3]}');
@@ -1,4 +1,4 @@
import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i,m as he,x as F,O as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as f,d as $e,R as Se,C as Te,p as Re,r as I,u as Ve,N as Me}from"./index-04665dfb.js";import{S as Ae}from"./SdkTabs-aab7d363.js";function pe(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,p,n,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=c("button"),_=h(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){r(q,s,w),i(s,_),i(s,p),n||(u=Ve(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&F(_,o),w&6&&I(s,"active",l[1]===l[5].code)},d(q){q&&f(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Me({props:{content:l[5].body}}),{key:a,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){r(n,s,u),he(o,s,null),i(s,_),p=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!p||u&6)&&I(s,"active",l[1]===l[5].code)},i(n){p||(Z(o.$$.fragment,n),p=!0)},o(n){x(o.$$.fragment,n),p=!1},d(n){n&&f(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,u,d,q,w,j=a[0].name+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,O=a[0].name+"",J,se,K,T,W,R,X,V,Y,y,M,$=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Ae({props:{js:` import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i,m as he,x as F,O as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as f,d as $e,R as Se,C as Te,p as Re,r as I,u as Ve,N as Me}from"./index-e5419a23.js";import{S as Ae}from"./SdkTabs-b7dd00a7.js";function pe(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,p,n,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=c("button"),_=h(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){r(q,s,w),i(s,_),i(s,p),n||(u=Ve(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&F(_,o),w&6&&I(s,"active",l[1]===l[5].code)},d(q){q&&f(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Me({props:{content:l[5].body}}),{key:a,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){r(n,s,u),he(o,s,null),i(s,_),p=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!p||u&6)&&I(s,"active",l[1]===l[5].code)},i(n){p||(Z(o.$$.fragment,n),p=!0)},o(n){x(o.$$.fragment,n),p=!1},d(n){n&&f(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,u,d,q,w,j=a[0].name+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,O=a[0].name+"",J,se,K,T,W,R,X,V,Y,y,M,$=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Ae({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}'); const pb = new PocketBase('${a[3]}');
@@ -1 +1 @@
import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,O as C,P as J,k as O,Q,n as Y,t as N,a as P,o as w,w as E,r as S,u as z,x as R,N as A,c as G,m as H,d as L}from"./index-04665dfb.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(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=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(u,_){y(u,l,_),m(l,s),m(s,r),m(l,i),n||(k=z(l,"click",c),n=!0)},p(u,_){e=u,_&4&&g!==(g=e[6].title+"")&&R(r,g),_&6&&S(l,"active",e[1]===e[6].language)},d(u){u&&w(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,u,_,p,f;return s=new A({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),G(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),u=E(" SDK"),p=j(),h(n,"href",_=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"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),H(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,u),m(l,p),f=!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),(!f||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!f||t&4&&_!==(_=e[6].url))&&h(n,"href",_),(!f||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){f||(N(s.$$.fragment,b),f=!0)},o(b){P(s.$$.fragment,b),f=!1},d(b){b&&w(l),L(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,u,_=o[2];const p=t=>t[6].language;for(let t=0;t<_.length;t+=1){let a=K(o,_,t),d=p(a);g.set(d,s[t]=T(d,a))}let f=o[2];const b=t=>t[6].language;for(let t=0;t<f.length;t+=1){let a=D(o,f,t),d=b(a);k.set(d,n[t]=I(d,a))}return{c(){e=v("div"),l=v("div");for(let t=0;t<s.length;t+=1)s[t].c();r=j(),i=v("div");for(let t=0;t<n.length;t+=1)n[t].c();h(l,"class","tabs-header compact left"),h(i,"class","tabs-content"),h(e,"class",c="tabs sdk-tabs "+o[0]+" svelte-1maocj6")},m(t,a){y(t,e,a),m(e,l);for(let d=0;d<s.length;d+=1)s[d].m(l,null);m(e,r),m(e,i);for(let d=0;d<n.length;d+=1)n[d].m(i,null);u=!0},p(t,[a]){a&6&&(_=t[2],s=C(s,a,p,1,t,_,g,l,J,T,null,K)),a&6&&(f=t[2],O(),n=C(n,a,b,1,t,f,k,i,Q,I,null,D),Y()),(!u||a&1&&c!==(c="tabs sdk-tabs "+t[0]+" svelte-1maocj6"))&&h(e,"class",c)},i(t){if(!u){for(let a=0;a<f.length;a+=1)N(n[a]);u=!0}},o(t){for(let a=0;a<n.length;a+=1)P(n[a]);u=!1},d(t){t&&w(e);for(let a=0;a<s.length;a+=1)s[a].d();for(let a=0;a<n.length;a+=1)n[a].d()}}}const M="pb_sdk_preference";function V(o,e,l){let s,{class:g="m-b-base"}=e,{js:r=""}=e,{dart:i=""}=e,n=localStorage.getItem(M)||"javascript";const k=c=>l(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 X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S}; import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,O as C,P as J,k as O,Q,n as Y,t as N,a as P,o as w,w as E,r as S,u as z,x as R,N as A,c as G,m as H,d as L}from"./index-e5419a23.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(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=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(u,_){y(u,l,_),m(l,s),m(s,r),m(l,i),n||(k=z(l,"click",c),n=!0)},p(u,_){e=u,_&4&&g!==(g=e[6].title+"")&&R(r,g),_&6&&S(l,"active",e[1]===e[6].language)},d(u){u&&w(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,u,_,p,f;return s=new A({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),G(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),u=E(" SDK"),p=j(),h(n,"href",_=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"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),H(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,u),m(l,p),f=!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),(!f||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!f||t&4&&_!==(_=e[6].url))&&h(n,"href",_),(!f||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){f||(N(s.$$.fragment,b),f=!0)},o(b){P(s.$$.fragment,b),f=!1},d(b){b&&w(l),L(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,u,_=o[2];const p=t=>t[6].language;for(let t=0;t<_.length;t+=1){let a=K(o,_,t),d=p(a);g.set(d,s[t]=T(d,a))}let f=o[2];const b=t=>t[6].language;for(let t=0;t<f.length;t+=1){let a=D(o,f,t),d=b(a);k.set(d,n[t]=I(d,a))}return{c(){e=v("div"),l=v("div");for(let t=0;t<s.length;t+=1)s[t].c();r=j(),i=v("div");for(let t=0;t<n.length;t+=1)n[t].c();h(l,"class","tabs-header compact left"),h(i,"class","tabs-content"),h(e,"class",c="tabs sdk-tabs "+o[0]+" svelte-1maocj6")},m(t,a){y(t,e,a),m(e,l);for(let d=0;d<s.length;d+=1)s[d].m(l,null);m(e,r),m(e,i);for(let d=0;d<n.length;d+=1)n[d].m(i,null);u=!0},p(t,[a]){a&6&&(_=t[2],s=C(s,a,p,1,t,_,g,l,J,T,null,K)),a&6&&(f=t[2],O(),n=C(n,a,b,1,t,f,k,i,Q,I,null,D),Y()),(!u||a&1&&c!==(c="tabs sdk-tabs "+t[0]+" svelte-1maocj6"))&&h(e,"class",c)},i(t){if(!u){for(let a=0;a<f.length;a+=1)N(n[a]);u=!0}},o(t){for(let a=0;a<n.length;a+=1)P(n[a]);u=!1},d(t){t&&w(e);for(let a=0;a<s.length;a+=1)s[a].d();for(let a=0;a<n.length;a+=1)n[a].d()}}}const M="pb_sdk_preference";function V(o,e,l){let s,{class:g="m-b-base"}=e,{js:r=""}=e,{dart:i=""}=e,n=localStorage.getItem(M)||"javascript";const k=c=>l(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 X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S};
@@ -1,4 +1,4 @@
import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as Be,x as j,O as ye,P as Me,k as We,Q as ze,n as He,t as le,a as oe,o as d,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,N as Ne}from"./index-04665dfb.js";import{S as Ke}from"./SdkTabs-aab7d363.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,u;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m($,P){r($,o,P),s(o,_),s(o,b),c||(u=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&j(_,a),P&6&&I(o,"active",l[1]===l[5].code)},d($){$&&d(o),c=!1,u()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Be(a,o,null),s(o,_),b=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!b||u&6)&&I(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&d(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,u,m,$,P,M=n[0].name+"",N,se,ae,K,Q,A,F,E,G,g,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,w=[],ue=new Map,pe,O,k=[],me=new Map,T;A=new Ke({props:{js:` import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as Be,x as j,O as ye,P as Me,k as We,Q as ze,n as He,t as le,a as oe,o as d,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,N as Ne}from"./index-e5419a23.js";import{S as Ke}from"./SdkTabs-b7dd00a7.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,u;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m($,P){r($,o,P),s(o,_),s(o,b),c||(u=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&j(_,a),P&6&&I(o,"active",l[1]===l[5].code)},d($){$&&d(o),c=!1,u()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Be(a,o,null),s(o,_),b=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!b||u&6)&&I(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&d(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,u,m,$,P,M=n[0].name+"",N,se,ae,K,Q,A,F,E,G,g,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,w=[],ue=new Map,pe,O,k=[],me=new Map,T;A=new Ke({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${n[3]}'); const pb = new PocketBase('${n[3]}');
@@ -1,4 +1,4 @@
import{S as Ct,i as St,s as Ot,C as U,N as Tt,e as r,w as y,b as m,c as Ae,f as T,g as a,h as i,m as Be,x as I,O as Pe,P as ut,k as Mt,Q as $t,n as Rt,t as pe,a as fe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-04665dfb.js";import{S as Lt}from"./SdkTabs-aab7d363.js";function bt(p,t,l){const s=p.slice();return s[7]=t[l],s}function mt(p,t,l){const s=p.slice();return s[7]=t[l],s}function _t(p,t,l){const s=p.slice();return s[12]=t[l],s}function yt(p){let t;return{c(){t=r("p"),t.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",T(t,"class","txt-hint txt-sm txt-right")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function kt(p){let t,l,s,b,u,d,f,k,C,v,O,D,A,F,M,N,B;return{c(){t=r("tr"),t.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=r("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span> import{S as Ct,i as St,s as Ot,C as U,N as Tt,e as r,w as y,b as m,c as Ae,f as T,g as a,h as i,m as Be,x as I,O as Pe,P as ut,k as Mt,Q as $t,n as Rt,t as pe,a as fe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-e5419a23.js";import{S as Lt}from"./SdkTabs-b7dd00a7.js";function bt(p,t,l){const s=p.slice();return s[7]=t[l],s}function mt(p,t,l){const s=p.slice();return s[7]=t[l],s}function _t(p,t,l){const s=p.slice();return s[12]=t[l],s}function yt(p){let t;return{c(){t=r("p"),t.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",T(t,"class","txt-hint txt-sm txt-right")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function kt(p){let t,l,s,b,u,d,f,k,C,v,O,D,A,F,M,N,B;return{c(){t=r("tr"),t.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=r("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>username</span></div></td> <span>username</span></div></td>
<td><span class="label">String</span></td> <td><span class="label">String</span></td>
<td>The username of the auth record.</td>`,b=m(),u=r("tr"),u.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span> <td>The username of the auth record.</td>`,b=m(),u=r("tr"),u.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
@@ -1,4 +1,4 @@
import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as r,h as l,m as ke,x as me,O as Ve,P as lt,k as st,Q as nt,n as ot,t as z,a as G,o as d,d as he,R as it,C as ze,p as at,r as J,u as rt}from"./index-04665dfb.js";import{S as dt}from"./SdkTabs-aab7d363.js";function Ge(i,s,n){const a=i.slice();return a[6]=s[n],a}function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function We(i,s){let n,a=s[6].code+"",w,c,p,u;function C(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=m(a),c=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,w),l(n,c),p||(u=rt(n,"click",C),p=!0)},p(h,F){s=h,F&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),p=!1,u()}}}function Xe(i,s){let n,a,w,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),w=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(p,u){r(p,n,u),ke(a,n,null),l(n,w),c=!0},p(p,u){s=p,(!c||u&20)&&J(n,"active",s[2]===s[6].code)},i(p){c||(z(a.$$.fragment,p),c=!0)},o(p){G(a.$$.fragment,p),c=!1},d(p){p&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",w,c,p,u,C,h,F,N=i[0].name+"",K,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,Q=i[0].name+"",ee,$e,te,Ce,le,x,se,A,ne,I,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,pe,Se,Be,xe,fe,Ae,ue,M,be,P,H,R=[],Ie=new Map,Me,q,y=[],He=new Map,T;g=new dt({props:{js:` import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as r,h as l,m as ke,x as me,O as Ve,P as lt,k as st,Q as nt,n as ot,t as z,a as G,o as d,d as he,R as it,C as ze,p as at,r as J,u as rt}from"./index-e5419a23.js";import{S as dt}from"./SdkTabs-b7dd00a7.js";function Ge(i,s,n){const a=i.slice();return a[6]=s[n],a}function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function We(i,s){let n,a=s[6].code+"",w,c,p,u;function C(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=m(a),c=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,w),l(n,c),p||(u=rt(n,"click",C),p=!0)},p(h,F){s=h,F&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),p=!1,u()}}}function Xe(i,s){let n,a,w,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),w=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(p,u){r(p,n,u),ke(a,n,null),l(n,w),c=!0},p(p,u){s=p,(!c||u&20)&&J(n,"active",s[2]===s[6].code)},i(p){c||(z(a.$$.fragment,p),c=!0)},o(p){G(a.$$.fragment,p),c=!1},d(p){p&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",w,c,p,u,C,h,F,N=i[0].name+"",K,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,Q=i[0].name+"",ee,$e,te,Ce,le,x,se,A,ne,I,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,pe,Se,Be,xe,fe,Ae,ue,M,be,P,H,R=[],Ie=new Map,Me,q,y=[],He=new Map,T;g=new dt({props:{js:`
import PocketBase from 'pocketbase'; import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}'); const pb = new PocketBase('${i[3]}');
-202
View File
@@ -1,202 +0,0 @@
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function X(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function J1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function ug(n){return n()}function ou(){return Object.create(null)}function Pe(n){n.forEach(ug)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function Hn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Z1(n){return Object.keys(n).length===0}function fg(n,...e){if(n==null)return X;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(fg(e,t))}function Nt(n,e,t,i){if(n){const s=cg(n,e,t,i);return n[0](s)}}function cg(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Rt(n,e,t,i,s,l){if(s){const o=cg(e,t,i,l);n.p(o,s)}}function qt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Qn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function At(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Si(n){return n??""}function Kt(n,e,t){return n.set(t),e}function Ie(n){return n&&Bt(n.destroy)?n.destroy:X}const dg=typeof window<"u";let No=dg?()=>window.performance.now():()=>Date.now(),ca=dg?n=>requestAnimationFrame(n):X;const bs=new Set;function pg(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&ca(pg)}function Fo(n){let e;return bs.size===0&&ca(pg),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function _(n,e){n.appendChild(e)}function mg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function G1(n){const e=b("style");return X1(mg(n),e),e.sheet}function X1(n,e){return _(n.head||n,e),e.sheet}function T(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function B(n){return document.createTextNode(n)}function D(){return B(" ")}function $e(){return B("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function dt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function m(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xn(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?n[i]=e[i]:m(n,i,e[i])}function pt(n){return n===""?null:+n}function Q1(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function fe(n,e){n.value=e??""}function Pr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function hg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function jt(n,e){return new n(e)}const po=new Map;let mo=0;function x1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function eb(n,e){const t={stylesheet:G1(e),rules:{}};return po.set(n,t),t}function rl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${x1(f)}_${r}`,d=mg(n),{stylesheet:p,rules:h}=po.get(d)||eb(d,n);h[c]||(h[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,mo+=1,c}function al(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),mo-=s,mo||tb())}function tb(){ca(()=>{mo||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),po.clear())})}function nb(n,e,t,i){if(!e)return X;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return X;const{delay:l=0,duration:o=300,easing:r=kl,start:a=No()+l,end:u=a+o,tick:f=X,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,h;function g(){c&&(h=rl(n,0,1,o,l,r,c)),l||(p=!0)}function v(){c&&al(n,h),d=!1}return Fo(k=>{if(!p&&k>=a&&(p=!0),p&&k>=u&&(f(1,0),v()),!d)return!1;if(p){const y=k-a,S=0+1*r(y/o);f(S,1-S)}return!0}),g(),f(0,1),v}function ib(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,gg(n,s)}}function gg(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ul;function oi(n){ul=n}function wl(){if(!ul)throw new Error("Function called outside component initialization");return ul}function Zt(n){wl().$$.on_mount.push(n)}function sb(n){wl().$$.after_update.push(n)}function _g(n){wl().$$.on_destroy.push(n)}function Mt(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=hg(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ze(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gs=[],se=[],oo=[],Lr=[],bg=Promise.resolve();let Nr=!1;function vg(){Nr||(Nr=!0,bg.then(da))}function sn(){return vg(),bg}function Ge(n){oo.push(n)}function ke(n){Lr.push(n)}const xo=new Set;let fs=0;function da(){if(fs!==0)return;const n=ul;do{try{for(;fs<gs.length;){const e=gs[fs];fs++,oi(e),lb(e.$$)}}catch(e){throw gs.length=0,fs=0,e}for(oi(null),gs.length=0,fs=0;se.length;)se.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];xo.has(t)||(xo.add(t),t())}oo.length=0}while(gs.length);for(;Lr.length;)Lr.pop()();Nr=!1,xo.clear(),oi(n)}function lb(n){if(n.fragment!==null){n.update(),Pe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ge)}}let Rs;function pa(){return Rs||(Rs=Promise.resolve(),Rs.then(()=>{Rs=null})),Rs}function Ki(n,e,t){n.dispatchEvent(hg(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Jn;function re(){Jn={r:0,c:[],p:Jn}}function ae(){Jn.r||Pe(Jn.c),Jn=Jn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Jn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ma={duration:0};function yg(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&al(n,o)}function f(){const{delay:d=0,duration:p=300,easing:h=kl,tick:g=X,css:v}=s||ma;v&&(o=rl(n,0,1,p,d,h,v,a++)),g(0,1);const k=No()+d,y=k+p;r&&r.abort(),l=!0,Ge(()=>Ki(n,!0,"start")),r=Fo(S=>{if(l){if(S>=y)return g(1,0),Ki(n,!0,"end"),u(),l=!1;if(S>=k){const C=h((S-k)/p);g(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),Bt(s)?(s=s(i),pa().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function kg(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Jn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=X,css:p}=s||ma;p&&(o=rl(n,1,0,f,u,c,p));const h=No()+u,g=h+f;Ge(()=>Ki(n,!1,"start")),Fo(v=>{if(l){if(v>=g)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(v>=h){const k=c((v-h)/f);d(1-k,k)}}return l})}return Bt(s)?pa().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&al(n,o),l=!1)}}}function qe(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&al(n,u)}function c(p,h){const g=p.b-o;return h*=Math.abs(g),{a:o,b:p.b,d:g,duration:h,start:p.start,end:p.start+h,group:p.group}}function d(p){const{delay:h=0,duration:g=300,easing:v=kl,tick:k=X,css:y}=l||ma,S={start:No()+h,b:p};p||(S.group=Jn,Jn.r+=1),r||a?a=S:(y&&(f(),u=rl(n,o,p,g,h,v,y)),p&&k(0,1),r=c(S,g),Ge(()=>Ki(n,p,"start")),Fo(C=>{if(a&&C>a.start&&(r=c(a,g),a=null,Ki(n,r.b,"start"),y&&(f(),u=rl(n,o,r.b,r.duration,0,v,l.css))),r){if(C>=r.end)k(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?f():--r.group.r||Pe(r.group.c)),r=null;else if(C>=r.start){const M=C-r.start;o=r.a+r.d*v(M/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(p){Bt(l)?pa().then(()=>{l=l(s),d(p)}):d(p)},end(){f(),r=a=null}}}function ru(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e Line truncated
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=b("div"),m(e,"class","block txt-center m-b-lg"),m(i,"class","clearfix")},m(s,l){T(s,e,l),T(s,t,l),T(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function Fv(n){let e,t,i,s=!n[0]&&Vu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=D(),o&&o.c(),m(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){T(r,e,a),s&&s.m(e,null),_(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Vu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):qt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function Rv(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[Fv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function qv(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class D_ extends ye{constructor(e){super(),ve(this,e,qv,Rv,he,{nobranding:0})}}function Bo(n){const e=n-1;return e*e*e+1}function bo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function An(n,{delay:e=0,duration:t=400,easing:i=Bo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function St(n,{delay:e=0,duration:t=400,easing:i=Bo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:p=>`overflow: hidden;opacity: ${Math.min(p*20,1)*l};height: ${p*o}px;padding-top: ${p*r}px;padding-bottom: ${p*a}px;margin-top: ${p*u}px;margin-bottom: ${p*f}px;border-top-width: ${p*c}px;border-bottom-width: ${p*d}px;`}}function It(n,{delay:e=0,duration:t=400,easing:i=Bo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function Hu(n,e,t){const i=n.slice();return i[11]=e[t],i}const jv=n=>({}),zu=n=>({uniqueId:n[3]});function Vv(n){let e=(n[11]||vo)+"",t;return{c(){t=B(e)},m(i,s){T(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||vo)+"")&&le(t,e)},d(i){i&&w(t)}}}function Hv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||vo)+"",i;return{c(){e=b("pre"),i=B(t)},m(o,r){T(o,e,r),_(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||vo)+"")&&le(i,t)},d(o){o&&w(e)}}}function Bu(n){let e,t,i,s;function l(a,u){return typeof a[11]=="object"?Hv:Vv}let o=l(n),r=o(n);return{c(){e=b("div"),r.c(),t=D(),m(e,"class","help-block help-block-error")},m(a,u){T(a,e,u),r.m(e,null),_(e,t),s=!0},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r.d(1),r=o(a),r&&(r.c(),r.m(e,t)))},i(a){s||(a&&Ge(()=>{i||(i=qe(e,St,{duration:150},!0)),i.run(1)}),s=!0)},o(a){a&&(i||(i=qe(e,St,{duration:150},!1)),i.run(0)),s=!1},d(a){a&&w(e),r.d(),a&&i&&i.end()}}}function zv(n){let e,t,i,s,l;const o=n[8].default,r=Nt(o,n,n[7],zu);let a=n[2],u=[];for(let c=0;c<a.length;c+=1)u[c]=Bu(Hu(n,a,c));const f=c=>P(u[c],1,1,()=>{u[c]=null});return{c(){e=b("div"),r&&r.c(),t=D();for(let c=0;c<u.length;c+=1)u[c].c();m(e,"class",n[0]),Q(e,"error",n[2].length)},m(c,d){T(c,e,d),r&&r.m(e,null),_(e,t);for(let p=0;p<u.length;p+=1)u[p].m(e,null);n[10](e),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p(c,[d]){if(r&&r.p&&(!i||d&128)&&Rt(r,o,c,c[7],i?Ft(o,c[7],d,jv):qt(c[7]),zu),d&4){a=c[2];let p;for(p=0;p<a.length;p+=1){const h=Hu(c,a,p);u[p]?(u[p].p(h,d),A(u[p],1)):(u[p]=Bu(h),u[p].c(),A(u[p],1),u[p].m(e,null))}for(re(),p=a.length;p<u.length;p+=1)f(p);ae()}(!i||d&1)&&m(e,"class",c[0]),(!i||d&5)&&Q(e,"error",c[2].length)},i(c){if(!i){A(r,c);for(let d=0;d<a.length;d+=1)A(u[d]);i=!0}},o(c){P(r,c),u=u.filter(Boolean);for(let d=0;d<u.length;d+=1)P(u[d]);i=!1},d(c){c&&w(e),r&&r.d(c),ht(u,c),n[10](null),s=!1,l()}}}const vo="Invalid value";function Bv(n,e,t){let i;Ye(n,fi,h=>t(6,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Qi(r)}Zt(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(h){ze.call(this,n,h)}function p(h){se[h?"unshift":"push"](()=>{u=h,t(1,u)})}return n.$$set=h=>{"name"in h&&t(4,r=h.name),"class"in h&&t(0,a=h.class),"$$scope"in h&&t(7,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&80&&t(2,f=H.toArray(H.getNestedVal(i,r)))},[a,u,f,o,r,c,i,l,s,d,p]}class me extends ye{constructor(e){super(),ve(this,e,Bv,zv,he,{name:4,class:0,changed:5})}get changed(){return this.$$.ctx[5]}}function Uv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Email"),s=D(),l=b("input"),m(e,"for",i=n[9]),m(l,"type","email"),m(l,"autocomplete","off"),m(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Wv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=B("Password"),s=D(),l=b("input"),r=D(),a=b("div"),a.textContent="Minimum 10 characters.",m(e,"for",i=n[9]),m(l,"type","password"),m(l,"autocomplete","new-password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0,m(a,"class","help-block")},m(c,d){T(c,e,d),_(e,t),T(c,s,d),T(c,l,d),fe(l,n[1]),T(c,r,d),T(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&m(e,"for",i),d&512&&o!==(o=c[9])&&m(l,"id",o),d&2&&l.value!==c[1]&&fe(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function Yv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Password confirm"),s=D(),l=b("input"),m(e,"for",i=n[9]),m(l,"type","password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&4&&l.value!==u[2]&&fe(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Kv(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return s=new me({props:{class:"form-field required",name:"email",$$slots:{default:[Uv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[Wv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Yv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),f=b("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(f,"type","submit"),m(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),m(e,"class","block"),m(e,"autocomplete","off")},m(h,g){T(h,e,g),_(e,t),_(e,i),q(s,e,null),_(e,l),q(o,e,null),_(e,r),q(a,e,null),_(e,u),_(e,f),c=!0,d||(p=Y(e,"submit",dt(n[4])),d=!0)},p(h,[g]){const v={};g&1537&&(v.$$scope={dirty:g,ctx:h}),s.$set(v);const k={};g&1538&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const y={};g&1540&&(y.$$scope={dirty:g,ctx:h}),a.$set(y),(!c||g&8)&&Q(f,"btn-disabled",h[3]),(!c||g&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){P(s.$$.fragment,h),P(o.$$.fragment,h),P(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,p()}}}function Jv(n,e,t){const i=Mt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await pe.admins.create({email:s,password:l,passwordConfirm:o}),await pe.admins.authWithPassword(s,l),i("submit")}catch(d){pe.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class Zv extends ye{constructor(e){super(),ve(this,e,Jv,Kv,he,{})}}function Uu(n){let e,t;return e=new D_({props:{$$slots:{default:[Gv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Gv(n){let e,t;return e=new Zv({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:X,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Xv(n){let e,t,i=n[0]&&Uu(n);return{c(){i&&i.c(),e=$e()},m(s,l){i&&i.m(s,l),T(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Uu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Qv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){pe.logout(!1),t(0,i=!0);return}pe.authStore.isValid?Oi("/collections"):pe.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class xv extends ye{constructor(e){super(),ve(this,e,Qv,Xv,he,{})}}const Tt=Ln(""),yo=Ln(""),$s=Ln(!1);function ey(n){let e,t,i,s;return{c(){e=b("input"),m(e,"type","text"),m(e,"id",n[8]),m(e,"placeholder",t=n[0]||n[1])},m(l,o){T(l,e,o),n[13](e),fe(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&m(e,"placeholder",t),o&128&&e.value!==l[7]&&fe(e,l[7])},i:X,o:X,d(l){l&&w(e),n[13](null),i=!1,s()}}}function ty(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={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&&(u.value=a[7]),{props:u}}return o&&(e=jt(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=$e()},m(a,u){e&&q(e,a,u),T(a,i,u),s=!0},p(a,u){const f={};if(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],ke(()=>t=!1)),o!==(o=a[4])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Wu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Yu();return{c(){r&&r.c(),e=D(),t=b("button"),t.innerHTML='<span class="txt">Clear</span>',m(t,"type","button"),m(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),T(a,e,u),T(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Yu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){s||(A(r),a&&Ge(()=>{i||(i=qe(t,An,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=qe(t,An,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Yu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Search</span>',m(e,"type","submit"),m(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){T(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,An,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,An,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function ny(n){let e,t,i,s,l,o,r,a,u,f;const c=[ty,ey],d=[];function p(g,v){return g[4]&&!g[5]?0:1}l=p(n),o=d[l]=c[l](n);let h=(n[0].length||n[7].length)&&Wu(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=D(),o.c(),r=D(),h&&h.c(),m(i,"class","ri-search-line"),m(t,"for",n[8]),m(t,"class","m-l-10 txt-xl"),m(e,"class","searchbar")},m(g,v){T(g,e,v),_(e,t),_(t,i),_(e,s),d[l].m(e,null),_(e,r),h&&h.m(e,null),aLine truncated
<span class="txt">method</span>`,m(e,"class","col-header-content")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function by(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="url",m(t,"class",H.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function vy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="referer",m(t,"class",H.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function yy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="User IP",m(t,"class",H.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function ky(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="status",m(t,"class",H.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function wy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="created",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Xu(n){let e;function t(l,o){return l[6]?Ty:Sy}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),T(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function Sy(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Qu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(a,u){T(a,e,u),_(e,t),_(t,i),_(t,s),o&&o.m(t,null),_(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Qu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Ty(n){let e;return{c(){e=b("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function Qu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function xu(n){let e;return{c(){e=b("i"),m(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),m(e,"title","Error")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function ef(n,e){var Se,We,lt;let t,i,s,l=((Se=e[23].method)==null?void 0:Se.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,p,h,g,v,k,y=(e[23].referer||"N/A")+"",S,C,M,$,O,E=(e[23].userIp||"N/A")+"",I,L,N,F,R,K=e[23].status+"",x,U,G,ne,J,ue,Z,de,_e,Ce,Ne=(((We=e[23].meta)==null?void 0:We.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&xu();ne=new ui({props:{date:e[23].created}});function Re(){return e[17](e[23])}function be(...ce){return e[18](e[23],...ce)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("span"),o=B(l),a=D(),u=b("td"),f=b("span"),d=B(c),h=D(),Ne&&Ne.c(),g=D(),v=b("td"),k=b("span"),S=B(y),M=D(),$=b("td"),O=b("span"),I=B(E),N=D(),F=b("td"),R=b("span"),x=B(K),U=D(),G=b("td"),V(ne.$$.fragment),J=D(),ue=b("td"),ue.innerHTML='<i class="ri-arrow-right-line"></i>',Z=D(),m(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),m(i,"class","col-type-text col-field-method min-width"),m(f,"class","txt txt-ellipsis"),m(f,"title",p=e[23].url),m(u,"class","col-type-text col-field-url"),m(k,"class","txt txt-ellipsis"),m(k,"title",C=e[23].referer),Q(k,"txt-hint",!e[23].referer),m(v,"class","col-type-text col-field-referer"),m(O,"class","txt txt-ellipsis"),m(O,"title",L=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),m($,"class","col-type-number col-field-userIp"),m(R,"class","label"),Q(R,"label-danger",e[23].status>=400),m(F,"class","col-type-number col-field-status"),m(G,"class","col-type-date col-field-created"),m(ue,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(ce,He){T(ce,t,He),_(t,i),_(i,s),_(s,o),_(t,a),_(t,u),_(u,f),_(f,d),_(u,h),Ne&&Ne.m(u,null),_(t,g),_(t,v),_(v,k),_(k,S),_(t,M),_(t,$),_($,O),_(O,I),_(t,N),_(t,F),_(F,R),_(R,x),_(t,U),_(t,G),q(ne,G,null),_(t,J),_(t,ue),_(t,Z),de=!0,_e||(Ce=[Y(t,"click",Re),Y(t,"keydown",be)],_e=!0)},p(ce,He){var Fe,ot,Vt;e=ce,(!de||He&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!de||He&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&m(s,"class",r),(!de||He&8)&&c!==(c=e[23].url+"")&&le(d,c),(!de||He&8&&p!==(p=e[23].url))&&m(f,"title",p),(ot=e[23].meta)!=null&&ot.errorMessage||(Vt=e[23].meta)!=null&&Vt.errorData?Ne||(Ne=xu(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!de||He&8)&&y!==(y=(e[23].referer||"N/A")+"")&&le(S,y),(!de||He&8&&C!==(C=e[23].referer))&&m(k,"title",C),(!de||He&8)&&Q(k,"txt-hint",!e[23].referer),(!de||He&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&le(I,E),(!de||He&8&&L!==(L=e[23].userIp))&&m(O,"title",L),(!de||He&8)&&Q(O,"txt-hint",!e[23].userIp),(!de||He&8)&&K!==(K=e[23].status+"")&&le(x,K),(!de||He&8)&&Q(R,"label-danger",e[23].status>=400);const te={};He&8&&(te.date=e[23].created),ne.$set(te)},i(ce){de||(A(ne.$$.fragment,ce),de=!0)},o(ce){P(ne.$$.fragment,ce),de=!1},d(ce){ce&&w(t),Ne&&Ne.d(),j(ne),_e=!1,Pe(Ce)}}}function Cy(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M,$,O,E,I=[],L=new Map,N;function F(be){n[11](be)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[_y]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Wt({props:R}),se.push(()=>ge(s,"sort",F));function K(be){n[12](be)}let x={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[by]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),r=new Wt({props:x}),se.push(()=>ge(r,"sort",K));function U(be){n[13](be)}let G={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[vy]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),f=new Wt({props:G}),se.push(()=>ge(f,"sort",U));function ne(be){n[14](be)}let J={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[yy]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),p=new Wt({props:J}),se.push(()=>ge(p,"sort",ne));function ue(be){n[15](be)}let Z={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[ky]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),v=new Wt({props:Z}),se.push(()=>ge(v,"sort",ue));function de(be){n[16](be)}let _e={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[wy]},$$scope:{ctx:n}};n[1]!==void 0&&(_e.sort=n[1]),S=new Wt({props:_e}),se.push(()=>ge(S,"sort",de));let Ce=n[3];const Ne=be=>be[23].id;for(let be=0;be<Ce.length;be+=1){let Se=Gu(n,Ce,be),We=Ne(Se);L.set(We,I[be]=ef(We,Se))}let Re=null;return Ce.length||(Re=Xu(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),V(s.$$.fragment),o=D(),V(r.$$.fragment),u=D(),V(f.$$.fragment),d=D(),V(p.$$.fragment),g=D(),V(v.$$.fragment),y=D(),V(S.$$.fragm Line truncated
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function ni(){}const Dy=function(){let n=0;return function(){return n++}}();function at(n){return n===null||typeof n>"u"}function gt(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 Ke(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const $t=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Cn(n,e){return $t(n)?n:e}function Qe(n,e){return typeof n>"u"?e:n}const Ey=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,A_=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function yt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ut(n,e,t,i){let s,l,o;if(gt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ke(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function ko(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function wo(n){if(gt(n))return n.map(wo);if(Ke(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=wo(n[t[s]]);return e}return n}function I_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Ay(n,e,t,i){if(!I_(n))return;const s=e[n],l=t[n];Ke(s)&&Ke(l)?dl(s,l,i):e[n]=wo(l)}function dl(n,e,t){const i=gt(e)?e:[e],s=i.length;if(!Ke(n))return n;t=t||{};const l=t.merger||Ay;for(let o=0;o<s;++o){if(e=i[o],!Ke(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function tl(n,e){return dl(n,e,{merger:Iy})}function Iy(n,e,t){if(!I_(n))return;const i=e[n],s=t[n];Ke(i)&&Ke(s)?tl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=wo(s))}const sf={"":n=>n,x:n=>n.x,y:n=>n.y};function Ci(n,e){return(sf[e]||(sf[e]=Py(e)))(n)}function Py(n){const e=Ly(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ly(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Aa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const In=n=>typeof n<"u",$i=n=>typeof n=="function",lf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Ny(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ct=Math.PI,ct=2*Ct,Fy=ct+Ct,So=Number.POSITIVE_INFINITY,Ry=Ct/180,kt=Ct/2,zs=Ct/4,of=Ct*2/3,Dn=Math.log10,Gn=Math.sign;function rf(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Dn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function qy(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)<t}function jy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function P_(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Vn(n){return n*(Ct/180)}function Ia(n){return n*(180/Ct)}function af(n){if(!$t(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function L_(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Ct&&(l+=ct),{angle:l,distance:s}}function Gr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Vy(n,e){return(n-e+Fy)%ct-Ct}function bn(n){return(n%ct+ct)%ct}function pl(n,e,t,i){const s=bn(n),l=bn(e),o=bn(t),r=bn(l-s),a=bn(o-s),u=bn(s-l),f=bn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Yt(n,e,t){return Math.max(e,Math.min(t,n))}function Hy(n){return Yt(n,-32768,32767)}function ml(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Pa(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Yi=(n,e,t,i)=>Pa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),zy=(n,e,t)=>Pa(n,t,i=>n[i][e]>=t);function By(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const N_=["push","pop","shift","splice","unshift"];function Uy(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),N_.forEach(t=>{const i="_onData"+Aa(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function uf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(N_.forEach(l=>{delete n[l]}),delete n._chartjs)}function F_(n){const e=new Set;let t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}const R_=function(){return typeof window>"u"?function(n){return n()}:window.requestLine truncated
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Dl(n){return n+.5|0}const bi=(n,e,t)=>Math.max(Math.min(n,t),e);function Xs(n){return bi(Dl(n*2.55),0,255)}function wi(n){return bi(Dl(n*255),0,255)}function li(n){return bi(Dl(n/2.55)/100,0,1)}function pf(n){return bi(Dl(n*100),0,100)}const Tn={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},Xr=[..."0123456789ABCDEF"],Ky=n=>Xr[n&15],Jy=n=>Xr[(n&240)>>4]+Xr[n&15],Wl=n=>(n&240)>>4===(n&15),Zy=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function Gy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Tn[n[1]]*17,g:255&Tn[n[2]]*17,b:255&Tn[n[3]]*17,a:e===5?Tn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Tn[n[1]]<<4|Tn[n[2]],g:Tn[n[3]]<<4|Tn[n[4]],b:Tn[n[5]]<<4|Tn[n[6]],a:e===9?Tn[n[7]]<<4|Tn[n[8]]:255})),t}const Xy=(n,e)=>n<255?e(n):"";function Qy(n){var e=Zy(n)?Ky:Jy;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Xy(n.a,e):void 0}const xy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function H_(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function e2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function t2(n,e,t){const i=H_(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function n2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function La(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=n2(t,i,s,f,l),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(wi)}function Fa(n,e,t){return Na(H_,n,e,t)}function i2(n,e,t){return Na(t2,n,e,t)}function s2(n,e,t){return Na(e2,n,e,t)}function z_(n){return(n%360+360)%360}function l2(n){const e=xy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xs(+e[5]):wi(+e[5]));const s=z_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=i2(s,l,o):e[1]==="hsv"?i=s2(s,l,o):i=Fa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function o2(n,e){var t=La(n);t[0]=z_(t[0]+e),t=Fa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function r2(n){if(!n)return;const e=La(n),t=e[0],i=pf(e[1]),s=pf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${li(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}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 a2(){const n={},e=Object.keys(hf),t=Object.keys(mf);let i,s,l,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s]Line truncated
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class fk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=R_.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ii=new fk;const Mf="transparent",ck={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=_f(n||Mf),s=i.valid&&_f(e||Mf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class dk{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||ck[e.type||typeof o],this._easing=il[e.easing]||il.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const pk=["x","y","borderWidth","radius","tension"],mk=["color","borderColor","backgroundColor"];xe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const hk=Object.keys(xe.animation);xe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});xe.set("animations",{colors:{type:"color",properties:mk},numbers:{type:"number",properties:pk}});xe.describe("animations",{_fallback:"animation"});xe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class i1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ke(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ke(s))return;const l={};for(const o of hk)l[o]=s[o];(gt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=_k(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&gk(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new dk(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ii.add(this._chart,i),!0}}function gk(n,e){const t=[],Line truncated
`)>-1?n.split(`
`):n}function AS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function sc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=vn(e.bodyFont),u=vn(e.titleFont),f=vn(e.footerFont),c=l.length,d=s.length,p=i.length,h=Pn(e.padding);let g=h.height,v=0,k=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=p*C+(k-p)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let y=0;const S=function(C){v=Math.max(v,t.measureText(C).width+y)};return t.save(),t.font=u.string,ut(n.title,S),t.font=a.string,ut(n.beforeBody.concat(n.afterBody),S),y=e.displayColors?o+2+e.boxPadding:0,ut(i,C=>{ut(C.before,S),ut(C.lines,S),ut(C.after,S)}),y=0,t.font=f.string,ut(n.footer,S),t.restore(),v+=h.width,{width:v,height:g}}function IS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function PS(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function LS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),PS(u,n,e,t)&&(u="center"),u}function lc(n,e,t){const i=t.yAlign||e.yAlign||IS(n,t);return{xAlign:t.xAlign||e.xAlign||LS(n,e,t,i),yAlign:i}}function NS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function FS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function oc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:p}=ys(o);let h=NS(e,r);const g=FS(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,p)+s),{x:Yt(h,0,i.width-e.width),y:Yt(g,0,i.height-e.height)}}function to(n,e,t){const i=Pn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function rc(n){return Kn([],si(n))}function RS(n,e,t){return Di(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function ac(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class oa extends ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new i1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=RS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}getBeforeBody(e,t){return rc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ut(e,l=>{const o={before:[],lines:[],after:[]},r=ac(i,l);Kn(o.before,si(r.beforeLabel.call(this,l))),Kn(o.lines,r.label.call(this,l)),Kn(o.after,si(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return rc(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;a<u;++a)r.push(AS(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ut(r,f=>{const c=ac(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;l Line truncated
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const s3={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};a1._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return s3},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=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.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 gc(n){let e,t,i;return{c(){e=b("div"),m(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){T(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,It,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,It,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function l3(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=B(n[1]),t=D(),s=B(i)},m(l,o){T(l,e,o),T(l,t,o),T(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function o3(n){let e;return{c(){e=B("Loading...")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function r3(n){let e,t,i,s,l,o=n[2]&&gc();function r(f,c){return f[2]?o3:l3}let a=r(n),u=a(n);return{c(){e=b("div"),o&&o.c(),t=D(),i=b("canvas"),s=D(),l=b("div"),u.c(),m(i,"class","chart-canvas svelte-vh4sl8"),Pr(i,"height","250px"),Pr(i,"width","100%"),m(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),m(l,"class","txt-hint m-t-xs txt-right")},m(f,c){T(f,e,c),o&&o.m(e,null),_(e,t),_(e,i),n[8](i),T(f,s,c),T(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=gc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function a3(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),pe.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let h of p)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),pe.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Ao.register(Ei,Jo,Yo,Qa,Pl,ES,qS),t(6,o=new Ao(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:p=>p.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:p=>p.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(p){se[p?"unshift":"push"](()=>{l=p,t(0,l)})}return n.$$set=p=>{"filter"in p&&t(3,i=p.filter),"presets"in p&&t(4,s=p.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class u3 extends ye{constructor(e){super(),ve(this,e,a3,r3,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ua={},f3={get exports(){return ua},set exports(n){ua=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function y(S){return S instanceof a?new a(S.type,y(S.content),S.alias):Array.isArray(S)?S.map(y):S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++l}),y.__id},clone:function y(S,C){C=C||{};var M,$;switch(r.util.type(S)){case"Object":if($=r.util.objId(S),C[$])return C[$];M={},C[$]=M;for(var O in S)S.hasOwnProperty(O)&&(M[O]=y(S[O],C));return M;case"Array":return $=r.util.objId(S),C[$]?C[$]:(M=[],C[$]=M,S.forEach(function(E,I){M[I]=y(E,C)}),M);default:return S}},getLanguage:function(y){for(;y;){var S=s.exec(y.className);if(S)return S[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,S){y.className=y.className.replace(RegExp(s,"gi"),""),y.classList.add("language-"+S)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(y){var S=document.getElementsByTagName("script");for(var C in S)if(S[C].src==y)return S[C]}return null}},isActive:function(y,S,C){for(var M="no-"+S;y;){var $=y.classList;if($.contains(S))return!0;if($.contains(M))return!1;y=y.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,S){var C=r.util.clone(r.languages[y]);for(var M in S)C[M]=S[M];return C},insertBefore:function(y,S,C,M){M=M||r.languages;var $=M[y],O={};for(var E in $)if($.hasOwnProperty(E)){if(E==S)for(var I in C)C.hasOwnProperty(I)&&(O[I]=C[I]);C.hasOwnProperty(E)||(O[E]=$[E])}var L=M[y];return M[y]=O,r.languages.DFS(r.languages,function(N,F){F===L&&N!=y&&(this[N]=O)}),O},DFS:function y(S,C,M,$){$=$||{};var O=r.util.objId;for(var E in S)if(S.hasOwnProperty(E)){C.call(S,E,S[E],M||E);var I=S[E],L=r.util.type(I);L==="Object"&&!$[O(I)]?($[O(I)]=!0,y(I,C,null,$)):L==="Array"&&!$[O(I)]&&($[O(I)]=!0,y(I,C,E,$))}}},plugins:{},highlightAll:function(y,S){r.highlightAllUnder(document,y,S)},highlightAllUnder:function(y,S,C){var M={callback:C,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var $=0,O;O=M.elements[$++];)r.highlightElement(O,S===!0,M.callback)},highlightElement:function(y,S,C){var M=r.util.getLanguage(y),$=r.languages[M];r.util.setLanguage(y,M);var O=y.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var E=y.textContent,I={element:y,language:M,grammar:$,code:E};function L(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),O=I.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if(S&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(y,S,C){var M={code:y,grammar:S,language:C};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(y,S){var C=S.rest;if(C){for(var M in C)S[M]=C[M];delete S.rest}var $=new c;return d($,$.head,y),f(y,$,S,$.head,0),h($)},hooks:{all:{},add:function(y,S){var C=r.hooks.all;C[y]=C[y]||[],C[y].push(S)},run:function(y,S){var C=r.hooks.all[y];if(!(!C||!C.length))for(var M=0,$;$=C[M++];)$(S)}},Token:a};i.Prism=r;function a(y,S,C,M){this.type=y,this.content=S,this.alias=C,this.length=(M||"").length|0}a.stringify=function y(S,C){if(typeof S=="string")return S;if(Array.isArray(S)){var M="";return S.forEach(function(L){M+=y(L,C)}),M}var $={type:S.type,content:y(S.content,C),tag:"span",classes:["token",S.type],attributes:{},language:C},O=S.alias;O&&(Array.isArray(O)?Array.prototype.push.apply($.classes,O):$.classes.push(O)),r.hooks.run("wrap",$);var E="";for(var I in $.attributes)E+=" "+I+'="'+($.attributes[I]||"").replace(/"/g,"&quot;")+'"';return"<"+$.tag+' class="'+$.classes.join(" ")+'"'+E+">"+$.content+"</"+$.tag+">"};function u(y,S,C,M){y.lastIndex=S;var $=y.exec(C);if($&&M&&$[1]){var O=$[1].length;$.index+=O,$[0]=$[0].slice(O)}return $}funLine truncated
`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(I+1))}k.textContent=$,t.highlightElement(k)},function($){v.setAttribute(r,f),k.textContent=$})}}),t.plugins.fileHighlight={highlight:function(v){for(var k=(v||document).querySelectorAll(c),y=0,S;S=k[y++];)t.highlightElement(S)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(f3);const Js=ua;var bc={},c3={get exports(){return bc},set exports(n){bc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var p=s(f[d]);c+=p,c>r&&(f[d]=`
`+f[d],c=p)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,p="",h="",g=!1,v=0;v<d.length;++v){var k=d[v];k==o.element?g=!0:k.nodeName==="#text"&&(g?h+=k.nodeValue:p+=k.nodeValue,a.removeChild(k),--v)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=p+o.code+h,o.code=r.normalize(o.code,o.settings);else{var y=p+o.element.innerHTML+h;o.element.innerHTML=r.normalize(y,o.settings),o.code=o.element.textContent}}}})})()})(c3);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),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 d3(n){let e,t,i;return{c(){e=b("div"),t=b("code"),m(t,"class","svelte-10s5tkd"),m(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){T(s,e,l),_(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&m(e,"class",i)},i:X,o:X,d(s){s&&w(e)}}}function p3(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Js.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Js.highlight(a,Js.languages[l]||Js.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Js<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class O1 extends ye{constructor(e){super(),ve(this,e,p3,d3,he,{class:0,content:2,language:3})}}const m3=n=>({}),vc=n=>({}),h3=n=>({}),yc=n=>({});function kc(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S=n[4]&&!n[2]&&wc(n);const C=n[19].header,M=Nt(C,n,n[18],yc);let $=n[4]&&n[2]&&Sc(n);const O=n[19].default,E=Nt(O,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],vc);return{c(){e=b("div"),t=b("div"),s=D(),l=b("div"),o=b("div"),S&&S.c(),r=D(),M&&M.c(),a=D(),$&&$.c(),u=D(),f=b("div"),E&&E.c(),c=D(),d=b("div"),L&&L.c(),m(t,"class","overlay"),m(o,"class","overlay-panel-section panel-header"),m(f,"class","overlay-panel-section panel-content"),m(d,"class","overlay-panel-section panel-footer"),m(l,"class",p="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),m(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(N,F){T(N,e,F),_(e,t),_(e,s),_(e,l),_(l,o),S&&S.m(o,null),_(o,r),M&&M.m(o,null),_(o,a),$&&$.m(o,null),_(l,u),_(l,f),E&&E.m(f,null),n[21](f),_(l,c),_(l,d),L&&L.m(d,null),v=!0,k||(y=[Y(t,"click",dt(n[20])),Y(f,"scroll",n[22])],k=!0)},p(N,F){n=N,n[4]&&!n[2]?S?S.p(n,F):(S=wc(n),S.c(),S.m(o,r)):S&&(S.d(1),S=null),M&&M.p&&(!v||F[0]&262144)&&Rt(M,C,n,n[18],v?Ft(C,n[18],F,h3):qt(n[18]),yc),n[4]&&n[2]?$?$.p(n,F):($=Sc(n),$.c(),$.m(o,null)):$&&($.d(1),$=null),E&&E.p&&(!v||F[0]&262144)&&Rt(E,O,n,n[18],v?Ft(O,n[18],F,null):qt(n[18]),null),L&&L.p&&(!v||F[0]&262144)&&Rt(L,I,n,n[18],v?Ft(I,n[18],F,m Line truncated
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]))&&m(e,"for",l);const y={};k&16&&(y.id=v[4]),k&1&&(y.disabled=!H.isEmpty(v[0].onlyDomains)),!a&&k&1&&(a=!0,y.value=v[0].exceptDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,p()}}}function kT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(v){n[3](v)}let g={id:n[4]+".options.onlyDomains",disabled:!H.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new Ns({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=D(),s=b("i"),o=D(),V(r.$$.fragment),u=D(),f=b("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[4]+".options.onlyDomains"),m(f,"class","help-block")},m(v,k){T(v,e,k),_(e,t),_(e,i),_(e,s),T(v,o,k),q(r,v,k),T(v,u,k),T(v,f,k),c=!0,d||(p=Ie(Ue.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]+".options.onlyDomains"))&&m(e,"for",l);const y={};k&16&&(y.id=v[4]+".options.onlyDomains"),k&1&&(y.disabled=!H.isEmpty(v[0].exceptDomains)),!a&&k&1&&(a=!0,y.value=v[0].onlyDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,p()}}}function wT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[yT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[kT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=D(),l=b("div"),V(o.$$.fragment),m(t,"class","col-sm-6"),m(l,"class","col-sm-6"),m(e,"class","grid")},m(a,u){T(a,e,u),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function ST(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class I1 extends ye{constructor(e){super(),ve(this,e,ST,wT,he,{key:1,options:0})}}function TT(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new I1({props:r}),se.push(()=>ge(e,"key",l)),se.push(()=>ge(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],ke(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],ke(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function CT(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class $T extends ye{constructor(e){super(),ve(this,e,CT,TT,he,{key:0,options:1})}}function MT(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class OT extends ye{constructor(e){super(),ve(this,e,MT,null,he,{key:0,options:1})}}var Sr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},_l={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%10 Line truncated
<span class='flatpickr-weekday'>
`+W.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ue(){t.calendarContainer.classList.add("hasWeeks");var z=st("div","flatpickr-weekwrapper");z.appendChild(st("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=st("div","flatpickr-weeks");return z.appendChild(W),{weekWrapper:z,weekNumbers:W}}function Z(z,W){W===void 0&&(W=!0);var ee=W?z:z-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),R()),F(),Ze("onMonthChange"),Li())}function de(z,W){if(z===void 0&&(z=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Mr(t.config),oe=ee.hours,Te=ee.minutes,De=ee.seconds;p(oe,Te,De)}t.redraw(),z&&Ze("onChange")}function _e(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function Ce(){t.config!==void 0&&Ze("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 W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}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(ee){try{delete t[ee]}catch{}})}function Ne(z){return t.calendarContainer.contains(z)}function Re(z){if(t.isOpen&&!t.config.inline){var W=gn(z),ee=Ne(W),oe=W===t.input||W===t.altInput||t.element.contains(W)||z.path&&z.path.indexOf&&(~z.path.indexOf(t.input)||~z.path.indexOf(t.altInput)),Te=!oe&&!ee&&!Ne(z.relatedTarget),De=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(W)});Te&&De&&(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 be(z){if(!(!z||t.config.minDate&&z<t.config.minDate.getFullYear()||t.config.maxDate&&z>t.config.maxDate.getFullYear())){var W=z,ee=t.currentYear!==W;t.currentYear=W||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)),ee&&(t.redraw(),Ze("onYearChange"),R())}}function Se(z,W){var ee;W===void 0&&(W=!0);var oe=t.parseDate(z,void 0,W);if(t.config.minDate&&oe&&_n(oe,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&oe&&_n(oe,t.config.maxDate,W!==void 0?W:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Te=!!t.config.enable,De=(ee=t.config.enable)!==null&&ee!==void 0?ee:t.config.disable,Ee=0,Me=void 0;Ee<De.length;Ee++){if(Me=De[Ee],typeof Me=="function"&&Me(oe))return Te;if(Me instanceof Date&&oe!==void 0&&Me.getTime()===oe.getTime())return Te;if(typeof Me=="string"){var Be=t.parseDate(Me,void 0,!0);return Be&&Be.getTime()===oe.getTime()?Te:!Te}else if(typeof Me=="object"&&oe!==void 0&&Me.from&&Me.to&&oe.getTime()>=Me.from.getTime()&&oe.getTime()<=Me.to.getTime())return Te}return!Te}function We(z){return t.daysContainer!==void 0?z.className.indexOf("hidden")===-1&&z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(z):!1}function lt(z){var W=z.target===t._input,ee=t._input.value.trimEnd()!==Ni();W&&ee&&!(z.relatedTarget&&Ne(z.relatedTarget))&&t.setDate(t._input.value,!0,z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}f Line truncated
`),r=b("code"),r.textContent="multipart/form-data",a=B(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=B(` field is a
`),c=b("strong"),c.textContent="plain string",d=B(`:
`),p=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=D(),v=b("li"),v.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=D(),y=b("li"),y.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",S=D(),C=b("li"),C.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=D(),$=b("li"),E=B(O),I=B(" is converted to the json "),L=b("code"),L.textContent='{"a":1,"b":2}',N=D(),F=b("li"),F.textContent="numeric strings are converted to json number",R=D(),K=b("li"),K.textContent="double quoted strings are left as they are (aka. without normalizations)",x=D(),U=b("li"),U.textContent="any other string (empty string too) is double quoted",G=B(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside
an object, eg.`),ne=b("code"),ne.textContent='{"data": anything}',m(i,"class","content"),m(t,"class","alert alert-warning m-b-0 m-t-10"),m(e,"class","block")},m(Z,de){T(Z,e,de),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o),_(i,r),_(i,a),_(i,u),_(i,f),_(i,c),_(i,d),_(i,p),_(p,h),_(p,g),_(p,v),_(p,k),_(p,y),_(p,S),_(p,C),_(p,M),_(p,$),_($,E),_($,I),_($,L),_(p,N),_(p,F),_(p,R),_(p,K),_(p,x),_(p,U),_(i,G),_(i,ne),ue=!0},i(Z){ue||(Z&&Ge(()=>{J||(J=qe(e,St,{duration:150},!0)),J.run(1)}),ue=!0)},o(Z){Z&&(J||(J=qe(e,St,{duration:150},!1)),J.run(0)),ue=!1},d(Z){Z&&w(e),Z&&J&&J.end()}}}function XT(n){let e,t,i,s,l,o,r;function a(d,p){return d[0]?GT:ZT}let u=a(n),f=u(n),c=n[0]&&Xc();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=D(),f.c(),s=D(),c&&c.c(),l=$e(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,p){T(d,e,p),_(e,t),_(e,i),f.m(e,null),T(d,s,p),c&&c.m(d,p),T(d,l,p),o||(r=Y(e,"click",n[3]),o=!0)},p(d,[p]){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[0]?c?p&1&&A(c,1):(c=Xc(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){A(c)},o(d){P(c)},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function QT(n,e,t){const i="",s={};let l=!1;return[l,i,s,()=>{t(0,l=!l)}]}class xT extends ye{constructor(e){super(),ve(this,e,QT,XT,he,{key:1,options:2})}get key(){return this.$$.ctx[1]}get options(){return this.$$.ctx[2]}}function eC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=B(t),s=D(),l=b("small"),r=B(o),m(e,"class","txt"),m(l,"class","txt-hint")},m(a,u){T(a,e,u),_(e,i),T(a,s,u),T(a,l,u),_(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:X,o:X,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function tC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Qc extends ye{constructor(e){super(),ve(this,e,tC,eC,he,{item:0})}}const nC=[{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",mimeT Line truncated
Leave empty for no restriction.`,position:"top"})),y=!0)},p($,O){(!k||O&4096&&l!==(l=$[12]))&&m(e,"for",l);const E={};O&4096&&(E.id=$[12]),O&4&&(E.items=$[2]),!a&&O&1&&(a=!0,E.keyOfSelected=$[0].mimeTypes,ke(()=>a=!1)),r.$set(E);const I={};O&8193&&(I.$$scope={dirty:O,ctx:$}),v.$set(I)},i($){k||(A(r.$$.fragment,$),A(v.$$.fragment,$),k=!0)},o($){P(r.$$.fragment,$),P(v.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(o),j(r,$),$&&w(u),$&&w(f),j(v),y=!1,S()}}}function rC(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,m(e,"class","m-0")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function aC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M;function $(E){n[10](E)}let O={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(O.value=n[0].thumbs),r=new Ns({props:O}),se.push(()=>ge(r,"value",$)),y=new ei({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[rC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=D(),s=b("i"),o=D(),V(r.$$.fragment),u=D(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=D(),p=b("button"),h=b("span"),h.textContent="Supported formats",g=D(),v=b("i"),k=D(),V(y.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(c,"class","txt"),m(h,"class","txt link-primary"),m(v,"class","ri-arrow-drop-down-fill"),m(p,"type","button"),m(p,"class","inline-flex flex-gap-0"),m(f,"class","help-block")},m(E,I){T(E,e,I),_(e,t),_(e,i),_(e,s),T(E,o,I),q(r,E,I),T(E,u,I),T(E,f,I),_(f,c),_(f,d),_(f,p),_(p,h),_(p,g),_(p,v),_(p,k),q(y,p,null),S=!0,C||(M=Ie(Ue.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),C=!0)},p(E,I){(!S||I&4096&&l!==(l=E[12]))&&m(e,"for",l);const L={};I&4096&&(L.id=E[12]),!a&&I&1&&(a=!0,L.value=E[0].thumbs,ke(()=>a=!1)),r.$set(L);const N={};I&8192&&(N.$$scope={dirty:I,ctx:E}),y.$set(N)},i(E){S||(A(r.$$.fragment,E),A(y.$$.fragment,E),S=!0)},o(E){P(r.$$.fragment,E),P(y.$$.fragment,E),S=!1},d(E){E&&w(e),E&&w(o),j(r,E),E&&w(u),E&&w(f),j(y),C=!1,M()}}}function uC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[iC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[sC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[oC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[aC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=D(),l=b("div"),V(o.$$.fragment),r=D(),a=b("div"),V(u.$$.fragment),f=D(),c=b("div"),V(d.$$.fragment),m(t,"class","col-sm-6"),m(l,"class","col-sm-6"),m(a,"class","col-sm-12"),m(c,"class","col-sm-12"),m(e,"class","grid")},m(h,g){T(h,e,g),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),_(e,a),q(u,a,null),_(e,f),_(e,c),q(d,c,null),p=!0},p(h,[g]){const v={};g&2&&(v.name="schema."+h[1]+".options.maxSize"),g&12289&&(v.$$scope={dirty:g,ctx:h}),i.$set(v);const k={};g&2&&(k.name="schema."+h[1]+".options.maxSelect"),g&12289&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const y={};g&2&&(y.name="schema."+h[1]+".options.mimeTypes"),g&12293&&(y.$$scope={dirty:g,ctx:h}),u.$set(y);const S={};g&2&&(S.name="schema."+h[1]+".options.thumbs"),g&12289&&(S.$$scope={dirty:g,ctx:h}),d.$set(S)},i(h){p||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(u.$$.fragment,h),A(d.$$.fragment,h),p=!0)},o(h){P(i.$$.fragment,h),P(o.$$.fragment,h),P(u.$$.fragment,h),P(d.$$.fragment,h),p=!1},d(h){h&&w(e),j(i),j(o),j(u),j(d)}}}function fC(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=nC.slice();function o(){if(H.isEmpty(s.mimeTypes))return;const g=[];for(const v of s.mimeTypes)l.find(k=>k.mimeType===v)||g.push({mimeType:v});g.length&&t(2,l=l.concat(g))}function r(){s.maxSize=pt(this.value),t(0,s)}function a(){s.maxSelect=pt(this.value),t(0,s)}function u(g){n.$$.not_equal(s.mimeTypes,g)&&(s.mimeTypes=g,t(0,s))}const f=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},c=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},d=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},p=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function h(g){n.$$.not_equal(s.thumbs,g)&&(s.thumbs=g,t(0,s))}return n.$$set=g=>{"key"in g&&t(1,i=g.key),"options"in g&&t(0,s=g.options)},n.$$.update=()=>{n.$$.dirty&1&&(H.isEmpty(s)?t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]}):o())},[s,i,l,r,a,u,f,c,d,p,h]}class cC extends ye{constructor(e){super(),ve(this,e,fC,uC,he,{key:1,options:0})}}function dC(n){let e,t,i,s,l;return{c(){e=b("hr"),t=D(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,m(i,"type","button"),m(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){T(o,e,r),T(o,t,r),T(o,i,r),s||(l=Y(i,"click",n[10]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function pC(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[23],searchable:n[3].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3],$$slots:{afterOptions:[dC]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new is({props:u}),se.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("Collection"),s=D(),V(l.$$.fragment),m(e,"for",i=n[23])},m(f,c){T(f,e,c),_(e,t),T(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&m(e,"for",i);const d={};c&8388608&&(d.id=f[23]),c&8&&(d.searchable=f[3].length>5),c&8&&(d.items=f[3]),c&16777232&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function mC(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[23],items:n[6]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),l=new is({props:u}),se.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("Relation type"),s=D(),V(l.$$.fragment),m(e,"for",i=n[23])},m(f,c){T(f,e,c),_(e,t),T(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&m(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function xc(n){let e,t,i,s,l,o;return t=new me({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[hC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[gC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),i=D(),s=b("div"),V(l.$$.fragment),m(e,"class","col-sm-6"),m(s,"class","col-sm-6")},m(r,a){T(r,e,a),q(t,e,null),T(r,i,a),T(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&25165825&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&25165825&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function hC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Min select"),s=D(),l=b("input"),m(e,"for",i=n[23]),m(l,"type","number"),m(l,"id",o=n[23]),m(l,"step","1"),m(l,"min","1"),m(l,"placeholder","No min limit")},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[0].minSelect),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&m(e,"for",i),f&8388608&&o!==(o=u[23])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].minSelect&&fe(l,u[0].minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function gC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),s=D(),l=b("input"),m(e,"for",i=n[23]),m(l,"type","number"),m(l,"id",o=n[23]),m(l,"step","1"),m(l,"placeholder","No max limit"),m(l,"min",r=n[0].minSelect||2)},m(f,c){T(f,e,c),_(e,t),T(f,s,c),T(f,l,c),fe(l,n[0].maxSelect),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&m(e,"for",i),c&8388608&&o!==(o=f[23])&&m(l,"id",o),c&1&&r!==(r=f[0].minSelect||2)&&m(l,"min",r),c&1&&pt(l.value)!==f[0].maxSelect&&fe(l,f[0].maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function _C(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[15](h)}let p={multiple:!0,searchable:!0,id:n[23],selectPlaceholder:"Auto",items:n[5]};return n[0].displayFields!==void 0&&(p.selected=n[0].displayFields),r=new eu({props:p}),se.push(()=>ge(r,"selected",d)),{c(){e=b("label"),t=b("span"),t.textContent="Display fields",i=D(),s=b("i"),o=D(),V(r.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[23])},m(h,g){T(h,e,g),_(e,t),_(e,i),_(e,s),T(h,o,g),q(r,h,g),u=!0,f||(c=Ie(Ue.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(h,g){(!u||g&8388608&&l!==(l=h[23]))&&m(e,"for",l);const v={};g&8388608&&(v.id=h[23]),g&32&&(v.items=h[5]),!a&&g&1&&(a=!0,v.selected=h[0].displayFields,ke(()=>a=!1)),r.$set(v)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&w(e),h&&w(o),j(r,h),f=!1,c()}}}function bC(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[23],items:n[7]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new is({props:u}),se.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("Delete main record on relation delete"),s=D(),V(l.$$.fragment),m(e,"for",i=n[23])},m(f,c){T(f,e,c),_(e,t),T(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&m(e,"for",iLine truncated
(aka. not ${H.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(h,g){g[1]&4096&&t!==(t=h[43])&&m(e,"id",t),g[0]&1&&(e.checked=h[0].required),g[0]&1&&o!==(o=_s(h[0])+"")&&le(r,o),f&&Bt(f.update)&&g[0]&1&&f.update.call(null,{text:`Requires the field value to be ${_s(h[0])}
(aka. not ${H.zeroDefaultStr(h[0])}).`,position:"right"}),g[1]&4096&&c!==(c=h[43])&&m(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Pe(p)}}}function td(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[FC,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function FC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=B("Unique"),m(e,"type","checkbox"),m(e,"id",t=n[43]),m(s,"for",o=n[43])},m(u,f){T(u,e,f),e.checked=n[0].unique,T(u,i,f),T(u,s,f),_(s,l),r||(a=Y(e,"change",n[31]),r=!0)},p(u,f){f[1]&4096&&t!==(t=u[43])&&m(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&4096&&o!==(o=u[43])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function nd(n){let e,t,i,s,l,o,r,a,u,f;a=new ei({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[RC]},$$scope:{ctx:n}}});let c=n[8]&&id(n);return{c(){e=b("div"),t=b("div"),i=D(),s=b("div"),l=b("button"),o=b("i"),r=D(),V(a.$$.fragment),u=D(),c&&c.c(),m(t,"class","flex-fill"),m(o,"class","ri-more-line"),m(l,"type","button"),m(l,"aria-label","More"),m(l,"class","btn btn-circle btn-sm btn-transparent"),m(s,"class","inline-flex flex-gap-sm flex-nowrap"),m(e,"class","col-sm-4 txt-right")},m(d,p){T(d,e,p),_(e,t),_(e,i),_(e,s),_(s,l),_(l,o),_(l,r),q(a,l,null),_(s,u),c&&c.m(s,null),f=!0},p(d,p){const h={};p[1]&8192&&(h.$$scope={dirty:p,ctx:d}),a.$set(h),d[8]?c?c.p(d,p):(c=id(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function RC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Remove</span>',m(e,"type","button"),m(e,"class","dropdown-item txt-right")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function id(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Done</span>',m(e,"type","button"),m(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){T(s,e,l),t||(i=Y(e,"click",kn(n[3])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function qC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M,$;s=new me({props:{class:"form-field required "+(n[0].id?"readonly":""),name:"schema."+n[1]+".type",$$slots:{default:[wC,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[SC,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});const O=[LC,PC,IC,AC,EC,DC,OC,MC,$C,CC,TC],E=[];function I(F,R){return F[0].type==="text"?0:F[0].type==="number"?1:F[0].type==="bool"?2:F[0].type==="email"?3:F[0].type==="url"?4:F[0].type==="editor"?5:F[0].type==="date"?6:F[0].type==="select"?7:F[0].type==="json"?8:F[0].type==="file"?9:F[0].type==="relation"?10:-1}~(f=I(n))&&(c=E[f]=O[f](n)),h=new me({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[NC,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&td(n),N=!n[0].toDelete&&nd(n);return{c(){e=b("form"),t=b("div"),i=b("div"),V(s.$$.fragment),l=D(),o=b("div"),V(r.$$.fragment),a=D(),u=b("div"),c&&c.c(),d=D(),p=b("div"),V(h.$$.fragment),g=D(),v=b("div"),L&&L.c(),k=D(),N&&N.c(),y=D(),S=b("input"),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(u,"class","col-sm-12 hidden-empty"),m(p,"class","col-sm-4 flex"),m(v,"class","col-sm-4 flex"),m(t,"class","grid"),m(S,"type","submit"),m(S,"class","hidden"),m(S,"tabindex","-1"),m(e,"class","field-form")},m(F,R){T(F,e,R),_(e,t),_(t,i),q(s,i,null),_(t,l),_(t,o),q(r,o,null),_(t,a),_(t,u),~f&&E[f].m(u,null),_(t,d),_(t,p),q(h,p,null),_(t,g),_(t,v),L&&L.m(v,null),_(t,k),N&&N.m(t,null),_(e,y),_(e,S),C=!0,M||($=[Y(e,"dragstart",HC),Y(e,"submit",dt(n[32]))],M=!0)},p(F,R){const K={};R[0]&1&&(K.class="form-field required "+(F[0].id?"readonly":"")),R[0]&2&&(K.name="schema."+F[1]+".type"),R[0]&1|R[1]&12288&&(K.$$scope={dirty:R,ctx:F}),s.$set(K);const x={};R[0]&33&&(x.class=`
form-field
required
`+(F[5]?"":"invalid")+`
`+(F[0].id&&F[0].system?"disabled":"")+`
`),R[0]&2&&(x.name="schema."+F[1]+".name"),R[0]&33|R[1]&12288&&(x.$$scope={dirty:R,ctx:F}),r.$set(x);let U=f;f=I(F),f===U?~f&&E[f].p(F,R):(c&&(re(),P(E[U],1,1,()=>{E[U]=null}),ae()),~f?(c=E[f],c?c.p(F,R):(c=E[f]=O[f](F),c.c()),A(c,1),c.m(u,null)):c=null);const G={};R[0]&1|R[1]&12288&&(G.$$scope={dirty:R,ctx:F}),h.$set(G),F[0].type!=="file"?L?(L.p(F,R),R[0]&1&&A(L,1)):(L=td(F),L.c(),A(L,1),L.m(v,null)):L&&(re(),P(L,1,1,()=>{L=null}),ae()),F[0].toDelete?N&&(re(),P(N,1,1,()=>{N=null}),ae()):N?(N.p(F,R),R[0]&1&&A(N,1)):(N=nd(F),N.c(),A(N,1),N.m(t,null))},i(F){C||(A(s.$$.fragment,F),A(r.$$.fragment,F),A(c),A(h.$$.fragment,F),A(L),A(N),C=!0)},o(F){P(s.$$.fragment,F),P(r.$$.fragment,F),P(c),P(h.$$.fragment,F),P(L),P(N),C=!1},d(F){F&&w(e),j(s),j(r),~f&&E[f].d(),j(h),L&&L.d(),N&&N.d(),M=!1,Pe($)}}}function sd(n){let e,t,i,s,l=n[0].system&&ld(),o=!n[0].id&&od(n),r=n[0].required&&rd(n),a=n[0].unique&&ad();return{c(){e=b("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),m(e,"class","inline-flex")},m(u,f){T(u,e,f),l&&l.m(e,null),_(e,t),o&&o.m(e,null),_(e,i),r&&r.m(e,null),_(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=ld(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=od(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=rd(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ad(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function ld(n){let e;return{c(){e=b("span"),e.textContent="System",m(e,"class","label label-danger")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function od(n){let e;return{c(){e=b("span"),e.textContent="New",m(e,"class","label"),Q(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){T(t,e,i)},p(t,i){i[0]&257&&Q(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function rd(n){let e,t=_s(n[0])+"",i;return{c(){e=b("span"),i=B(t),m(e,"class","label label-success")},m(s,l){T(s,e,l),_(e,i)},p(s,l){l[0]&1&&t!==(t=_s(s[0])+"")&&le(i,t)},d(s){s&&w(e)}}}function ad(n){let e;return{c(){e=b("span"),e.textContent="Unique",m(e,"class","label label-success")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function ud(n){let e,t,i,s,l;return{c(){e=b("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){T(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function fd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',m(e,"type","button"),m(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){T(s,e,l),t||(i=Y(e,"click",kn(n[16])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function jC(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,p,h,g,v,k=!n[0].toDelete&&sd(n),y=n[7]&&!n[0].system&&ud(),S=n[0].toDelete&&fd(n);return{c(){e=b("div"),t=b("span"),i=b("i"),l=D(),o=b("strong"),a=B(r),f=D(),k&&k.c(),c=D(),d=b("div"),p=D(),y&&y.c(),h=D(),S&&S.c(),g=$e(),m(i,"class",s=Si(H.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),m(t,"class","icon field-type"),m(o,"class","title field-name svelte-1tpxlm5"),m(o,"title",u=n[0].name),Q(o,"txt-strikethrough",n[0].toDelete),m(e,"class","inline-flex"),m(d,"class","flex-fill")},m(C,M){T(C,e,M),_(e,t),_(t,i),_(e,l),_(e,o),_(o,a),T(C,f,M),k&&k.m(C,M),T(C,c,M),T(C,d,M),T(C,p,M),y&&y.m(C,M),T(C,h,M),S&&S.m(C,M),T(C,g,M),v=!0},p(C,M){(!v||M[0]&1&&s!==(s=Si(H.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&m(i,"class",s),(!v||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&le(a,r),(!v||M[0]&1&&u!==(u=C[0].name))&&m(o,"title",u),(!v||M[0]&1)&&Q(o,"txt-strikethrough",C[0].toDelete),C[0].toDelete?k&&(k.d(1),k=null):k?k.p(C,M):(k=sd(C),k.c(),k.m(c.parentNode,c)),C[7]&&!C[0].system?y?M[0]&129&&A(y,1):(y=ud(),y.c(),A(y,1),y.m(h.parentNode,h)):y&&(re(),P(y,1,1,()=>{y=null}),ae()),C[0].toDelete?S?S.p(C,M):(S=fd(C),S.c(),S.m(g.parentNode,g)):S&&(S.d(1),S=null)},i(C){v||(A(y),v=!0)},o(C){P(y),v=!1},d(C){C&&w(e),C&&w(f),k&&k.d(C),C&&w(c),C&&w(d),C&&w(p),y&&y.d(C),C&&w(h),S&&S.d(C),C&&w(g)}}}function VC(n){let e,t;const i=[{draggable:!0},{single:!0},{interactive:n[8]},{class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion"},n[11]];let s={$$slots:{header:[jC],default:[qC]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[33](e),e.$on("expand",n[34]),e.$on("collapse",n[35]),e.$on("toggle",n[36]),e.$on("dragenter",n[37]),e.$on("dragleave",n[38]),e.$on("dragstart",n[39]),e.$on("drop",n[40]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&2309?on(i,[i[0],i[1],o[0]&256&&{interactive:l[8]},o[0]&5&&{class:l[2]||l[0].toDelete||l[0].system?"field-accordion disabled":"field-accordion"},o[0]&2048&&xn(l[11])]):{};o[0]&483|o[1]&8192&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[33](null),j(e,l)}}}function _s(n){switch(n==null?void 0:n.type){case"bool":ret Line truncated
`),t=b("code"),t.textContent="username",i=B(` ,
`),s=b("code"),s.textContent="email",l=B(` ,
`),o=b("code"),o.textContent="emailVisibility",r=B(` ,
`),a=b("code"),a.textContent="verified",m(t,"class","txt-sm"),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm")},m(u,f){T(u,e,f),T(u,t,f),T(u,i,f),T(u,s,f),T(u,l,f),T(u,o,f),T(u,r,f),T(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function pd(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new BC({props:f}),se.push(()=>ge(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(c,d){T(c,t,d),q(i,c,d),l=!0},p(c,d){e=c;const p={};d&1&&(p.key=e[15]),d&3&&(p.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,p.field=e[13],ke(()=>s=!1)),i.$set(p)},i(c){l||(A(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function UC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=[],h=new Map,g,v,k,y,S,C,M,$,O,E,I,L=n[0].isAuth&&dd(),N=n[0].schema;const F=R=>R[13];for(let R=0;R<N.length;R+=1){let K=cd(n,N,R),x=F(K);h.set(x,p[R]=pd(x,K))}return{c(){e=b("div"),t=b("p"),i=B(`System fields:
`),s=b("code"),s.textContent="id",l=B(` ,
`),o=b("code"),o.textContent="created",r=B(` ,
`),a=b("code"),a.textContent="updated",u=D(),L&&L.c(),f=B(`
.`),c=D(),d=b("div");for(let R=0;R<p.length;R+=1)p[R].c();g=D(),v=b("div"),k=D(),y=b("button"),S=b("i"),C=D(),M=b("span"),M.textContent="New field",m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm"),m(t,"class","txt-sm"),m(e,"class","block m-b-25"),m(d,"class","accordions"),m(v,"class","clearfix m-t-xs"),m(S,"class","ri-add-line"),m(M,"class","txt"),m(y,"type","button"),m(y,"class",$="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(R,K){T(R,e,K),_(e,t),_(t,i),_(t,s),_(t,l),_(t,o),_(t,r),_(t,a),_(t,u),L&&L.m(t,null),_(t,f),T(R,c,K),T(R,d,K);for(let x=0;x<p.length;x+=1)p[x].m(d,null);T(R,g,K),T(R,v,K),T(R,k,K),T(R,y,K),_(y,S),_(y,C),_(y,M),O=!0,E||(I=Y(y,"click",n[3]),E=!0)},p(R,[K]){R[0].isAuth?L||(L=dd(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),K&55&&(N=R[0].schema,re(),p=wt(p,K,F,1,R,N,h,d,ln,pd,null,cd),ae()),(!O||K&1&&$!==($="btn btn-block "+(R[0].schema.length?"btn-transparent":"btn-secondary")))&&m(y,"class",$)},i(R){if(!O){for(let K=0;K<N.length;K+=1)A(p[K]);O=!0}},o(R){for(let K=0;K<p.length;K+=1)P(p[K]);O=!1},d(R){R&&w(e),L&&L.d(),R&&w(c),R&&w(d);for(let K=0;K<p.length;K+=1)p[K].d();R&&w(g),R&&w(v),R&&w(k),R&&w(y),E=!1,I()}}}function WC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function YC(n,e,t){let{collection:i=new pn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(v){i.schema[v]&&(i.schema.splice(v,1),t(0,i))}function r(){const v=new mn({name:a()});v.onMountExpand=!0,i.schema.push(v),t(0,i)}function a(v="field"){let k="";for(;u(v+k);)++k;return v+k}function u(v){return!!i.schema.find(k=>k.name===v)}function f(v){let k=[];if(v.toDelete)return k;for(let y of i.schema)y===v||y.toDelete||k.push(y.name);return k}function c(v,k){if(!v)return;v.dataTransfer.dropEffect="move";const y=parseInt(v.dataTransfer.getData("text/plain")),S=i.schema;y<k?(S.splice(k+1,0,S[y]),S.splice(y,1)):(S.splice(k,0,S[y]),S.splice(y+1,1)),t(0,i.schema=S,i)}function d(v,k,y,S){y[S]=v,t(0,i)}const p=v=>o(v),h=(v,k)=>WC(k==null?void 0:k.detail,v),g=(v,k)=>c(k==null?void 0:k.detail,v);return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new pn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,p,h,g]}class KC extends ye{constructor(e){super(),ve(this,e,YC,UC,he,{collection:0})}}const JC=n=>({isAdminOnly:n&256}),md=n=>({isAdminOnly:n[8]});function ZC(n){let e,t;return e=new me({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[xC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function GC(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',m(e,"class","txt-center")},m(t,i){T(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function XC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-5uq9tk")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function QC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-5uq9tk")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function xC(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,p,h,g;function v(E,I){return E[8]?QC:XC}let k=v(n),y=k(n);function S(E){n[13](E)}var C=n[6];function M(E){let I={id:E[17],baseCollection:E[1],disabled:E[8],placeholder:E[8]?"":"Leave empty to grant everyone access..."};return E[0]!==void 0&&(I.value=E[0]),{props:I}}C&&(c=jt(C,M(n)),n[12](c),se.push(()=>ge(c,"value",S)));const $=n[11].default,O=Nt($,n,n[14],md);return{c(){e=b("label"),t=b("span"),i=B(n[2]),s=D(),l=b("span"),r=B(o),a=D(),y.c(),f=D(),c&&V(c.$$.fragment),p=D(),h=b("div"),O&&O.c(),m(t,"class","txt"),Q(t,"txt-hint",n[8]),m(l,"class","label label-sm svelte-5uq9tk"),m(e,"for",u=n[17]),m(e,"class","svelte-5uq9tk"),m(h,"class","help-block")},m(E,I){T(E,e,I),_(e,t),_(t,i),_(e,s),_(e,l),_(l,r),_(e,a),y.m(e,null),T(E,f,I),c&&q(c,E,I),T(E,p,I),T(E,h,I),O&&O.m(h,null),g=!0},p(E,I){(!g||I&4)&&le(i,E[2]),(!g||I&256)&&Q(t,"txt-hint",E[8]),(!g||I&256)&&o!==(o=E[8]?"Admins only":"Custom rule")&&le(r,o),k===(k=v(E))&&y?y.p(E,I):(y.d(1),y=k(E),y&&(y.c(),y.m(e,null))),(!g||I&131072&&u!==(u=E[17]))&&m(e,"for",u);const L={};if(I&131072&&(L.id=E[17]),I&2&&(L.baseCollection=E[1]),I&256&&(L.disabled=E[8]),I&256&&(L.placeholder=E[8]?"":"Leave empty to grant everyone access..."),!d&&I&1&&(d=!0,L.value=E[0],ke(()=>d=!1)),C!==(C=E[6])){if(c){re();const N=c;P(N.$$.fragment,1,0,()=>{j(N,1)}),ae()}C?(c=jt(C,M(E)),E[12](c),se.push(()=>ge(c,"value",S)),V(c.$$.fragment),A(c.$$.fragment,1),q(c,p.parentNode,p)):c=null}else C&&c.$set(L);O&&O.p&&(!g||I&16640)&&Rt(O,$,E,E[14],g?Ft($,E[14],I,JC):qt(E[14]),md)},i(E){g||(c&&A(c.$$.fragment,E),A(O,E),g=!0)},o(E){c&&P(c.$$.fragment,E),P(O,E),g=!1},d(E){E&&w(e),y.d(),E&&w(f),n[12](null),c&&j(c,E),E&&w(p),E&&w(h),O&&O.d(E)}}}function e$(n){let e,t,i,s;const l=[GC,ZC],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=$e()},m(a,u){o[e].m(a,u),T(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let hd;function t$(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,p=hd,h=!1;g();async function g(){p||h||(t(7,h=!0),t(6,p=(await rt(()=>import("./FilterAutocompleteInput-6bd00cc5.js"),["./FilterAutocompleteInput-6bd00cc5.js","./index-a6ccb683.js"],import.meta.url)).default),hd=p,t(7,h=!1))}async function v(){t(0,r=d||""),await sn(),c==null||c.focus()}async function k(){d=r,t(0,r=null)}function y(C){se[C?"unshift":"push"](()=>{c=C,t(5,c)})}function S(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),"$$scope"in C&&t(14,l=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,p,h,i,v,k,s,y,S,l]}class Ts extends ye{constructor(e){super(),ve(this,e,t$,e$,he,{collection:1,rule:0,label:2,formKey:3,required:4})}}function gd(n,e,t){const i=n.slice();return i[10]=e[t],i}function _d(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M,$,O,E,I=n[2],L=[];for(let N=0;N<I.length;N+=1)L[N]=bd(gd(n,I,N));return{c(){e=b("div"),t=b("div"),i=b("div"),s=b("p"),s.textContent="The following record fields are available:",l=D(),o=b("div");for(let N=0;N<L.length;N+=1)L[N].c();r=D(),a=b("hr"),u=D(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=D(),d=b("div"),d.innerHTML=`<code>@request.headers.*</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,p=D(),h=b("hr"),g=D(),v=b("p"),v.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=D(),y=b("div"),y.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",S=D(),C=b("hr"),M=D(),$=b("p"),$.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,m(s,"class","m-b-0"),m(o,"class","inline-flex flex-gap-5"),m(a,"class","m-t-10 m-b-5"),m(f,"class","m-b-0"),m(d,"class","inline-flex flex-gap-5"),m(h,"class","m-t-10 m-b-5"),m(v,"class","m-b-0"),m(y,"class","inline-flex flex-gap-5"),m(C,"class","m-t-10 m-b-5"),m(i,"class","content"),m(t,"class","alert alert-warning m-0")},m(N,F){T(N,e,F),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o);for(let R=0;R<L.length;R+=1)L[R].m(o,null);_(i,r),_(i,a),_(i,u),_(i,f),_(i,c),_(i,d),_(i,p),_(i,h),_(i,g),_(i,v),_(i,k),_(i,y),_(i,S),_(i,C),_(i,M),_(i,$),E=!0},p(N,F){if(F&4){I=N[2];let R;for(R=0;R<I.length;R+=1){const K=gd(N,I,R);L[R]?L[R].p(K,F):(L[R]=bd(K),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=I.length}},i(N){E||(N&&Ge(()=>{O||(O=qe(e,St,{duration:150},!0)),O.run(1)}),E=!0)},o(N){N&&(O||(O=qe(e,St,{duration:150},!1)),O.run(0)),E=!1},d(N){N&&w(e),ht(L,N),N&&O&&O.end()}}}function bd(n){let e,t=n[10]+"",i;return{c(){e=b("code"),i=B(t)},m(s,l){T(s,e,l),_(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function vd(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;function v($){n[6]($)}let k={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(k.rule=n[0].createRule),i=new Ts({props:k}),se.push(()=>ge(i,"rule",v));function y($){n[7]($)}let S={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(S.rule=n[0].updateRule),a=new Ts({props:S}),se.push(()=>ge(a,"rule",y));function C($){n[8]($)}let M={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(M.rule=n[0].deleteRule),p=new Ts({props:M}),se.push(()=>ge(p,"rule",C)),{c(){e=b("hr"),t=D(),V(i.$$.fragment),l=D(),o=b("hr"),r=D(),V(a.$$.fragment),f=D(),c=b("hr"),d=D(),V(p.$$.fragment)},m($,O){T($,e,O),T($,t,O),q(i,$,O),T($,l,O),T($,o,O),T($,r,O),q(a,$,O),T($,f,O),T($,c,O),T($,d,O),q(p,$,O),g=!0},p($,O){const E={};O&1&&(E.collection=$[0]),!s&&O&1&&(s=!0,E.rule=$[0].createRule,ke(()=>s=!1)),i.$set(E);const I={};O&1&&(I.collection=$[0]),!u&&O&1&&(u=!0,I.rule=$[0].updateRule,ke(()=>u=!1)),a.$set(I);const L={};O&1&&(L.collection=$[0]),!h&&O&1&&(h=!0,L.rule=$[0].deleteRule,ke(()=>h=!1)),p.$set(L)},i($){g||(A(i.$$.fragment,$),A(a.$$.fragment,$),A(p.$$.fragment,$),g=!0)},o($){P(i.$$.fragment,$),P(a.$$.fragment,$),P(p.$$.fragment,$),g=!1},d($){$&&w(e),$&&w(t),j(i,$),$&&w(l),$&&w(o),$&&w(r),j(a,$),$&&w(f),$&&w(c),$&&w(d),j(p,$)}}}function yd(n){let e,t,i,s,l;function o(a){n[9](a)}let r={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[n$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new Ts({props:r}),se.push(()=>ge(i,"rule",o)),{c(){e=b("hr"),t=D(),V(i.$$.fragment)},m(a,u){T(a,e,u),T(a,t,u),q(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&8192&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,ke(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function n$(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=D(),i=b("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){T(s,e,l),T(s,t,l),T(s,i,l)},p:X,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function i$(n){var K,x;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,p,h,g,v,k,y,S,C,M,$,O=n[1]&&_d(n);function E(U){n[4](U)}let I={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(I.rule=n[0].listRule),f=new Ts({props:I}),se.push(()=>ge(f,"rule",E));function L(U){n[5](U)}let N={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(N.rule=n[0].viewRule),g=new Ts({props:N}),se.push(()=>ge(g,"rule",L));let F=!((K=n[0])!=null&&K.isView)&&vd(n),R=((x=n[0])==null?void 0:x.isAuth)&&yd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=D(),l=b("button"),r=B(o),a=D(),O&&O.c(),u=D(),V(f.$$.fragment),d=D(),p=b("hr"),h=D(),V(g.$$.fragment),k=D(),F&&F.c(),y=D(),R&&R.c(),S=$e(),m(l,"type","button"),m(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),m(t,"class","flex txt-sm txt-hint m-b-5"),m(e,"class","block m-b-base handle"),Q(e,"fade",!n[1])},m(U,G){T(U,e,G),_(e,t),_(t,i),_(t,s),_(t,l),_(l,r),_(e,a),O&&O.m(e,null),T(U,u,G),q(f,U,G),T(U,d,G),T(U,p,G),T(U,h,G),q(g,U,G),T(U,k,G),F&&F.m(U,G),T(U,y,G),R&&R.m(U,G),T(U,S,G),C=!0,M||($=Y(l,"click",n[3]),M=!0)},p(U,[G]){var ue,Z;(!C||G&2)&&o!==(o=U[1]?"Hide available fields":"Show available fields")&&le(r,o),U[1]?O?(O.p(U,G),G&2&&A(O,1)):(O=_d(U),O.c(),A(O,1),O.m(e,null)):O&&(re(),P(O,1,1,()=>{O=null}),ae()),(!C||G&2)&&Q(e,"fade",!U[1]);const ne={};G&1&&(ne.collection=U[0]),!c&&G&1&&(c=!0,ne.rule=U[0].listRule,ke(()=>c=!1)),f.$set(ne);const J={};G&1&&(J.collection=U[0]),!v&&G&1&&(v=!0,J.rule=U[0].viewRule,ke(()=>v=!1)),g.$set(J),(ue=U[0])!=null&&ue.isView?F&&(re(),P(F,1,1,()=>{F=null}),ae()):F?(F.p(U,G),G&1&&A(F,1)):(F=vd(U),F.c(),A(F,1),F.m(y.parentNode,y)),(Z=U[0])!=null&&Z.isAuth?R?(R.p(U,G),G&1&&A(R,1)):(R=yd(U),R.c(),A(R,1),R.m(S.parentNode,S)):R&&(re(),P(R,1,1,()=>{R=null}),ae())},i(U){C||(A(O),A(f.$$.fragment,U),A(g.$$.fragment,U),A(F),A(R),C=!0)},o(U){P(O),P(f.$$.fragment,U),P(g.$$.fragment,U),P(F),P(R),C=!1},d(U){U&&w(e),O&&O.d(),U&&w(u),j(f,U),U&&w(d),U&&w(p),U&&w(h),j(g,U),U&&w(k),F&&F.d(U),U&&w(y),R&&R.d(U),U&&w(S),M=!1,$()}}}function s$(n,e,t){let i,{collection:s=new pn}=e,l=!1;const o=()=>t(1,l=!l);function r(p){n.$$.not_equal(s.listRule,p)&&(s.listRule=p,t(0,s))}function a(p){n.$$.not_equal(s.viewRule,p)&&(s.viewRule=p,t(0,s))}function u(p){n.$$.not_equal(s.createRule,p)&&(s.createRule=p,t(0,s))}function f(p){n.$$.not_equal(s.updateRule,p)&&(s.updateRule=p,t(0,s))}function c(p){n.$$.not_equal(s.deleteRule,p)&&(s.deleteRule=p,t(0,s))}function d(p){n.$$.not_equal(s.options.manageRule,p)&&(s.options.manageRule=p,t(0,s))}return n.$$set=p=>{"collection"in p&&t(0,s=p.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class l$ extends ye{constructor(e){super(),ve(this,e,s$,i$,he,{collection:0})}}function kd(n,e,t){const i=n.slice();return i[9]=e[t],i}function o$(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=jt(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=$e()},m(a,u){e&&q(e,a,u),T(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),o!==(o=a[1])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("change",a[6]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function r$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,m(e,"rows","7"),m(e,"placeholder","Loading...")},m(t,i){T(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function wd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Sd(kd(n,i,l));return{c(){e=b("div"),t=b("div");for(let l=0;l<s.length;l+=1)s[l].c();m(t,"class","content"),m(e,"class","help-block help-block-error")},m(l,o){T(l,e,o),_(e,t);for(let r=0;r<s.length;r+=1)s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=kd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Sd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),ht(s,l)}}}function Sd(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=B(t)},m(s,l){T(s,e,l),_(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function a$(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[r$,o$],p=[];function h(v,k){return v[2]?0:1}l=h(n),o=p[l]=d[l](n);let g=n[3].length&&wd(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",s=D(),o.c(),r=D(),a=b("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li>
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=D(),g&&g.c(),f=$e(),m(t,"class","txt"),m(e,"for",i=n[8]),m(a,"class","help-block")},m(v,k){T(v,e,k),_(e,t),T(v,s,k),p[l].m(v,k),T(v,r,k),T(v,a,k),T(v,u,k),g&&g.m(v,k),T(v,f,k),c=!0},p(v,k){(!c||k&256&&i!==(i=v[8]))&&m(e,"for",i);let y=l;l=h(v),l===y?p[l].p(v,k):(re(),P(p[y],1,1,()=>{p[y]=null}),ae(),o=p[l],o?o.p(v,k):(o=p[l]=d[l](v),o.c()),A(o,1),o.m(r.parentNode,r)),v[3].length?g?g.p(v,k):(g=wd(v),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(v){c||(A(o),c=!0)},o(v){P(o),c=!1},d(v){v&&w(e),v&&w(s),p[l].d(v),v&&w(r),v&&w(a),v&&w(u),g&&g.d(v),v&&w(f)}}}function u$(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[a$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function f$(n,e,t){let i;Ye(n,fi,c=>t(4,i=c));let{collection:s=new pn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=H.getNestedVal(c,"schema",null);if(H.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const p=H.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);H.removeByValue(p,"id"),H.removeByValue(p,"created"),H.removeByValue(p,"updated");for(let g in d)for(let v in d[g]){const k=d[g][v].message,y=p[g]||g;r.push(H.sentenize(y+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-afa58a50.js"),["./CodeEditor-afa58a50.js","./index-a6ccb683.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&Qi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class c$ extends ye{constructor(e){super(),ve(this,e,f$,u$,he,{collection:0})}}function d$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){T(u,e,f),e.checked=n[0].options.allowUsernameAuth,T(u,i,f),T(u,s,f),_(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function p$(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[d$,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function m$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function h$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function Td(n){let e,t,i,s,l;return{c(){e=b("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){T(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function g$(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowUsernameAuth?h$:m$}let u=a(n),f=u(n),c=n[3]&&Td();return{c(){e=b("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=D(),i=b("div"),s=D(),f.c(),l=D(),c&&c.c(),o=$e(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){T(d,e,p),T(d,t,p),T(d,i,p),T(d,s,p),f.m(d,p),T(d,l,p),c&&c.m(d,p),T(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?p&8&&A(c,1):(c=Td(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function _$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){T(u,e,f),e.checked=n[0].options.allowEmailAuth,T(u,i,f),T(u,s,f),_(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(H.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[b$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(H.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[v$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=D(),l=b("div"),V(o.$$.fragment),m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(e,"class","grid grid-sm p-t-sm")},m(u,f){T(u,e,f),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(H.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 "+(H.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&&Ge(()=>{r||(r=qe(e,St,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=qe(e,St,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function b$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(v){n[7](v)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Ns({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=D(),s=b("i"),o=D(),V(r.$$.fragment),u=D(),f=b("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(v,k){T(v,e,k),_(e,t),_(e,i),_(e,s),T(v,o,k),q(r,v,k),T(v,u,k),T(v,f,k),c=!0,d||(p=Ie(Ue.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&m(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!H.isEmpty(v[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,p()}}}function v$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(v){n[8](v)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Ns({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=D(),s=b("i"),o=D(),V(r.$$.fragment),u=D(),f=b("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(v,k){T(v,e,k),_(e,t),_(e,i),_(e,s),T(v,o,k),q(r,v,k),T(v,u,k),T(v,f,k),c=!0,d||(p=Ie(Ue.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&m(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!H.isEmpty(v[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,p()}}}function y$(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[_$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Cd(n);return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=$e()},m(o,r){q(e,o,r),T(o,t,r),l&&l.m(o,r),T(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Cd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function k$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function w$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function $d(n){let e,t,i,s,l;return{c(){e=b("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){T(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function S$(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowEmailAuth?w$:k$}let u=a(n),f=u(n),c=n[2]&&$d();return{c(){e=b("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=b("div"),s=D(),f.c(),l=D(),c&&c.c(),o=$e(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){T(d,e,p),T(d,t,p),T(d,i,p),T(d,s,p),f.m(d,p),T(d,l,p),c&&c.m(d,p),T(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?p&4&&A(c,1):(c=$d(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function T$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){T(u,e,f),e.checked=n[0].options.allowOAuth2Auth,T(u,i,f),T(u,s,f),_(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Md(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',m(e,"class","block")},m(s,l){T(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,St,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,St,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function C$(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[T$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Md();return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=$e()},m(o,r){q(e,o,r),T(o,t,r),l&&l.m(o,r),T(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Md(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function $$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function M$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function Od(n){let e,t,i,s,l;return{c(){e=b("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){T(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function O$(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowOAuth2Auth?M$:$$}let u=a(n),f=u(n),c=n[1]&&Od();return{c(){e=b("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=b("div"),s=D(),f.c(),l=D(),c&&c.c(),o=$e(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){T(d,e,p),T(d,t,p),T(d,i,p),T(d,s,p),f.m(d,p),T(d,l,p),c&&c.m(d,p),T(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?p&2&&A(c,1):(c=Od(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function D$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Minimum password length"),s=D(),l=b("input"),m(e,"for",i=n[12]),m(l,"type","number"),m(l,"id",o=n[12]),l.required=!0,m(l,"min","6"),m(l,"max","72")},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&m(e,"for",i),f&4096&&o!==(o=u[12])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&fe(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function E$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=D(),s=b("label"),l=b("span"),l.textContent="Always require email",o=D(),r=b("i"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(l,"class","txt"),m(r,"class","ri-information-line txt-sm link-hint"),m(s,"for",a=n[12])},m(c,d){T(c,e,d),e.checked=n[0].options.requireEmail,T(c,i,d),T(c,s,d),_(s,l),_(s,o),_(s,r),u||(f=[Y(e,"change",n[11]),Ie(Ue.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])&&m(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&m(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function A$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k;return s=new ks({props:{single:!0,$$slots:{header:[g$],default:[p$]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[S$],default:[y$]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[O$],default:[C$]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[D$,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),v=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[E$,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=D(),i=b("div"),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),f=b("hr"),c=D(),d=b("h4"),d.textContent="General",p=D(),V(h.$$.fragment),g=D(),V(v.$$.fragment),m(e,"class","section-title"),m(i,"class","accordions"),m(d,"class","section-title")},m(y,S){T(y,e,S),T(y,t,S),T(y,i,S),q(s,i,null),_(i,l),q(o,i,null),_(i,r),q(a,i,null),T(y,u,S),T(y,f,S),T(y,c,S),T(y,d,S),T(y,p,S),q(h,y,S),T(y,g,S),q(v,y,S),k=!0},p(y,[S]){const C={};S&8201&&(C.$$scope={dirty:S,ctx:y}),s.$set(C);const M={};S&8197&&(M.$$scope={dirty:S,ctx:y}),o.$set(M);const $={};S&8195&&($.$$scope={dirty:S,ctx:y}),a.$set($);const O={};S&12289&&(O.$$scope={dirty:S,ctx:y}),h.$set(O);const E={};S&12289&&(E.$$scope={dirty:S,ctx:y}),v.$set(E)},i(y){k||(A(s.$$.fragment,y),A(o.$$.fragment,y),A(a.$$.fragment,y),A(h.$$.fragment,y),A(v.$$.fragment,y),k=!0)},o(y){P(s.$$.fragment,y),P(o.$$.fragment,y),P(a.$$.fragment,y),P(h.$$.fragment,y),P(v.$$.fragment,y),k=!1},d(y){y&&w(e),y&&w(t),y&&w(i),j(s),j(o),j(a),y&&w(u),y&&w(f),y&&w(c),y&&w(d),y&&w(p),j(h,y),y&&w(g),j(v,y)}}}function I$(n,e,t){let i,s,l,o;Ye(n,fi,g=>t(4,o=g));let{collection:r=new pn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function p(){r.options.minPasswordLength=pt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,v,k,y;n.$$.dirty&1&&r.isAuth&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!H.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!H.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!H.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!H.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,p,h]}class P$ extends ye{constructor(e){super(),ve(this,e,I$,A$,he,{collection:0})}}function Dd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ed(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ad(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function Id(n){var r;let e,t,i,s,l=n[2]&&Pd(n),o=!((r=n[1])!=null&&r.isView)&&Ld(n);return{c(){e=b("h6"),e.textContent="Changes:",t=D(),i=b("ul"),l&&l.c(),s=D(),o&&o.c(),m(i,"class","changes-list svelte-1ghly2p")},m(a,u){T(a,e,u),T(a,t,u),T(a,i,u),l&&l.m(i,null),_(i,s),o&&o.m(i,null)},p(a,u){var f;a[2]?l?l.p(a,u):(l=Pd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[1])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Ld(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d(),o&&o.d()}}}function Pd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=b("li"),t=b("div"),i=B(`Renamed collection
`),s=b("strong"),o=B(l),r=D(),a=b("i"),u=D(),f=b("strong"),d=B(c),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex")},m(p,h){T(p,e,h),_(e,t),_(t,i),_(t,s),_(s,o),_(t,r),_(t,a),_(t,u),_(t,f),_(f,d)},p(p,h){h&2&&l!==(l=p[1].originalName+"")&&le(o,l),h&2&&c!==(c=p[1].name+"")&&le(d,c)},d(p){p&&w(e)}}}function Ld(n){let e,t,i=n[5],s=[];for(let r=0;r<i.length;r+=1)s[r]=Nd(Ed(n,i,r));let l=n[4],o=[];for(let r=0;r<l.length;r+=1)o[r]=Fd(Dd(n,l,r));return{c(){for(let r=0;r<s.length;r+=1)s[r].c();e=D();for(let r=0;r<o.length;r+=1)o[r].c();t=$e()},m(r,a){for(let u=0;u<s.length;u+=1)s[u].m(r,a);T(r,e,a);for(let u=0;u<o.length;u+=1)o[u].m(r,a);T(r,t,a)},p(r,a){if(a&32){i=r[5];let u;for(u=0;u<i.length;u+=1){const f=Ed(r,i,u);s[u]?s[u].p(f,a):(s[u]=Nd(f),s[u].c(),s[u].m(e.parentNode,e))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}if(a&16){l=r[4];let u;for(u=0;u<l.length;u+=1){const f=Dd(r,l,u);o[u]?o[u].p(f,a):(o[u]=Fd(f),o[u].c(),o[u].m(t.parentNode,t))}for(;u<o.length;u+=1)o[u].d(1);o.length=l.length}},d(r){ht(s,r),r&&w(e),ht(o,r),r&&w(t)}}}function Nd(n){let e,t,i,s,l=n[15].originalName+"",o,r,a,u,f,c=n[15].name+"",d;return{c(){e=b("li"),t=b("div"),i=B(`Renamed field
`),s=b("strong"),o=B(l),r=D(),a=b("i"),u=D(),f=b("strong"),d=B(c),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex")},m(p,h){T(p,e,h),_(e,t),_(t,i),_(t,s),_(s,o),_(t,r),_(t,a),_(t,u),_(t,f),_(f,d)},p(p,h){h&32&&l!==(l=p[15].originalName+"")&&le(o,l),h&32&&c!==(c=p[15].name+"")&&le(d,c)},d(p){p&&w(e)}}}function Fd(n){let e,t,i,s=n[15].name+"",l,o;return{c(){e=b("li"),t=B("Removed field "),i=b("span"),l=B(s),o=D(),m(i,"class","txt-bold"),m(e,"class","txt-danger")},m(r,a){T(r,e,a),_(e,t),_(e,i),_(i,l),_(e,o)},p(r,a){a&16&&s!==(s=r[15].name+"")&&le(l,s)},d(r){r&&w(e)}}}function L$(n){let e,t,i,s,l,o,r,a,u=n[4].length&&Ad(),f=n[6]&&Id(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=b("div"),l=b("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=D(),u&&u.c(),r=D(),f&&f.c(),a=$e(),m(t,"class","icon"),m(s,"class","content txt-bold"),m(e,"class","alert alert-warning")},m(c,d){T(c,e,d),_(e,t),_(e,i),_(e,s),_(s,l),_(s,o),u&&u.m(s,null),T(c,r,d),f&&f.m(c,d),T(c,a,d)},p(c,d){c[4].length?u||(u=Ad(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[6]?f?f.p(c,d):(f=Id(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function N$(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function F$(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn btn-expanded")},m(o,r){T(o,e,r),T(o,t,r),T(o,i,r),e.focus(),s||(l=[Y(e,"click",n[9]),Y(i,"click",n[10])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function R$(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[F$],header:[N$],default:[L$]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&1048694&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function q$(n,e,t){let i,s,l,o;const r=Mt();let a,u;async function f(y){t(1,u=y),await sn(),!i&&!s.length&&!l.length?d():a==null||a.show()}function c(){a==null||a.hide()}function d(){c(),r("confirm")}const p=()=>c(),h=()=>d();function g(y){se[y?"unshift":"push"](()=>{a=y,t(3,a)})}function v(y){ze.call(this,n,y)}function k(y){ze.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=(u==null?void 0:u.originalName)!=(u==null?void 0:u.name)),n.$$.dirty&2&&t(5,s=(u==null?void 0:u.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(4,l=(u==null?void 0:u.schema.filter(y=>y.id&&y.toDelete))||[]),n.$$.dirty&6&&t(6,o=i||!(u!=null&&u.isView))},[c,u,i,a,l,s,o,d,f,p,h,g,v,k]}class j$ extends ye{constructor(e){super(),ve(this,e,q$,R$,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Rd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function V$(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new KC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function H$(n){let e,t,i;function s(o){n[31](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new c$({props:l}),se.push(()=>ge(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function qd(n){let e,t,i,s;function l(r){n[33](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new l$({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=b("div"),V(t.$$.fragment),m(e,"class","tab-item active")},m(r,a){T(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function jd(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new P$({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=b("div"),V(t.$$.fragment),m(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){T(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Es)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function z$(n){let e,t,i,s,l,o,r;const a=[H$,V$],u=[];function f(p,h){return p[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===bl&&qd(n),d=n[2].isAuth&&jd(n);return{c(){e=b("div"),t=b("div"),s.c(),l=D(),c&&c.c(),o=D(),d&&d.c(),m(t,"class","tab-item"),Q(t,"active",n[3]===yi),m(e,"class","tabs-content svelte-12y0yzb")},m(p,h){T(p,e,h),_(e,t),u[i].m(t,null),_(e,l),c&&c.m(e,null),_(e,o),d&&d.m(e,null),r=!0},p(p,h){let g=i;i=f(p),i===g?u[i].p(p,h):(re(),P(u[g],1,1,()=>{u[g]=null}),ae(),s=u[i],s?s.p(p,h):(s=u[i]=a[i](p),s.c()),A(s,1),s.m(t,null)),(!r||h[0]&8)&&Q(t,"active",p[3]===yi),p[3]===bl?c?(c.p(p,h),h[0]&8&&A(c,1)):(c=qd(p),c.c(),A(c,1),c.m(e,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae()),p[2].isAuth?d?(d.p(p,h),h[0]&4&&A(d,1)):(d=jd(p),d.c(),A(d,1),d.m(e,null)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(s),A(c),A(d),r=!0)},o(p){P(s),P(c),P(d),r=!1},d(p){p&&w(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Vd(n){let e,t,i,s,l,o,r;return o=new ei({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[B$]},$$scope:{ctx:n}}Line truncated
<span class="txt">Duplicate</span>`,t=D(),i=b("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable"),m(i,"type","button"),m(i,"class","dropdown-item txt-danger closable")},m(o,r){T(o,e,r),T(o,t,r),T(o,i,r),s||(l=[Y(e,"click",n[23]),Y(i,"click",kn(dt(n[24])))],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function Hd(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[U$]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=D(),V(i.$$.fragment),m(e,"class","ri-arrow-down-s-fill")},m(l,o){T(l,e,o),T(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function zd(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[26](n[47])}return{c(){e=b("button"),t=b("i"),s=D(),l=b("span"),r=B(o),a=B(" collection"),u=D(),m(t,"class",i=Si(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),m(l,"class","txt"),m(e,"type","button"),m(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(p,h){T(p,e,h),_(e,t),_(e,s),_(e,l),_(l,r),_(l,a),_(e,u),f||(c=Y(e,"click",d),f=!0)},p(p,h){n=p,h[0]&64&&i!==(i=Si(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&m(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(p){p&&w(e),f=!1,c()}}}function U$(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=zd(Rd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=$e()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);T(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=Rd(s,t,o);i[o]?i[o].p(r,l):(i[o]=zd(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function Bd(n){let e;return{c(){e=b("div"),e.textContent="System collection",m(e,"class","help-block")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function W$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k=(n[6][n[2].type]||"N/A")+"",y,S,C,M,$,O,E,I,L,N=n[2].isNew&&Hd(n),F=n[2].system&&Bd();return{c(){e=b("label"),t=B("Name"),s=D(),l=b("input"),f=D(),c=b("div"),d=b("button"),p=b("span"),h=D(),g=b("span"),v=B("Type: "),y=B(k),S=D(),N&&N.c(),$=D(),F&&F.c(),O=$e(),m(e,"for",i=n[46]),m(l,"type","text"),m(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],m(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,m(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,m(g,"class","txt"),m(d,"type","button"),m(d,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,m(c,"class","form-field-addon")},m(R,K){T(R,e,K),_(e,t),T(R,s,K),T(R,l,K),T(R,f,K),T(R,c,K),_(c,d),_(d,p),_(d,h),_(d,g),_(g,v),_(g,y),_(d,S),N&&N.m(d,null),T(R,$,K),F&&F.m(R,K),T(R,O,K),E=!0,n[2].isNew&&l.focus(),I||(L=Y(l,"input",n[25]),I=!0)},p(R,K){(!E||K[1]&32768&&i!==(i=R[46]))&&m(e,"for",i),(!E||K[1]&32768&&o!==(o=R[46]))&&m(l,"id",o),(!E||K[0]&8192)&&(l.disabled=R[13]),(!E||K[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!E||K[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&m(l,"placeholder",a),(!E||K[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!E||K[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&le(y,k),R[2].isNew?N?(N.p(R,K),K[0]&4&&A(N,1)):(N=Hd(R),N.c(),A(N,1),N.m(d,null)):N&&(re(),P(N,1,1,()=>{N=null}),ae()),(!E||K[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&m(d,"class",C),(!E||K[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?F||(F=Bd(),F.c(),F.m(O.parentNode,O)):F&&(F.d(1),F=null)},i(R){E||(A(N),E=!0)},o(R){P(N),E=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),N&&N.d(),R&&w($),F&&F.d(R),R&&w(O),I=!1,L()}}}function Ud(n){let e,t,i,s,l,o;return{c(){e=b("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(r,a){T(r,e,a),s=!0,l||(o=Ie(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Ge(()=>{i||(i=qe(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=qe(e,It,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function Wd(n){let e,t,i,s,l;return{c(){e=b("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){T(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Yd(n){var a,u,f;let e,t,i,s=!H.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&Kd();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=D(),r&&r.c(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(c,d){T(c,e,d),_(e,t),_(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[30]),l=!0)},p(c,d){var p,h,g;d[0]&32&&(s=!H.isEmpty((p=c[5])==null?void 0:p.options)&&!((g=(h=Line truncated
<span class="txt">New collection</span>`,m(t,"type","button"),m(t,"class","btn btn-block btn-outline"),m(e,"class","sidebar-footer")},m(l,o){T(l,e,o),_(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function X$(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],p=new Map,h,g,v,k,y,S,C=n[3];const M=I=>I[15].id;for(let I=0;I<C.length;I+=1){let L=Gd(n,C,I),N=M(L);p.set(N,d[I]=xd(N,L))}let $=null;C.length||($=Xd(n));let O=!n[7]&&ep(n),E={};return v=new nu({props:E}),n[13](v),v.$on("save",n[14]),{c(){e=b("aside"),t=b("header"),i=b("div"),s=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=b("input"),a=D(),u=b("hr"),f=D(),c=b("div");for(let I=0;I<d.length;I+=1)d[I].c();$&&$.c(),h=D(),O&&O.c(),g=D(),V(v.$$.fragment),m(l,"type","button"),m(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[4]),m(s,"class","form-field-addon"),m(r,"type","text"),m(r,"placeholder","Search collections..."),m(i,"class","form-field search"),Q(i,"active",n[4]),m(t,"class","sidebar-header"),m(u,"class","m-t-5 m-b-xs"),m(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),m(e,"class","page-sidebar collection-sidebar")},m(I,L){T(I,e,L),_(e,t),_(t,i),_(i,s),_(s,l),_(i,o),_(i,r),fe(r,n[0]),_(e,a),_(e,u),_(e,f),_(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);$&&$.m(c,null),_(e,h),O&&O.m(e,null),T(I,g,L),q(v,I,L),k=!0,y||(S=[Y(l,"click",n[10]),Y(r,"input",n[11])],y=!0)},p(I,[L]){(!k||L&16)&&Q(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&fe(r,I[0]),(!k||L&16)&&Q(i,"active",I[4]),L&42&&(C=I[3],d=wt(d,L,M,1,I,C,p,c,es,xd,null,Gd),!C.length&&$?$.p(I,L):C.length?$&&($.d(1),$=null):($=Xd(I),$.c(),$.m(c,null))),(!k||L&64)&&Q(c,"fade",I[6]),(!k||L&8)&&Q(c,"sidebar-content-compact",I[3].length>20),I[7]?O&&(O.d(1),O=null):O?O.p(I,L):(O=ep(I),O.c(),O.m(e,null));const N={};v.$set(N)},i(I){k||(A(v.$$.fragment,I),k=!0)},o(I){P(v.$$.fragment,I),k=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();$&&$.d(),O&&O.d(),I&&w(g),n[13](null),j(v,I),y=!1,Pe(S)}}}function Q$(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function x$(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,y=>t(5,o=y)),Ye(n,Ai,y=>t(9,r=y)),Ye(n,Po,y=>t(6,a=y)),Ye(n,$s,y=>t(7,u=y));let f,c="";function d(y){Kt(Mi,o=y,o)}const p=()=>t(0,c="");function h(){c=this.value,t(0,c)}const g=()=>f==null?void 0:f.show();function v(y){se[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var S;(S=y.detail)!=null&&S.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&Q$(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(y=>y.id==c||y.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,p,h,g,v,k]}class e4 extends ye{constructor(e){super(),ve(this,e,x$,X$,he,{})}}function tp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function np(n){n[18]=n[19].default}function ip(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function sp(n){let e;return{c(){e=b("hr"),m(e,"class","m-t-sm m-b-sm")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function lp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&sp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=$e(),c&&c.c(),s=D(),l=b("button"),r=B(o),a=D(),m(l,"type","button"),m(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(p,h){T(p,t,h),c&&c.m(p,h),T(p,s,h),T(p,l,h),_(l,r),_(l,a),u||(f=Y(l,"click",d),u=!0)},p(p,h){e=p,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=sp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(p){p&&w(t),c&&c.d(p),p&&w(s),p&&w(l),u=!1,f()}}}function op(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:i4,then:n4,catch:t4,value:19,blocks:[,,,]};return ru(t=n[15].component,s),{c(){e=$e(),s.block.c()},m(l,o){T(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&ru(t,s)||ob(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];P(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function t4(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function n4(n){np(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=D()},m(s,l){q(e,s,l),T(s,t,l),i=!0},p(s,l){np(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function i4(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function rp(n,e){let t,i,s,l=e[5]===e[14]&&op(e);return{key:n,first:null,c(){t=$e(),l&&l.c(),i=$e(),this.first=t},m(o,r){T(o,t,r),l&&l.m(o,r),T(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=op(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(l),s=!0)},o(o){P(lLine truncated
`),O&&O.c(),p=D(),g.c(),v=$e(),m(s,"type","button"),m(s,"class","btn btn-transparent btn-hint p-l-sm p-r-sm"),m(e,"class","flex m-b-base flex-gap-10"),m(o,"class","list picker-list m-b-base svelte-1u8jhky"),m(c,"class","section-title")},m(N,F){T(N,e,F),q(t,e,null),_(e,i),_(e,s),T(N,l,F),T(N,o,F);for(let R=0;R<r.length;R+=1)r[R].m(o,null);$&&$.m(o,null),T(N,f,F),T(N,c,F),_(c,d),O&&O.m(c,null),T(N,p,F),I[h].m(N,F),T(N,v,F),k=!0,y||(S=[Y(s,"click",n[31]),Ie(u=SM.call(null,o,n[36]))],y=!0)},p(N,F){const R={};F[0]&4&&(R.value=N[2]),F[0]&4096&&(R.autocompleteCollection=N[12]),t.$set(R),F[0]&142252&&(C=N[3],re(),r=wt(r,F,M,1,N,C,a,o,ln,Op,null,Cp),ae(),!C.length&&$?$.p(N,F):C.length?$&&($.d(1),$=null):($=$p(N),$.c(),$.m(o,null))),u&&Bt(u.update)&&F[0]&1040&&u.update.call(null,N[36]),N[5]>1?O?O.p(N,F):(O=Dp(N),O.c(),O.m(c,null)):O&&(O.d(1),O=null);let K=h;h=L(N),h===K?I[h].p(N,F):(re(),P(I[K],1,1,()=>{I[K]=null}),ae(),g=I[h],g?g.p(N,F):(g=I[h]=E[h](N),g.c()),A(g,1),g.m(v.parentNode,v))},i(N){if(!k){A(t.$$.fragment,N);for(let F=0;F<C.length;F+=1)A(r[F]);A(g),k=!0}},o(N){P(t.$$.fragment,N);for(let F=0;F<r.length;F+=1)P(r[F]);P(g),k=!1},d(N){N&&w(e),j(t),N&&w(l),N&&w(o);for(let F=0;F<r.length;F+=1)r[F].d();$&&$.d(),N&&w(f),N&&w(c),O&&O.d(),N&&w(p),I[h].d(N),N&&w(v),y=!1,Pe(S)}}}function qM(n){var r;let e,t,i,s=(((r=n[12])==null?void 0:r.name)||"")+"",l,o;return{c(){e=b("h4"),t=B("Select "),i=b("strong"),l=B(s),o=B(" records")},m(a,u){T(a,e,u),_(e,t),_(e,i),_(i,l),_(e,o)},p(a,u){var f;u[0]&4096&&s!==(s=(((f=a[12])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function jM(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=b("button"),i.innerHTML='<span class="txt">Save selection</span>',m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn")},m(o,r){T(o,e,r),T(o,t,r),T(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function VM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[jM],header:[qM],default:[RM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Je(o,l[a]);e=new Nn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[12]};return i=new R1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(a,u){q(e,a,u),T(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?on(l,[l[0],l[1],xn(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&4096&&(c.collection=a[12]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Dr=100;function HM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=At(e,c),p;Ye(n,Ai,Ae=>t(26,p=Ae));const h=Mt(),g="picker_"+H.randomString(5);let{value:v}=e,{field:k}=e,y,S,C="",M=[],$=[],O=1,E=0,I=!1,L=!1;function N(){return t(2,C=""),t(3,M=[]),t(6,$=[]),R(),K(!0),y==null?void 0:y.show()}function F(){return y==null?void 0:y.hide()}async function R(){const Ae=H.toArray(v);if(!s||!Ae.length)return;t(24,L=!0);let ie=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Dr))et.push(`id="${bt}"`);nt.push(pe.collection(s).getFullList(Dr,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ie=ie.concat(...et)}),t(6,$=[]);for(const et of Ae){const bt=H.findByKey(ie,"id",et);bt&&$.push(bt)}C.trim()||t(3,M=H.filterDuplicatesByKey($.concat(M)))}catch(et){pe.errorResponseHandler(et)}t(24,L=!1)}async function K(Ae=!1){if(s){t(4,I=!0),Ae&&(C.trim()?t(3,M=[]):t(3,M=H.toArray($).slice()));try{const ie=Ae?1:O+1,we=await pe.collection(s).getList(ie,Dr,{filter:C,sort:"-created",$cancelKey:g+"loadList"});t(3,M=H.filterDuplicatesByKey(M.concat(we.items))),O=we.page,t(23,E=we.totalItems)}catch(ie){pe.errorResponseHandler(ie)}t(4,I=!1)}}function x(Ae){i==1?t(6,$=[Ae]):u&&(H.pushOrReplaceByKey($,Ae),t(6,$))}function U(Ae){H.removeByKey($,"id",Ae.id),t(6,$)}function G(Ae){f(Ae)?U(Ae):x(Ae)}function ne(){var Ae;i!=1?t(20,v=$.map(ie=>ie.id)):t(20,v=((Ae=$==null?void 0:$[0])==null?void 0:Ae.id)||""),h("save",$),F()}function J(Ae){ze.call(this,n,Ae)}const ue=()=>F(),Z=()=>ne(),de=Ae=>t(2,C=Ae.detail),_e=()=>S==null?void 0:S.show(),Ce=Ae=>S==null?void 0:S.show(Ae),Ne=Ae=>G(Ae),Re=(Ae,ie)=>{(ie.code==="Enter"||ie.code==="Space")&&(ie.preventDefault(),ie.stopPropagation(),G(Ae))},be=()=>t(2,C=""),Se=()=>{a&&!I&&K()},We=Ae=>U(Ae);function lt(Ae){$=Ae,t(6,$)}function ce(Ae){se[Ae?"unshift":"push"](()=>{y=Ae,t(1,y)})}function He(Ae){ze.call(this,n,Ae)}function te(Ae){ze.call(this,n,Ae)}function Fe(Ae){se[Ae?"unshift":"push"](()=>{S=Ae,t(7,S)})}const ot=Ae=>{H.removeByKey(M,"id",Ae.detail.id),M.unshift(Ae.detail),t(3,M),x(Ae.detail)},Vt=Ae=>{H.removeByKey(M,"id",Ae.detail.id),t(3,M),U(Ae.detail)};return n.$$set=Ae=>{e=Je(Je({},e Line truncated
`,m(e,"class","list-item")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function Fp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Xo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=D(),l=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),m(t,"class","content"),m(o,"type","button"),m(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),m(l,"class","actions"),m(e,"class","list-item")},m(p,h){T(p,e,h),_(e,t),q(i,t,null),_(e,s),_(e,l),_(l,o),_(e,r),a=!0,u||(f=[Ie(Ue.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(p,h){var v;n=p;const g={};h&16&&(g.record=n[15]),h&4&&(g.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(g)},i(p){a||(A(i.$$.fragment,p),a=!0)},o(p){P(i.$$.fragment,p),a=!1},d(p){p&&w(e),j(i),u=!1,Pe(f)}}}function BM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,p,h,g,v,k,y=n[4],S=[];for(let $=0;$<y.length;$+=1)S[$]=Fp(Ap(n,y,$));const C=$=>P(S[$],1,1,()=>{S[$]=null});let M=null;return y.length||(M=Pp(n)),{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=B(o),u=D(),f=b("div"),c=b("div");for(let $=0;$<S.length;$+=1)S[$].c();M&&M.c(),d=D(),p=b("div"),h=b("button"),h.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,m(t,"class",i=Si(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),m(l,"class","txt"),m(e,"for",a=n[14]),m(c,"class","relations-list svelte-1ynw0pc"),m(h,"type","button"),m(h,"class","btn btn-transparent btn-sm btn-block"),m(p,"class","list-item list-item-btn"),m(f,"class","list")},m($,O){T($,e,O),_(e,t),_(e,s),_(e,l),_(l,r),T($,u,O),T($,f,O),_(f,c);for(let E=0;E<S.length;E+=1)S[E].m(c,null);M&&M.m(c,null),_(f,d),_(f,p),_(p,h),g=!0,v||(k=Y(h,"click",n[9]),v=!0)},p($,O){if((!g||O&4&&i!==(i=Si(H.getFieldTypeIcon($[2].type))+" svelte-1ynw0pc"))&&m(t,"class",i),(!g||O&4)&&o!==(o=$[2].name+"")&&le(r,o),(!g||O&16384&&a!==(a=$[14]))&&m(e,"for",a),O&181){y=$[4];let E;for(E=0;E<y.length;E+=1){const I=Ap($,y,E);S[E]?(S[E].p(I,O),A(S[E],1)):(S[E]=Fp(I),S[E].c(),A(S[E],1),S[E].m(c,null))}for(re(),E=y.length;E<S.length;E+=1)C(E);ae(),!y.length&&M?M.p($,O):y.length?M&&(M.d(1),M=null):(M=Pp($),M.c(),M.m(c,null))}},i($){if(!g){for(let O=0;O<y.length;O+=1)A(S[O]);g=!0}},o($){S=S.filter(Boolean);for(let O=0;O<S.length;O+=1)P(S[O]);g=!1},d($){$&&w(e),$&&w(u),$&&w(f),ht(S,$),M&&M.d(),v=!1,k()}}}function UM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[BM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new me({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new zM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(r,a){q(e,r,a),T(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const Rp=100;function WM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var C,M;const k=H.toArray(s);if(!((C=o==null?void 0:o.options)!=null&&C.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const y=k.slice(),S=[];for(;y.length>0;){const $=[];for(const O of y.splice(0,Rp))$.push(`id="${O}"`);S.push(pe.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(Rp,{filter:$.join("||"),$autoCancel:!1}))}try{let $=[];await Promise.all(S).then(O=>{$=$.concat(...O)});for(const O of k){const E=H.findByKey($,"id",O);E&&a.push(E)}t(4,a)}catch($){pe.errorResponseHandler($)}t(5,u=!1)}function c(k){var y;H.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(S=>S.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),p=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function g(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map(S=>S.id):((y=a[0])==null?void 0:y.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,p,h,g,v]}class YM extends ye{constructor(e){super(),ve(this,e,WM,UM,he,{value:0,picker:1,field:2})}}const KM=["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"],JM=(n,e)=>{KM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function ZM(n){let e;return{c(){e=b("textarea"),m(e,"id",n[0]),Pr(e,"visibility","hidden")},m(t,i){T(t,e,i),n[18](e)},p(t,i){i&1&&m(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function GM(n){let e;return{c(){e=b("div"),m(e,"id",n[0])},m(t,i){T(t,e,i),n[17](e)},p(t,i){i&1&&m(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function XM(n){let e;function t(l,o){return l[1]?GM:ZM}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),m(e,"class",n[2])},m(l,o){T(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&m(e,"class",l[2])},i:X,o:X,d(l){l&&w(e),s.d(),n[19](null)}}}const N1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),QM=()=>{let n={listeners:[],scriptId:N1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("scripLine truncated
Updated: ${n[2].updated}`,position:"left"})),v=!0)},p(y,S){S[1]&8388608&&r!==(r=y[54])&&m(e,"for",r),c&&Bt(c.update)&&S[0]&4&&c.update.call(null,{text:`Created: ${y[2].created}
Updated: ${y[2].updated}`,position:"left"}),S[1]&8388608&&h!==(h=y[54])&&m(p,"id",h),S[0]&4&&g!==(g=y[2].id)&&p.value!==g&&(p.value=g)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(p),v=!1,k()}}}function Bp(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new _4({props:r}),se.push(()=>ge(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Up();return{c(){V(e.$$.fragment),i=D(),a&&a.c(),s=$e()},m(c,d){q(e,c,d),T(c,i,d),a&&a.m(c,d),T(c,s,d),l=!0},p(c,d){var h,g;const p={};d[0]&1&&(p.collection=c[0]),!t&&d[0]&4&&(t=!0,p.record=c[2],ke(()=>t=!1)),e.$set(p),(g=(h=c[0])==null?void 0:h.schema)!=null&&g.length?a||(a=Up(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Up(n){let e;return{c(){e=b("hr")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function M5(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new YM({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function O5(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new wM({props:u}),se.push(()=>ge(e,"value",o)),se.push(()=>ge(e,"uploadedFiles",r)),se.push(()=>ge(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function D5(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new Q4({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function E5(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new J4({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function A5(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new U4({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function I5(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new s5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function P5(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new V4({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function L5(n){let e,t,i;function s(o){n[33](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new F4({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function N5(n){let e,t,i;function s(o){n[32](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new I4({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={}; Line truncated
<span class="txt">Send verification email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Zp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function j5(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&Jp(n),u=n[0].isAuth&&n[7].email&&Zp(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=b("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=b("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(i,"type","button"),m(i,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),T(f,e,c),u&&u.m(f,c),T(f,t,c),T(f,i,c),T(f,s,c),T(f,l,c),o||(r=[Y(i,"click",n[25]),Y(l,"click",kn(dt(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=Jp(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=Zp(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Pe(r)}}}function Gp(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=D(),s=b("button"),s.textContent="Authorized providers",m(t,"type","button"),m(t,"class","tab-item"),Q(t,"active",n[10]===Gi),m(s,"type","button"),m(s,"class","tab-item"),Q(s,"active",n[10]===yl),m(e,"class","tabs-header stretched")},m(r,a){T(r,e,a),_(e,t),_(e,i),_(e,s),l||(o=[Y(t,"click",n[27]),Y(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===Gi),a[0]&1024&&Q(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Pe(o)}}}function V5(n){var g;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,c,d,p=!n[2].isNew&&Kp(n),h=n[0].isAuth&&!n[2].isNew&&Gp(n);return{c(){e=b("h4"),i=B(t),s=D(),l=b("strong"),r=B(o),a=B(" record"),u=D(),p&&p.c(),f=D(),h&&h.c(),c=$e()},m(v,k){T(v,e,k),_(e,i),_(e,s),_(e,l),_(l,r),_(e,a),T(v,u,k),p&&p.m(v,k),T(v,f,k),h&&h.m(v,k),T(v,c,k),d=!0},p(v,k){var y;(!d||k[0]&4)&&t!==(t=v[2].isNew?"New":"Edit")&&le(i,t),(!d||k[0]&1)&&o!==(o=((y=v[0])==null?void 0:y.name)+"")&&le(r,o),v[2].isNew?p&&(re(),P(p,1,1,()=>{p=null}),ae()):p?(p.p(v,k),k[0]&4&&A(p,1)):(p=Kp(v),p.c(),A(p,1),p.m(f.parentNode,f)),v[0].isAuth&&!v[2].isNew?h?h.p(v,k):(h=Gp(v),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(v){d||(A(p),d=!0)},o(v){P(p),d=!1},d(v){v&&w(e),v&&w(u),p&&p.d(v),v&&w(f),h&&h.d(v),v&&w(c)}}}function H5(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),s=b("button"),l=b("span"),r=B(o),m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[8],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[13]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){T(c,e,d),_(e,t),T(c,i,d),T(c,s,d),_(s,l),_(l,r),u||(f=Y(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function z5(n){var s;let e,t,i={class:`
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[H5],header:[V5],default:[q5]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function Xp(n){return JSON.stringify(n)}function B5(n,e,t){let i,s,l,o;const r=Mt(),a="record_"+H.randomString(5);let{collection:u}=e,f,c=null,d=new Ti,p=!1,h=!1,g={},v={},k="",y=Gi;function S(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function M(ie){Bn({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new Ti),t(3,g={}),t(4,v={}),await sn(),t(20,k=Xp(d))}function $(){if(p||!o||!(u!=null&&u.id))return;t(8,p=!0);const ie=E();let we;d.isNew?we=pe.collection(u.id).create(ie):we=pe.collection(u.id).update(d.id,ie),we.then(nt=>{zt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),C(),r("save",nt)}).catch(nt=>{pe.errorResponseHandler(nt)}).finally(()=>{t(8,p=!1)})}function O(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>pe.collection(c.collectionId).delete(c.id).then(()=>{C(),zt("Successfully deleted record."),r("delete",c)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function E(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),H.addValueToFormData(we,et,ie[et]));for(const et in g){const bt=H.toArray(g[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=H.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>pe.collection(u.id).requestVerification(c.email).then(()=>{zt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>pe.collection(u.id).requestPasswordReset(c.email).then(()=>{zt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function N(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}S(ie),await sn(),t(20,k="")}const R=()=>C(),K=()=>I(),x=()=>L(),U=()=>N(),G=()=>O(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function ue(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function _e(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ce(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function be(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(g[we.name],ie)&&(g[we.name]=ie,t(3,g))}function He(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),C()}),!1):(Bn({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Vt(ie){ze.call(this,n,ie)}function Ae(ie){ze.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(we=>we.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=H.hasNonEmptyProps(g)||H.hasNonEmptyProps(v)),n.$$.dirty[0]&3145732&&t(5,l=s||k!=Xp(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,C,d,g,v,l,f,c,p,h,y,o,i,a,$,O,I,L,N,S,k,s,R,K,x,U,G,ne,J,ue,Z,de,_e,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt,Ae]}class R1 extends ye{constructor(e){super(),ve(this,e,B5,z5,he,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function Qp(n,e,t){const i=n.slice();return i[15]=e[t],i[7]=t,i}function xp(n,e,t){const i=n.slice();return i[12]=e[t],i}function em(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function tm(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function U5(n){const e=n.slice(),t=H.toArray(e[3]);e[8]=t;const i=H.toArray(e[0].expand[e[1].name]);e[9]=i;const s=e[2]?20:200;return e[10]=s,e}funct Line truncated
`},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function MO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function OO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Cm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=D(),r=b("label"),m(i,"type","checkbox"),m(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],m(r,"for",a="checkbox_"+n[55].id),m(t,"class","form-field"),m(e,"class","bulk-select-col min-width")},m(d,p){T(d,e,p),_(e,t),_(t,i),_(t,o),_(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,p){n=d,p[0]&16&&s!==(s="checkbox_"+n[55].id)&&m(i,"id",s),p[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),p[0]&16&&a!==(a="checkbox_"+n[55].id)&&m(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function $m(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new su({props:{value:n[55].id}});let c=n[2].isAuth&&Mm(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(s.$$.fragment),l=D(),o=b("div"),a=B(r),u=D(),c&&c.c(),m(o,"class","txt"),m(i,"class","label"),m(t,"class","flex flex-gap-5"),m(e,"class","col-type-text col-field-id")},m(d,p){T(d,e,p),_(e,t),_(t,i),q(s,i,null),_(i,l),_(i,o),_(o,a),_(t,u),c&&c.m(t,null),f=!0},p(d,p){const h={};p[0]&16&&(h.value=d[55].id),s.$set(h),(!f||p[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,p):(c=Mm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Mm(n){let e;function t(l,o){return l[55].verified?EO:DO}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),T(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function DO(n){let e,t,i;return{c(){e=b("i"),m(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){T(s,e,l),t||(i=Ie(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function EO(n){let e,t,i;return{c(){e=b("i"),m(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){T(s,e,l),t||(i=Ie(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Om(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Dm(n),o=i&&Em(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=$e()},m(r,a){l&&l.m(r,a),T(r,t,a),o&&o.m(r,a),T(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Dm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Em(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Dm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?IO:AO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),m(e,"class","col-type-text col-field-username")},m(o,r){T(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function AO(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].username)},m(l,o){T(l,e,o),_(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&m(e,"title",s)},d(l){l&&w(e)}}}function IO(n){let e;return{c(){e=b("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function Em(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?LO:PO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),m(e,"class","col-type-text col-field-email")},m(o,r){T(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function PO(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].email)},m(l,o){T(l,e,o),_(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&m(e,"title",s)},d(l){l&&w(e)}}}function LO(n){let e;return{c(){e=b("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function Am(n,e){let t,i,s,l;return i=new q1({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=b("td"),V(i.$$.fragment),m(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){T(o,t,r),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&m(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Im(n){let e,t,i;return t=new ui({props:{date:n[55].created}}),{c(){e=b("td"),V(t.$$.fragment),m(e,"class","col-type-date col-field-created")},m(s,l){T(s,e,l),q(t,e,null),i=!0},p(s,l){coLine truncated
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function YO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,p,h,g,v,k,y,S,C,M,$,O,E,I,L,N=!n[10]&&Vm(n);c=new Da({}),c.$on("refresh",n[16]);let F=!n[2].isView&&Hm(n);k=new Uo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(U){n[21](U)}function K(U){n[22](U)}let x={collection:n[2]};return n[0]!==void 0&&(x.filter=n[0]),n[1]!==void 0&&(x.sort=n[1]),M=new zO({props:x}),n[20](M),se.push(()=>ge(M,"filter",R)),se.push(()=>ge(M,"sort",K)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",s=D(),l=b("div"),r=B(o),a=D(),u=b("div"),N&&N.c(),f=D(),V(c.$$.fragment),d=D(),p=b("div"),h=b("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=D(),F&&F.c(),v=D(),V(k.$$.fragment),y=D(),S=b("div"),C=D(),V(M.$$.fragment),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(u,"class","inline-flex gap-5"),m(h,"type","button"),m(h,"class","btn btn-outline"),m(p,"class","btns-group"),m(e,"class","page-header"),m(S,"class","clearfix m-b-base")},m(U,G){T(U,e,G),_(e,t),_(t,i),_(t,s),_(t,l),_(l,r),_(e,a),_(e,u),N&&N.m(u,null),_(u,f),q(c,u,null),_(e,d),_(e,p),_(p,h),_(p,g),F&&F.m(p,null),T(U,v,G),q(k,U,G),T(U,y,G),T(U,S,G),T(U,C,G),q(M,U,G),E=!0,I||(L=Y(h,"click",n[17]),I=!0)},p(U,G){(!E||G[0]&4)&&o!==(o=U[2].name+"")&&le(r,o),U[10]?N&&(N.d(1),N=null):N?N.p(U,G):(N=Vm(U),N.c(),N.m(u,f)),U[2].isView?F&&(F.d(1),F=null):F?F.p(U,G):(F=Hm(U),F.c(),F.m(p,null));const ne={};G[0]&1&&(ne.value=U[0]),G[0]&4&&(ne.autocompleteCollection=U[2]),k.$set(ne);const J={};G[0]&4&&(J.collection=U[2]),!$&&G[0]&1&&($=!0,J.filter=U[0],ke(()=>$=!1)),!O&&G[0]&2&&(O=!0,J.sort=U[1],ke(()=>O=!1)),M.$set(J)},i(U){E||(A(c.$$.fragment,U),A(k.$$.fragment,U),A(M.$$.fragment,U),E=!0)},o(U){P(c.$$.fragment,U),P(k.$$.fragment,U),P(M.$$.fragment,U),E=!1},d(U){U&&w(e),N&&N.d(),j(c),F&&F.d(),U&&w(v),j(k,U),U&&w(y),U&&w(S),U&&w(C),n[20](null),j(M,U),I=!1,L()}}}function KO(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=D(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,m(e,"class","m-b-10"),m(i,"type","button"),m(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){T(o,e,r),T(o,t,r),T(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function JO(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",m(e,"class","m-b-10")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function ZO(n){let e,t,i;function s(r,a){return r[10]?JO:KO}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),m(t,"class","icon"),m(e,"class","placeholder-section m-b-base")},m(r,a){T(r,e,a),_(e,t),_(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function GO(n){let e;return{c(){e=b("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,m(e,"class","placeholder-section m-b-base")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function XO(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[WO,UO,BO],p=[];function h(S,C){return S[3]&&!S[9].length?0:S[9].length?2:1}e=h(n),t=p[e]=d[e](n);let g={};s=new nu({props:g}),n[25](s);let v={};o=new a4({props:v}),n[26](o);let k={collection:n[2]};a=new R1({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new gO({props:y}),n[30](f),{c(){t.c(),i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment)},m(S,C){p[e].m(S,C),T(S,i,C),q(s,S,C),T(S,l,C),q(o,S,C),T(S,r,C),q(a,S,C),T(S,u,C),q(f,S,C),c=!0},p(S,C){let M=e;e=h(S),e===M?p[e].p(S,C):(re(),P(p[M],1,1,()=>{p[M]=null}),ae(),t=p[e],t?t.p(S,C):(t=p[e]=d[e](S),t.c()),A(t,1),t.m(i.parentNode,i));const $={};s.$set($);const O={};o.$set(O);const E={};C[0]&4&&(E.collection=S[2]),a.$set(E);const I={};C[0]&4&&(I.collection=S[2]),f.$set(I)},i(S){c||(A(t),A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(f.$$.fragment,S),c=!0)},o(S){P(t),P(s.$$.fragment,S),P(o.$$.fragment,S),P(a.$$.fragment,S),P(f.$$.fragment,S),c=!1},d(S){p[e].d(S),S&&w(i),n[25](null),j(s,S),S&&w(l),n[26](null),j(o,S),S&&w(r),n[27](null),j(a,S),S&&w(u),n[30](null),j(f,S)}}}function QO(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,Tt,Z=>t(31,l=Z)),Ye(n,Po,Z=>t(3,o=Z)),Ye(n,ha,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,$s,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,p,h,g,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function S(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}E1(y);const C=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),$=()=>g==null?void 0:g.load(),O=()=>d==null?void 0:d.show(s),E=()=>p==null?void 0:p.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{g=Z,t(8,g)})}function N(Z){v=Z,t(0,v)}function F(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):p==null||p.show(Z==null?void 0:Z.detail)},K=()=>p==null?void 0:p.show();function x(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function G(Z){se[Z?"unshift":"push"](()=>{p=Z,t(6,p)})}const ne=()=>g==null?void 0:g.reloadLoadedPages(),J=()=>g==null?void 0:g.reloadLoadedPages();function ue(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=y&&P3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&S(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Oi("/collections?"+Z)}n.$$.dirty[0]&4&&Kt(Tt,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,p,h,g,a,u,y,i,r,C,M,$,O,E,I,L,N,F,R,K,x,U,G,ne,J,ue]}class xO extends ye{constructor(e){super(),ve(this,e,QO,XO,he,{},null,[-1,-1])}}function eD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M,$,O,E,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=D(),l=b("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=b("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=b("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=b("div"),c.innerHTML='<span class="txt">Sync</span>',d=D(),p=b("a"),p.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=D(),g=b("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,v=D(),k=b("div"),k.textContent="Authentication",y=D(),S=b("a"),S.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,C=D(),M=b("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,$=D(),O=b("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,m(i,"class","sidebar-title"),m(l,"href","/settings"),m(l,"class","sidebar-list-item"),m(r,"href","/settings/mail"),m(r,"class","sidebar-list-item"),m(u,"href","/settings/storage"),m(u,"class","sidebar-list-item"),m(c,"class","sidebar-title"),m(p,"href","/settings/export-collections"),m(p,"class","sidebar-list-item"),m(g,"href","/settings/import-collections"),m(g,"class","sidebar-list-item"),m(k,"class","sidebar-title"),m(S,"href","/settings/auth-providers"),m(S,"class","sidebar-list-item"),m(M,"href","/settings/tokens"),m(M,"class","sidebar-list-item"),m(O,"href","/settings/admins"),m(O,"class","sidebar-list-item"),m(t,"class","sidebar-content"),m(e,"class","page-sidebar settings-sidebar")},m(L,N){T(L,e,N),_(e,t),_(t,i),_(t,s),_(t,l),_(t,o),_(t,r),_(t,a),_(t,u),_(t,f),_(t,c),_(t,d),_(t,p),_(t,h),_(t,g),_(t,v),_(t,k),_(t,y),_(t,S),_(t,C),_(t,M),_(t,$),_(t,O),E||(I=[Ie(qn.call(null,l,{path:"/settings"})),Ie(xt.call(null,l)),Ie(qn.call(null,r,{path:"/settings/mail/?.*"})),Ie(xt.call(null,r)),Ie(qn.call(null,u,{path:"/settings/storage/?.*"})),Ie(xt.call(null,u)),Ie(qn.call(null,p,{path:"/settings/export-collections/?.*"})),Ie(xt.call(null,p)),Ie(qn.call(null,g,{path:"/settings/import-collections/?.*"})),Ie(xt.call(null,g)),Ie(qn.call(null,S,{path:"/settings/auth-providers/?.*"})),Ie(xt.call(null,S)),Ie(qn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(xt.call(null,M)),Ie(qn.call(null,O,{path:"/settings/admins/?.*"})),Ie(xt.call(null,O))],E=!0)},p:X,i:X,o:X,d(L){L&&w(e),E=!1,Pe(I)}}}class Ii extends ye{constructor(e){super(),ve(this,e,null,eD,he,{})}}function zm(n,e,t){const i=n.slice();return i[30]=e[t],i}function Bm(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[tD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function tD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="id",o=D(),r=b("div"),a=b("i"),f=D(),c=b("input"),m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"for",l=n[29]),m(a,"class","ri-calendar-event-line txt-disabled"),m(r,"class","form-field-addon"),m(c,"type","text"),m(c,"id",d=n[29]),c.value=p=n[1].id,c.readOnly=!0},m(v,k){T(v,e,k),_(e,t),_(e,i),_(e,s),T(v,o,k),T(v,r,k),_(r,a),T(v,f,k),T(v,c,k),h||(g=Ie(u=Ue.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(v,k){k[0]&536870912&&l!==(l=v[29])&&m(e,"for",l),u&&Bt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${v[1].created}
Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&m(c,"id",d),k[0]&2&&p!==(p=v[1].id)&&c.value!==p&&(c.value=p)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(f),v&&w(c),h=!1,g()}}}function Um(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=b("button"),t=b("img"),s=D(),Hn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||m(t,"src",i),m(t,"alt","Avatar "+n[30]),m(e,"type","button"),m(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){T(u,e,f),_(e,t),_(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&m(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function nD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Email",o=D(),r=b("input"),m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","email"),m(r,"autocomplete","off"),m(r,"id",a=n[29]),r.required=!0},m(c,d){T(c,e,d),_(e,t),_(e,i),_(e,s),T(c,o,d),T(c,r,d),fe(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&8&&r.value!==c[3]&&fe(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function Wm(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[iD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function iD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=B("Change password"),m(e,"type","checkbox"),m(e,"id",t=n[29]),m(s,"for",o=n[29])},m(u,f){T(u,e,f),e.checked=n[4],T(u,i,f),T(u,s,f),_(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&m(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Ym(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[sD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[lD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(s.$$.fragment),l=D(),o=b("div"),V(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(t,"class","grid"),m(e,"class","col-12")},m(f,c){T(f,e,c),_(e,t),_(t,i),q(s,i,null),_(t,l),_(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&536871424|c[1]&4&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Ge(()=>{a||(a=qe(t,St,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=qe(t,St,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function sD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Password",o=D(),r=b("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(c,d){T(c,e,d),_(e,t),_(e,i),_(e,s),T(c,o,d),T(c,r,d),fe(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&256&&r.value!==c[8]&&fe(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function lD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Password confirm",o=D(),r=b("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(c,d){T(c,e,d),_(e,t),_(e,i),_(e,s),T(c,o,d),T(c,r,d),fe(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&512&&r.value!==c[9]&&fe(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function oD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h=!n[1].isNew&&Bm(n),g=[0,1,2,3,4,5,6,7,8,9],v=[];for(let S=0;S<10;S+=1)v[S]=Um(zm(n,g,S));a=new me({props:{class:"form-field required",name:"email",$$slots:{default:[nD,({uniqueId:S})=>({29:S}),({uniqueId:S})=>[S?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].isNew&&Wm(n),y=(n[1].isNew||n[4])&&Ym(n);return{c(){e=b("form"),h&&h.c(),t=D(),i=b("div"),s=b("p"),s.textContent="Avatar",l=D(),o=b("div");for(let S=0;S<10;S+=1)v[S].c();r=D(),V(a.$$.fragment),u=D(),k&&k.c(),f=D(),y&&y.c(),m(s,"class","section-title"),m(o,"class","flex flex-gap-xs flex-wrap"),m(i,"class","content"),m(e,"id",n[11]),m(e,"class","grid"),m(e,"autocomplete","off")},m(S,C){T(S,e,C),h&&h.m(e,null),_(e,t),_(e,i),_(i,s),_(i,l),_(i,o);for(let M=0;M<10;M+=1)v[M].m(o,null);_ Line truncated
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item txt-danger")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function uD(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&Km(n);return{c(){p&&p.c(),e=D(),t=b("button"),i=b("span"),i.textContent="Cancel",s=D(),l=b("button"),o=b("span"),a=B(r),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-transparent"),t.disabled=n[6],m(o,"class","txt"),m(l,"type","submit"),m(l,"form",n[11]),m(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(h,g){p&&p.m(h,g),T(h,e,g),T(h,t,g),_(t,i),T(h,s,g),T(h,l,g),_(l,o),_(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(h,g){h[1].isNew?p&&(re(),P(p,1,1,()=>{p=null}),ae()):p?(p.p(h,g),g[0]&2&&A(p,1)):(p=Km(h),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=h[6]),(!f||g[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||g[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(p),f=!0)},o(h){P(p),f=!1},d(h){p&&p.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function fD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[uD],header:[rD],default:[oD]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function cD(n,e,t){let i;const s=Mt(),l="admin_"+H.randomString(5);let o,r=new Xi,a=!1,u=!1,f=0,c="",d="",p="",h=!1;function g(U){return k(U),t(7,u=!0),o==null?void 0:o.show()}function v(){return o==null?void 0:o.hide()}function k(U){t(1,r=U!=null&&U.clone?U.clone():new Xi),y()}function y(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,p=""),Bn({})}function S(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||h)&&(U.password=d,U.passwordConfirm=p);let G;r.isNew?G=pe.admins.create(U):G=pe.admins.update(r.id,U),G.then(async ne=>{var J;t(7,u=!1),v(),zt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((J=pe.authStore.model)==null?void 0:J.id)===ne.id&&pe.authStore.save(pe.authStore.token,ne)}).catch(ne=>{pe.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&cn("Do you really want to delete the selected admin?",()=>pe.admins.delete(r.id).then(()=>{t(7,u=!1),v(),zt("Successfully deleted admin."),s("delete",r)}).catch(U=>{pe.errorResponseHandler(U)}))}const M=()=>C(),$=()=>v(),O=U=>t(2,f=U);function E(){c=this.value,t(3,c)}function I(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function N(){p=this.value,t(9,p)}const F=()=>i&&u?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),v()}),!1):!0;function R(U){se[U?"unshift":"push"](()=>{o=U,t(5,o)})}function K(U){ze.call(this,n,U)}function x(U){ze.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[v,r,f,c,h,o,a,u,d,p,i,l,S,C,g,M,$,O,E,I,L,N,F,R,K,x]}class dD extends ye{constructor(e){super(),ve(this,e,cD,fD,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Jm(n,e,t){const i=n.slice();return i[24]=e[t],i}function pD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="id",m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function mD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="email",m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function hD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="created",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function gD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="updated",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){T(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Zm(n){let e;function t(l,o){return l[5]?bD:_D}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),T(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function _D(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Gm(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",s=D(),o&&o.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(a,u){T(a,e,u),_(e,t),_(t,i),_(t,s),o&&o.m(t,null),_(Line truncated
`},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function Gm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Xm(n){let e;return{c(){e=b("span"),e.textContent="You",m(e,"class","label label-warning m-l-5")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function Qm(n,e){let t,i,s,l,o,r,a,u,f,c,d,p=e[24].id+"",h,g,v,k,y,S=e[24].email+"",C,M,$,O,E,I,L,N,F,R,K,x,U,G;f=new su({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&Xm();E=new ui({props:{date:e[24].created}}),N=new ui({props:{date:e[24].updated}});function J(){return e[15](e[24])}function ue(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("figure"),l=b("img"),r=D(),a=b("td"),u=b("div"),V(f.$$.fragment),c=D(),d=b("span"),h=B(p),g=D(),ne&&ne.c(),v=D(),k=b("td"),y=b("span"),C=B(S),$=D(),O=b("td"),V(E.$$.fragment),I=D(),L=b("td"),V(N.$$.fragment),F=D(),R=b("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',K=D(),Hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||m(l,"src",o),m(l,"alt","Admin avatar"),m(s,"class","thumb thumb-sm thumb-circle"),m(i,"class","min-width"),m(d,"class","txt"),m(u,"class","label"),m(a,"class","col-type-text col-field-id"),m(y,"class","txt txt-ellipsis"),m(y,"title",M=e[24].email),m(k,"class","col-type-email col-field-email"),m(O,"class","col-type-date col-field-created"),m(L,"class","col-type-date col-field-updated"),m(R,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Z,de){T(Z,t,de),_(t,i),_(i,s),_(s,l),_(t,r),_(t,a),_(a,u),q(f,u,null),_(u,c),_(u,d),_(d,h),_(a,g),ne&&ne.m(a,null),_(t,v),_(t,k),_(k,y),_(y,C),_(t,$),_(t,O),q(E,O,null),_(t,I),_(t,L),q(N,L,null),_(t,F),_(t,R),_(t,K),x=!0,U||(G=[Y(t,"click",J),Y(t,"keydown",ue)],U=!0)},p(Z,de){e=Z,(!x||de&16&&!Hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&m(l,"src",o);const _e={};de&16&&(_e.value=e[24].id),f.$set(_e),(!x||de&16)&&p!==(p=e[24].id+"")&&le(h,p),e[24].id===e[7].id?ne||(ne=Xm(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!x||de&16)&&S!==(S=e[24].email+"")&&le(C,S),(!x||de&16&&M!==(M=e[24].email))&&m(y,"title",M);const Ce={};de&16&&(Ce.date=e[24].created),E.$set(Ce);const Ne={};de&16&&(Ne.date=e[24].updated),N.$set(Ne)},i(Z){x||(A(f.$$.fragment,Z),A(E.$$.fragment,Z),A(N.$$.fragment,Z),x=!0)},o(Z){P(f.$$.fragment,Z),P(E.$$.fragment,Z),P(N.$$.fragment,Z),x=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(E),j(N),U=!1,Pe(G)}}}function vD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M=[],$=new Map,O;function E(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[pD]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Wt({props:I}),se.push(()=>ge(o,"sort",E));function L(J){n[12](J)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[mD]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Wt({props:N}),se.push(()=>ge(u,"sort",L));function F(J){n[13](J)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[hD]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Wt({props:R}),se.push(()=>ge(d,"sort",F));function K(J){n[14](J)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[gD]},$$scope:{ctx:n}};n[2]!==void 0&&(x.sort=n[2]),g=new Wt({props:x}),se.push(()=>ge(g,"sort",K));let U=n[4];const G=J=>J[24].id;for(let J=0;J<U.length;J+=1){let ue=Jm(n,U,J),Z=G(ue);$.set(Z,M[J]=Qm(Z,ue))}let ne=null;return U.length||(ne=Zm(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),s=b("th"),l=D(),V(o.$$.fragment),a=D(),V(u.$$.fragment),c=D(),V(d.$$.fragment),h=D(),V(g.$$.fragment),k=D(),y=b("th"),S=D(),C=b("tbody");for(let J=0;J<M.length;J+=1)M[J].c();ne&&ne.c(),m(s,"class","min-width"),m(y,"class","col-type-action min-width"),m(e,"class","table"),Q(e,"table-loading",n[5])},m(J,ue){T(J,e,ue),_(e,t),_(t,i),_(i,s),_(i,l),q(o,i,null),_(i,a),q(u,i,null),_(i,c),q(d,i,null),_(i,h),q(g,i,null),_(i,k),_(i,y),_(e,S),_(e,C);for(let Z=0;Z<M.length;Z+=1)M[Z].m(C,null);ne&&ne.m(C,null),O=!0},p(J,ue){const Z={};ue&134217728&&(Z.$$scope={dirty:ue,ctx:J}),!r&&ue&4&&(r=!0,Z.sort=J[2],ke(()=>r=!1)),o.$set(Z);const de={};ue&134217728&&(de.$$scope={dirty:ue,ctx:J}),!f&&ue&4&&(f=!0,de.sort=J[2],ke(()=>f=!1)),u.$set(de);const _e={};ue&134217728&&(_e.$$scope={dirty:ue,ctx:J}),!p&&ue&4&&(p=!0,_e.sort=J[2],ke(()=>p=!1)),d.$set(_e);const Ce={};ue&134217728&&(Ce.$$scope={dirty:ue,ctx:J}),!v&&ue&4&&(v=!0,Ce.sort=J[2],ke(()=>v=!1)),g.$set(Ce),ue&186&&(U=J[4],re(),M=wt(M,ue,G,1,J,U,$,C,ln,Qm,null,Jm),ae(),!U.length&&ne?ne.p(J,ue):U.length?ne&&(ne.d(1),ne=null):(ne=Zm(J),ne.c(),ne.m(C,null))),(!O||ue&32)&&Q(e,"table-loading",J[5])},i(J){if(!O){A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J),A(g.$$.fragment,J);for(let ue=0;ue<U.length;ue+=1)A(M[ue]);O=!0}},o(J){P(o.$$.fragment,J),P(u.$$.fragment,J),P(d.$$.fragment,J),P(g.$$. Line truncated
<span class="txt">New admin</span>`,p=D(),V(h.$$.fragment),g=D(),v=b("div"),k=D(),V(y.$$.fragment),S=D(),E&&E.c(),C=$e(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(f,"class","flex-fill"),m(d,"type","button"),m(d,"class","btn btn-expanded"),m(e,"class","page-header"),m(v,"class","clearfix m-b-base")},m(I,L){T(I,e,L),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),_(e,r),q(a,e,null),_(e,u),_(e,f),_(e,c),_(e,d),T(I,p,L),q(h,I,L),T(I,g,L),T(I,v,L),T(I,k,L),q(y,I,L),T(I,S,L),E&&E.m(I,L),T(I,C,L),M=!0,$||(O=Y(d,"click",n[9]),$=!0)},p(I,L){(!M||L&64)&&le(o,I[6]);const N={};L&2&&(N.value=I[1]),h.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:I}),y.$set(F),I[4].length?E?E.p(I,L):(E=xm(I),E.c(),E.m(C.parentNode,C)):E&&(E.d(1),E=null)},i(I){M||(A(a.$$.fragment,I),A(h.$$.fragment,I),A(y.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(h.$$.fragment,I),P(y.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(p),j(h,I),I&&w(g),I&&w(v),I&&w(k),j(y,I),I&&w(S),E&&E.d(I),I&&w(C),$=!1,O()}}}function kD(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[yD]},$$scope:{ctx:n}}});let r={};return l=new dD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),T(a,t,u),q(i,a,u),T(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function wD(n,e,t){let i,s,l;Ye(n,ha,N=>t(21,i=N)),Ye(n,Tt,N=>t(6,s=N)),Ye(n,Oa,N=>t(7,l=N)),Kt(Tt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),pe.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),p(),pe.errorResponseHandler(N,!1))})}function p(){t(4,a=[])}const h=()=>d(),g=()=>r==null?void 0:r.show(),v=N=>t(1,f=N.detail);function k(N){c=N,t(2,c)}function y(N){c=N,t(2,c)}function S(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),$=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},O=()=>t(1,f="");function E(N){se[N?"unshift":"push"](()=>{r=N,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Oi("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,h,g,v,k,y,S,C,M,$,O,E,I,L]}class SD extends ye{constructor(e){super(),ve(this,e,wD,kD,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function TD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Email"),s=D(),l=b("input"),m(e,"for",i=n[8]),m(l,"type","email"),m(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&m(e,"for",i),f&256&&o!==(o=u[8])&&m(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function CD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Password"),s=D(),l=b("input"),r=D(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",m(e,"for",i=n[8]),m(l,"type","password"),m(l,"id",o=n[8]),l.required=!0,m(u,"href","/request-password-reset"),m(u,"class","link-hint"),m(a,"class","help-block")},m(d,p){T(d,e,p),_(e,t),T(d,s,p),T(d,l,p),fe(l,n[1]),T(d,r,p),T(d,a,p),_(a,u),f||(c=[Y(l,"input",n[5]),Ie(xt.call(null,u))],f=!0)},p(d,p){p&256&&i!==(i=d[8])&&m(e,"for",i),p&256&&o!==(o=d[8])&&m(l,"id",o),p&2&&l.value!==d[1]&&fe(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Pe(c)}}}function $D(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[TD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[CD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Admin sign in</h4>",i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),a=b("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(a,"type","submit"),m(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),m(e,"class","block")},m(d,p){T(d,e,p),_(e,t),_(e,i),q(s,e,null),_(e,l),q(o,e,null),_(e,r),_(e,a),u=!0,f||(c=Y(e,"submit",dt(n[3])),f=!0)},p(d,p){const h={};p&769&&(h.$$scope={dirty:p,ctx:d}),s.$set(h);const g={};p&770&&(g.$$scope={dirty:p,ctx:d}),o.$set(g),(!u||p&4)&&Q(a,"btn-disabled",d[2]),(!u||p&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function MD(n){let e,t;return e=new D_({props:{$$slots:{default:[$D]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function OD(n,e,t){let i;Ye(n,ha,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),pe.admins.authWithPassword(l,o).then(()=>{$a(),Oi("/")}).catch(()=>{cl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class DD extends ye{constructor(e){super(),ve(this,e,OD,MD,he,{})}}function ED(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[ID,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[PD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[LD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[ND,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let $=n[3]&&eh(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=D(),l=b("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),c=D(),d=b("div"),p=b("div"),h=D(),$&&$.c(),g=D(),v=b("button"),k=b("span"),k.textContent="Save changes",m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(p,"class","flex-fill"),m(k,"class","txt"),m(v,"type","submit"),m(v,"class","btn btn-expanded"),v.disabled=y=!n[3]||n[2],Q(v,"btn-loading",n[2]),m(d,"class","col-lg-12 flex"),m(e,"class","grid")},m(O,E){T(O,e,E),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),q(a,e,null),_(e,u),q(f,e,null),_(e,c),_(e,d),_(d,p),_(d,h),$&&$.m(d,null),_(d,g),_(d,v),_(v,k),S=!0,C||(M=Y(v,"click",n[13]),C=!0)},p(O,E){const I={};E&1572865&&(I.$$scope={dirty:E,ctx:O}),i.$set(I);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:O}),a.$set(N);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),f.$set(F),O[3]?$?$.p(O,E):($=eh(O),$.c(),$.m(d,g)):$&&($.d(1),$=null),(!S||E&12&&y!==(y=!O[3]||O[2]))&&(v.disabled=y),(!S||E&4)&&Q(v,"btn-loading",O[2])},i(O){S||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),S=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(a.$$.fragment,O),P(f.$$.fragment,O),S=!1},d(O){O&&w(e),j(i),j(o),j(a),j(f),$&&$.d(),C=!1,M()}}}function AD(n){let e;return{c(){e=b("div"),m(e,"class","loader")},m(t,i){T(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function ID(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Application name"),s=D(),l=b("input"),m(e,"for",i=n[19]),m(l,"type","text"),m(l,"id",o=n[19]),l.required=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&l.value!==u[0].meta.appName&&fe(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function PD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Application url"),s=D(),l=b("input"),m(e,"for",i=n[19]),m(l,"type","text"),m(l,"id",o=n[19]),l.required=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&fe(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function LD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Logs max days retention"),s=D(),l=b("input"),m(e,"for",i=n[19]),m(l,"type","number"),m(l,"id",o=n[19]),l.required=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].logs.maxDays&&fe(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function ND(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=D(),s=b("label"),l=b("spanLine truncated
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=b("div"),s=b("form"),o.c(),m(e,"class","page-header"),m(s,"class","panel"),m(s,"autocomplete","off"),m(i,"class","wrapper")},m(p,h){T(p,e,h),T(p,t,h),T(p,i,h),_(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",dt(n[4])),a=!0)},p(p,h){let g=l;l=d(p),l===g?c[l].p(p,h):(re(),P(c[g],1,1,()=>{c[g]=null}),ae(),o=c[l],o?o.p(p,h):(o=c[l]=f[l](p),o.c()),A(o,1),o.m(s,null))},i(p){r||(A(o),r=!0)},o(p){P(o),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),c[l].d(),a=!1,u()}}}function RD(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[FD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),T(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function qD(n,e,t){let i,s,l,o;Ye(n,$s,$=>t(14,s=$)),Ye(n,yo,$=>t(15,l=$)),Ye(n,Tt,$=>t(16,o=$)),Kt(Tt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const $=await pe.settings.getAll()||{};h($)}catch($){pe.errorResponseHandler($)}t(1,u=!1)}async function p(){if(!(f||!i)){t(2,f=!0);try{const $=await pe.settings.update(H.filterRedactedProps(a));h($),zt("Successfully saved application settings.")}catch($){pe.errorResponseHandler($)}t(2,f=!1)}}function h($={}){var O,E;Kt(yo,l=(O=$==null?void 0:$.meta)==null?void 0:O.appName,l),Kt($s,s=!!((E=$==null?void 0:$.meta)!=null&&E.hideControls),s),t(0,a={meta:($==null?void 0:$.meta)||{},logs:($==null?void 0:$.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function y(){a.logs.maxDays=pt(this.value),t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),M=()=>p();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,p,g,r,c,v,k,y,S,C,M]}class jD extends ye{constructor(e){super(),ve(this,e,qD,RD,he,{})}}function VD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Je(l,s[o]);return{c(){e=b("input"),Xn(e,l)},m(o,r){T(o,e,r),e.autofocus&&e.focus(),n[7](e),fe(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){Xn(e,l=on(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&fe(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function HD(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=Je(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=b("input"),m(t,"type","button"),m(t,"class","btn btn-transparent btn-circle"),m(e,"class","form-field-addon"),Xn(s,a)},m(u,f){T(u,e,f),_(e,t),T(u,i,f),T(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(Ue.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Xn(s,a=on(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Pe(o)}}}function zD(n){let e;function t(l,o){return l[3]?HD:VD}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),T(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:X,o:X,d(l){s.d(l),l&&w(e)}}}function BD(n,e,t){const i=["value","mask"];let s=At(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(p){se[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=Je(Je({},e),Qn(p)),t(5,s=At(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class lu extends ye{constructor(e){super(),ve(this,e,BD,zD,he,{value:0,mask:1})}}function UD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;return{c(){e=b("label"),t=B("Subject"),s=D(),l=b("input"),r=D(),a=b("div"),u=B(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,p=B("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(a,"class","help-block")},m(v,k){T(v,e,k),_(e,t),T(v,s,k),T(v,l,k),fe(l,n[0].subject),T(v,r,k),T(v,a,k),_(a,u),_(a,f),_(a,c),_(a,d),_(a,p),h||(g=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],h=!0)},p(v,k){k[1]&1&&i!==(i=v[31])&&m(e,"for",i),k[1]&1&&o!==(o=v[31])&&m(l,"id",o),k[0]&1&&l.value!==v[0].subject&&fe(l,v[0].subject)},d(v){v&&w(e),v&&w(s),v&&w(l),v&&w(r),v&&w(a),h=!1,Pe(g)}}}function WD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k;return{c(){e=b("label"),t=B("Action URL"),s=D(),l=b("input"),r=D(),a=b("div"),u=B(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,p=B(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,g=B("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(h,"type","button"),m(h,"class","label label-sm link-primary txt-mono"),m(h,"title","Required parameter"),m(a,"class","help-block")},m(y,S){T(y,e,S),_(e,t),T(y,s,S),T(y,l,S),fe(l,n[0].actionUrl),T(y,r,S),T(y,a,S),_(a,u),_(a,f),_(a,c),_(a,d),_(a,p),_(a,h),_(a,g),v||(k=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(h,"click",n[19])],v=!0)},p(y,S){S[1]&1&&i!==(i=y[31])&&m(e,"for",i),S[1]&1&&o!==(o=y[31])&&m(l,"id",o),S[0]&1&&l.value!==y[0].actionUrl&&fe(l,y[0].actionUrl)},d(y){y&&w(e),y&&w(s),y&&w(l),y&&w(r),y&&w(a),v=!1,Pe(k)}}}function YD(n){let e,t,i,s;return{c(){e=b("textarea"),m(e,"id",t=n[31]),m(e,"class","txt-mono"),m(e,"spellcheck","false"),m(e,"rows","14"),e.required=!0},m(l,o){T(l,e,o),fe(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&m(e,"id",t),o[0]&1&&fe(e,l[0].body)},i:X,o:X,d(l){l&&w(e),i=!1,s()}}}function KD(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=jt(o,r(n)),se.push(()=>ge(e,"value",l))),{c(){e&&V(e.$$.fragment),i=$e()},m(a,u){e&&q(e,a,u),T(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),o!==(o=a[4])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>ge(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function JD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C;const M=[KD,YD],$=[];function O(E,I){return E[4]&&!E[5]?0:1}return l=O(n),o=$[l]=M[l](n),{c(){e=b("label"),t=B("Body (HTML)"),s=D(),o.c(),r=D(),a=b("div"),u=B(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,p=B(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,g=B(`,
`),v=b("button"),v.textContent=`{ACTION_URL}
`,k=B("."),m(e,"for",i=n[31]),m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(h,"type","button"),m(h,"class","label label-sm link-primary txt-mono"),m(v,"type","button"),m(v,"class","label label-sm link-primary txt-mono"),m(v,"title","Required parameter"),m(a,"class","help-block")},m(E,I){T(E,e,I),_(e,t),T(E,s,I),$[l].m(E,I),T(E,r,I),T(E,a,I),_(a,u),_(a,f),_(a,c),_(a,d),_(a,p),_(a,h),_(a,g),_(a,v),_(a,k),y=!0,S||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],S=!0)},p(E,I){(!y||I[1]&1&&i!==(i=E[31]))&&m(e,"for",i);let L=l;l=O(E),l===L?$[l].p(E,I):(re(),P($[L],1,1,()=>{$[L]=null}),ae(),o=$[l],o?o.p(E,I):(o=$[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){y||(A(o),y=!0)},o(E){P(o),y=!1},d(E){E&&w(e),E&&w(s),$[l].d(E),E&&w(r),E&&w(a),S=!1,Pe(C)}}}function ZD(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[UD,({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:[WD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[JD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(r,a){q(e,r,a),T(r,t,a),q(i,r,a),T(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function th(n){let e,t,i,s,l;return{c(){e=b("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){T(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function GD(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&th();return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),l=B(n[2]),o=D(),r=b("div"),a=D(),f&&f.c(),u=$e(),m(t,"class","ri-draft-line"),m(s,"class","txt"),m(e,"class","inline-flex"),m(r,"class","flex-fill")},m(c,d){T(c,e,d),_(e,t),_(e,i),_(e,s),_(s,l),T(c,o,d),T(c,r,d),T(c,a,d),f&&f.m(c,d),T(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=th(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function XD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[GD],default:[ZD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?on(i,[xn(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let nh;function QD(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=At(e,s),o;Ye(n,fi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=nh,d=!1;function p(){f==null||f.expand()}function h(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-afa58a50.js"),["./CodeEditor-afa58a50.js","./index-a6ccb683.js"],import.meta.url)).default),nh=c,t(5,d=!1))}function k(J){H.copyToClipboard(J),M_(`Copied ${J} to clipboard`,2e3)}v();function y(){u.subject=this.value,t(0,u)}const S=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),O=()=>k("{APP_URL}"),E=()=>k("{TOKEN}");function I(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function L(){u.body=this.value,t(0,u)}const N=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),R=()=>k("{TOKEN}"),K=()=>k("{ACTION_URL}");function x(J){se[J?"unshift":"push"](()=>{f=J,t(3,f)})}function U(J){ze.call(this,n,J)}function G(J){ze.call(this,n,J)}function ne(J){ze.call(this,n,J)}return n.$$set=J=>{e=Je(Je({},e),Qn(J)),t(8,l=At(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Qi(r))},[u,r,a,f,c,d,i,k,l,p,h,g,o,y,S,C,M,$,O,E,I,L,N,F,R,K,x,U,G,ne]}class Ar extends ye{constructor(e){super(),ve(this,e,QD,XD,he,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return thi Line truncated
<span class="txt">Send test email</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded btn-outline")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function vE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),s=b("button"),l=b("span"),l.textContent="Save changes",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],m(l,"class","txt"),m(s,"type","submit"),m(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){T(u,e,f),_(e,t),T(u,i,f),T(u,s,f),_(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function yE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v;const k=[aE,rE],y=[];function S(C,M){return C[2]?0:1}return d=S(n),p=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=B(n[5]),r=D(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),p.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(C,M){T(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),T(C,r,M),T(C,a,M),_(a,u),_(u,f),_(u,c),y[d].m(u,null),h=!0,g||(v=Y(u,"submit",dt(n[27])),g=!0)},p(C,M){(!h||M[0]&32)&&le(o,C[5]);let $=d;d=S(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),p=y[d],p?p.p(C,M):(p=y[d]=k[d](C),p.c()),A(p,1),p.m(u,null))},i(C){h||(A(p),h=!0)},o(C){P(p),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),g=!1,v()}}}function kE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[yE]},$$scope:{ctx:n}}});let r={};return l=new oE({props:r}),n[28](l),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),T(a,t,u),q(i,a,u),T(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function wE(n,e,t){let i,s,l;Ye(n,Tt,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Kt(Tt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;p();async function p(){t(2,c=!0);try{const ne=await pe.settings.getAll()||{};g(ne)}catch(ne){pe.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await pe.settings.update(H.filterRedactedProps(f));g(ne),Bn({}),zt("Successfully saved mail settings.")}catch(ne){pe.errorResponseHandler(ne)}t(3,d=!1)}}function g(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function y(){f.meta.senderAddress=this.value,t(0,f)}function S(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function C(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function $(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=pt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>v(),K=()=>h(),x=()=>a==null?void 0:a.show(),U=()=>h();function G(ne){se[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,h,v,u,i,k,y,S,C,M,$,O,E,I,L,N,F,R,K,x,U,G]}class SE extends ye{constructor(e){super(),ve(this,e,wE,kE,he,{},null,[-1,-1])}}function TE(n){var C,M;let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[$E,({uniqueId:$})=>({25:$}),({uniqueId:$})=>$?33554432:0]},$$scope:{ctx:n}}});let v=((C=n[0].s3)==null?void 0:C.enabled)!=n[1].s3.enabled&&rh(n),k=n[1].s3.enabled&&ah(n),y=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&uh(n),S=n[6]&&fh(n);return{c(){V(e.$$.fragment),t=D(),v&&v.c(),i=D(),k&&k.c(),s=D(),l=b("div"),o=b("div"),r=D(),y&&y.c(),a=D(),S&&S.c(),u=D(),f=b("button"),c=b("span"),c.textContent="Save changes",m(o,"class",Line truncated
the
`),r=b("strong"),u=B(a),f=B(`
to the
`),c=b("strong"),p=B(d),h=B(`.
`),g=b("br"),v=B(`
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
`,y=B(`,
`),S=b("a"),S.textContent=`s5cmd
`,C=B(", etc."),M=D(),$=b("div"),m(i,"class","icon"),m(k,"href","https://github.com/rclone/rclone"),m(k,"target","_blank"),m(k,"rel","noopener noreferrer"),m(k,"class","txt-bold"),m(S,"href","https://github.com/peak/s5cmd"),m(S,"target","_blank"),m(S,"rel","noopener noreferrer"),m(S,"class","txt-bold"),m(l,"class","content"),m(t,"class","alert alert-warning m-0"),m($,"class","clearfix m-t-base")},m(L,N){T(L,e,N),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),_(l,r),_(r,u),_(l,f),_(l,c),_(c,p),_(l,h),_(l,g),_(l,v),_(l,k),_(l,y),_(l,S),_(l,C),_(e,M),_(e,$),E=!0},p(L,N){var F;(!E||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!E||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(p,d)},i(L){E||(L&&Ge(()=>{O||(O=qe(e,St,{duration:150},!0)),O.run(1)}),E=!0)},o(L){L&&(O||(O=qe(e,St,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&w(e),L&&O&&O.end()}}}function ah(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M,$;return i=new me({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[ME,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[OE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"s3.region",$$slots:{default:[DE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[EE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[AE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),y=new me({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[IE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=D(),l=b("div"),V(o.$$.fragment),r=D(),a=b("div"),V(u.$$.fragment),f=D(),c=b("div"),V(d.$$.fragment),p=D(),h=b("div"),V(g.$$.fragment),v=D(),k=b("div"),V(y.$$.fragment),S=D(),C=b("div"),m(t,"class","col-lg-6"),m(l,"class","col-lg-3"),m(a,"class","col-lg-3"),m(c,"class","col-lg-6"),m(h,"class","col-lg-6"),m(k,"class","col-lg-12"),m(C,"class","col-lg-12"),m(e,"class","grid")},m(O,E){T(O,e,E),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),_(e,a),q(u,a,null),_(e,f),_(e,c),q(d,c,null),_(e,p),_(e,h),q(g,h,null),_(e,v),_(e,k),q(y,k,null),_(e,S),_(e,C),$=!0},p(O,E){const I={};E&100663298&&(I.$$scope={dirty:E,ctx:O}),i.$set(I);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:O}),u.$set(N);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),d.$set(F);const R={};E&100663298&&(R.$$scope={dirty:E,ctx:O}),g.$set(R);const K={};E&100663298&&(K.$$scope={dirty:E,ctx:O}),y.$set(K)},i(O){$||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(g.$$.fragment,O),A(y.$$.fragment,O),O&&Ge(()=>{M||(M=qe(e,St,{duration:150},!0)),M.run(1)}),$=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(d.$$.fragment,O),P(g.$$.fragment,O),P(y.$$.fragment,O),O&&(M||(M=qe(e,St,{duration:150},!1)),M.run(0)),$=!1},d(O){O&&w(e),j(i),j(o),j(u),j(d),j(g),j(y),O&&M&&M.end()}}}function ME(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Endpoint"),s=D(),l=b("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[1].s3.endpoint),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&fe(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function OE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Bucket"),s=D(),l=b("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&fe(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function DE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Region"),s=D(),l=b("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[1].s3.region),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.region&&fe(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function EE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Access key"),s=D(),l=b("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){T(u,e,f),_(e,t),T(u,s,f),T(u,l,f),fe(l,n[1].s3.accessKey),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==( Line truncated
<span class="txt">S3 connected successfully</span>`,m(e,"class","label label-sm label-success entrance-right")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function LE(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,m(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;T(l,e,o),i||(s=Ie(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function NE(n){let e;return{c(){e=b("span"),m(e,"class","loader loader-sm")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function fh(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){T(l,e,o),_(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function FE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v;const k=[CE,TE],y=[];function S(C,M){return C[2]?0:1}return d=S(n),p=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=B(n[7]),r=D(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=D(),p.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(C,M){T(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),T(C,r,M),T(C,a,M),_(a,u),_(u,f),_(u,c),y[d].m(u,null),h=!0,g||(v=Y(u,"submit",dt(n[20])),g=!0)},p(C,M){(!h||M&128)&&le(o,C[7]);let $=d;d=S(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),p=y[d],p?p.p(C,M):(p=y[d]=k[d](C),p.c()),A(p,1),p.m(u,null))},i(C){h||(A(p),h=!0)},o(C){P(p),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),g=!1,v()}}}function RE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[FE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),T(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function qE(n,e,t){let i,s,l;Ye(n,Tt,F=>t(7,l=F)),Kt(Tt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;p();async function p(){t(2,a=!0);try{const F=await pe.settings.getAll()||{};g(F)}catch(F){pe.errorResponseHandler(F)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{pe.cancelRequest(lo);const F=await pe.settings.update(H.filterRedactedProps(r));Bn({}),await g(F),$a(),c?Iv("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(F){pe.errorResponseHandler(F)}t(3,u=!1)}}async function g(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function v(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){pe.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{pe.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await pe.settings.testS3({$cancelKey:lo})}catch(F){t(5,c=F)}t(4,f=!1),clearTimeout(d)}}Zt(()=>()=>{clearTimeout(d)});function y(){r.s3.enabled=this.checked,t(1,r)}function S(){r.s3.endpoint=this.value,t(1,r)}function C(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function $(){r.s3.accessKey=this.value,t(1,r)}function O(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>v(),L=()=>h(),N=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,v,i,y,S,C,M,$,O,E,I,L,N]}class jE extends ye{constructor(e){super(),ve(this,e,qE,RE,he,{})}}function VE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[21]),m(s,"for",o=n[21])},m(u,f){T(u,e,f),e.checked=n[0].enabled,T(u,i,f),T(u,s,f),_(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&m(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function HE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Client ID"),s=D(),l=b("input"),m(e,"for",i=n[21]),m(l,"type","text"),m(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){T(f,e,c),_(e,t),T(f,s,c),T(f,l,c),fe(l,n[0].clientId),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&m(e,"for",i),c&2097152&&o!==(o=f[21])&&m(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&fe(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function zE(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new lu({props:u}),se.push(()=>ge(l,"value",a)),{c(){e=b("label"),t=B("Client Secret"),s=D(),V(l.$$.fragment),m(e,"for",i=n[21])},m(f,c){T(f,e,c),_(e,t),T(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&m(e,"for",i);const d={};c&2097152&&(d.id=f[21]),c&1&&(d.required=f[0].enabled),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function ch(n){let e,t,i,s;function l(a){n[16](a)}var o=n[4];function r(a){let u={key:a[1]};return a[0]!==void 0&&(u.config=a[0]),{props:u}}return o&&(t=jt(o,r(n)),se.push(()=>ge(t,"config",l))),{c(){e=b("div"),t&&V(t.$$.fragment),m(e,"class","col-lg-12")},m(a,u){T(a,e,u),t&&q(t,e,null),s=!0},p(a,u){const f={};if(u&2&&(f.key=a[1]),!i&&u&1&&(i=!0,f.config=a[0],ke(()=>i=!1)),o!==(o=a[4])){if(t){re();const c=t;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(t=jt(o,r(a)),se.push(()=>ge(t,"config",l)),V(t.$$.fragment),A(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}functionLine truncated
<span class="txt">Show all</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-hint m-t-10")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[13]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function bh(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){T(l,e,o),_(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function QE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v;const k=[XE,GE],y=[];function S(C,M){return C[2]?0:1}return d=S(n),p=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=B(n[6]),r=D(),a=b("div"),u=b("form"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=D(),p.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(C,M){T(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),T(C,r,M),T(C,a,M),_(a,u),_(u,f),_(u,c),y[d].m(u,null),h=!0,g||(v=Y(u,"submit",dt(n[7])),g=!0)},p(C,M){(!h||M&64)&&le(o,C[6]);let $=d;d=S(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),p=y[d],p?p.p(C,M):(p=y[d]=k[d](C),p.c()),A(p,1),p.m(u,null))},i(C){h||(A(p),h=!0)},o(C){P(p),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),g=!1,v()}}}function xE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[QE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),T(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&2097279&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function eA(n,e,t){let i,s,l;Ye(n,Tt,C=>t(6,l=C)),Kt(Tt,l="Auth providers",l);let o={},r={},a={},u=!1,f=!1,c=!1;d();async function d(){t(2,u=!0);try{const C=await pe.settings.getAll()||{};h(C)}catch(C){pe.errorResponseHandler(C)}t(2,u=!1)}async function p(){var C;if(!(f||!s)){t(3,f=!0);try{const M=await pe.settings.update(H.filterRedactedProps(a));h(M),Bn({}),(C=o[Object.keys(o)[0]])==null||C.collapseSiblings(),zt("Successfully updated auth providers.")}catch(M){pe.errorResponseHandler(M)}t(3,f=!1)}}function h(C){C=C||{},t(0,a={});for(const M in vl)t(0,a[M]=Object.assign({enabled:!1},C[M]),a);t(9,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(C,M){se[C?"unshift":"push"](()=>{o[M]=C,t(1,o)})}function k(C,M){n.$$.not_equal(a[M],C)&&(a[M]=C,t(0,a))}const y=()=>t(4,c=!0),S=()=>g();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(r)),n.$$.dirty&1025&&t(5,s=i!=JSON.stringify(a))},[a,o,u,f,c,s,l,p,g,r,i,v,k,y,S]}class tA extends ye{constructor(e){super(),ve(this,e,eA,xE,he,{})}}function vh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function nA(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,p,h=n[5];const g=k=>k[16].key;for(let k=0;k<h.length;k+=1){let y=vh(n,h,k),S=g(y);t.set(S,e[k]=yh(S,y))}let v=n[3]&&kh(n);return{c(){for(let k=0;k<e.length;k+=1)e[k].c();i=D(),s=b("div"),l=b("div"),o=D(),v&&v.c(),r=D(),a=b("button"),u=b("span"),u.textContent="Save changes",m(l,"class","flex-fill"),m(u,"class","txt"),m(a,"type","submit"),m(a,"class","btn btn-expanded"),a.disabled=f=!n[3]||n[2],Q(a,"btn-loading",n[2]),m(s,"class","flex")},m(k,y){for(let S=0;S<e.length;S+=1)e[S].m(k,y);T(k,i,y),T(k,s,y),_(s,l),_(s,o),v&&v.m(s,null),_(s,r),_(s,a),_(a,u),c=!0,d||(p=Y(a,"click",n[13]),d=!0)},p(k,y){y&524321&&(h=k[5],re(),e=wt(e,y,g,1,k,h,t,i.parentNode,ln,yh,i,vh),ae()),k[3]?v?v.p(k,y):(v=kh(k),v.c(),v.m(s,r)):v&&(v.d(1),v=null),(!c||y&12&&f!==(f=!k[3]||k[2]))&&(a.disabled=f),(!c||y&4)&&Q(a,"btn-loading",k[2])},i(k){if(!c){for(let y=0;y<h.length;y+=1)A(e[y]);c=!0}},o(k){for(let y=0;y<e.length;y+=1)P(e[y]);c=!1},d(k){for(let y=0;y<e.length;y+=1)e[y].d(k);k&&w(i),k&&w(s),v&&v.d(),d=!1,p()}}}function iA(n){let e;return{c(){e=b("div"),m(e,"class","loader")},m(t,i){T(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function sA(n){let e,t=n[16].label+"",i,s,l,o,r,a,u,f,c,d,p;function h(){n[10].call(r,n[16])}function g(){return n[11](n[16])}return{c(){e=b("label"),i=B(t),s=B(" duration (in seconds)"),o=D(),r=b("input"),u=D(),f=b("div"),c=b("span"),c.textContent="Invalidate all previously issued tokens",m(e,"for",l=n[19]),m(r,"type","number"),m(r,"id",a=n[19]),r.required=!0,m(c,"class","link-primary"),Q(c,"txt-success",n[0][n[16].key].secret),m(f,"class","help-block")},m(v,k){T(v,e,k),_(e,i),_(e,s),T(v,o,k),T(v,r,k),fe(r,n[0][n[16].key].duration),T(v,u,k),T(v,f,k),_(f,c),d||(p=[Y(r,"input",h),Y(c,"click",g)],d=!0)},p(v,k){n=v,k&524288&&l!==(l=n[19])&&m(e,"for",l),k&524288&&a!==(a=n[19])&&m(r,"id",a),k&33&&pt(r.value)!==n[0][n[16].key].duration&&fe(r,n[0][n[16].key].duration),k&33&&Q(c,"txt-success",n[0][n[16].key].secret)},d(v){v&&w(e),v&&w(o),v&&w(r),Line truncated
another PocketBase environment.</p>`,t=D(),i=b("div"),s=b("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),V(o.$$.fragment),r=D(),a=b("div"),u=b("div"),f=D(),c=b("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,m(e,"class","content txt-xl m-b-base"),m(s,"type","button"),m(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),m(i,"tabindex","0"),m(i,"class","export-preview svelte-jm5c4z"),m(u,"class","flex-fill"),m(c,"type","button"),m(c,"class","btn btn-expanded"),m(a,"class","flex m-t-base")},m(g,v){T(g,e,v),T(g,t,v),T(g,i,v),_(i,s),_(i,l),q(o,i,null),n[8](i),T(g,r,v),T(g,a,v),_(a,u),_(a,f),_(a,c),d=!0,p||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],p=!0)},p(g,v){const k={};v&4&&(k.content=g[2]),o.$set(k)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){P(o.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(t),g&&w(i),j(o),n[8](null),g&&w(r),g&&w(a),p=!1,Pe(h)}}}function fA(n){let e;return{c(){e=b("div"),m(e,"class","loader")},m(t,i){T(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function cA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=[fA,uA],h=[];function g(v,k){return v[1]?0:1}return f=g(n),c=h[f]=p[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=B(n[3]),r=D(),a=b("div"),u=b("div"),c.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(v,k){T(v,e,k),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),T(v,r,k),T(v,a,k),_(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k&8)&&le(o,v[3]);let y=f;f=g(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=p[f](v),c.c()),A(c,1),c.m(u,null))},i(v){d||(A(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function dA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[cA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),T(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function pA(n,e,t){let i,s;Ye(n,Tt,v=>t(3,s=v)),Kt(Tt,s="Export collections",s);const l="export_"+H.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await pe.collections.getFullList(100,{$cancelKey:l}));for(let v of r)delete v.created,delete v.updated}catch(v){pe.errorResponseHandler(v)}t(1,a=!1)}function f(){H.downloadJson(r,"pb_schema")}function c(){H.copyToClipboard(i),M_("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function p(v){se[v?"unshift":"push"](()=>{o=v,t(0,o)})}const h=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,p,h,g]}class mA extends ye{constructor(e){super(),ve(this,e,pA,dA,he,{})}}function wh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Sh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Th(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function $h(n,e,t){const i=n.slice();return i[14]=e[t],i}function Mh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Oh(n,e,t){const i=n.slice();return i[30]=e[t],i}function hA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Dh(),a=n[0].name!==n[1].name&&Eh(n);return{c(){e=b("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=b("strong"),o=B(l),m(s,"class","txt"),m(e,"class","inline-flex fleg-gap-5")},m(u,f){T(u,e,f),r&&r.m(e,null),_(e,t),a&&a.m(e,null),_(e,i),_(e,s),_(s,o)},p(u,f){u[9]?r||(r=Dh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Eh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function gA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=D(),i=b("strong"),l=B(s),m(e,"class","label label-danger")},m(r,a){T(r,e,a),T(r,t,a),T(r,i,a),_(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function _A(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Added",t=D(),i=b("strong"),l=B(s),m(e,"class","label label-success")},m(r,a){T(r,e,a),T(r,t,a),T(r,i,a),_(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function Dh(n){let e;return{c(){e=b("span"),e.textContent="Changed",m(e,"class","label label-warning")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function Eh(n){let e,t=n[0].name+"",i,s,l;return{c(){e=b("strong"),i=B(t),s=D(),l=b("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){T(o,e,r),_(e,i),T(o,s,r),T(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Ah(n){var v,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((v=n[0])==null?void 0:v[n[30]])+"",Line truncated
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=b("tbody");for(let C=0;C<h.length;C+=1)h[C].c();r=D(),g&&g.c(),a=D();for(let C=0;C<k.length;C+=1)k[C].c();u=D();for(let C=0;C<S.length;C+=1)S[C].c();m(e,"class","section-title"),m(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,M){T(C,e,M),d.m(e,null),T(C,t,M),T(C,i,M),_(i,s),_(i,l),_(i,o);for(let $=0;$<h.length;$+=1)h[$].m(o,null);_(o,r),g&&g.m(o,null),_(o,a);for(let $=0;$<k.length;$+=1)k[$].m(o,null);_(o,u);for(let $=0;$<S.length;$+=1)S[$].m(o,null)},p(C,M){if(c===(c=f(C))&&d?d.p(C,M):(d.d(1),d=c(C),d&&(d.c(),d.m(e,null))),M[0]&7203){p=C[11];let $;for($=0;$<p.length;$+=1){const O=Oh(C,p,$);h[$]?h[$].p(O,M):(h[$]=Ah(O),h[$].c(),h[$].m(o,r))}for(;$<h.length;$+=1)h[$].d(1);h.length=p.length}if(C[2]||C[5]?g?g.p(C,M):(g=Ih(C),g.c(),g.m(o,a)):g&&(g.d(1),g=null),M[0]&4248){v=C[7];let $;for($=0;$<v.length;$+=1){const O=Th(C,v,$);k[$]?k[$].p(O,M):(k[$]=Rh(O),k[$].c(),k[$].m(o,u))}for(;$<k.length;$+=1)k[$].d(1);k.length=v.length}if(M[0]&4352){y=C[8];let $;for($=0;$<y.length;$+=1){const O=wh(C,y,$);S[$]?S[$].p(O,M):(S[$]=jh(O),S[$].c(),S[$].m(o,null))}for(;$<S.length;$+=1)S[$].d(1);S.length=y.length}},i:X,o:X,d(C){C&&w(e),d.d(),C&&w(t),C&&w(i),ht(h,C),g&&g.d(),ht(k,C),ht(S,C)}}}function Mn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function un(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function vA(n,e,t){let i,s,l,{collectionA:o=new pn}=e,{collectionB:r=new pn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],p=[];const h=Object.keys(new pn().export()).filter(k=>!["schema","created","updated"].includes(k));function g(){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(y=>k.id==y.id))))}function v(k){return typeof k>"u"?"":H.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,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(y=>k.id==y.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(y=>y.id==k.id))),n.$$.dirty[0]&24&&t(8,p=f.filter(k=>!u.find(y=>y.id==k.id))),n.$$.dirty[0]&7&&t(9,l=H.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,p,l,s,h,v]}class yA extends ye{constructor(e){super(),ve(this,e,vA,bA,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Vh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Hh(n){let e,t;return e=new yA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function kA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Hh(Vh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=$e()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);T(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Vh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Hh(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function wA(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",m(e,"class","center txt-break")},m(t,i){T(t,e,i)},p:X,d(t){t&&w(e)}}}function SA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=B("Close"),i=D(),s=b("button"),l=b("span"),l.textContent="Confirm and import",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[4],m(l,"class","txt"),m(s,"type","button"),m(s,"class","btn btn-expanded"),s.disabled=n[4],Q(s,"btn-loading",n[4])},m(a,u){T(a,e,u),_(e,t),T(a,i,u),T(a,s,u),_(s,l),o||(r=[Y(e,"click",n[0]),Y(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&Q(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Pe(r)}}}function TA(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[SA],header:[wA],default:[kA]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function CA(n,e,t){const i=Mt();let s,l=[Line truncated
- ${C.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await pe.collections.import(o,a),zt("Successfully imported collections configuration."),i("submit")}catch(C){pe.errorResponseHandler(C)}t(4,u=!1),c()}}const g=()=>p(),v=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function y(C){ze.call(this,n,C)}function S(C){ze.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,p,f,l,o,g,v,k,y,S]}class $A extends ye{constructor(e){super(),ve(this,e,CA,TA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function zh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Bh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[32]=e[t],i}function MA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,v,k,y,S,C,M,$,O;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[DA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,I=n[6]&&n[1].length&&!n[7]&&Yh(),L=n[6]&&n[1].length&&n[7]&&Kh(n),N=n[13].length&&sg(n),F=!!n[0]&&lg(n);return{c(){e=b("input"),t=D(),i=b("div"),s=b("p"),l=B(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),V(a.$$.fragment),u=D(),f=D(),I&&I.c(),c=D(),L&&L.c(),d=D(),N&&N.c(),p=D(),h=b("div"),F&&F.c(),g=D(),v=b("div"),k=D(),y=b("button"),S=b("span"),S.textContent="Review",m(e,"type","file"),m(e,"class","hidden"),m(e,"accept",".json"),m(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),m(i,"class","content txt-xl m-b-base"),m(v,"class","flex-fill"),m(S,"class","txt"),m(y,"type","button"),m(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=C=!n[14],m(h,"class","flex m-t-base")},m(R,K){T(R,e,K),n[19](e),T(R,t,K),T(R,i,K),_(i,s),_(s,l),_(s,o),T(R,r,K),q(a,R,K),T(R,u,K),T(R,f,K),I&&I.m(R,K),T(R,c,K),L&&L.m(R,K),T(R,d,K),N&&N.m(R,K),T(R,p,K),T(R,h,K),F&&F.m(h,null),_(h,g),_(h,v),_(h,k),_(h,y),_(y,S),M=!0,$||(O=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],$=!0)},p(R,K){(!M||K[0]&4096)&&Q(o,"btn-loading",R[12]);const x={};K[0]&64&&(x.class="form-field "+(R[6]?"":"field-error")),K[0]&65|K[1]&1536&&(x.$$scope={dirty:K,ctx:R}),a.$set(x),R[6]&&R[1].length&&!R[7]?I||(I=Yh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?L?L.p(R,K):(L=Kh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?N?N.p(R,K):(N=sg(R),N.c(),N.m(p.parentNode,p)):N&&(N.d(1),N=null),R[0]?F?F.p(R,K):(F=lg(R),F.c(),F.m(h,g)):F&&(F.d(1),F=null),(!M||K[0]&16384&&C!==(C=!R[14]))&&(y.disabled=C)},i(R){M||(A(a.$$.fragment,R),A(E),M=!0)},o(R){P(a.$$.fragment,R),P(E),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),I&&I.d(R),R&&w(c),L&&L.d(R),R&&w(d),N&&N.d(R),R&&w(p),R&&w(h),F&&F.d(),$=!1,Pe(O)}}}function OA(n){let e;return{c(){e=b("div"),m(e,"class","loader")},m(t,i){T(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Wh(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",m(e,"class","help-block help-block-error")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function DA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Wh();return{c(){e=b("label"),t=B("Collections"),s=D(),l=b("textarea"),r=D(),c&&c.c(),a=$e(),m(e,"for",i=n[40]),m(e,"class","p-b-10"),m(l,"id",o=n[40]),m(l,"class","code"),m(l,"spellcheck","false"),m(l,"rows","15"),l.required=!0},m(d,p){T(d,e,p),_(e,t),T(d,s,p),T(d,l,p),fe(l,n[0]),T(d,r,p),c&&c.m(d,p),T(d,a,p),u||(f=Y(l,"input",n[22]),u=!0)},p(d,p){p[1]&512&&i!==(i=d[40])&&m(e,"for",i),p[1]&512&&o!==(o=d[40])&&m(l,"id",o),p[0]&1&&fe(l,d[0]),d[0]&&!d[6]?c||(c=Wh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function Yh(n){let e;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,m(e,"class","alert alert-info")},m(t,i){T(t,e,i)},d(t){t&&w(e)}}}function Kh(n){let e,t,i,s,l,o=n[9].length&&Jh(n),r=n[4].length&&Xh(n),a=n[8].length&&tg(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=D(),i=b("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),m(e,"class","section-title"),m(i,"class","list")},m(u,f){T(u,e,f),T(u,t,f),T(u,i,f),o&&o.m(i,null),_(i,s),r&&r.m(i,null),_(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Jh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Xh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=tg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Jh(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Uh(n,s,o),a=l(r);t.set(a,e[o]=Gh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);T(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=wt(e,r,l,1,o,s,t,i.parentNode,es,Gh,i,Uh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Zh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){T(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function Gh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Zh(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",s=D(),l=b("strong"),r=B(o),a=D(),f&&f.c(),u=D(),m(i,"class","label label-danger list-label svelte-1jx20fl"),m(t,"class","list-item"),this.first=t},m(c,d){T(c,t,d),_(t,i),_(t,s),_(t,l),_(l,r),_(t,a),f&&f.m(t,null),_(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=Zh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Xh(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=Bh(n,s,o),a=l(r);t.set(a,e[o]=eg(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);T(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=wt(e,r,l,1,o,s,t,i.parentNode,es,eg,i,Bh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Qh(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=b("strong"),i=B(t),s=D(),l=b("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){T(o,e,r),_(e,i),T(o,s,r),T(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function xh(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=b("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){T(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function eg(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&Qh(e),p=e[35].new.id&&xh(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",s=D(),l=b("div"),d&&d.c(),o=D(),r=b("strong"),u=B(a),f=D(),p&&p.c(),c=D(),m(i,"class","label label-warning list-label svelte-1jx20fl"),m(l,"class","inline-flex flex-gap-5"),m(t,"class","list-item"),this.first=t},m(h,g){T(h,t,g),_(t,i),_(t,s),_(t,l),d&&d.m(l,null),_(l,o),_(l,r),_(r,u),_(l,f),p&&p.m(l,null),_(t,c)},p(h,g){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,g):(d=Qh(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),g[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?p?p.p(e,g):(p=xh(e),p.c(),p.m(l,null)):p&&(p.d(1),p=null)},d(h){h&&w(t),d&&d.d(),p&&p.d()}}}function tg(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=zh(n,s,o),a=l(r);t.set(a,e[o]=ig(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);T(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=wt(e,r,l,1,o,s,t,i.parentNode,es,ig,i,zh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function ng(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){T(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function ig(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&ng(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Added",s=D(),l=b("strong"),r=B(o),a=D(),f&&f.c(),u=D(),m(i,"class","label label-success list-label svelte-1jx20fl"),m(t,"class","list-item"),this.first=t},m(c,d){T(c,t,d),_(t,i),_(t,s),_(t,l),_(l,r),_(t,a),f&&f.m(t,null),_(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=ng(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function sg(n){let e,t,i,s,l,o,r,a;return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=b("div"),s.innerHTML=`<string>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.</string>`,l=D(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',m(t,"class","icon"),m(s,"class","content"),m(o,"type","button"),m(o,"class","btn btn-warning btn-sm btn-outline"),m(e,"class","alert alert-warning m-t-base")},m(u,f){T(u,e,f),_(e,t),_(e,i),_(e,s),_(e,l),_(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:X,d(u){u&&w(e),r=!1,a()}}}function lg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"),m(e,"class","btn btn-transparent link-hint")},m(s,l){T(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function EA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=[OA,MA],h=[];function g(v,k){return v[5]?0:1}return f=g(n),c=h[f]=p[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=B(n[15]),r=D(),a=b("div"),u=b("div"),c.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(v,k){T(v,e,k),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),T(v,r,k),T(v,a,k),_(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=g(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=p[f](v),c.c()),A(c,1),c.m(u,null))},i(v){d||(A(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function AA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[EA]},$$scope:{ctx:n}}});let r={};return l=new $A({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),T(a,t,u),q(i,a,u),T(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function IA(n,e,t){let i,s,l,o,r,a,u;Ye(n,Tt,J=>t(15,u=J)),Kt(Tt,u="Import collections",u);let f,c,d="",p=!1,h=[],g=[],v=!0,k=[],y=!1;S();async function S(){t(5,y=!0);try{t(2,g=await pe.collections.getFullList(200));for(let J of g)delete J.created,delete J.updated}catch(J){pe.errorResponseHandler(J)}t(5,y=!1)}function C(){if(t(4,k=[]),!!i)for(let J of h){const ue=H.findByKey(g,"id",J.id);!(ue!=null&&ue.id)||!H.hasCollectionChanges(ue,J,v)||k.push({new:J,old:ue})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=H.filterDuplicatesByKey(J.schema)}function $(){var J,ue;for(let Z of h){const de=H.findByKey(g,"name",Z.name)||H.findByKey(g,"id",Z.id);if(!de)continue;const _e=Z.id,Ce=de.id;Z.id=Ce;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const be of Re){const Se=H.findByKey(Ne,"name",be.name);Se&&Se.id&&(be.id=Se.id)}for(let be of h)if(Array.isArray(be.schema))for(let Se of be.schema)(J=Se.options)!=null&&J.collectionId&&((ue=Se.options)==null?void 0:ue.collectionId)===_e&&(Se.options.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function O(J){t(12,p=!0);const ue=new FileReader;ue.onload=async Z=>{t(12,p=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(cl("Invalid collections configuration."),E())},ue.onerror=Z=>{console.warn(Z),cl("Failed to load the imported JSON."),t(12,p=!1),t(10,f.value="",f)},ue.readAsText(J)}function E(){t(0,d=""),t(10,f.value="",f),Bn({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&O(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>$(),x=()=>E(),U=()=>c==null?void 0:c.show(g,h,v);function G(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(J=>i&&v&&!H.findByKey(h,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(J=>i&&!H.findByKey(g,"id",J.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof v<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!y&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(J=>{let ue=H.findByKey(g,"name",J.name)||H.findByKey(g,"id",J.id);if(!ue)return!1;if(ue.id!=J.id)return!0;const Z=Array.isArray(ue.schema)?ue.schema:[],de=Array.isArray(J.schema)?J.schema:[];for(const _e of de){if(H.findByKey(Z,"id",_e.id))continue;const Ne=H.findByKey(Z,"name",_e.name);if(Ne&&_e.id!=Ne.id)return!0}return!1}))},[d,h,g,v,k,y,i,o,l,s,f,c,p,a,r,u,$,O,E,I,L,N,F,R,K,x,U,G,ne]}class PA extends ye{constructor(e){super(),ve(this,e,IA,AA,he,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Oi("/"):!0}],LA={"/login":Ot({component:DD,conditions:Pt.coLine truncated
<span class="txt">Manage admins</span>`,t=D(),i=b("hr"),s=D(),l=b("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,m(e,"href","/settings/admins"),m(e,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item closable")},m(a,u){T(a,e,u),T(a,t,u),T(a,i,u),T(a,s,u),T(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:X,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function ZA(n){var p;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=H.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((p=n[0])==null?void 0:p.id)&&n[1]&&ag(n);return o=new hb({props:{routes:LA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new zA({}),f=new KA({}),{c(){t=D(),i=b("div"),d&&d.c(),s=D(),l=b("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),m(l,"class","app-body"),m(i,"class","app-layout")},m(h,g){T(h,t,g),T(h,i,g),d&&d.m(i,null),_(i,s),_(i,l),q(o,l,null),_(l,r),q(a,l,null),T(h,u,g),q(f,h,g),c=!0},p(h,[g]){var v;(!c||g&12)&&e!==(e=H.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,g),g&3&&A(d,1)):(d=ag(h),d.c(),A(d,1),d.m(i,s)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function GA(n,e,t){let i,s,l,o;Ye(n,$s,p=>t(8,i=p)),Ye(n,yo,p=>t(2,s=p)),Ye(n,Oa,p=>t(0,l=p)),Ye(n,Tt,p=>t(3,o=p));let r,a=!1;function u(p){var h,g,v,k;((h=p==null?void 0:p.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(g=p==null?void 0:p.detail)==null?void 0:g.userData)!=null&&v.showAppSidebar)),r=(k=p==null?void 0:p.detail)==null?void 0:k.location,Kt(Tt,o="",o),Bn({}),A1())}function f(){Oi("/")}async function c(){var p,h;if(l!=null&&l.id)try{const g=await pe.settings.getAll({$cancelKey:"initialAppSettings"});Kt(yo,s=((p=g==null?void 0:g.meta)==null?void 0:p.appName)||"",s),Kt($s,i=!!((h=g==null?void 0:g.meta)!=null&&h.hideControls),i)}catch(g){g!=null&&g.isAbort||console.warn("Failed to load app settings.",g)}}function d(){pe.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class XA extends ye{constructor(e){super(),ve(this,e,GA,ZA,he,{})}}new XA({target:document.getElementById("app")});export{Pe as A,zt as B,H as C,Oi as D,$e as E,D_ as F,_a as G,hu as H,Ye as I,Ai as J,Mt as K,Zt as L,se as M,O1 as N,wt as O,es as P,ln as Q,pn as R,ye as S,Pr as T,P as a,D as b,V as c,j as d,b as e,m as f,T as g,_ as h,ve as i,Ie as j,re as k,xt as l,q as m,ae as n,w as o,pe as p,me as q,Q as r,he as s,A as t,Y as u,dt as v,B as w,le as x,X as y,fe as z};
+203
View File
@@ -0,0 +1,203 @@
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function X(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function Zb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function f_(n){return n()}function ru(){return Object.create(null)}function Pe(n){n.forEach(f_)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function zn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Gb(n){return Object.keys(n).length===0}function c_(n,...e){if(n==null)return X;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(c_(e,t))}function Nt(n,e,t,i){if(n){const s=d_(n,e,t,i);return n[0](s)}}function d_(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Rt(n,e,t,i,s,l){if(s){const o=d_(e,t,i,l);n.p(o,s)}}function qt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Qn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function At(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Si(n){return n??""}function Kt(n,e,t){return n.set(t),e}function Ie(n){return n&&Bt(n.destroy)?n.destroy:X}const p_=typeof window<"u";let Fo=p_?()=>window.performance.now():()=>Date.now(),da=p_?n=>requestAnimationFrame(n):X;const bs=new Set;function m_(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&da(m_)}function Ro(n){let e;return bs.size===0&&da(m_),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function h_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Xb(n){const e=b("style");return Qb(h_(n),e),e.sheet}function Qb(n,e){return g(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function z(n){return document.createTextNode(n)}function O(){return z(" ")}function Ce(){return z("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(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)}function Xn(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?n[i]=e[i]:p(n,i,e[i])}function pt(n){return n===""?null:+n}function xb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function re(n,e){n.value=e??""}function Lr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function __(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Ht(n,e){return new n(e)}const mo=new Map;let ho=0;function e1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function t1(n,e){const t={stylesheet:Xb(e),rules:{}};return mo.set(n,t),t}function al(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${e1(f)}_${r}`,d=h_(n),{stylesheet:m,rules:h}=mo.get(d)||t1(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function ul(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ho-=s,ho||n1())}function n1(){da(()=>{ho||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),mo.clear())})}function i1(n,e,t,i){if(!e)return X;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return X;const{delay:l=0,duration:o=300,easing:r=kl,start:a=Fo()+l,end:u=a+o,tick:f=X,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function _(){c&&(h=al(n,0,1,o,l,r,c)),l||(m=!0)}function v(){c&&ul(n,h),d=!1}return Ro(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),v()),!d)return!1;if(m){const y=k-a,$=0+1*r(y/o);f($,1-$)}return!0}),_(),f(0,1),v}function s1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,g_(n,s)}}function g_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let fl;function oi(n){fl=n}function wl(){if(!fl)throw new Error("Function called outside component initialization");return fl}function Zt(n){wl().$$.on_mount.push(n)}function l1(n){wl().$$.after_update.push(n)}function b_(n){wl().$$.on_destroy.push(n)}function Ct(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=__(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Ve(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _s=[],se=[],oo=[],Nr=[],v_=Promise.resolve();let Fr=!1;function y_(){Fr||(Fr=!0,v_.then(pa))}function sn(){return y_(),v_}function Ge(n){oo.push(n)}function ke(n){Nr.push(n)}const er=new Set;let fs=0;function pa(){if(fs!==0)return;const n=fl;do{try{for(;fs<_s.length;){const e=_s[fs];fs++,oi(e),o1(e.$$)}}catch(e){throw _s.length=0,fs=0,e}for(oi(null),_s.length=0,fs=0;se.length;)se.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];er.has(t)||(er.add(t),t())}oo.length=0}while(_s.length);for(;Nr.length;)Nr.pop()();Fr=!1,er.clear(),oi(n)}function o1(n){if(n.fragment!==null){n.update(),Pe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ge)}}let qs;function ma(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function Ki(n,e,t){n.dispatchEvent(__(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Jn;function ae(){Jn={r:0,c:[],p:Jn}}function ue(){Jn.r||Pe(Jn.c),Jn=Jn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Jn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ha={duration:0};function k_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&ul(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:_=X,css:v}=s||ha;v&&(o=al(n,0,1,m,d,h,v,a++)),_(0,1);const k=Fo()+d,y=k+m;r&&r.abort(),l=!0,Ge(()=>Ki(n,!0,"start")),r=Ro($=>{if(l){if($>=y)return _(1,0),Ki(n,!0,"end"),u(),l=!1;if($>=k){const T=h(($-k)/m);_(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,ul(n),Bt(s)?(s=s(i),ma().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function w_(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Jn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=X,css:m}=s||ha;m&&(o=al(n,1,0,f,u,c,m));const h=Fo()+u,_=h+f;Ge(()=>Ki(n,!1,"start")),Ro(v=>{if(l){if(v>=_)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(v>=h){const k=c((v-h)/f);d(1-k,k)}}return l})}return Bt(s)?ma().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&ul(n,o),l=!1)}}}function qe(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&ul(n,u)}function c(m,h){const _=m.b-o;return h*=Math.abs(_),{a:o,b:m.b,d:_,duration:h,start:m.start,end:m.start+h,group:m.group}}function d(m){const{delay:h=0,duration:_=300,easing:v=kl,tick:k=X,css:y}=l||ha,$={start:Fo()+h,b:m};m||($.group=Jn,Jn.r+=1),r||a?a=$:(y&&(f(),u=al(n,o,m,_,h,v,y)),m&&k(0,1),r=c($,_),Ge(()=>Ki(n,m,"start")),Ro(T=>{if(a&&T>a.start&&(r=c(a,_),a=null,Ki(n,r.b,"start"),y&&(f(),u=al(n,o,r.b,r.duration,0,v,l.css))),r){if(T>=r.end)k(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?f():--r.group.r||Pe(r.group.c)),r=null;else if(T>=r.start){const M=T-r.start;o=r.a+r.d*v(M/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Bt(l)?ma().then(()=>{l=l(s),d(m)}):d(m)},end(){f(),r=a=null}}}function au(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e Line truncated
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=O(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function Rv(n){let e,t,i,s=!n[0]&&Vu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=O(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Vu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):qt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function qv(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[Rv]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function jv(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Eg extends be{constructor(e){super(),ge(this,e,jv,qv,he,{nobranding:0})}}function Uo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Pn(n,{delay:e=0,duration:t=400,easing:i=Uo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function St(n,{delay:e=0,duration:t=400,easing:i=Uo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*l};height: ${m*o}px;padding-top: ${m*r}px;padding-bottom: ${m*a}px;margin-top: ${m*u}px;margin-bottom: ${m*f}px;border-top-width: ${m*c}px;border-bottom-width: ${m*d}px;`}}function It(n,{delay:e=0,duration:t=400,easing:i=Uo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function zu(n,e,t){const i=n.slice();return i[11]=e[t],i}const Hv=n=>({}),Bu=n=>({uniqueId:n[3]});function Vv(n){let e=(n[11]||yo)+"",t;return{c(){t=z(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||yo)+"")&&le(t,e)},d(i){i&&w(t)}}}function zv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||yo)+"",i;return{c(){e=b("pre"),i=z(t)},m(o,r){S(o,e,r),g(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||yo)+"")&&le(i,t)},d(o){o&&w(e)}}}function Uu(n){let e,t,i,s;function l(a,u){return typeof a[11]=="object"?zv:Vv}let o=l(n),r=o(n);return{c(){e=b("div"),r.c(),t=O(),p(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),r.m(e,null),g(e,t),s=!0},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r.d(1),r=o(a),r&&(r.c(),r.m(e,t)))},i(a){s||(a&&Ge(()=>{i||(i=qe(e,St,{duration:150},!0)),i.run(1)}),s=!0)},o(a){a&&(i||(i=qe(e,St,{duration:150},!1)),i.run(0)),s=!1},d(a){a&&w(e),r.d(),a&&i&&i.end()}}}function Bv(n){let e,t,i,s,l;const o=n[8].default,r=Nt(o,n,n[7],Bu);let a=n[2],u=[];for(let c=0;c<a.length;c+=1)u[c]=Uu(zu(n,a,c));const f=c=>P(u[c],1,1,()=>{u[c]=null});return{c(){e=b("div"),r&&r.c(),t=O();for(let c=0;c<u.length;c+=1)u[c].c();p(e,"class",n[0]),Q(e,"error",n[2].length)},m(c,d){S(c,e,d),r&&r.m(e,null),g(e,t);for(let m=0;m<u.length;m+=1)u[m].m(e,null);n[10](e),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p(c,[d]){if(r&&r.p&&(!i||d&128)&&Rt(r,o,c,c[7],i?Ft(o,c[7],d,Hv):qt(c[7]),Bu),d&4){a=c[2];let m;for(m=0;m<a.length;m+=1){const h=zu(c,a,m);u[m]?(u[m].p(h,d),A(u[m],1)):(u[m]=Uu(h),u[m].c(),A(u[m],1),u[m].m(e,null))}for(ae(),m=a.length;m<u.length;m+=1)f(m);ue()}(!i||d&1)&&p(e,"class",c[0]),(!i||d&5)&&Q(e,"error",c[2].length)},i(c){if(!i){A(r,c);for(let d=0;d<a.length;d+=1)A(u[d]);i=!0}},o(c){P(r,c),u=u.filter(Boolean);for(let d=0;d<u.length;d+=1)P(u[d]);i=!1},d(c){c&&w(e),r&&r.d(c),ht(u,c),n[10](null),s=!1,l()}}}const yo="Invalid value";function Uv(n,e,t){let i;Ye(n,fi,h=>t(6,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Qi(r)}Zt(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(h){Ve.call(this,n,h)}function m(h){se[h?"unshift":"push"](()=>{u=h,t(1,u)})}return n.$$set=h=>{"name"in h&&t(4,r=h.name),"class"in h&&t(0,a=h.class),"$$scope"in h&&t(7,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&80&&t(2,f=V.toArray(V.getNestedVal(i,r)))},[a,u,f,o,r,c,i,l,s,d,m]}class pe extends be{constructor(e){super(),ge(this,e,Uv,Bv,he,{name:4,class:0,changed:5})}get changed(){return this.$$.ctx[5]}}function Wv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Email"),s=O(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Yv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=z("Password"),s=O(),l=b("input"),r=O(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[1]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&re(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function Kv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Password confirm"),s=O(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Jv(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[Wv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[Yv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Kv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=O(),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),f=b("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){S(h,e,_),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),q(a,e,null),g(e,u),g(e,f),c=!0,d||(m=Y(e,"submit",ft(n[4])),d=!0)},p(h,[_]){const v={};_&1537&&(v.$$scope={dirty:_,ctx:h}),s.$set(v);const k={};_&1538&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&1540&&(y.$$scope={dirty:_,ctx:h}),a.$set(y),(!c||_&8)&&Q(f,"btn-disabled",h[3]),(!c||_&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){P(s.$$.fragment,h),P(o.$$.fragment,h),P(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,m()}}}function Zv(n,e,t){const i=Ct();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(d){me.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class Gv extends be{constructor(e){super(),ge(this,e,Zv,Jv,he,{})}}function Wu(n){let e,t;return e=new Eg({props:{$$slots:{default:[Xv]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Xv(n){let e,t;return e=new Gv({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:X,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Qv(n){let e,t,i=n[0]&&Wu(n);return{c(){i&&i.c(),e=Ce()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Wu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),P(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function xv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Di("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class ey extends be{constructor(e){super(),ge(this,e,xv,Qv,he,{})}}const $t=Fn(""),ko=Fn(""),Cs=Fn(!1);function ty(n){let e,t,i,s;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),re(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&re(e,l[7])},i:X,o:X,d(l){l&&w(e),n[13](null),i=!1,s()}}}function ny(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={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&&(u.value=a[7]),{props:u}}return o&&(e=Ht(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(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],ke(()=>t=!1)),o!==(o=a[4])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("submit",a[10]),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Yu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Ku();return{c(){r&&r.c(),e=O(),t=b("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Ku(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(ae(),P(r,1,1,()=>{r=null}),ue())},i(a){s||(A(r),a&&Ge(()=>{i||(i=qe(t,Pn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=qe(t,Pn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Ku(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,Pn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function iy(n){let e,t,i,s,l,o,r,a,u,f;const c=[ny,ty],d=[];function m(_,v){return _[4]&&!_[5]?0:1}l=m(n),o=d[l]=c[l](n);let h=(n[0].length||n[7].length)&&Yu(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=O(),o.c(),r=O(),h&&h.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(_,v){S(_,e,v),g(e,t),g(t,i),g(e,s),d[l].m(e,null),g(e,r),h&&h.m(e,null),aLine truncated
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function vy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="url",p(t,"class",V.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function yy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="referer",p(t,"class",V.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function ky(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="User IP",p(t,"class",V.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function wy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="status",p(t,"class",V.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function Sy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function Qu(n){let e;function t(l,o){return l[6]?Ty:$y}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function $y(n){var r;let e,t,i,s,l,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.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},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&&w(e),o&&o.d()}}}function Ty(n){let e;return{c(){e=b("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function xu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function ef(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function tf(n,e){var Se,We,lt;let t,i,s,l=((Se=e[23].method)==null?void 0:Se.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,h,_,v,k,y=(e[23].referer||"N/A")+"",$,T,M,C,D,E=(e[23].userIp||"N/A")+"",I,L,N,F,R,K=e[23].status+"",x,U,G,ne,J,fe,Z,de,ve,Te,Ne=(((We=e[23].meta)==null?void 0:We.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&ef();ne=new ui({props:{date:e[23].created}});function Re(){return e[17](e[23])}function ye(...ce){return e[18](e[23],...ce)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("span"),o=z(l),a=O(),u=b("td"),f=b("span"),d=z(c),h=O(),Ne&&Ne.c(),_=O(),v=b("td"),k=b("span"),$=z(y),M=O(),C=b("td"),D=b("span"),I=z(E),N=O(),F=b("td"),R=b("span"),x=z(K),U=O(),G=b("td"),H(ne.$$.fragment),J=O(),fe=b("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',Z=O(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(k,"class","txt txt-ellipsis"),p(k,"title",T=e[23].referer),Q(k,"txt-hint",!e[23].referer),p(v,"class","col-type-text col-field-referer"),p(D,"class","txt txt-ellipsis"),p(D,"title",L=e[23].userIp),Q(D,"txt-hint",!e[23].userIp),p(C,"class","col-type-number col-field-userIp"),p(R,"class","label"),Q(R,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(G,"class","col-type-date col-field-created"),p(fe,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ce,ze){S(ce,t,ze),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,h),Ne&&Ne.m(u,null),g(t,_),g(t,v),g(v,k),g(k,$),g(t,M),g(t,C),g(C,D),g(D,I),g(t,N),g(t,F),g(F,R),g(R,x),g(t,U),g(t,G),q(ne,G,null),g(t,J),g(t,fe),g(t,Z),de=!0,ve||(Te=[Y(t,"click",Re),Y(t,"keydown",ye)],ve=!0)},p(ce,ze){var Fe,ot,Vt;e=ce,(!de||ze&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!de||ze&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!de||ze&8)&&c!==(c=e[23].url+"")&&le(d,c),(!de||ze&8&&m!==(m=e[23].url))&&p(f,"title",m),(ot=e[23].meta)!=null&&ot.errorMessage||(Vt=e[23].meta)!=null&&Vt.errorData?Ne||(Ne=ef(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!de||ze&8)&&y!==(y=(e[23].referer||"N/A")+"")&&le($,y),(!de||ze&8&&T!==(T=e[23].referer))&&p(k,"title",T),(!de||ze&8)&&Q(k,"txt-hint",!e[23].referer),(!de||ze&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&le(I,E),(!de||ze&8&&L!==(L=e[23].userIp))&&p(D,"title",L),(!de||ze&8)&&Q(D,"txt-hint",!e[23].userIp),(!de||ze&8)&&K!==(K=e[23].status+"")&&le(x,K),(!de||ze&8)&&Q(R,"label-danger",e[23].status>=400);const te={};ze&8&&(te.date=e[23].created),ne.$set(te)},i(ce){de||(A(ne.$$.fragment,ce),de=!0)},o(ce){P(ne.$$.fragment,ce),de=!1},d(ce){ce&&w(t),Ne&&Ne.d(),j(ne),ve=!1,Pe(Te)}}}function Cy(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I=[],L=new Map,N;function F(ye){n[11](ye)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[by]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Wt({props:R}),se.push(()=>_e(s,"sort",F));function K(ye){n[12](ye)}let x={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[vy]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),r=new Wt({props:x}),se.push(()=>_e(r,"sort",K));function U(ye){n[13](ye)}let G={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[yy]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),f=new Wt({props:G}),se.push(()=>_e(f,"sort",U));function ne(ye){n[14](ye)}let J={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[ky]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),m=new Wt({props:J}),se.push(()=>_e(m,"sort",ne));function fe(ye){n[15](ye)}let Z={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[wy]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),v=new Wt({props:Z}),se.push(()=>_e(v,"sort",fe));function de(ye){n[16](ye)}let ve={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Sy]},$$scope:{ctx:n}};n[1]!==void 0&&(ve.sort=n[1]),$=new Wt({props:ve}),se.push(()=>_e($,"sort",de));let Te=n[3];const Ne=ye=>ye[23].id;for(let ye=0;ye<Te.length;ye+=1){let Se=Xu(n,Te,ye),We=Ne(Se);L.set(We,I[ye]=tf(We,Se))}let Re=null;return Te.length||(Re=Qu(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),H(s.$$.fragment),o=O(),H(r.$$.fragment),u=O(),H(f.$$.fragment),d=O(),H(m.$$.fragment),_=O(),H(v.$$.fragment),y=O(),H($.$$.fragm Line truncated
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function ni(){}const Ey=function(){let n=0;return function(){return n++}}();function at(n){return n===null||typeof n>"u"}function _t(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 Ke(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Mt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Cn(n,e){return Mt(n)?n:e}function Qe(n,e){return typeof n>"u"?e:n}const Ay=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Ig=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function yt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ut(n,e,t,i){let s,l,o;if(_t(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ke(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function So(n){if(_t(n))return n.map(So);if(Ke(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function Pg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Iy(n,e,t,i){if(!Pg(n))return;const s=e[n],l=t[n];Ke(s)&&Ke(l)?pl(s,l,i):e[n]=So(l)}function pl(n,e,t){const i=_t(e)?e:[e],s=i.length;if(!Ke(n))return n;t=t||{};const l=t.merger||Iy;for(let o=0;o<s;++o){if(e=i[o],!Ke(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function nl(n,e){return pl(n,e,{merger:Py})}function Py(n,e,t){if(!Pg(n))return;const i=e[n],s=t[n];Ke(i)&&Ke(s)?nl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const lf={"":n=>n,x:n=>n.x,y:n=>n.y};function Ti(n,e){return(lf[e]||(lf[e]=Ly(e)))(n)}function Ly(n){const e=Ny(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ny(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Ia(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ln=n=>typeof n<"u",Ci=n=>typeof n=="function",of=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Fy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Tt=Math.PI,dt=2*Tt,Ry=dt+Tt,$o=Number.POSITIVE_INFINITY,qy=Tt/180,kt=Tt/2,Bs=Tt/4,rf=Tt*2/3,En=Math.log10,Gn=Math.sign;function af(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(En(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function jy(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)<t}function Hy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Lg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Vn(n){return n*(Tt/180)}function Pa(n){return n*(180/Tt)}function uf(n){if(!Mt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Ng(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Tt&&(l+=dt),{angle:l,distance:s}}function Xr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Vy(n,e){return(n-e+Ry)%dt-Tt}function bn(n){return(n%dt+dt)%dt}function ml(n,e,t,i){const s=bn(n),l=bn(e),o=bn(t),r=bn(l-s),a=bn(o-s),u=bn(s-l),f=bn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Yt(n,e,t){return Math.max(e,Math.min(t,n))}function zy(n){return Yt(n,-32768,32767)}function hl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function La(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Yi=(n,e,t,i)=>La(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),By=(n,e,t)=>La(n,t,i=>n[i][e]>=t);function Uy(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const Fg=["push","pop","shift","splice","unshift"];function Wy(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Fg.forEach(t=>{const i="_onData"+Ia(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function ff(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Fg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Rg(n){const e=new Set;let t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}const qg=function(){return typeof window>"u"?function(n){return n()}:window.requestLine truncated
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Ol(n){return n+.5|0}const bi=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return bi(Ol(n*2.55),0,255)}function wi(n){return bi(Ol(n*255),0,255)}function li(n){return bi(Ol(n/2.55)/100,0,1)}function mf(n){return bi(Ol(n*100),0,100)}const Tn={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},Qr=[..."0123456789ABCDEF"],Jy=n=>Qr[n&15],Zy=n=>Qr[(n&240)>>4]+Qr[n&15],Wl=n=>(n&240)>>4===(n&15),Gy=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function Xy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Tn[n[1]]*17,g:255&Tn[n[2]]*17,b:255&Tn[n[3]]*17,a:e===5?Tn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Tn[n[1]]<<4|Tn[n[2]],g:Tn[n[3]]<<4|Tn[n[4]],b:Tn[n[5]]<<4|Tn[n[6]],a:e===9?Tn[n[7]]<<4|Tn[n[8]]:255})),t}const Qy=(n,e)=>n<255?e(n):"";function xy(n){var e=Gy(n)?Jy:Zy;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Qy(n.a,e):void 0}const e2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function zg(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function t2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function n2(n,e,t){const i=zg(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function i2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Na(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=i2(t,i,s,f,l),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(wi)}function Ra(n,e,t){return Fa(zg,n,e,t)}function s2(n,e,t){return Fa(n2,n,e,t)}function l2(n,e,t){return Fa(t2,n,e,t)}function Bg(n){return(n%360+360)%360}function o2(n){const e=e2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):wi(+e[5]));const s=Bg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=s2(s,l,o):e[1]==="hsv"?i=l2(s,l,o):i=Ra(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function r2(n,e){var t=Na(n);t[0]=Bg(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function a2(n){if(!n)return;const e=Na(n),t=e[0],i=mf(e[1]),s=mf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${li(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}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"},_f={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 u2(){const n={},e=Object.keys(_f),t=Object.keys(hf);let i,s,l,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s]Line truncated
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class ck{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=qg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ii=new ck;const Df="transparent",dk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=bf(n||Df),s=i.valid&&bf(e||Df);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class pk{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||dk[e.type||typeof o],this._easing=sl[e.easing]||sl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const mk=["x","y","borderWidth","radius","tension"],hk=["color","borderColor","backgroundColor"];xe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const _k=Object.keys(xe.animation);xe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});xe.set("animations",{colors:{type:"color",properties:hk},numbers:{type:"number",properties:mk}});xe.describe("animations",{_fallback:"animation"});xe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class sb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ke(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ke(s))return;const l={};for(const o of _k)l[o]=s[o];(_t(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=bk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&gk(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new pk(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ii.add(this._chart,i),!0}}function gk(n,e){const t=[],Line truncated
`)>-1?n.split(`
`):n}function IS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function lc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=vn(e.bodyFont),u=vn(e.titleFont),f=vn(e.footerFont),c=l.length,d=s.length,m=i.length,h=Nn(e.padding);let _=h.height,v=0,k=i.reduce((T,M)=>T+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let y=0;const $=function(T){v=Math.max(v,t.measureText(T).width+y)};return t.save(),t.font=u.string,ut(n.title,$),t.font=a.string,ut(n.beforeBody.concat(n.afterBody),$),y=e.displayColors?o+2+e.boxPadding:0,ut(i,T=>{ut(T.before,$),ut(T.lines,$),ut(T.after,$)}),y=0,t.font=f.string,ut(n.footer,$),t.restore(),v+=h.width,{width:v,height:_}}function PS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function LS(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function NS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),LS(u,n,e,t)&&(u="center"),u}function oc(n,e,t){const i=t.yAlign||e.yAlign||PS(n,t);return{xAlign:t.xAlign||e.xAlign||NS(n,e,t,i),yAlign:i}}function FS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function RS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function rc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=ys(o);let h=FS(e,r);const _=RS(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,m)+s),{x:Yt(h,0,i.width-e.width),y:Yt(_,0,i.height-e.height)}}function to(n,e,t){const i=Nn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function ac(n){return Kn([],si(n))}function qS(n,e,t){return Oi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function uc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ra extends ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new sb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=qS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}getBeforeBody(e,t){return ac(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ut(e,l=>{const o={before:[],lines:[],after:[]},r=uc(i,l);Kn(o.before,si(r.beforeLabel.call(this,l))),Kn(o.lines,r.label.call(this,l)),Kn(o.after,si(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return ac(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;a<u;++a)r.push(IS(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ut(r,f=>{const c=uc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;l Line truncated
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const l3={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};ub._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return l3},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=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.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 gc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,It,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,It,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function o3(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=z(n[1]),t=O(),s=z(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function r3(n){let e;return{c(){e=z("Loading...")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function a3(n){let e,t,i,s,l,o=n[2]&&gc();function r(f,c){return f[2]?r3:o3}let a=r(n),u=a(n);return{c(){e=b("div"),o&&o.c(),t=O(),i=b("canvas"),s=O(),l=b("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Lr(i,"height","250px"),Lr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=gc(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),P(o,1,1,()=>{o=null}),ue()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function u3(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let h of m)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),me.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Io.register(Ei,Zo,Ko,xa,Pl,AS,jS),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class f3 extends be{constructor(e){super(),ge(this,e,u3,a3,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var bc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},fa={},c3={get exports(){return fa},set exports(n){fa=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function y($){return $ instanceof a?new a($.type,y($.content),$.alias):Array.isArray($)?$.map(y):$.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++l}),y.__id},clone:function y($,T){T=T||{};var M,C;switch(r.util.type($)){case"Object":if(C=r.util.objId($),T[C])return T[C];M={},T[C]=M;for(var D in $)$.hasOwnProperty(D)&&(M[D]=y($[D],T));return M;case"Array":return C=r.util.objId($),T[C]?T[C]:(M=[],T[C]=M,$.forEach(function(E,I){M[I]=y(E,T)}),M);default:return $}},getLanguage:function(y){for(;y;){var $=s.exec(y.className);if($)return $[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,$){y.className=y.className.replace(RegExp(s,"gi"),""),y.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(y){var $=document.getElementsByTagName("script");for(var T in $)if($[T].src==y)return $[T]}return null}},isActive:function(y,$,T){for(var M="no-"+$;y;){var C=y.classList;if(C.contains($))return!0;if(C.contains(M))return!1;y=y.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,$){var T=r.util.clone(r.languages[y]);for(var M in $)T[M]=$[M];return T},insertBefore:function(y,$,T,M){M=M||r.languages;var C=M[y],D={};for(var E in C)if(C.hasOwnProperty(E)){if(E==$)for(var I in T)T.hasOwnProperty(I)&&(D[I]=T[I]);T.hasOwnProperty(E)||(D[E]=C[E])}var L=M[y];return M[y]=D,r.languages.DFS(r.languages,function(N,F){F===L&&N!=y&&(this[N]=D)}),D},DFS:function y($,T,M,C){C=C||{};var D=r.util.objId;for(var E in $)if($.hasOwnProperty(E)){T.call($,E,$[E],M||E);var I=$[E],L=r.util.type(I);L==="Object"&&!C[D(I)]?(C[D(I)]=!0,y(I,T,null,C)):L==="Array"&&!C[D(I)]&&(C[D(I)]=!0,y(I,T,E,C))}}},plugins:{},highlightAll:function(y,$){r.highlightAllUnder(document,y,$)},highlightAllUnder:function(y,$,T){var M={callback:T,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var C=0,D;D=M.elements[C++];)r.highlightElement(D,$===!0,M.callback)},highlightElement:function(y,$,T){var M=r.util.getLanguage(y),C=r.languages[M];r.util.setLanguage(y,M);var D=y.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,M);var E=y.textContent,I={element:y,language:M,grammar:C,code:E};function L(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),T&&T.call(I.element)}if(r.hooks.run("before-sanity-check",I),D=I.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),T&&T.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if($&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(y,$,T){var M={code:y,grammar:$,language:T};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(y,$){var T=$.rest;if(T){for(var M in T)$[M]=T[M];delete $.rest}var C=new c;return d(C,C.head,y),f(y,C,$,C.head,0),h(C)},hooks:{all:{},add:function(y,$){var T=r.hooks.all;T[y]=T[y]||[],T[y].push($)},run:function(y,$){var T=r.hooks.all[y];if(!(!T||!T.length))for(var M=0,C;C=T[M++];)C($)}},Token:a};i.Prism=r;function a(y,$,T,M){this.type=y,this.content=$,this.alias=T,this.length=(M||"").length|0}a.stringify=function y($,T){if(typeof $=="string")return $;if(Array.isArray($)){var M="";return $.forEach(function(L){M+=y(L,T)}),M}var C={type:$.type,content:y($.content,T),tag:"span",classes:["token",$.type],attributes:{},language:T},D=$.alias;D&&(Array.isArray(D)?Array.prototype.push.apply(C.classes,D):C.classes.push(D)),r.hooks.run("wrap",C);var E="";for(var I in C.attributes)E+=" "+I+'="'+(C.attributes[I]||"").replace(/"/g,"&quot;")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+E+">"+C.content+"</"+C.tag+">"};function u(y,$,T,M){y.lastIndex=$;var C=y.exec(T);if(C&&M&&C[1]){var D=C[1].length;C.index+=D,C[0]=C[0].slice(D)}return C}funLine truncated
`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(I+1))}k.textContent=C,t.highlightElement(k)},function(C){v.setAttribute(r,f),k.textContent=C})}}),t.plugins.fileHighlight={highlight:function(v){for(var k=(v||document).querySelectorAll(c),y=0,$;$=k[y++];)t.highlightElement($)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(c3);const Zs=fa;var vc={},d3={get exports(){return vc},set exports(n){vc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var m=s(f[d]);c+=m,c>r&&(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 l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",h="",_=!1,v=0;v<d.length;++v){var k=d[v];k==o.element?_=!0:k.nodeName==="#text"&&(_?h+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--v)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+h,o.code=r.normalize(o.code,o.settings);else{var y=m+o.element.innerHTML+h;o.element.innerHTML=r.normalize(y,o.settings),o.code=o.element.textContent}}}})})()})(d3);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),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 p3(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(s,l){S(s,e,l),g(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:X,o:X,d(s){s&&w(e)}}}function m3(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zs.highlight(a,Zs.languages[l]||Zs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class Ob extends be{constructor(e){super(),ge(this,e,m3,p3,he,{class:0,content:2,language:3})}}const h3=n=>({}),yc=n=>({}),_3=n=>({}),kc=n=>({});function wc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$=n[4]&&!n[2]&&Sc(n);const T=n[19].header,M=Nt(T,n,n[18],kc);let C=n[4]&&n[2]&&$c(n);const D=n[19].default,E=Nt(D,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],yc);return{c(){e=b("div"),t=b("div"),s=O(),l=b("div"),o=b("div"),$&&$.c(),r=O(),M&&M.c(),a=O(),C&&C.c(),u=O(),f=b("div"),E&&E.c(),c=O(),d=b("div"),L&&L.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",m="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(N,F){S(N,e,F),g(e,t),g(e,s),g(e,l),g(l,o),$&&$.m(o,null),g(o,r),M&&M.m(o,null),g(o,a),C&&C.m(o,null),g(l,u),g(l,f),E&&E.m(f,null),n[21](f),g(l,c),g(l,d),L&&L.m(d,null),v=!0,k||(y=[Y(t,"click",ft(n[20])),Y(f,"scroll",n[22])],k=!0)},p(N,F){n=N,n[4]&&!n[2]?$?$.p(n,F):($=Sc(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),M&&M.p&&(!v||F[0]&262144)&&Rt(M,T,n,n[18],v?Ft(T,n[18],F,_3):qt(n[18]),kc),n[4]&&n[2]?C?C.p(n,F):(C=$c(n),C.c(),C.m(o,null)):C&&(C.d(1),C=null),E&&E.p&&(!v||F[0]&262144)&&Rt(E,D,n,n[18],v?Ft(D,n[18],F,null):qt(n[18]),null),L&&L.p&&(!v||F[0]&262144)&&Rt(L,I,n,n[18],v?Ft(I,n[18],F,h Line truncated
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]),k&1&&(y.disabled=!V.isEmpty(v[0].onlyDomains)),!a&&k&1&&(a=!0,y.value=v[0].exceptDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function w$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[3](v)}let _={id:n[4]+".options.onlyDomains",disabled:!V.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(_.value=n[0].onlyDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),H(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]+".options.onlyDomains"))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]+".options.onlyDomains"),k&1&&(y.disabled=!V.isEmpty(v[0].exceptDomains)),!a&&k&1&&(a=!0,y.value=v[0].onlyDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function S$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[k$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[w$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function $$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class Pb extends be{constructor(e){super(),ge(this,e,$$,S$,he,{key:1,options:0})}}function T$(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new Pb({props:r}),se.push(()=>_e(e,"key",l)),se.push(()=>_e(e,"options",o)),{c(){H(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],ke(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],ke(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function C$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class M$ extends be{constructor(e){super(),ge(this,e,C$,T$,he,{key:0,options:1})}}function D$(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class O$ extends be{constructor(e){super(),ge(this,e,D$,null,he,{key:0,options:1})}}var $r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},bl={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%10 Line truncated
<span class='flatpickr-weekday'>
`+W.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var B=st("div","flatpickr-weekwrapper");B.appendChild(st("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=st("div","flatpickr-weeks");return B.appendChild(W),{weekWrapper:B,weekNumbers:W}}function Z(B,W){W===void 0&&(W=!0);var ee=W?B:B-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),R()),F(),Ze("onMonthChange"),Li())}function de(B,W){if(B===void 0&&(B=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Dr(t.config),oe=ee.hours,$e=ee.minutes,Oe=ee.seconds;m(oe,$e,Oe)}t.redraw(),B&&Ze("onChange")}function ve(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function Te(){t.config!==void 0&&Ze("onDestroy");for(var B=t._handlers.length;B--;)t._handlers[B].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 W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}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(ee){try{delete t[ee]}catch{}})}function Ne(B){return t.calendarContainer.contains(B)}function Re(B){if(t.isOpen&&!t.config.inline){var W=_n(B),ee=Ne(W),oe=W===t.input||W===t.altInput||t.element.contains(W)||B.path&&B.path.indexOf&&(~B.path.indexOf(t.input)||~B.path.indexOf(t.altInput)),$e=!oe&&!ee&&!Ne(B.relatedTarget),Oe=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(W)});$e&&Oe&&(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 ye(B){if(!(!B||t.config.minDate&&B<t.config.minDate.getFullYear()||t.config.maxDate&&B>t.config.maxDate.getFullYear())){var W=B,ee=t.currentYear!==W;t.currentYear=W||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)),ee&&(t.redraw(),Ze("onYearChange"),R())}}function Se(B,W){var ee;W===void 0&&(W=!0);var oe=t.parseDate(B,void 0,W);if(t.config.minDate&&oe&&gn(oe,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&oe&&gn(oe,t.config.maxDate,W!==void 0?W:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var $e=!!t.config.enable,Oe=(ee=t.config.enable)!==null&&ee!==void 0?ee:t.config.disable,Ee=0,Me=void 0;Ee<Oe.length;Ee++){if(Me=Oe[Ee],typeof Me=="function"&&Me(oe))return $e;if(Me instanceof Date&&oe!==void 0&&Me.getTime()===oe.getTime())return $e;if(typeof Me=="string"){var Ue=t.parseDate(Me,void 0,!0);return Ue&&Ue.getTime()===oe.getTime()?$e:!$e}else if(typeof Me=="object"&&oe!==void 0&&Me.from&&Me.to&&oe.getTime()>=Me.from.getTime()&&oe.getTime()<=Me.to.getTime())return $e}return!$e}function We(B){return t.daysContainer!==void 0?B.className.indexOf("hidden")===-1&&B.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(B):!1}function lt(B){var W=B.target===t._input,ee=t._input.value.trimEnd()!==Ni();W&&ee&&!(B.relatedTarget&&Ne(B.relatedTarget))&&t.setDate(t._input.value,!0,B.target===t.altInput?t.config.altFormat:t.config.dateFormat)}f Line truncated
`),r=b("code"),r.textContent="multipart/form-data",a=z(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=z(` field is a
`),c=b("strong"),c.textContent="plain string",d=z(`:
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=O(),v=b("li"),v.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=O(),y=b("li"),y.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",$=O(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=O(),C=b("li"),E=z(D),I=z(" is converted to the json "),L=b("code"),L.textContent='{"a":1,"b":2}',N=O(),F=b("li"),F.textContent="numeric strings are converted to json number",R=O(),K=b("li"),K.textContent="double quoted strings are left as they are (aka. without normalizations)",x=O(),U=b("li"),U.textContent="any other string (empty string too) is double quoted",G=z(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside
an object, eg.`),ne=b("code"),ne.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(Z,de){S(Z,e,de),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(m,h),g(m,_),g(m,v),g(m,k),g(m,y),g(m,$),g(m,T),g(m,M),g(m,C),g(C,E),g(C,I),g(C,L),g(m,N),g(m,F),g(m,R),g(m,K),g(m,x),g(m,U),g(i,G),g(i,ne),fe=!0},i(Z){fe||(Z&&Ge(()=>{J||(J=qe(e,St,{duration:150},!0)),J.run(1)}),fe=!0)},o(Z){Z&&(J||(J=qe(e,St,{duration:150},!1)),J.run(0)),fe=!1},d(Z){Z&&w(e),Z&&J&&J.end()}}}function Q$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0]?X$:G$}let u=a(n),f=u(n),c=n[0]&&Qc();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=O(),f.c(),s=O(),c&&c.c(),l=Ce(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){S(d,e,m),g(e,t),g(e,i),f.m(e,null),S(d,s,m),c&&c.m(d,m),S(d,l,m),o||(r=Y(e,"click",n[3]),o=!0)},p(d,[m]){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[0]?c?m&1&&A(c,1):(c=Qc(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){A(c)},o(d){P(c)},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function x$(n,e,t){const i="",s={};let l=!1;return[l,i,s,()=>{t(0,l=!l)}]}class eT extends be{constructor(e){super(),ge(this,e,x$,Q$,he,{key:1,options:2})}get key(){return this.$$.ctx[1]}get options(){return this.$$.ctx[2]}}function tT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=z(t),s=O(),l=b("small"),r=z(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){S(a,e,u),g(e,i),S(a,s,u),S(a,l,u),g(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:X,o:X,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function nT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class xc extends be{constructor(e){super(),ge(this,e,nT,tT,he,{item:0})}}const iT=[{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",mimeT Line truncated
Leave empty for no restriction.`,position:"top"})),y=!0)},p(C,D){(!k||D&4096&&l!==(l=C[12]))&&p(e,"for",l);const E={};D&4096&&(E.id=C[12]),D&4&&(E.items=C[2]),!a&&D&1&&(a=!0,E.keyOfSelected=C[0].mimeTypes,ke(()=>a=!1)),r.$set(E);const I={};D&8193&&(I.$$scope={dirty:D,ctx:C}),v.$set(I)},i(C){k||(A(r.$$.fragment,C),A(v.$$.fragment,C),k=!0)},o(C){P(r.$$.fragment,C),P(v.$$.fragment,C),k=!1},d(C){C&&w(e),C&&w(o),j(r,C),C&&w(u),C&&w(f),j(v),y=!1,$()}}}function aT(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function uT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M;function C(E){n[10](E)}let D={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(D.value=n[0].thumbs),r=new Fs({props:D}),se.push(()=>_e(r,"value",C)),y=new ei({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[aT]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=O(),s=b("i"),o=O(),H(r.$$.fragment),u=O(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=O(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=O(),v=b("i"),k=O(),H(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(v,"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,I){S(E,e,I),g(e,t),g(e,i),g(e,s),S(E,o,I),q(r,E,I),S(E,u,I),S(E,f,I),g(f,c),g(f,d),g(f,m),g(m,h),g(m,_),g(m,v),g(m,k),q(y,m,null),$=!0,T||(M=Ie(Be.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(E,I){(!$||I&4096&&l!==(l=E[12]))&&p(e,"for",l);const L={};I&4096&&(L.id=E[12]),!a&&I&1&&(a=!0,L.value=E[0].thumbs,ke(()=>a=!1)),r.$set(L);const N={};I&8192&&(N.$$scope={dirty:I,ctx:E}),y.$set(N)},i(E){$||(A(r.$$.fragment,E),A(y.$$.fragment,E),$=!0)},o(E){P(r.$$.fragment,E),P(y.$$.fragment,E),$=!1},d(E){E&&w(e),E&&w(o),j(r,E),E&&w(u),E&&w(f),j(y),T=!1,M()}}}function fT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[sT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[lT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[rT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[uT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),r=O(),a=b("div"),H(u.$$.fragment),f=O(),c=b("div"),H(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(h,_){S(h,e,_),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(h,[_]){const v={};_&2&&(v.name="schema."+h[1]+".options.maxSize"),_&12289&&(v.$$scope={dirty:_,ctx:h}),i.$set(v);const k={};_&2&&(k.name="schema."+h[1]+".options.maxSelect"),_&12289&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&2&&(y.name="schema."+h[1]+".options.mimeTypes"),_&12293&&(y.$$scope={dirty:_,ctx:h}),u.$set(y);const $={};_&2&&($.name="schema."+h[1]+".options.thumbs"),_&12289&&($.$$scope={dirty:_,ctx:h}),d.$set($)},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(u.$$.fragment,h),A(d.$$.fragment,h),m=!0)},o(h){P(i.$$.fragment,h),P(o.$$.fragment,h),P(u.$$.fragment,h),P(d.$$.fragment,h),m=!1},d(h){h&&w(e),j(i),j(o),j(u),j(d)}}}function cT(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=iT.slice();function o(){if(V.isEmpty(s.mimeTypes))return;const _=[];for(const v of s.mimeTypes)l.find(k=>k.mimeType===v)||_.push({mimeType:v});_.length&&t(2,l=l.concat(_))}function r(){s.maxSize=pt(this.value),t(0,s)}function a(){s.maxSelect=pt(this.value),t(0,s)}function u(_){n.$$.not_equal(s.mimeTypes,_)&&(s.mimeTypes=_,t(0,s))}const f=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},c=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},d=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},m=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function h(_){n.$$.not_equal(s.thumbs,_)&&(s.thumbs=_,t(0,s))}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"options"in _&&t(0,s=_.options)},n.$$.update=()=>{n.$$.dirty&1&&(V.isEmpty(s)?t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]}):o())},[s,i,l,r,a,u,f,c,d,m,h]}class dT extends be{constructor(e){super(),ge(this,e,cT,fT,he,{key:1,options:0})}}function pT(n){let e,t,i,s,l;return{c(){e=b("hr"),t=O(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[10]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function mT(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[23],searchable:n[3].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3],$$slots:{afterOptions:[pT]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=z("Collection"),s=O(),H(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),c&8&&(d.searchable=f[3].length>5),c&8&&(d.items=f[3]),c&16777232&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function hT(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[23],items:n[6]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=z("Relation type"),s=O(),H(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function ed(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[_T,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[gT,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),i=O(),s=b("div"),H(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&25165825&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&25165825&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function _T(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Min select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].minSelect),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].minSelect&&re(l,u[0].minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function gT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=z("Max select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].minSelect||2)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].maxSelect),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].minSelect||2)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].maxSelect&&re(l,f[0].maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function bT(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[15](h)}let m={multiple:!0,searchable:!0,id:n[23],selectPlaceholder:"Auto",items:n[5]};return n[0].displayFields!==void 0&&(m.selected=n[0].displayFields),r=new tu({props:m}),se.push(()=>_e(r,"selected",d)),{c(){e=b("label"),t=b("span"),t.textContent="Display fields",i=O(),s=b("i"),o=O(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23])},m(h,_){S(h,e,_),g(e,t),g(e,i),g(e,s),S(h,o,_),q(r,h,_),u=!0,f||(c=Ie(Be.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(h,_){(!u||_&8388608&&l!==(l=h[23]))&&p(e,"for",l);const v={};_&8388608&&(v.id=h[23]),_&32&&(v.items=h[5]),!a&&_&1&&(a=!0,v.selected=h[0].displayFields,ke(()=>a=!1)),r.$set(v)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&w(e),h&&w(o),j(r,h),f=!1,c()}}}function vT(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[23],items:n[7]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=z("Delete main record on relation delete"),s=O(),H(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",iLine truncated
(aka. not ${V.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(h,_){_[1]&4096&&t!==(t=h[43])&&p(e,"id",t),_[0]&1&&(e.checked=h[0].required),_[0]&1&&o!==(o=gs(h[0])+"")&&le(r,o),f&&Bt(f.update)&&_[0]&1&&f.update.call(null,{text:`Requires the field value to be ${gs(h[0])}
(aka. not ${V.zeroDefaultStr(h[0])}).`,position:"right"}),_[1]&4096&&c!==(c=h[43])&&p(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Pe(m)}}}function nd(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[RT,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function RT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(s,"for",o=n[43])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[31]),r=!0)},p(u,f){f[1]&4096&&t!==(t=u[43])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&4096&&o!==(o=u[43])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function id(n){let e,t,i,s,l,o,r,a,u,f;a=new ei({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[qT]},$$scope:{ctx:n}}});let c=n[8]&&sd(n);return{c(){e=b("div"),t=b("div"),i=O(),s=b("div"),l=b("button"),o=b("i"),r=O(),H(a.$$.fragment),u=O(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,m){S(d,e,m),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),q(a,l,null),g(s,u),c&&c.m(s,null),f=!0},p(d,m){const h={};m[1]&8192&&(h.$$scope={dirty:m,ctx:d}),a.$set(h),d[8]?c?c.p(d,m):(c=sd(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function qT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function sd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[3])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;s=new pe({props:{class:"form-field required "+(n[0].id?"readonly":""),name:"schema."+n[1]+".type",$$slots:{default:[ST,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[$T,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});const D=[NT,LT,PT,IT,AT,ET,OT,DT,MT,CT,TT],E=[];function I(F,R){return F[0].type==="text"?0:F[0].type==="number"?1:F[0].type==="bool"?2:F[0].type==="email"?3:F[0].type==="url"?4:F[0].type==="editor"?5:F[0].type==="date"?6:F[0].type==="select"?7:F[0].type==="json"?8:F[0].type==="file"?9:F[0].type==="relation"?10:-1}~(f=I(n))&&(c=E[f]=D[f](n)),h=new pe({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[FT,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&nd(n),N=!n[0].toDelete&&id(n);return{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=O(),o=b("div"),H(r.$$.fragment),a=O(),u=b("div"),c&&c.c(),d=O(),m=b("div"),H(h.$$.fragment),_=O(),v=b("div"),L&&L.c(),k=O(),N&&N.c(),y=O(),$=b("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(m,"class","col-sm-4 flex"),p(v,"class","col-sm-4 flex"),p(t,"class","grid"),p($,"type","submit"),p($,"class","hidden"),p($,"tabindex","-1"),p(e,"class","field-form")},m(F,R){S(F,e,R),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),~f&&E[f].m(u,null),g(t,d),g(t,m),q(h,m,null),g(t,_),g(t,v),L&&L.m(v,null),g(t,k),N&&N.m(t,null),g(e,y),g(e,$),T=!0,M||(C=[Y(e,"dragstart",zT),Y(e,"submit",ft(n[32]))],M=!0)},p(F,R){const K={};R[0]&1&&(K.class="form-field required "+(F[0].id?"readonly":"")),R[0]&2&&(K.name="schema."+F[1]+".type"),R[0]&1|R[1]&12288&&(K.$$scope={dirty:R,ctx:F}),s.$set(K);const x={};R[0]&33&&(x.class=`
form-field
required
`+(F[5]?"":"invalid")+`
`+(F[0].id&&F[0].system?"disabled":"")+`
`),R[0]&2&&(x.name="schema."+F[1]+".name"),R[0]&33|R[1]&12288&&(x.$$scope={dirty:R,ctx:F}),r.$set(x);let U=f;f=I(F),f===U?~f&&E[f].p(F,R):(c&&(ae(),P(E[U],1,1,()=>{E[U]=null}),ue()),~f?(c=E[f],c?c.p(F,R):(c=E[f]=D[f](F),c.c()),A(c,1),c.m(u,null)):c=null);const G={};R[0]&1|R[1]&12288&&(G.$$scope={dirty:R,ctx:F}),h.$set(G),F[0].type!=="file"?L?(L.p(F,R),R[0]&1&&A(L,1)):(L=nd(F),L.c(),A(L,1),L.m(v,null)):L&&(ae(),P(L,1,1,()=>{L=null}),ue()),F[0].toDelete?N&&(ae(),P(N,1,1,()=>{N=null}),ue()):N?(N.p(F,R),R[0]&1&&A(N,1)):(N=id(F),N.c(),A(N,1),N.m(t,null))},i(F){T||(A(s.$$.fragment,F),A(r.$$.fragment,F),A(c),A(h.$$.fragment,F),A(L),A(N),T=!0)},o(F){P(s.$$.fragment,F),P(r.$$.fragment,F),P(c),P(h.$$.fragment,F),P(L),P(N),T=!1},d(F){F&&w(e),j(s),j(r),~f&&E[f].d(),j(h),L&&L.d(),N&&N.d(),M=!1,Pe(C)}}}function ld(n){let e,t,i,s,l=n[0].system&&od(),o=!n[0].id&&rd(n),r=n[0].required&&ad(n),a=n[0].unique&&ud();return{c(){e=b("div"),l&&l.c(),t=O(),o&&o.c(),i=O(),r&&r.c(),s=O(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),g(e,t),o&&o.m(e,null),g(e,i),r&&r.m(e,null),g(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=od(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=rd(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=ad(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ud(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function od(n){let e;return{c(){e=b("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rd(n){let e;return{c(){e=b("span"),e.textContent="New",p(e,"class","label"),Q(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&Q(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function ad(n){let e,t=gs(n[0])+"",i;return{c(){e=b("span"),i=z(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=gs(s[0])+"")&&le(i,t)},d(s){s&&w(e)}}}function ud(n){let e;return{c(){e=b("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function fd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[16])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function HT(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,h,_,v,k=!n[0].toDelete&&ld(n),y=n[7]&&!n[0].system&&fd(),$=n[0].toDelete&&cd(n);return{c(){e=b("div"),t=b("span"),i=b("i"),l=O(),o=b("strong"),a=z(r),f=O(),k&&k.c(),c=O(),d=b("div"),m=O(),y&&y.c(),h=O(),$&&$.c(),_=Ce(),p(i,"class",s=Si(V.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),Q(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),S(T,f,M),k&&k.m(T,M),S(T,c,M),S(T,d,M),S(T,m,M),y&&y.m(T,M),S(T,h,M),$&&$.m(T,M),S(T,_,M),v=!0},p(T,M){(!v||M[0]&1&&s!==(s=Si(V.getFieldTypeIcon(T[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!v||M[0]&1)&&r!==(r=(T[0].name||"-")+"")&&le(a,r),(!v||M[0]&1&&u!==(u=T[0].name))&&p(o,"title",u),(!v||M[0]&1)&&Q(o,"txt-strikethrough",T[0].toDelete),T[0].toDelete?k&&(k.d(1),k=null):k?k.p(T,M):(k=ld(T),k.c(),k.m(c.parentNode,c)),T[7]&&!T[0].system?y?M[0]&129&&A(y,1):(y=fd(),y.c(),A(y,1),y.m(h.parentNode,h)):y&&(ae(),P(y,1,1,()=>{y=null}),ue()),T[0].toDelete?$?$.p(T,M):($=cd(T),$.c(),$.m(_.parentNode,_)):$&&($.d(1),$=null)},i(T){v||(A(y),v=!0)},o(T){P(y),v=!1},d(T){T&&w(e),T&&w(f),k&&k.d(T),T&&w(c),T&&w(d),T&&w(m),y&&y.d(T),T&&w(h),$&&$.d(T),T&&w(_)}}}function VT(n){let e,t;const i=[{draggable:!0},{single:!0},{interactive:n[8]},{class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion"},n[11]];let s={$$slots:{header:[HT],default:[jT]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[33](e),e.$on("expand",n[34]),e.$on("collapse",n[35]),e.$on("toggle",n[36]),e.$on("dragenter",n[37]),e.$on("dragleave",n[38]),e.$on("dragstart",n[39]),e.$on("drop",n[40]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&2309?on(i,[i[0],i[1],o[0]&256&&{interactive:l[8]},o[0]&5&&{class:l[2]||l[0].toDelete||l[0].system?"field-accordion disabled":"field-accordion"},o[0]&2048&&xn(l[11])]):{};o[0]&483|o[1]&8192&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[33](null),j(e,l)}}}function gs(n){switch(n==null?void 0:n.type){case"bool":ret Line truncated
`),t=b("code"),t.textContent="username",i=z(` ,
`),s=b("code"),s.textContent="email",l=z(` ,
`),o=b("code"),o.textContent="emailVisibility",r=z(` ,
`),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function md(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new UT({props:f}),se.push(()=>_e(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=Ce(),H(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),q(i,c,d),l=!0},p(c,d){e=c;const m={};d&1&&(m.key=e[15]),d&3&&(m.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,m.field=e[13],ke(()=>s=!1)),i.$set(m)},i(c){l||(A(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function WT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],h=new Map,_,v,k,y,$,T,M,C,D,E,I,L=n[0].isAuth&&pd(),N=n[0].schema;const F=R=>R[13];for(let R=0;R<N.length;R+=1){let K=dd(n,N,R),x=F(K);h.set(x,m[R]=md(x,K))}return{c(){e=b("div"),t=b("p"),i=z(`System fields:
`),s=b("code"),s.textContent="id",l=z(` ,
`),o=b("code"),o.textContent="created",r=z(` ,
`),a=b("code"),a.textContent="updated",u=O(),L&&L.c(),f=z(`
.`),c=O(),d=b("div");for(let R=0;R<m.length;R+=1)m[R].c();_=O(),v=b("div"),k=O(),y=b("button"),$=b("i"),T=O(),M=b("span"),M.textContent="New field",p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","accordions"),p(v,"class","clearfix m-t-xs"),p($,"class","ri-add-line"),p(M,"class","txt"),p(y,"type","button"),p(y,"class",C="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(R,K){S(R,e,K),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),L&&L.m(t,null),g(t,f),S(R,c,K),S(R,d,K);for(let x=0;x<m.length;x+=1)m[x].m(d,null);S(R,_,K),S(R,v,K),S(R,k,K),S(R,y,K),g(y,$),g(y,T),g(y,M),D=!0,E||(I=Y(y,"click",n[3]),E=!0)},p(R,[K]){R[0].isAuth?L||(L=pd(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),K&55&&(N=R[0].schema,ae(),m=wt(m,K,F,1,R,N,h,d,ln,md,null,dd),ue()),(!D||K&1&&C!==(C="btn btn-block "+(R[0].schema.length?"btn-transparent":"btn-secondary")))&&p(y,"class",C)},i(R){if(!D){for(let K=0;K<N.length;K+=1)A(m[K]);D=!0}},o(R){for(let K=0;K<m.length;K+=1)P(m[K]);D=!1},d(R){R&&w(e),L&&L.d(),R&&w(c),R&&w(d);for(let K=0;K<m.length;K+=1)m[K].d();R&&w(_),R&&w(v),R&&w(k),R&&w(y),E=!1,I()}}}function YT(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function KT(n,e,t){let{collection:i=new pn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(v){i.schema[v]&&(i.schema.splice(v,1),t(0,i))}function r(){const v=new mn({name:a()});v.onMountExpand=!0,i.schema.push(v),t(0,i)}function a(v="field"){let k="";for(;u(v+k);)++k;return v+k}function u(v){return!!i.schema.find(k=>k.name===v)}function f(v){let k=[];if(v.toDelete)return k;for(let y of i.schema)y===v||y.toDelete||k.push(y.name);return k}function c(v,k){if(!v)return;v.dataTransfer.dropEffect="move";const y=parseInt(v.dataTransfer.getData("text/plain")),$=i.schema;y<k?($.splice(k+1,0,$[y]),$.splice(y,1)):($.splice(k,0,$[y]),$.splice(y+1,1)),t(0,i.schema=$,i)}function d(v,k,y,$){y[$]=v,t(0,i)}const m=v=>o(v),h=(v,k)=>YT(k==null?void 0:k.detail,v),_=(v,k)=>c(k==null?void 0:k.detail,v);return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new pn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,m,h,_]}class JT extends be{constructor(e){super(),ge(this,e,KT,WT,he,{collection:0})}}const ZT=n=>({isAdminOnly:n&256}),hd=n=>({isAdminOnly:n[8]});function GT(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[eC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function XT(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function QT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function xT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function eC(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,m,h,_;function v(E,I){return E[8]?xT:QT}let k=v(n),y=k(n);function $(E){n[13](E)}var T=n[6];function M(E){let I={id:E[17],baseCollection:E[1],disabled:E[8],placeholder:E[8]?"":"Leave empty to grant everyone access..."};return E[0]!==void 0&&(I.value=E[0]),{props:I}}T&&(c=Ht(T,M(n)),n[12](c),se.push(()=>_e(c,"value",$)));const C=n[11].default,D=Nt(C,n,n[14],hd);return{c(){e=b("label"),t=b("span"),i=z(n[2]),s=O(),l=b("span"),r=z(o),a=O(),y.c(),f=O(),c&&H(c.$$.fragment),m=O(),h=b("div"),D&&D.c(),p(t,"class","txt"),Q(t,"txt-hint",n[8]),p(l,"class","label label-sm svelte-5uq9tk"),p(e,"for",u=n[17]),p(e,"class","svelte-5uq9tk"),p(h,"class","help-block")},m(E,I){S(E,e,I),g(e,t),g(t,i),g(e,s),g(e,l),g(l,r),g(e,a),y.m(e,null),S(E,f,I),c&&q(c,E,I),S(E,m,I),S(E,h,I),D&&D.m(h,null),_=!0},p(E,I){(!_||I&4)&&le(i,E[2]),(!_||I&256)&&Q(t,"txt-hint",E[8]),(!_||I&256)&&o!==(o=E[8]?"Admins only":"Custom rule")&&le(r,o),k===(k=v(E))&&y?y.p(E,I):(y.d(1),y=k(E),y&&(y.c(),y.m(e,null))),(!_||I&131072&&u!==(u=E[17]))&&p(e,"for",u);const L={};if(I&131072&&(L.id=E[17]),I&2&&(L.baseCollection=E[1]),I&256&&(L.disabled=E[8]),I&256&&(L.placeholder=E[8]?"":"Leave empty to grant everyone access..."),!d&&I&1&&(d=!0,L.value=E[0],ke(()=>d=!1)),T!==(T=E[6])){if(c){ae();const N=c;P(N.$$.fragment,1,0,()=>{j(N,1)}),ue()}T?(c=Ht(T,M(E)),E[12](c),se.push(()=>_e(c,"value",$)),H(c.$$.fragment),A(c.$$.fragment,1),q(c,m.parentNode,m)):c=null}else T&&c.$set(L);D&&D.p&&(!_||I&16640)&&Rt(D,C,E,E[14],_?Ft(C,E[14],I,ZT):qt(E[14]),hd)},i(E){_||(c&&A(c.$$.fragment,E),A(D,E),_=!0)},o(E){c&&P(c.$$.fragment,E),P(D,E),_=!1},d(E){E&&w(e),y.d(),E&&w(f),n[12](null),c&&j(c,E),E&&w(m),E&&w(h),D&&D.d(E)}}}function tC(n){let e,t,i,s;const l=[XT,GT],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ce()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),P(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let _d;function nC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,m=_d,h=!1;_();async function _(){m||h||(t(7,h=!0),t(6,m=(await rt(()=>import("./FilterAutocompleteInput-dd018caa.js"),["./FilterAutocompleteInput-dd018caa.js","./index-a6ccb683.js"],import.meta.url)).default),_d=m,t(7,h=!1))}async function v(){t(0,r=d||""),await sn(),c==null||c.focus()}async function k(){d=r,t(0,r=null)}function y(T){se[T?"unshift":"push"](()=>{c=T,t(5,c)})}function $(T){r=T,t(0,r)}return n.$$set=T=>{"collection"in T&&t(1,o=T.collection),"rule"in T&&t(0,r=T.rule),"label"in T&&t(2,a=T.label),"formKey"in T&&t(3,u=T.formKey),"required"in T&&t(4,f=T.required),"$$scope"in T&&t(14,l=T.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,m,h,i,v,k,s,y,$,l]}class $s extends be{constructor(e){super(),ge(this,e,nC,tC,he,{collection:1,rule:0,label:2,formKey:3,required:4})}}function gd(n,e,t){const i=n.slice();return i[10]=e[t],i}function bd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I=n[2],L=[];for(let N=0;N<I.length;N+=1)L[N]=vd(gd(n,I,N));return{c(){e=b("div"),t=b("div"),i=b("div"),s=b("p"),s.textContent="The following record fields are available:",l=O(),o=b("div");for(let N=0;N<L.length;N+=1)L[N].c();r=O(),a=b("hr"),u=O(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=O(),d=b("div"),d.innerHTML=`<code>@request.headers.*</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,m=O(),h=b("hr"),_=O(),v=b("p"),v.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=O(),y=b("div"),y.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",$=O(),T=b("hr"),M=O(),C=b("p"),C.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(v,"class","m-b-0"),p(y,"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(N,F){S(N,e,F),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o);for(let R=0;R<L.length;R+=1)L[R].m(o,null);g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(i,h),g(i,_),g(i,v),g(i,k),g(i,y),g(i,$),g(i,T),g(i,M),g(i,C),E=!0},p(N,F){if(F&4){I=N[2];let R;for(R=0;R<I.length;R+=1){const K=gd(N,I,R);L[R]?L[R].p(K,F):(L[R]=vd(K),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=I.length}},i(N){E||(N&&Ge(()=>{D||(D=qe(e,St,{duration:150},!0)),D.run(1)}),E=!0)},o(N){N&&(D||(D=qe(e,St,{duration:150},!1)),D.run(0)),E=!1},d(N){N&&w(e),ht(L,N),N&&D&&D.end()}}}function vd(n){let e,t=n[10]+"",i;return{c(){e=b("code"),i=z(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function yd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;function v(C){n[6](C)}let k={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(k.rule=n[0].createRule),i=new $s({props:k}),se.push(()=>_e(i,"rule",v));function y(C){n[7](C)}let $={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&($.rule=n[0].updateRule),a=new $s({props:$}),se.push(()=>_e(a,"rule",y));function T(C){n[8](C)}let M={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(M.rule=n[0].deleteRule),m=new $s({props:M}),se.push(()=>_e(m,"rule",T)),{c(){e=b("hr"),t=O(),H(i.$$.fragment),l=O(),o=b("hr"),r=O(),H(a.$$.fragment),f=O(),c=b("hr"),d=O(),H(m.$$.fragment)},m(C,D){S(C,e,D),S(C,t,D),q(i,C,D),S(C,l,D),S(C,o,D),S(C,r,D),q(a,C,D),S(C,f,D),S(C,c,D),S(C,d,D),q(m,C,D),_=!0},p(C,D){const E={};D&1&&(E.collection=C[0]),!s&&D&1&&(s=!0,E.rule=C[0].createRule,ke(()=>s=!1)),i.$set(E);const I={};D&1&&(I.collection=C[0]),!u&&D&1&&(u=!0,I.rule=C[0].updateRule,ke(()=>u=!1)),a.$set(I);const L={};D&1&&(L.collection=C[0]),!h&&D&1&&(h=!0,L.rule=C[0].deleteRule,ke(()=>h=!1)),m.$set(L)},i(C){_||(A(i.$$.fragment,C),A(a.$$.fragment,C),A(m.$$.fragment,C),_=!0)},o(C){P(i.$$.fragment,C),P(a.$$.fragment,C),P(m.$$.fragment,C),_=!1},d(C){C&&w(e),C&&w(t),j(i,C),C&&w(l),C&&w(o),C&&w(r),j(a,C),C&&w(f),C&&w(c),C&&w(d),j(m,C)}}}function kd(n){let e,t,i,s,l;function o(a){n[9](a)}let r={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[iC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new $s({props:r}),se.push(()=>_e(i,"rule",o)),{c(){e=b("hr"),t=O(),H(i.$$.fragment)},m(a,u){S(a,e,u),S(a,t,u),q(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&8192&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,ke(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function iC(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=O(),i=b("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:X,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function sC(n){var K,x;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D=n[1]&&bd(n);function E(U){n[4](U)}let I={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(I.rule=n[0].listRule),f=new $s({props:I}),se.push(()=>_e(f,"rule",E));function L(U){n[5](U)}let N={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(N.rule=n[0].viewRule),_=new $s({props:N}),se.push(()=>_e(_,"rule",L));let F=!((K=n[0])!=null&&K.isView)&&yd(n),R=((x=n[0])==null?void 0:x.isAuth)&&kd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=O(),l=b("button"),r=z(o),a=O(),D&&D.c(),u=O(),H(f.$$.fragment),d=O(),m=b("hr"),h=O(),H(_.$$.fragment),k=O(),F&&F.c(),y=O(),R&&R.c(),$=Ce(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-base handle"),Q(e,"fade",!n[1])},m(U,G){S(U,e,G),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),D&&D.m(e,null),S(U,u,G),q(f,U,G),S(U,d,G),S(U,m,G),S(U,h,G),q(_,U,G),S(U,k,G),F&&F.m(U,G),S(U,y,G),R&&R.m(U,G),S(U,$,G),T=!0,M||(C=Y(l,"click",n[3]),M=!0)},p(U,[G]){var fe,Z;(!T||G&2)&&o!==(o=U[1]?"Hide available fields":"Show available fields")&&le(r,o),U[1]?D?(D.p(U,G),G&2&&A(D,1)):(D=bd(U),D.c(),A(D,1),D.m(e,null)):D&&(ae(),P(D,1,1,()=>{D=null}),ue()),(!T||G&2)&&Q(e,"fade",!U[1]);const ne={};G&1&&(ne.collection=U[0]),!c&&G&1&&(c=!0,ne.rule=U[0].listRule,ke(()=>c=!1)),f.$set(ne);const J={};G&1&&(J.collection=U[0]),!v&&G&1&&(v=!0,J.rule=U[0].viewRule,ke(()=>v=!1)),_.$set(J),(fe=U[0])!=null&&fe.isView?F&&(ae(),P(F,1,1,()=>{F=null}),ue()):F?(F.p(U,G),G&1&&A(F,1)):(F=yd(U),F.c(),A(F,1),F.m(y.parentNode,y)),(Z=U[0])!=null&&Z.isAuth?R?(R.p(U,G),G&1&&A(R,1)):(R=kd(U),R.c(),A(R,1),R.m($.parentNode,$)):R&&(ae(),P(R,1,1,()=>{R=null}),ue())},i(U){T||(A(D),A(f.$$.fragment,U),A(_.$$.fragment,U),A(F),A(R),T=!0)},o(U){P(D),P(f.$$.fragment,U),P(_.$$.fragment,U),P(F),P(R),T=!1},d(U){U&&w(e),D&&D.d(),U&&w(u),j(f,U),U&&w(d),U&&w(m),U&&w(h),j(_,U),U&&w(k),F&&F.d(U),U&&w(y),R&&R.d(U),U&&w($),M=!1,C()}}}function lC(n,e,t){let i,{collection:s=new pn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=V.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class oC extends be{constructor(e){super(),ge(this,e,lC,sC,he,{collection:0})}}function wd(n,e,t){const i=n.slice();return i[9]=e[t],i}function rC(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Ht(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("change",n[6])),{c(){e&&H(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),o!==(o=a[1])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("change",a[6]),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function aC(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Sd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=$d(wd(n,i,l));return{c(){e=b("div"),t=b("div");for(let l=0;l<s.length;l+=1)s[l].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),g(e,t);for(let r=0;r<s.length;r+=1)s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=wd(l,i,r);s[r]?s[r].p(a,o):(s[r]=$d(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),ht(s,l)}}}function $d(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=z(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function uC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[aC,rC],m=[];function h(v,k){return v[2]?0:1}l=h(n),o=m[l]=d[l](n);let _=n[3].length&&Sd(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",s=O(),o.c(),r=O(),a=b("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li>
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=O(),_&&_.c(),f=Ce(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),m[l].m(v,k),S(v,r,k),S(v,a,k),S(v,u,k),_&&_.m(v,k),S(v,f,k),c=!0},p(v,k){(!c||k&256&&i!==(i=v[8]))&&p(e,"for",i);let y=l;l=h(v),l===y?m[l].p(v,k):(ae(),P(m[y],1,1,()=>{m[y]=null}),ue(),o=m[l],o?o.p(v,k):(o=m[l]=d[l](v),o.c()),A(o,1),o.m(r.parentNode,r)),v[3].length?_?_.p(v,k):(_=Sd(v),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(v){c||(A(o),c=!0)},o(v){P(o),c=!1},d(v){v&&w(e),v&&w(s),m[l].d(v),v&&w(r),v&&w(a),v&&w(u),_&&_.d(v),v&&w(f)}}}function fC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[uC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function cC(n,e,t){let i;Ye(n,fi,c=>t(4,i=c));let{collection:s=new pn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=V.getNestedVal(c,"schema",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let _ in d)for(let v in d[_]){const k=d[_][v].message,y=m[_]||_;r.push(V.sentenize(y+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-dca4f6f5.js"),["./CodeEditor-dca4f6f5.js","./index-a6ccb683.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&Qi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class dC extends be{constructor(e){super(),ge(this,e,cC,fC,he,{collection:0})}}function pC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function mC(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[pC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function hC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function _C(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Td(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function gC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowUsernameAuth?_C:hC}let u=a(n),f=u(n),c=n[3]&&Td();return{c(){e=b("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?m&8&&A(c,1):(c=Td(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function bC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(V.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[vC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(V.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[yC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(V.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 "+(V.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&&Ge(()=>{r||(r=qe(e,St,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=qe(e,St,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function vC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[7](v)}let _={id:n[12],disabled:!V.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),s=b("i"),o=O(),H(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!V.isEmpty(v[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function yC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[8](v)}let _={id:n[12],disabled:!V.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),H(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!V.isEmpty(v[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function kC(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[bC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Cd(n);return{c(){H(e.$$.fragment),t=O(),l&&l.c(),i=Ce()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Cd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function wC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function SC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Md(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function $C(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowEmailAuth?SC:wC}let u=a(n),f=u(n),c=n[2]&&Md();return{c(){e=b("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?m&4&&A(c,1):(c=Md(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function TC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Dd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,St,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,St,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function CC(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[TC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Dd();return{c(){H(e.$$.fragment),t=O(),l&&l.c(),i=Ce()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Dd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function MC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function DC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Od(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function OC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?DC:MC}let u=a(n),f=u(n),c=n[1]&&Od();return{c(){e=b("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?m&2&&A(c,1):(c=Od(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function EC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Minimum password length"),s=O(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&re(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function AC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.textContent="Always require email",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[11]),Ie(Be.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function IC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return s=new ks({props:{single:!0,$$slots:{header:[gC],default:[mC]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[$C],default:[kC]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[OC],default:[CC]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[EC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),v=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[AC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=O(),i=b("div"),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),f=b("hr"),c=O(),d=b("h4"),d.textContent="General",m=O(),H(h.$$.fragment),_=O(),H(v.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(y,$){S(y,e,$),S(y,t,$),S(y,i,$),q(s,i,null),g(i,l),q(o,i,null),g(i,r),q(a,i,null),S(y,u,$),S(y,f,$),S(y,c,$),S(y,d,$),S(y,m,$),q(h,y,$),S(y,_,$),q(v,y,$),k=!0},p(y,[$]){const T={};$&8201&&(T.$$scope={dirty:$,ctx:y}),s.$set(T);const M={};$&8197&&(M.$$scope={dirty:$,ctx:y}),o.$set(M);const C={};$&8195&&(C.$$scope={dirty:$,ctx:y}),a.$set(C);const D={};$&12289&&(D.$$scope={dirty:$,ctx:y}),h.$set(D);const E={};$&12289&&(E.$$scope={dirty:$,ctx:y}),v.$set(E)},i(y){k||(A(s.$$.fragment,y),A(o.$$.fragment,y),A(a.$$.fragment,y),A(h.$$.fragment,y),A(v.$$.fragment,y),k=!0)},o(y){P(s.$$.fragment,y),P(o.$$.fragment,y),P(a.$$.fragment,y),P(h.$$.fragment,y),P(v.$$.fragment,y),k=!1},d(y){y&&w(e),y&&w(t),y&&w(i),j(s),j(o),j(a),y&&w(u),y&&w(f),y&&w(c),y&&w(d),y&&w(m),j(h,y),y&&w(_),j(v,y)}}}function PC(n,e,t){let i,s,l,o;Ye(n,fi,_=>t(4,o=_));let{collection:r=new pn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(_){n.$$.not_equal(r.options.exceptEmailDomains,_)&&(r.options.exceptEmailDomains=_,t(0,r))}function c(_){n.$$.not_equal(r.options.onlyEmailDomains,_)&&(r.options.onlyEmailDomains=_,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=pt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=_=>{"collection"in _&&t(0,r=_.collection)},n.$$.update=()=>{var _,v,k,y;n.$$.dirty&1&&r.isAuth&&V.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!V.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.allowEmailAuth)||!V.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!V.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!V.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,h]}class LC extends be{constructor(e){super(),ge(this,e,PC,IC,he,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[15]=e[t],i}function Id(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Pd(n){var r;let e,t,i,s,l=n[2]&&Ld(n),o=!((r=n[1])!=null&&r.isView)&&Nd(n);return{c(){e=b("h6"),e.textContent="Changes:",t=O(),i=b("ul"),l&&l.c(),s=O(),o&&o.c(),p(i,"class","changes-list svelte-1ghly2p")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),g(i,s),o&&o.m(i,null)},p(a,u){var f;a[2]?l?l.p(a,u):(l=Ld(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[1])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Nd(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d(),o&&o.d()}}}function Ld(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=b("li"),t=b("div"),i=z(`Renamed collection
`),s=b("strong"),o=z(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=z(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&2&&l!==(l=m[1].originalName+"")&&le(o,l),h&2&&c!==(c=m[1].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Nd(n){let e,t,i=n[5],s=[];for(let r=0;r<i.length;r+=1)s[r]=Fd(Ad(n,i,r));let l=n[4],o=[];for(let r=0;r<l.length;r+=1)o[r]=Rd(Ed(n,l,r));return{c(){for(let r=0;r<s.length;r+=1)s[r].c();e=O();for(let r=0;r<o.length;r+=1)o[r].c();t=Ce()},m(r,a){for(let u=0;u<s.length;u+=1)s[u].m(r,a);S(r,e,a);for(let u=0;u<o.length;u+=1)o[u].m(r,a);S(r,t,a)},p(r,a){if(a&32){i=r[5];let u;for(u=0;u<i.length;u+=1){const f=Ad(r,i,u);s[u]?s[u].p(f,a):(s[u]=Fd(f),s[u].c(),s[u].m(e.parentNode,e))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}if(a&16){l=r[4];let u;for(u=0;u<l.length;u+=1){const f=Ed(r,l,u);o[u]?o[u].p(f,a):(o[u]=Rd(f),o[u].c(),o[u].m(t.parentNode,t))}for(;u<o.length;u+=1)o[u].d(1);o.length=l.length}},d(r){ht(s,r),r&&w(e),ht(o,r),r&&w(t)}}}function Fd(n){let e,t,i,s,l=n[15].originalName+"",o,r,a,u,f,c=n[15].name+"",d;return{c(){e=b("li"),t=b("div"),i=z(`Renamed field
`),s=b("strong"),o=z(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=z(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&32&&l!==(l=m[15].originalName+"")&&le(o,l),h&32&&c!==(c=m[15].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Rd(n){let e,t,i,s=n[15].name+"",l,o;return{c(){e=b("li"),t=z("Removed field "),i=b("span"),l=z(s),o=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(i,l),g(e,o)},p(r,a){a&16&&s!==(s=r[15].name+"")&&le(l,s)},d(r){r&&w(e)}}}function NC(n){let e,t,i,s,l,o,r,a,u=n[4].length&&Id(),f=n[6]&&Pd(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=b("div"),l=b("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=O(),u&&u.c(),r=O(),f&&f.c(),a=Ce(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[4].length?u||(u=Id(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[6]?f?f.p(c,d):(f=Pd(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function FC(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function RC(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',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){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[Y(e,"click",n[9]),Y(i,"click",n[10])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function qC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[RC],header:[FC],default:[NC]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&1048694&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function jC(n,e,t){let i,s,l,o;const r=Ct();let a,u;async function f(y){t(1,u=y),await sn(),!i&&!s.length&&!l.length?d():a==null||a.show()}function c(){a==null||a.hide()}function d(){c(),r("confirm")}const m=()=>c(),h=()=>d();function _(y){se[y?"unshift":"push"](()=>{a=y,t(3,a)})}function v(y){Ve.call(this,n,y)}function k(y){Ve.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=(u==null?void 0:u.originalName)!=(u==null?void 0:u.name)),n.$$.dirty&2&&t(5,s=(u==null?void 0:u.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(4,l=(u==null?void 0:u.schema.filter(y=>y.id&&y.toDelete))||[]),n.$$.dirty&6&&t(6,o=i||!(u!=null&&u.isView))},[c,u,i,a,l,s,o,d,f,m,h,_,v,k]}class HC extends be{constructor(e){super(),ge(this,e,jC,qC,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function qd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function VC(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new JT({props:l}),se.push(()=>_e(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function zC(n){let e,t,i;function s(o){n[31](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new dC({props:l}),se.push(()=>_e(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function jd(n){let e,t,i,s;function l(r){n[33](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new oC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function Hd(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new LC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Es)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function BC(n){let e,t,i,s,l,o,r;const a=[zC,VC],u=[];function f(m,h){return m[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===vl&&jd(n),d=n[2].isAuth&&Hd(n);return{c(){e=b("div"),t=b("div"),s.c(),l=O(),c&&c.c(),o=O(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===yi),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){S(m,e,h),g(e,t),u[i].m(t,null),g(e,l),c&&c.m(e,null),g(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=f(m),i===_?u[i].p(m,h):(ae(),P(u[_],1,1,()=>{u[_]=null}),ue(),s=u[i],s?s.p(m,h):(s=u[i]=a[i](m),s.c()),A(s,1),s.m(t,null)),(!r||h[0]&8)&&Q(t,"active",m[3]===yi),m[3]===vl?c?(c.p(m,h),h[0]&8&&A(c,1)):(c=jd(m),c.c(),A(c,1),c.m(e,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue()),m[2].isAuth?d?(d.p(m,h),h[0]&4&&A(d,1)):(d=Hd(m),d.c(),A(d,1),d.m(e,null)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},i(m){r||(A(s),A(c),A(d),r=!0)},o(m){P(s),P(c),P(d),r=!1},d(m){m&&w(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Vd(n){let e,t,i,s,l,o,r;return o=new ei({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[UC]},$$scope:{ctx:n}}Line truncated
<span class="txt">Duplicate</span>`,t=O(),i=b("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,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){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[23]),Y(i,"click",kn(ft(n[24])))],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function zd(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[WC]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=O(),H(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function Bd(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[26](n[47])}return{c(){e=b("button"),t=b("i"),s=O(),l=b("span"),r=z(o),a=z(" collection"),u=O(),p(t,"class",i=Si(V.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(m,h){S(m,e,h),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Si(V.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,c()}}}function WC(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Bd(qd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Ce()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=qd(s,t,o);i[o]?i[o].p(r,l):(i[o]=Bd(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function Ud(n){let e;return{c(){e=b("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function YC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k=(n[6][n[2].type]||"N/A")+"",y,$,T,M,C,D,E,I,L,N=n[2].isNew&&zd(n),F=n[2].system&&Ud();return{c(){e=b("label"),t=z("Name"),s=O(),l=b("input"),f=O(),c=b("div"),d=b("button"),m=b("span"),h=O(),_=b("span"),v=z("Type: "),y=z(k),$=O(),N&&N.c(),C=O(),F&&F.c(),D=Ce(),p(e,"for",i=n[46]),p(l,"type","text"),p(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(_,"class","txt"),p(d,"type","button"),p(d,"class",T="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,p(c,"class","form-field-addon")},m(R,K){S(R,e,K),g(e,t),S(R,s,K),S(R,l,K),S(R,f,K),S(R,c,K),g(c,d),g(d,m),g(d,h),g(d,_),g(_,v),g(_,y),g(d,$),N&&N.m(d,null),S(R,C,K),F&&F.m(R,K),S(R,D,K),E=!0,n[2].isNew&&l.focus(),I||(L=Y(l,"input",n[25]),I=!0)},p(R,K){(!E||K[1]&32768&&i!==(i=R[46]))&&p(e,"for",i),(!E||K[1]&32768&&o!==(o=R[46]))&&p(l,"id",o),(!E||K[0]&8192)&&(l.disabled=R[13]),(!E||K[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!E||K[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!E||K[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!E||K[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&le(y,k),R[2].isNew?N?(N.p(R,K),K[0]&4&&A(N,1)):(N=zd(R),N.c(),A(N,1),N.m(d,null)):N&&(ae(),P(N,1,1,()=>{N=null}),ue()),(!E||K[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&p(d,"class",T),(!E||K[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?F||(F=Ud(),F.c(),F.m(D.parentNode,D)):F&&(F.d(1),F=null)},i(R){E||(A(N),E=!0)},o(R){P(N),E=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),N&&N.d(),R&&w(C),F&&F.d(R),R&&w(D),I=!1,L()}}}function Wd(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ie(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Ge(()=>{i||(i=qe(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=qe(e,It,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function Yd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Kd(n){var a,u,f;let e,t,i,s=!V.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&Jd();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=O(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(c,d){S(c,e,d),g(e,t),g(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[30]),l=!0)},p(c,d){var m,h,_;d[0]&32&&(s=!V.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=Line truncated
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function QC(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,_,v,k,y,$,T=n[3];const M=I=>I[15].id;for(let I=0;I<T.length;I+=1){let L=Xd(n,T,I),N=M(L);m.set(N,d[I]=ep(N,L))}let C=null;T.length||(C=Qd(n));let D=!n[7]&&tp(n),E={};return v=new iu({props:E}),n[13](v),v.$on("save",n[14]),{c(){e=b("aside"),t=b("header"),i=b("div"),s=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',o=O(),r=b("input"),a=O(),u=b("hr"),f=O(),c=b("div");for(let I=0;I<d.length;I+=1)d[I].c();C&&C.c(),h=O(),D&&D.c(),_=O(),H(v.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),Q(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),re(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);C&&C.m(c,null),g(e,h),D&&D.m(e,null),S(I,_,L),q(v,I,L),k=!0,y||($=[Y(l,"click",n[10]),Y(r,"input",n[11])],y=!0)},p(I,[L]){(!k||L&16)&&Q(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&re(r,I[0]),(!k||L&16)&&Q(i,"active",I[4]),L&42&&(T=I[3],d=wt(d,L,M,1,I,T,m,c,es,ep,null,Xd),!T.length&&C?C.p(I,L):T.length?C&&(C.d(1),C=null):(C=Qd(I),C.c(),C.m(c,null))),(!k||L&64)&&Q(c,"fade",I[6]),(!k||L&8)&&Q(c,"sidebar-content-compact",I[3].length>20),I[7]?D&&(D.d(1),D=null):D?D.p(I,L):(D=tp(I),D.c(),D.m(e,null));const N={};v.$set(N)},i(I){k||(A(v.$$.fragment,I),k=!0)},o(I){P(v.$$.fragment,I),k=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();C&&C.d(),D&&D.d(),I&&w(_),n[13](null),j(v,I),y=!1,Pe($)}}}function xC(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function e4(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,y=>t(5,o=y)),Ye(n,Ai,y=>t(9,r=y)),Ye(n,Lo,y=>t(6,a=y)),Ye(n,Cs,y=>t(7,u=y));let f,c="";function d(y){Kt(Mi,o=y,o)}const m=()=>t(0,c="");function h(){c=this.value,t(0,c)}const _=()=>f==null?void 0:f.show();function v(y){se[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var $;($=y.detail)!=null&&$.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&xC(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(y=>y.id==c||y.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,h,_,v,k]}class t4 extends be{constructor(e){super(),ge(this,e,e4,QC,he,{})}}function np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function ip(n){n[18]=n[19].default}function sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function lp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function op(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&lp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Ce(),c&&c.c(),s=O(),l=b("button"),r=z(o),a=O(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,h){S(m,t,h),c&&c.m(m,h),S(m,s,h),S(m,l,h),g(l,r),g(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=lp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(m){m&&w(t),c&&c.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function rp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:s4,then:i4,catch:n4,value:19,blocks:[,,,]};return au(t=n[15].component,s),{c(){e=Ce(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&au(t,s)||r1(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];P(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function n4(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function i4(n){ip(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=O()},m(s,l){q(e,s,l),S(s,t,l),i=!0},p(s,l){ip(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function s4(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function ap(n,e){let t,i,s,l=e[5]===e[14]&&rp(e);return{key:n,first:null,c(){t=Ce(),l&&l.c(),i=Ce(),this.first=t},m(o,r){S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=rp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(l),s=!0)},o(o){P(lLine truncated
`),D&&D.c(),m=O(),_.c(),v=Ce(),p(s,"type","button"),p(s,"class","btn btn-transparent btn-hint p-l-sm p-r-sm"),p(e,"class","flex m-b-base flex-gap-10"),p(o,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(N,F){S(N,e,F),q(t,e,null),g(e,i),g(e,s),S(N,l,F),S(N,o,F);for(let R=0;R<r.length;R+=1)r[R].m(o,null);C&&C.m(o,null),S(N,f,F),S(N,c,F),g(c,d),D&&D.m(c,null),S(N,m,F),I[h].m(N,F),S(N,v,F),k=!0,y||($=[Y(s,"click",n[31]),Ie(u=$M.call(null,o,n[36]))],y=!0)},p(N,F){const R={};F[0]&4&&(R.value=N[2]),F[0]&4096&&(R.autocompleteCollection=N[12]),t.$set(R),F[0]&142252&&(T=N[3],ae(),r=wt(r,F,M,1,N,T,a,o,ln,Op,null,Cp),ue(),!T.length&&C?C.p(N,F):T.length?C&&(C.d(1),C=null):(C=Mp(N),C.c(),C.m(o,null))),u&&Bt(u.update)&&F[0]&1040&&u.update.call(null,N[36]),N[5]>1?D?D.p(N,F):(D=Ep(N),D.c(),D.m(c,null)):D&&(D.d(1),D=null);let K=h;h=L(N),h===K?I[h].p(N,F):(ae(),P(I[K],1,1,()=>{I[K]=null}),ue(),_=I[h],_?_.p(N,F):(_=I[h]=E[h](N),_.c()),A(_,1),_.m(v.parentNode,v))},i(N){if(!k){A(t.$$.fragment,N);for(let F=0;F<T.length;F+=1)A(r[F]);A(_),k=!0}},o(N){P(t.$$.fragment,N);for(let F=0;F<r.length;F+=1)P(r[F]);P(_),k=!1},d(N){N&&w(e),j(t),N&&w(l),N&&w(o);for(let F=0;F<r.length;F+=1)r[F].d();C&&C.d(),N&&w(f),N&&w(c),D&&D.d(),N&&w(m),I[h].d(N),N&&w(v),y=!1,Pe($)}}}function jM(n){var r;let e,t,i,s=(((r=n[12])==null?void 0:r.name)||"")+"",l,o;return{c(){e=b("h4"),t=z("Select "),i=b("strong"),l=z(s),o=z(" records")},m(a,u){S(a,e,u),g(e,t),g(e,i),g(i,l),g(e,o)},p(a,u){var f;u[0]&4096&&s!==(s=(((f=a[12])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function HM(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=b("button"),i.innerHTML='<span class="txt">Save selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function VM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[HM],header:[jM],default:[qM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Je(o,l[a]);e=new Sn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[12]};return i=new qb({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?on(l,[l[0],l[1],xn(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&4096&&(c.collection=a[12]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Er=100;function zM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=At(e,c),m;Ye(n,Ai,Ae=>t(26,m=Ae));const h=Ct(),_="picker_"+V.randomString(5);let{value:v}=e,{field:k}=e,y,$,T="",M=[],C=[],D=1,E=0,I=!1,L=!1;function N(){return t(2,T=""),t(3,M=[]),t(6,C=[]),R(),K(!0),y==null?void 0:y.show()}function F(){return y==null?void 0:y.hide()}async function R(){const Ae=V.toArray(v);if(!s||!Ae.length)return;t(24,L=!0);let ie=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Er))et.push(`id="${bt}"`);nt.push(me.collection(s).getFullList(Er,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ie=ie.concat(...et)}),t(6,C=[]);for(const et of Ae){const bt=V.findByKey(ie,"id",et);bt&&C.push(bt)}T.trim()||t(3,M=V.filterDuplicatesByKey(C.concat(M)))}catch(et){me.errorResponseHandler(et)}t(24,L=!1)}async function K(Ae=!1){if(s){t(4,I=!0),Ae&&(T.trim()?t(3,M=[]):t(3,M=V.toArray(C).slice()));try{const ie=Ae?1:D+1,we=await me.collection(s).getList(ie,Er,{filter:T,sort:"-created",$cancelKey:_+"loadList"});t(3,M=V.filterDuplicatesByKey(M.concat(we.items))),D=we.page,t(23,E=we.totalItems)}catch(ie){me.errorResponseHandler(ie)}t(4,I=!1)}}function x(Ae){i==1?t(6,C=[Ae]):u&&(V.pushOrReplaceByKey(C,Ae),t(6,C))}function U(Ae){V.removeByKey(C,"id",Ae.id),t(6,C)}function G(Ae){f(Ae)?U(Ae):x(Ae)}function ne(){var Ae;i!=1?t(20,v=C.map(ie=>ie.id)):t(20,v=((Ae=C==null?void 0:C[0])==null?void 0:Ae.id)||""),h("save",C),F()}function J(Ae){Ve.call(this,n,Ae)}const fe=()=>F(),Z=()=>ne(),de=Ae=>t(2,T=Ae.detail),ve=()=>$==null?void 0:$.show(),Te=Ae=>$==null?void 0:$.show(Ae),Ne=Ae=>G(Ae),Re=(Ae,ie)=>{(ie.code==="Enter"||ie.code==="Space")&&(ie.preventDefault(),ie.stopPropagation(),G(Ae))},ye=()=>t(2,T=""),Se=()=>{a&&!I&&K()},We=Ae=>U(Ae);function lt(Ae){C=Ae,t(6,C)}function ce(Ae){se[Ae?"unshift":"push"](()=>{y=Ae,t(1,y)})}function ze(Ae){Ve.call(this,n,Ae)}function te(Ae){Ve.call(this,n,Ae)}function Fe(Ae){se[Ae?"unshift":"push"](()=>{$=Ae,t(7,$)})}const ot=Ae=>{V.removeByKey(M,"id",Ae.detail.id),M.unshift(Ae.detail),t(3,M),x(Ae.detail)},Vt=Ae=>{V.removeByKey(M,"id",Ae.detail.id),t(3,M),U(Ae.detail)};return n.$$set=Ae=>{e=Je(Je({},e Line truncated
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Rp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Qo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=O(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(m,h){S(m,e,h),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(e,r),a=!0,u||(f=[Ie(Be.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,h){var v;n=m;const _={};h&16&&(_.record=n[15]),h&4&&(_.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(_)},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),j(i),u=!1,Pe(f)}}}function UM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y=n[4],$=[];for(let C=0;C<y.length;C+=1)$[C]=Rp(Ip(n,y,C));const T=C=>P($[C],1,1,()=>{$[C]=null});let M=null;return y.length||(M=Lp(n)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=z(o),u=O(),f=b("div"),c=b("div");for(let C=0;C<$.length;C+=1)$[C].c();M&&M.c(),d=O(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,p(t,"class",i=Si(V.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[14]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m(C,D){S(C,e,D),g(e,t),g(e,s),g(e,l),g(l,r),S(C,u,D),S(C,f,D),g(f,c);for(let E=0;E<$.length;E+=1)$[E].m(c,null);M&&M.m(c,null),g(f,d),g(f,m),g(m,h),_=!0,v||(k=Y(h,"click",n[9]),v=!0)},p(C,D){if((!_||D&4&&i!==(i=Si(V.getFieldTypeIcon(C[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!_||D&4)&&o!==(o=C[2].name+"")&&le(r,o),(!_||D&16384&&a!==(a=C[14]))&&p(e,"for",a),D&181){y=C[4];let E;for(E=0;E<y.length;E+=1){const I=Ip(C,y,E);$[E]?($[E].p(I,D),A($[E],1)):($[E]=Rp(I),$[E].c(),A($[E],1),$[E].m(c,null))}for(ae(),E=y.length;E<$.length;E+=1)T(E);ue(),!y.length&&M?M.p(C,D):y.length?M&&(M.d(1),M=null):(M=Lp(C),M.c(),M.m(c,null))}},i(C){if(!_){for(let D=0;D<y.length;D+=1)A($[D]);_=!0}},o(C){$=$.filter(Boolean);for(let D=0;D<$.length;D+=1)P($[D]);_=!1},d(C){C&&w(e),C&&w(u),C&&w(f),ht($,C),M&&M.d(),v=!1,k()}}}function WM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[UM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new BM({props:o}),n[11](i),i.$on("save",n[12]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const qp=100;function YM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var T,M;const k=V.toArray(s);if(!((T=o==null?void 0:o.options)!=null&&T.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const y=k.slice(),$=[];for(;y.length>0;){const C=[];for(const D of y.splice(0,qp))C.push(`id="${D}"`);$.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(qp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all($).then(D=>{C=C.concat(...D)});for(const D of k){const E=V.findByKey(C,"id",D);E&&a.push(E)}t(4,a)}catch(C){me.errorResponseHandler(C)}t(5,u=!1)}function c(k){var y;V.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map($=>$.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),m=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map($=>$.id):((y=a[0])==null?void 0:y.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,m,h,_,v]}class KM extends be{constructor(e){super(),ge(this,e,YM,WM,he,{value:0,picker:1,field:2})}}const JM=["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"],ZM=(n,e)=>{JM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function GM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Lr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function XM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function QM(n){let e;function t(l,o){return l[1]?XM:GM}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){S(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:X,o:X,d(l){l&&w(e),s.d(),n[19](null)}}}const Fb=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),xM=()=>{let n={listeners:[],scriptId:Fb("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("scripLine truncated
...
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[5]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&re(l,c[5])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function C5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[k5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[w5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[S5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[$5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[T5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=O(),o=b("div"),H(r.$$.fragment),a=O(),u=b("div"),H(f.$$.fragment),c=O(),d=b("div"),H(m.$$.fragment),h=O(),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){S($,e,T),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),q(f,u,null),g(t,c),g(t,d),q(m,d,null),g(t,h),q(_,t,null),v=!0,k||(y=Y(e,"submit",ft(n[17])),k=!0)},p($,T){const M={};T&25165828&&(M.$$scope={dirty:T,ctx:$}),s.$set(M);const C={};T&25165832&&(C.$$scope={dirty:T,ctx:$}),r.$set(C);const D={};T&25165840&&(D.$$scope={dirty:T,ctx:$}),f.$set(D);const E={};T&25165888&&(E.$$scope={dirty:T,ctx:$}),m.$set(E);const I={};T&25165856&&(I.$$scope={dirty:T,ctx:$}),_.$set(I)},i($){v||(A(s.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(_.$$.fragment,$),v=!0)},o($){P(s.$$.fragment,$),P(r.$$.fragment,$),P(f.$$.fragment,$),P(m.$$.fragment,$),P(_.$$.fragment,$),v=!1},d($){$&&w(e),j(s),j(r),j(f),j(m),j(_),k=!1,y()}}}function M5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function D5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=z("Close"),i=O(),s=b("button"),l=b("i"),o=O(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function O5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[D5],header:[M5],default:[C5]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const po=15777e3;function E5(n,e,t){let i;const s=Ct(),l="apple_secret_"+V.randomString(5);let o,r,a,u,f,c,d=!1;function m(L={}){t(2,r=L.clientId||""),t(3,a=L.teamId||""),t(4,u=L.keyId||""),t(5,f=L.privateKey||""),t(6,c=L.duration||po),In({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const L=await me.send("/api/settings/apple/generate-client-secret",{method:"POST",body:{teamId:a,clientId:r,keyId:u,privateKey:f.trim(),duration:c}});t(7,d=!1),jt("Successfully generated client secret."),s("submit",L),o==null||o.hide()}catch(L){me.errorResponseHandler(L)}t(7,d=!1)}function v(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function y(){u=this.value,t(4,u)}function $(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const M=()=>_(),C=()=>!d;function D(L){se[L?"unshift":"push"](()=>{o=L,t(1,o)})}function E(L){Ve.call(this,n,L)}function I(L){Ve.call(this,n,L)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,l,_,m,v,k,y,$,T,M,C,D,E,I]}class A5 extends be{constructor(e){super(),ge(this,e,E5,O5,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function I5(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new A5({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=O(),s=b("span"),s.textContent="Generate secret",o=O(),H(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn- Line truncated
Updated: ${n[2].updated}`,position:"left"})),v=!0)},p(y,$){$[1]&8388608&&r!==(r=y[54])&&p(e,"for",r),c&&Bt(c.update)&&$[0]&4&&c.update.call(null,{text:`Created: ${y[2].created}
Updated: ${y[2].updated}`,position:"left"}),$[1]&8388608&&h!==(h=y[54])&&p(m,"id",h),$[0]&4&&_!==(_=y[2].id)&&m.value!==_&&(m.value=_)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(m),v=!1,k()}}}function Up(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new b4({props:r}),se.push(()=>_e(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Wp();return{c(){H(e.$$.fragment),i=O(),a&&a.c(),s=Ce()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,_;const m={};d[0]&1&&(m.collection=c[0]),!t&&d[0]&4&&(t=!0,m.record=c[2],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Wp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Wp(n){let e;return{c(){e=b("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function z5(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new KM({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function B5(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new SM({props:u}),se.push(()=>_e(e,"value",o)),se.push(()=>_e(e,"uploadedFiles",r)),se.push(()=>_e(e,"deletedFileIndexes",a)),{c(){H(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function U5(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new x4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function W5(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new Z4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Y5(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new W4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function K5(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new l5({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function J5(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new V4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Z5(n){let e,t,i;function s(o){n[33](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new R4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function G5(n){let e,t,i;function s(o){n[32](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new P4({props:l}),se.push(()=>_e(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={}; Line truncated
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Gp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function eD(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&Zp(n),u=n[0].isAuth&&n[7].email&&Gp(n);return{c(){a&&a.c(),e=O(),u&&u.c(),t=O(),i=b("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=O(),l=b("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[Y(i,"click",n[25]),Y(l,"click",kn(ft(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=Zp(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=Gp(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Pe(r)}}}function Xp(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=O(),s=b("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[10]===Gi),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),l||(o=[Y(t,"click",n[27]),Y(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===Gi),a[0]&1024&&Q(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Pe(o)}}}function tD(n){var _;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((_=n[0])==null?void 0:_.name)+"",r,a,u,f,c,d,m=!n[2].isNew&&Jp(n),h=n[0].isAuth&&!n[2].isNew&&Xp(n);return{c(){e=b("h4"),i=z(t),s=O(),l=b("strong"),r=z(o),a=z(" record"),u=O(),m&&m.c(),f=O(),h&&h.c(),c=Ce()},m(v,k){S(v,e,k),g(e,i),g(e,s),g(e,l),g(l,r),g(e,a),S(v,u,k),m&&m.m(v,k),S(v,f,k),h&&h.m(v,k),S(v,c,k),d=!0},p(v,k){var y;(!d||k[0]&4)&&t!==(t=v[2].isNew?"New":"Edit")&&le(i,t),(!d||k[0]&1)&&o!==(o=((y=v[0])==null?void 0:y.name)+"")&&le(r,o),v[2].isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(v,k),k[0]&4&&A(m,1)):(m=Jp(v),m.c(),A(m,1),m.m(f.parentNode,f)),v[0].isAuth&&!v[2].isNew?h?h.p(v,k):(h=Xp(v),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(v){d||(A(m),d=!0)},o(v){P(m),d=!1},d(v){v&&w(e),v&&w(u),m&&m.d(v),v&&w(f),h&&h.d(v),v&&w(c)}}}function nD(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),r=z(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[13]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=Y(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function iD(n){var s;let e,t,i={class:`
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[nD],header:[tD],default:[x5]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function Qp(n){return JSON.stringify(n)}function sD(n,e,t){let i,s,l,o;const r=Ct(),a="record_"+V.randomString(5);let{collection:u}=e,f,c=null,d=new $i,m=!1,h=!1,_={},v={},k="",y=Gi;function $(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function T(){return f==null?void 0:f.hide()}async function M(ie){In({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new $i),t(3,_={}),t(4,v={}),await sn(),t(20,k=Qp(d))}function C(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ie=E();let we;d.isNew?we=me.collection(u.id).create(ie):we=me.collection(u.id).update(d.id,ie),we.then(nt=>{jt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),T(),r("save",nt)}).catch(nt=>{me.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function D(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>me.collection(c.collectionId).delete(c.id).then(()=>{T(),jt("Successfully deleted record."),r("delete",c)}).catch(ie=>{me.errorResponseHandler(ie)}))}function E(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),V.addValueToFormData(we,et,ie[et]));for(const et in _){const bt=V.toArray(_[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=V.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>me.collection(u.id).requestVerification(c.email).then(()=>{jt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>me.collection(u.id).requestPasswordReset(c.email).then(()=>{jt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function N(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}$(ie),await sn(),t(20,k="")}const R=()=>T(),K=()=>I(),x=()=>L(),U=()=>N(),G=()=>D(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function fe(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ve(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ye(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(_[we.name],ie)&&(_[we.name]=ie,t(3,_))}function ze(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),T()}),!1):(In({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Vt(ie){Ve.call(this,n,ie)}function Ae(ie){Ve.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(we=>we.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=V.hasNonEmptyProps(_)||V.hasNonEmptyProps(v)),n.$$.dirty[0]&3145732&&t(5,l=s||k!=Qp(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,T,d,_,v,l,f,c,m,h,y,o,i,a,C,D,I,L,N,$,k,s,R,K,x,U,G,ne,J,fe,Z,de,ve,Te,Ne,Re,ye,Se,We,lt,ce,ze,te,Fe,ot,Vt,Ae]}class qb extends be{constructor(e){super(),ge(this,e,sD,iD,he,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function xp(n,e,t){const i=n.slice();return i[15]=e[t],i[7]=t,i}function em(n,e,t){const i=n.slice();return i[12]=e[t],i}function tm(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function nm(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function lD(n){const e=n.slice(),t=V.toArray(e[3]);e[8]=t;const i=V.toArray(e[0].expand[e[1].name]);e[9]=i;const s=e[2]?20:200;return e[10]=s,e}funct Line truncated
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function zD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function BD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Cm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],p(r,"for",a="checkbox_"+n[55].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){S(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,m){n=d,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&p(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&p(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function Mm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new lu({props:{value:n[55].id}});let c=n[2].isAuth&&Dm(n);return{c(){e=b("td"),t=b("div"),i=b("div"),H(s.$$.fragment),l=O(),o=b("div"),a=z(r),u=O(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),g(e,t),g(t,i),q(s,i,null),g(i,l),g(i,o),g(o,a),g(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[55].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,m):(c=Dm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Dm(n){let e;function t(l,o){return l[55].verified?WD:UD}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function UD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function WD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(Be.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Om(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Em(n),o=i&&Am(n);return{c(){l&&l.c(),t=O(),o&&o.c(),s=Ce()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Em(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Am(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Em(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!V.isEmpty(o[55].username)),t?KD:YD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function YD(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=z(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function KD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Am(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!V.isEmpty(o[55].email)),t?ZD:JD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function JD(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=z(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function ZD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Im(n,e){let t,i,s,l;return i=new jb({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=b("td"),H(i.$$.fragment),p(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Pm(n){let e,t,i;return t=new ui({props:{date:n[55].created}}),{c(){e=b("td"),H(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){coLine truncated
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function rO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I,L,N=!n[10]&&Vm(n);c=new Ea({}),c.$on("refresh",n[16]);let F=!n[2].isView&&zm(n);k=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(U){n[21](U)}function K(U){n[22](U)}let x={collection:n[2]};return n[0]!==void 0&&(x.filter=n[0]),n[1]!==void 0&&(x.sort=n[1]),M=new iO({props:x}),n[20](M),se.push(()=>_e(M,"filter",R)),se.push(()=>_e(M,"sort",K)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",s=O(),l=b("div"),r=z(o),a=O(),u=b("div"),N&&N.c(),f=O(),H(c.$$.fragment),d=O(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,_=O(),F&&F.c(),v=O(),H(k.$$.fragment),y=O(),$=b("div"),T=O(),H(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-base")},m(U,G){S(U,e,G),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),N&&N.m(u,null),g(u,f),q(c,u,null),g(e,d),g(e,m),g(m,h),g(m,_),F&&F.m(m,null),S(U,v,G),q(k,U,G),S(U,y,G),S(U,$,G),S(U,T,G),q(M,U,G),E=!0,I||(L=Y(h,"click",n[17]),I=!0)},p(U,G){(!E||G[0]&4)&&o!==(o=U[2].name+"")&&le(r,o),U[10]?N&&(N.d(1),N=null):N?N.p(U,G):(N=Vm(U),N.c(),N.m(u,f)),U[2].isView?F&&(F.d(1),F=null):F?F.p(U,G):(F=zm(U),F.c(),F.m(m,null));const ne={};G[0]&1&&(ne.value=U[0]),G[0]&4&&(ne.autocompleteCollection=U[2]),k.$set(ne);const J={};G[0]&4&&(J.collection=U[2]),!C&&G[0]&1&&(C=!0,J.filter=U[0],ke(()=>C=!1)),!D&&G[0]&2&&(D=!0,J.sort=U[1],ke(()=>D=!1)),M.$set(J)},i(U){E||(A(c.$$.fragment,U),A(k.$$.fragment,U),A(M.$$.fragment,U),E=!0)},o(U){P(c.$$.fragment,U),P(k.$$.fragment,U),P(M.$$.fragment,U),E=!1},d(U){U&&w(e),N&&N.d(),j(c),F&&F.d(),U&&w(v),j(k,U),U&&w(y),U&&w($),U&&w(T),n[20](null),j(M,U),I=!1,L()}}}function aO(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=O(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function uO(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){S(t,e,i)},p:X,d(t){t&&w(e)}}}function fO(n){let e,t,i;function s(r,a){return r[10]?uO:aO}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),g(e,t),g(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function cO(n){let e;return{c(){e=b("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function dO(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[oO,lO,sO],m=[];function h($,T){return $[3]&&!$[9].length?0:$[9].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};s=new iu({props:_}),n[25](s);let v={};o=new u4({props:v}),n[26](o);let k={collection:n[2]};a=new qb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new AD({props:y}),n[30](f),{c(){t.c(),i=O(),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment)},m($,T){m[e].m($,T),S($,i,T),q(s,$,T),S($,l,T),q(o,$,T),S($,r,T),q(a,$,T),S($,u,T),q(f,$,T),c=!0},p($,T){let M=e;e=h($),e===M?m[e].p($,T):(ae(),P(m[M],1,1,()=>{m[M]=null}),ue(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const D={};o.$set(D);const E={};T[0]&4&&(E.collection=$[2]),a.$set(E);const I={};T[0]&4&&(I.collection=$[2]),f.$set(I)},i($){c||(A(t),A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(f.$$.fragment,$),c=!0)},o($){P(t),P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(f.$$.fragment,$),c=!1},d($){m[e].d($),$&&w(i),n[25](null),j(s,$),$&&w(l),n[26](null),j(o,$),$&&w(r),n[27](null),j(a,$),$&&w(u),n[30](null),j(f,$)}}}function pO(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,$t,Z=>t(31,l=Z)),Ye(n,Lo,Z=>t(3,o=Z)),Ye(n,_a,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,Cs,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,m,h,_,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function $(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!V.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Ab(y);const T=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),C=()=>_==null?void 0:_.load(),D=()=>d==null?void 0:d.show(s),E=()=>m==null?void 0:m.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{_=Z,t(8,_)})}function N(Z){v=Z,t(0,v)}function F(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):m==null||m.show(Z==null?void 0:Z.detail)},K=()=>m==null?void 0:m.show();function x(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function G(Z){se[Z?"unshift":"push"](()=>{m=Z,t(6,m)})}const ne=()=>_==null?void 0:_.reloadLoadedPages(),J=()=>_==null?void 0:_.reloadLoadedPages();function fe(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=y&&L3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&$(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Di("/collections?"+Z)}n.$$.dirty[0]&4&&Kt($t,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,m,h,_,a,u,y,i,r,T,M,C,D,E,I,L,N,F,R,K,x,U,G,ne,J,fe]}class mO extends be{constructor(e){super(),ge(this,e,pO,dO,he,{},null,[-1,-1])}}function hO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=O(),l=b("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=O(),r=b("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=O(),u=b("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=O(),c=b("div"),c.innerHTML='<span class="txt">Sync</span>',d=O(),m=b("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=O(),_=b("a"),_.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,v=O(),k=b("div"),k.textContent="Authentication",y=O(),$=b("a"),$.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,T=O(),M=b("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,C=O(),D=b("a"),D.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(k,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(D,"href","/settings/admins"),p(D,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,N){S(L,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),g(t,f),g(t,c),g(t,d),g(t,m),g(t,h),g(t,_),g(t,v),g(t,k),g(t,y),g(t,$),g(t,T),g(t,M),g(t,C),g(t,D),E||(I=[Ie(jn.call(null,l,{path:"/settings"})),Ie(xt.call(null,l)),Ie(jn.call(null,r,{path:"/settings/mail/?.*"})),Ie(xt.call(null,r)),Ie(jn.call(null,u,{path:"/settings/storage/?.*"})),Ie(xt.call(null,u)),Ie(jn.call(null,m,{path:"/settings/export-collections/?.*"})),Ie(xt.call(null,m)),Ie(jn.call(null,_,{path:"/settings/import-collections/?.*"})),Ie(xt.call(null,_)),Ie(jn.call(null,$,{path:"/settings/auth-providers/?.*"})),Ie(xt.call(null,$)),Ie(jn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(xt.call(null,M)),Ie(jn.call(null,D,{path:"/settings/admins/?.*"})),Ie(xt.call(null,D))],E=!0)},p:X,i:X,o:X,d(L){L&&w(e),E=!1,Pe(I)}}}class Ii extends be{constructor(e){super(),ge(this,e,null,hO,he,{})}}function Bm(n,e,t){const i=n.slice();return i[30]=e[t],i}function Um(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[_O,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function _O(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="id",o=O(),r=b("div"),a=b("i"),f=O(),c=b("input"),p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=m=n[1].id,c.readOnly=!0},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),S(v,r,k),g(r,a),S(v,f,k),S(v,c,k),h||(_=Ie(u=Be.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(v,k){k[0]&536870912&&l!==(l=v[29])&&p(e,"for",l),u&&Bt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${v[1].created}
Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c,"id",d),k[0]&2&&m!==(m=v[1].id)&&c.value!==m&&(c.value=m)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(f),v&&w(c),h=!1,_()}}}function Wm(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=b("button"),t=b("img"),s=O(),zn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),g(e,t),g(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function gO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Email",o=O(),r=b("input"),p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function Ym(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[bO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function bO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Km(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[vO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[yO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=O(),o=b("div"),H(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){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&536871424|c[1]&4&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Ge(()=>{a||(a=qe(t,St,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=qe(t,St,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function vO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&re(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function yO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&re(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function kO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=!n[1].isNew&&Um(n),_=[0,1,2,3,4,5,6,7,8,9],v=[];for(let $=0;$<10;$+=1)v[$]=Wm(Bm(n,_,$));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[gO,({uniqueId:$})=>({29:$}),({uniqueId:$})=>[$?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].isNew&&Ym(n),y=(n[1].isNew||n[4])&&Km(n);return{c(){e=b("form"),h&&h.c(),t=O(),i=b("div"),s=b("p"),s.textContent="Avatar",l=O(),o=b("div");for(let $=0;$<10;$+=1)v[$].c();r=O(),H(a.$$.fragment),u=O(),k&&k.c(),f=O(),y&&y.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m($,T){S($,e,T),h&&h.m(e,null),g(e,t),g(e,i),g(i,s),g(i,l),g(i,o);for(let M=0;M<10;M+=1)v[M].m(o,null);g Line truncated
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $O(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&Jm(n);return{c(){m&&m.c(),e=O(),t=b("button"),i=b("span"),i.textContent="Cancel",s=O(),l=b("button"),o=b("span"),a=z(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(h,_){m&&m.m(h,_),S(h,e,_),S(h,t,_),g(t,i),S(h,s,_),S(h,l,_),g(l,o),g(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(h,_){h[1].isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(h,_),_[0]&2&&A(m,1)):(m=Jm(h),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||_[0]&64)&&(t.disabled=h[6]),(!f||_[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||_[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||_[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(m),f=!0)},o(h){P(m),f=!1},d(h){m&&m.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function TO(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[$O],header:[wO],default:[kO]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function CO(n,e,t){let i;const s=Ct(),l="admin_"+V.randomString(5);let o,r=new Xi,a=!1,u=!1,f=0,c="",d="",m="",h=!1;function _(U){return k(U),t(7,u=!0),o==null?void 0:o.show()}function v(){return o==null?void 0:o.hide()}function k(U){t(1,r=U!=null&&U.clone?U.clone():new Xi),y()}function y(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,m=""),In({})}function $(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||h)&&(U.password=d,U.passwordConfirm=m);let G;r.isNew?G=me.admins.create(U):G=me.admins.update(r.id,U),G.then(async ne=>{var J;t(7,u=!1),v(),jt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((J=me.authStore.model)==null?void 0:J.id)===ne.id&&me.authStore.save(me.authStore.token,ne)}).catch(ne=>{me.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function T(){r!=null&&r.id&&cn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),v(),jt("Successfully deleted admin."),s("delete",r)}).catch(U=>{me.errorResponseHandler(U)}))}const M=()=>T(),C=()=>v(),D=U=>t(2,f=U);function E(){c=this.value,t(3,c)}function I(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function N(){m=this.value,t(9,m)}const F=()=>i&&u?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),v()}),!1):!0;function R(U){se[U?"unshift":"push"](()=>{o=U,t(5,o)})}function K(U){Ve.call(this,n,U)}function x(U){Ve.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[v,r,f,c,h,o,a,u,d,m,i,l,$,T,_,M,C,D,E,I,L,N,F,R,K,x]}class MO extends be{constructor(e){super(),ge(this,e,CO,TO,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Zm(n,e,t){const i=n.slice();return i[24]=e[t],i}function DO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="id",p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function OO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="email",p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function EO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function AO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="updated",p(t,"class",V.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:X,d(l){l&&w(e)}}}function Gm(n){let e;function t(l,o){return l[5]?PO:IO}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function IO(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Xm(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(Line truncated
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Xm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Qm(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xm(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",h,_,v,k,y,$=e[24].email+"",T,M,C,D,E,I,L,N,F,R,K,x,U,G;f=new lu({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&Qm();E=new ui({props:{date:e[24].created}}),N=new ui({props:{date:e[24].updated}});function J(){return e[15](e[24])}function fe(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("figure"),l=b("img"),r=O(),a=b("td"),u=b("div"),H(f.$$.fragment),c=O(),d=b("span"),h=z(m),_=O(),ne&&ne.c(),v=O(),k=b("td"),y=b("span"),T=z($),C=O(),D=b("td"),H(E.$$.fragment),I=O(),L=b("td"),H(N.$$.fragment),F=O(),R=b("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',K=O(),zn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(y,"class","txt txt-ellipsis"),p(y,"title",M=e[24].email),p(k,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(L,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,de){S(Z,t,de),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),g(a,u),q(f,u,null),g(u,c),g(u,d),g(d,h),g(a,_),ne&&ne.m(a,null),g(t,v),g(t,k),g(k,y),g(y,T),g(t,C),g(t,D),q(E,D,null),g(t,I),g(t,L),q(N,L,null),g(t,F),g(t,R),g(t,K),x=!0,U||(G=[Y(t,"click",J),Y(t,"keydown",fe)],U=!0)},p(Z,de){e=Z,(!x||de&16&&!zn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const ve={};de&16&&(ve.value=e[24].id),f.$set(ve),(!x||de&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?ne||(ne=Qm(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!x||de&16)&&$!==($=e[24].email+"")&&le(T,$),(!x||de&16&&M!==(M=e[24].email))&&p(y,"title",M);const Te={};de&16&&(Te.date=e[24].created),E.$set(Te);const Ne={};de&16&&(Ne.date=e[24].updated),N.$set(Ne)},i(Z){x||(A(f.$$.fragment,Z),A(E.$$.fragment,Z),A(N.$$.fragment,Z),x=!0)},o(Z){P(f.$$.fragment,Z),P(E.$$.fragment,Z),P(N.$$.fragment,Z),x=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(E),j(N),U=!1,Pe(G)}}}function LO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M=[],C=new Map,D;function E(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[DO]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Wt({props:I}),se.push(()=>_e(o,"sort",E));function L(J){n[12](J)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[OO]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Wt({props:N}),se.push(()=>_e(u,"sort",L));function F(J){n[13](J)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[EO]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Wt({props:R}),se.push(()=>_e(d,"sort",F));function K(J){n[14](J)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[AO]},$$scope:{ctx:n}};n[2]!==void 0&&(x.sort=n[2]),_=new Wt({props:x}),se.push(()=>_e(_,"sort",K));let U=n[4];const G=J=>J[24].id;for(let J=0;J<U.length;J+=1){let fe=Zm(n,U,J),Z=G(fe);C.set(Z,M[J]=xm(Z,fe))}let ne=null;return U.length||(ne=Gm(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),s=b("th"),l=O(),H(o.$$.fragment),a=O(),H(u.$$.fragment),c=O(),H(d.$$.fragment),h=O(),H(_.$$.fragment),k=O(),y=b("th"),$=O(),T=b("tbody");for(let J=0;J<M.length;J+=1)M[J].c();ne&&ne.c(),p(s,"class","min-width"),p(y,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[5])},m(J,fe){S(J,e,fe),g(e,t),g(t,i),g(i,s),g(i,l),q(o,i,null),g(i,a),q(u,i,null),g(i,c),q(d,i,null),g(i,h),q(_,i,null),g(i,k),g(i,y),g(e,$),g(e,T);for(let Z=0;Z<M.length;Z+=1)M[Z].m(T,null);ne&&ne.m(T,null),D=!0},p(J,fe){const Z={};fe&134217728&&(Z.$$scope={dirty:fe,ctx:J}),!r&&fe&4&&(r=!0,Z.sort=J[2],ke(()=>r=!1)),o.$set(Z);const de={};fe&134217728&&(de.$$scope={dirty:fe,ctx:J}),!f&&fe&4&&(f=!0,de.sort=J[2],ke(()=>f=!1)),u.$set(de);const ve={};fe&134217728&&(ve.$$scope={dirty:fe,ctx:J}),!m&&fe&4&&(m=!0,ve.sort=J[2],ke(()=>m=!1)),d.$set(ve);const Te={};fe&134217728&&(Te.$$scope={dirty:fe,ctx:J}),!v&&fe&4&&(v=!0,Te.sort=J[2],ke(()=>v=!1)),_.$set(Te),fe&186&&(U=J[4],ae(),M=wt(M,fe,G,1,J,U,C,T,ln,xm,null,Zm),ue(),!U.length&&ne?ne.p(J,fe):U.length?ne&&(ne.d(1),ne=null):(ne=Gm(J),ne.c(),ne.m(T,null))),(!D||fe&32)&&Q(e,"table-loading",J[5])},i(J){if(!D){A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J),A(_.$$.fragment,J);for(let fe=0;fe<U.length;fe+=1)A(M[fe]);D=!0}},o(J){P(o.$$.fragment,J),P(u.$$.fragment,J),P(d.$$.fragment,J),P(_.$$. Line truncated
<span class="txt">New admin</span>`,m=O(),H(h.$$.fragment),_=O(),v=b("div"),k=O(),H(y.$$.fragment),$=O(),E&&E.c(),T=Ce(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(v,"class","clearfix m-b-base")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),q(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),S(I,m,L),q(h,I,L),S(I,_,L),S(I,v,L),S(I,k,L),q(y,I,L),S(I,$,L),E&&E.m(I,L),S(I,T,L),M=!0,C||(D=Y(d,"click",n[9]),C=!0)},p(I,L){(!M||L&64)&&le(o,I[6]);const N={};L&2&&(N.value=I[1]),h.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:I}),y.$set(F),I[4].length?E?E.p(I,L):(E=eh(I),E.c(),E.m(T.parentNode,T)):E&&(E.d(1),E=null)},i(I){M||(A(a.$$.fragment,I),A(h.$$.fragment,I),A(y.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(h.$$.fragment,I),P(y.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(m),j(h,I),I&&w(_),I&&w(v),I&&w(k),j(y,I),I&&w($),E&&E.d(I),I&&w(T),C=!1,D()}}}function FO(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[NO]},$$scope:{ctx:n}}});let r={};return l=new MO({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function RO(n,e,t){let i,s,l;Ye(n,_a,N=>t(21,i=N)),Ye(n,$t,N=>t(6,s=N)),Ye(n,Oa,N=>t(7,l=N)),Kt($t,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),me.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),m(),me.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),v=N=>t(1,f=N.detail);function k(N){c=N,t(2,c)}function y(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}function T(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),C=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},D=()=>t(1,f="");function E(N){se[N?"unshift":"push"](()=>{r=N,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Di("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,h,_,v,k,y,$,T,M,C,D,E,I,L]}class qO extends be{constructor(e){super(),ge(this,e,RO,FO,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function jO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Email"),s=O(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function HO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=z("Password"),s=O(),l=b("input"),r=O(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[1]),S(d,r,m),S(d,a,m),g(a,u),f||(c=[Y(l,"input",n[5]),Ie(xt.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(l,"id",o),m&2&&l.value!==d[1]&&re(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Pe(c)}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[jO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[HO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Admin sign in</h4>",i=O(),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),a=b("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){S(d,e,m),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),g(e,a),u=!0,f||(c=Y(e,"submit",ft(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function zO(n){let e,t;return e=new Eg({props:{$$slots:{default:[VO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function BO(n,e,t){let i;Ye(n,_a,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Ma(),Di("/")}).catch(()=>{dl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class UO extends be{constructor(e){super(),ge(this,e,BO,zO,he,{})}}function WO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[KO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[JO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[ZO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[GO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let C=n[3]&&th(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment),c=O(),d=b("div"),m=b("div"),h=O(),C&&C.c(),_=O(),v=b("button"),k=b("span"),k.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(k,"class","txt"),p(v,"type","submit"),p(v,"class","btn btn-expanded"),v.disabled=y=!n[3]||n[2],Q(v,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(D,E){S(D,e,E),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),q(a,e,null),g(e,u),q(f,e,null),g(e,c),g(e,d),g(d,m),g(d,h),C&&C.m(d,null),g(d,_),g(d,v),g(v,k),$=!0,T||(M=Y(v,"click",n[13]),T=!0)},p(D,E){const I={};E&1572865&&(I.$$scope={dirty:E,ctx:D}),i.$set(I);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:D}),a.$set(N);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:D}),f.$set(F),D[3]?C?C.p(D,E):(C=th(D),C.c(),C.m(d,_)):C&&(C.d(1),C=null),(!$||E&12&&y!==(y=!D[3]||D[2]))&&(v.disabled=y),(!$||E&4)&&Q(v,"btn-loading",D[2])},i(D){$||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(a.$$.fragment,D),A(f.$$.fragment,D),$=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(a.$$.fragment,D),P(f.$$.fragment,D),$=!1},d(D){D&&w(e),j(i),j(o),j(a),j(f),C&&C.d(),T=!1,M()}}}function YO(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function KO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Application name"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&re(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Application url"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&re(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function ZO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Logs max days retention"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].logs.maxDays&&re(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function GO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("spanLine truncated
<div class="breadcrumb-item">Application</div></nav>`,t=O(),i=b("div"),s=b("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",ft(n[4])),a=!0)},p(m,h){let _=l;l=d(m),l===_?c[l].p(m,h):(ae(),P(c[_],1,1,()=>{c[_]=null}),ue(),o=c[l],o?o.p(m,h):(o=c[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),c[l].d(),a=!1,u()}}}function QO(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[XO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function xO(n,e,t){let i,s,l,o;Ye(n,Cs,C=>t(14,s=C)),Ye(n,ko,C=>t(15,l=C)),Ye(n,$t,C=>t(16,o=C)),Kt($t,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await me.settings.getAll()||{};h(C)}catch(C){me.errorResponseHandler(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await me.settings.update(V.filterRedactedProps(a));h(C),jt("Successfully saved application settings.")}catch(C){me.errorResponseHandler(C)}t(2,f=!1)}}function h(C={}){var D,E;Kt(ko,l=(D=C==null?void 0:C.meta)==null?void 0:D.appName,l),Kt(Cs,s=!!((E=C==null?void 0:C.meta)!=null&&E.hideControls),s),t(0,a={meta:(C==null?void 0:C.meta)||{},logs:(C==null?void 0:C.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function y(){a.logs.maxDays=pt(this.value),t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),M=()=>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,_,r,c,v,k,y,$,T,M]}class eE extends be{constructor(e){super(),ge(this,e,xO,QO,he,{})}}function tE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Je(l,s[o]);return{c(){e=b("input"),Xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),re(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){Xn(e,l=on(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&re(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function nE(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=Je(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',i=O(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Xn(s,a)},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(Be.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Xn(s,a=on(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Pe(o)}}}function iE(n){let e;function t(l,o){return l[3]?nE:tE}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:X,o:X,d(l){s.d(l),l&&w(e)}}}function sE(n,e,t){const i=["value","mask"];let s=At(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(5,s=At(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class ou extends be{constructor(e){super(),ge(this,e,sE,iE,he,{value:0,mask:1})}}function lE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=z("Subject"),s=O(),l=b("input"),r=O(),a=b("div"),u=z(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=z(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=z("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),S(v,l,k),re(l,n[0].subject),S(v,r,k),S(v,a,k),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),h||(_=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],h=!0)},p(v,k){k[1]&1&&i!==(i=v[31])&&p(e,"for",i),k[1]&1&&o!==(o=v[31])&&p(l,"id",o),k[0]&1&&l.value!==v[0].subject&&re(l,v[0].subject)},d(v){v&&w(e),v&&w(s),v&&w(l),v&&w(r),v&&w(a),h=!1,Pe(_)}}}function oE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=z("Action URL"),s=O(),l=b("input"),r=O(),a=b("div"),u=z(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=z(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=z(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,_=z("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(y,$){S(y,e,$),g(e,t),S(y,s,$),S(y,l,$),re(l,n[0].actionUrl),S(y,r,$),S(y,a,$),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),v||(k=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(h,"click",n[19])],v=!0)},p(y,$){$[1]&1&&i!==(i=y[31])&&p(e,"for",i),$[1]&1&&o!==(o=y[31])&&p(l,"id",o),$[0]&1&&l.value!==y[0].actionUrl&&re(l,y[0].actionUrl)},d(y){y&&w(e),y&&w(s),y&&w(l),y&&w(r),y&&w(a),v=!1,Pe(k)}}}function rE(n){let e,t,i,s;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(l,o){S(l,e,o),re(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&re(e,l[0].body)},i:X,o:X,d(l){l&&w(e),i=!1,s()}}}function aE(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Ht(o,r(n)),se.push(()=>_e(e,"value",l))),{c(){e&&H(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),o!==(o=a[4])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function uE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T;const M=[aE,rE],C=[];function D(E,I){return E[4]&&!E[5]?0:1}return l=D(n),o=C[l]=M[l](n),{c(){e=b("label"),t=z("Body (HTML)"),s=O(),o.c(),r=O(),a=b("div"),u=z(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=z(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=z(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,_=z(`,
`),v=b("button"),v.textContent=`{ACTION_URL}
`,k=z("."),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(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(v,"type","button"),p(v,"class","label label-sm link-primary txt-mono"),p(v,"title","Required parameter"),p(a,"class","help-block")},m(E,I){S(E,e,I),g(e,t),S(E,s,I),C[l].m(E,I),S(E,r,I),S(E,a,I),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),g(a,v),g(a,k),y=!0,$||(T=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],$=!0)},p(E,I){(!y||I[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let L=l;l=D(E),l===L?C[l].p(E,I):(ae(),P(C[L],1,1,()=>{C[L]=null}),ue(),o=C[l],o?o.p(E,I):(o=C[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){y||(A(o),y=!0)},o(E){P(o),y=!1},d(E){E&&w(e),E&&w(s),C[l].d(E),E&&w(r),E&&w(a),$=!1,Pe(T)}}}function fE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[lE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[oE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[uE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),H(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function nh(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&nh();return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),l=z(n[2]),o=O(),r=b("div"),a=O(),f&&f.c(),u=Ce(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=nh(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ae(),P(f,1,1,()=>{f=null}),ue())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function dE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[cE],default:[fE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?on(i,[xn(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let ih;function pE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=At(e,s),o;Ye(n,fi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=ih,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-dca4f6f5.js"),["./CodeEditor-dca4f6f5.js","./index-a6ccb683.js"],import.meta.url)).default),ih=c,t(5,d=!1))}function k(J){V.copyToClipboard(J),Dg(`Copied ${J} to clipboard`,2e3)}v();function y(){u.subject=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const C=()=>k("{APP_NAME}"),D=()=>k("{APP_URL}"),E=()=>k("{TOKEN}");function I(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function L(){u.body=this.value,t(0,u)}const N=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),R=()=>k("{TOKEN}"),K=()=>k("{ACTION_URL}");function x(J){se[J?"unshift":"push"](()=>{f=J,t(3,f)})}function U(J){Ve.call(this,n,J)}function G(J){Ve.call(this,n,J)}function ne(J){Ve.call(this,n,J)}return n.$$set=J=>{e=Je(Je({},e),Qn(J)),t(8,l=At(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Qi(r))},[u,r,a,f,c,d,i,k,l,m,h,_,o,y,$,T,M,C,D,E,I,L,N,F,R,K,x,U,G,ne]}class Ir extends be{constructor(e){super(),ge(this,e,pE,dE,he,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return thi Line truncated
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function LE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function NE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[SE,wE],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=z(n[5]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[27])),_=!0)},p(T,M){(!h||M[0]&32)&&le(o,T[5]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){h||(A(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function FE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[NE]},$$scope:{ctx:n}}});let r={};return l=new kE({props:r}),n[28](l),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function RE(n,e,t){let i,s,l;Ye(n,$t,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Kt($t,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const ne=await me.settings.getAll()||{};_(ne)}catch(ne){me.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await me.settings.update(V.filterRedactedProps(f));_(ne),In({}),jt("Successfully saved mail settings.")}catch(ne){me.errorResponseHandler(ne)}t(3,d=!1)}}function _(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function y(){f.meta.senderAddress=this.value,t(0,f)}function $(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function T(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function C(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=pt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>v(),K=()=>h(),x=()=>a==null?void 0:a.show(),U=()=>h();function G(ne){se[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,h,v,u,i,k,y,$,T,M,C,D,E,I,L,N,F,R,K,x,U,G]}class qE extends be{constructor(e){super(),ge(this,e,RE,FE,he,{},null,[-1,-1])}}function jE(n){var T,M;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[VE,({uniqueId:C})=>({25:C}),({uniqueId:C})=>C?33554432:0]},$$scope:{ctx:n}}});let v=((T=n[0].s3)==null?void 0:T.enabled)!=n[1].s3.enabled&&ah(n),k=n[1].s3.enabled&&uh(n),y=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&fh(n),$=n[6]&&ch(n);return{c(){H(e.$$.fragment),t=O(),v&&v.c(),i=O(),k&&k.c(),s=O(),l=b("div"),o=b("div"),r=O(),y&&y.c(),a=O(),$&&$.c(),u=O(),f=b("button"),c=b("span"),c.textContent="Save changes",p(o,"class",Line truncated
the
`),r=b("strong"),u=z(a),f=z(`
to the
`),c=b("strong"),m=z(d),h=z(`.
`),_=b("br"),v=z(`
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
`,y=z(`,
`),$=b("a"),$.textContent=`s5cmd
`,T=z(", etc."),M=O(),C=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(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(C,"class","clearfix m-t-base")},m(L,N){S(L,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(c,m),g(l,h),g(l,_),g(l,v),g(l,k),g(l,y),g(l,$),g(l,T),g(e,M),g(e,C),E=!0},p(L,N){var F;(!E||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!E||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(L){E||(L&&Ge(()=>{D||(D=qe(e,St,{duration:150},!0)),D.run(1)}),E=!0)},o(L){L&&(D||(D=qe(e,St,{duration:150},!1)),D.run(0)),E=!1},d(L){L&&w(e),L&&D&&D.end()}}}function uh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[zE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[BE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[UE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[WE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[YE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),y=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[KE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=O(),l=b("div"),H(o.$$.fragment),r=O(),a=b("div"),H(u.$$.fragment),f=O(),c=b("div"),H(d.$$.fragment),m=O(),h=b("div"),H(_.$$.fragment),v=O(),k=b("div"),H(y.$$.fragment),$=O(),T=b("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(D,E){S(D,e,E),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,$),g(e,T),C=!0},p(D,E){const I={};E&100663298&&(I.$$scope={dirty:E,ctx:D}),i.$set(I);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:D}),u.$set(N);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:D}),d.$set(F);const R={};E&100663298&&(R.$$scope={dirty:E,ctx:D}),_.$set(R);const K={};E&100663298&&(K.$$scope={dirty:E,ctx:D}),y.$set(K)},i(D){C||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(y.$$.fragment,D),D&&Ge(()=>{M||(M=qe(e,St,{duration:150},!0)),M.run(1)}),C=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(d.$$.fragment,D),P(_.$$.fragment,D),P(y.$$.fragment,D),D&&(M||(M=qe(e,St,{duration:150},!1)),M.run(0)),C=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),D&&M&&M.end()}}}function zE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Endpoint"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.endpoint),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&re(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function BE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Bucket"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&re(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function UE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Region"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.region),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.region&&re(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function WE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=z("Access key"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.accessKey),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==( Line truncated
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function ZE(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ie(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function GE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function ch(n){let e,t,i,s;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[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function XE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[HE,jE],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=z(n[7]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[20])),_=!0)},p(T,M){(!h||M&128)&&le(o,T[7]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){h||(A(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function QE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[XE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function xE(n,e,t){let i,s,l;Ye(n,$t,F=>t(7,l=F)),Kt($t,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;m();async function m(){t(2,a=!0);try{const F=await me.settings.getAll()||{};_(F)}catch(F){me.errorResponseHandler(F)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(lo);const F=await me.settings.update(V.filterRedactedProps(r));In({}),await _(F),Ma(),c?Pv("Successfully saved but failed to establish S3 connection."):jt("Successfully saved files storage settings.")}catch(F){me.errorResponseHandler(F)}t(3,u=!1)}}async function _(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function v(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){me.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:lo})}catch(F){t(5,c=F)}t(4,f=!1),clearTimeout(d)}}Zt(()=>()=>{clearTimeout(d)});function y(){r.s3.enabled=this.checked,t(1,r)}function $(){r.s3.endpoint=this.value,t(1,r)}function T(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function D(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>v(),L=()=>h(),N=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,v,i,y,$,T,M,C,D,E,I,L,N]}class eA extends be{constructor(e){super(),ge(this,e,xE,QE,he,{})}}function tA(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function nA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=z("Client ID"),s=O(),l=b("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].clientId),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&p(e,"for",i),c&2097152&&o!==(o=f[21])&&p(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&re(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function iA(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new ou({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=z("Client secret"),s=O(),H(l.$$.fragment),p(e,"for",i=n[21])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&p(e,"for",i);const d={};c&2097152&&(d.id=f[21]),c&1&&(d.required=f[0].enabled),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function dh(n){let e,t,i,s;function l(a){n[16](a)}var o=n[4];function r(a){let u={key:a[1]};return a[0]!==void 0&&(u.config=a[0]),{props:u}}return o&&(t=Ht(o,r(n)),se.push(()=>_e(t,"config",l))),{c(){e=b("div"),t&&H(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&q(t,e,null),s=!0},p(a,u){const f={};if(u&2&&(f.key=a[1]),!i&&u&1&&(i=!0,f.config=a[0],ke(()=>i=!1)),o!==(o=a[4])){if(t){ae();const c=t;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(t=Ht(o,r(a)),se.push(()=>_e(t,"config",l)),H(t.$$.fragment),A(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}functionLine truncated
another PocketBase environment.</p>`,t=O(),i=b("div"),s=b("button"),s.innerHTML='<span class="txt">Copy</span>',l=O(),H(o.$$.fragment),r=O(),a=b("div"),u=b("div"),f=O(),c=b("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(_,v){S(_,e,v),S(_,t,v),S(_,i,v),g(i,s),g(i,l),q(o,i,null),n[8](i),S(_,r,v),S(_,a,v),g(a,u),g(a,f),g(a,c),d=!0,m||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(_,v){const k={};v&4&&(k.content=_[2]),o.$set(k)},i(_){d||(A(o.$$.fragment,_),d=!0)},o(_){P(o.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(t),_&&w(i),j(o),n[8](null),_&&w(r),_&&w(a),m=!1,Pe(h)}}}function TA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function CA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[TA,$A],h=[];function _(v,k){return v[1]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=z(n[3]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k&8)&&le(o,v[3]);let y=f;f=_(v),f===y?h[f].p(v,k):(ae(),P(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),A(c,1),c.m(u,null))},i(v){d||(A(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function MA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[CA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function DA(n,e,t){let i,s;Ye(n,$t,v=>t(3,s=v)),Kt($t,s="Export collections",s);const l="export_"+V.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l}));for(let v of r)delete v.created,delete v.updated}catch(v){me.errorResponseHandler(v)}t(1,a=!1)}function f(){V.downloadJson(r,"pb_schema")}function c(){V.copyToClipboard(i),Dg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(v){se[v?"unshift":"push"](()=>{o=v,t(0,o)})}const h=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,h,_]}class OA extends be{constructor(e){super(),ge(this,e,DA,MA,he,{})}}function Sh(n,e,t){const i=n.slice();return i[14]=e[t],i}function $h(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Th(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Mh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Dh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Oh(n,e,t){const i=n.slice();return i[30]=e[t],i}function EA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Eh(),a=n[0].name!==n[1].name&&Ah(n);return{c(){e=b("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=b("strong"),o=z(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=Eh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Ah(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function AA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=O(),i=b("strong"),l=z(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function IA(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Added",t=O(),i=b("strong"),l=z(s),p(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function Eh(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Ah(n){let e,t=n[0].name+"",i,s,l;return{c(){e=b("strong"),i=z(t),s=O(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Ih(n){var v,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((v=n[0])==null?void 0:v[n[30]])+"",Line truncated
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=O(),o=b("tbody");for(let T=0;T<h.length;T+=1)h[T].c();r=O(),_&&_.c(),a=O();for(let T=0;T<k.length;T+=1)k[T].c();u=O();for(let T=0;T<$.length;T+=1)$[T].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(T,M){S(T,e,M),d.m(e,null),S(T,t,M),S(T,i,M),g(i,s),g(i,l),g(i,o);for(let C=0;C<h.length;C+=1)h[C].m(o,null);g(o,r),_&&_.m(o,null),g(o,a);for(let C=0;C<k.length;C+=1)k[C].m(o,null);g(o,u);for(let C=0;C<$.length;C+=1)$[C].m(o,null)},p(T,M){if(c===(c=f(T))&&d?d.p(T,M):(d.d(1),d=c(T),d&&(d.c(),d.m(e,null))),M[0]&7203){m=T[11];let C;for(C=0;C<m.length;C+=1){const D=Oh(T,m,C);h[C]?h[C].p(D,M):(h[C]=Ih(D),h[C].c(),h[C].m(o,r))}for(;C<h.length;C+=1)h[C].d(1);h.length=m.length}if(T[2]||T[5]?_?_.p(T,M):(_=Ph(T),_.c(),_.m(o,a)):_&&(_.d(1),_=null),M[0]&4248){v=T[7];let C;for(C=0;C<v.length;C+=1){const D=Th(T,v,C);k[C]?k[C].p(D,M):(k[C]=qh(D),k[C].c(),k[C].m(o,u))}for(;C<k.length;C+=1)k[C].d(1);k.length=v.length}if(M[0]&4352){y=T[8];let C;for(C=0;C<y.length;C+=1){const D=Sh(T,y,C);$[C]?$[C].p(D,M):($[C]=Hh(D),$[C].c(),$[C].m(o,null))}for(;C<$.length;C+=1)$[C].d(1);$.length=y.length}},i:X,o:X,d(T){T&&w(e),d.d(),T&&w(t),T&&w(i),ht(h,T),_&&_.d(),ht(k,T),ht($,T)}}}function Dn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function un(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function LA(n,e,t){let i,s,l,{collectionA:o=new pn}=e,{collectionB:r=new pn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const h=Object.keys(new pn().export()).filter(k=>!["schema","created","updated"].includes(k));function _(){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(y=>k.id==y.id))))}function v(k){return typeof k>"u"?"":V.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,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(y=>k.id==y.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(y=>y.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(y=>y.id==k.id))),n.$$.dirty[0]&7&&t(9,l=V.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,h,v]}class NA extends be{constructor(e){super(),ge(this,e,LA,PA,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Vh(n,e,t){const i=n.slice();return i[17]=e[t],i}function zh(n){let e,t;return e=new NA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function FA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=zh(Vh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Ce()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Vh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=zh(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function RA(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function qA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=z("Close"),i=O(),s=b("button"),l=b("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=n[4],Q(s,"btn-loading",n[4])},m(a,u){S(a,e,u),g(e,t),S(a,i,u),S(a,s,u),g(s,l),o||(r=[Y(e,"click",n[0]),Y(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&Q(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Pe(r)}}}function jA(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[qA],header:[RA],default:[FA]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function HA(n,e,t){const i=Ct();let s,l=[Line truncated
- ${T.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),jt("Successfully imported collections configuration."),i("submit")}catch(T){me.errorResponseHandler(T)}t(4,u=!1),c()}}const _=()=>m(),v=()=>!u;function k(T){se[T?"unshift":"push"](()=>{s=T,t(1,s)})}function y(T){Ve.call(this,n,T)}function $(T){Ve.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,_,v,k,y,$]}class VA extends be{constructor(e){super(),ge(this,e,HA,jA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Bh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Wh(n,e,t){const i=n.slice();return i[32]=e[t],i}function zA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[UA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,I=n[6]&&n[1].length&&!n[7]&&Kh(),L=n[6]&&n[1].length&&n[7]&&Jh(n),N=n[13].length&&l_(n),F=!!n[0]&&o_(n);return{c(){e=b("input"),t=O(),i=b("div"),s=b("p"),l=z(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=O(),H(a.$$.fragment),u=O(),f=O(),I&&I.c(),c=O(),L&&L.c(),d=O(),N&&N.c(),m=O(),h=b("div"),F&&F.c(),_=O(),v=b("div"),k=O(),y=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"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(v,"class","flex-fill"),p($,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=T=!n[14],p(h,"class","flex m-t-base")},m(R,K){S(R,e,K),n[19](e),S(R,t,K),S(R,i,K),g(i,s),g(s,l),g(s,o),S(R,r,K),q(a,R,K),S(R,u,K),S(R,f,K),I&&I.m(R,K),S(R,c,K),L&&L.m(R,K),S(R,d,K),N&&N.m(R,K),S(R,m,K),S(R,h,K),F&&F.m(h,null),g(h,_),g(h,v),g(h,k),g(h,y),g(y,$),M=!0,C||(D=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],C=!0)},p(R,K){(!M||K[0]&4096)&&Q(o,"btn-loading",R[12]);const x={};K[0]&64&&(x.class="form-field "+(R[6]?"":"field-error")),K[0]&65|K[1]&1536&&(x.$$scope={dirty:K,ctx:R}),a.$set(x),R[6]&&R[1].length&&!R[7]?I||(I=Kh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?L?L.p(R,K):(L=Jh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?N?N.p(R,K):(N=l_(R),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),R[0]?F?F.p(R,K):(F=o_(R),F.c(),F.m(h,_)):F&&(F.d(1),F=null),(!M||K[0]&16384&&T!==(T=!R[14]))&&(y.disabled=T)},i(R){M||(A(a.$$.fragment,R),A(E),M=!0)},o(R){P(a.$$.fragment,R),P(E),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),I&&I.d(R),R&&w(c),L&&L.d(R),R&&w(d),N&&N.d(R),R&&w(m),R&&w(h),F&&F.d(),C=!1,Pe(D)}}}function BA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Yh(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function UA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Yh();return{c(){e=b("label"),t=z("Collections"),s=O(),l=b("textarea"),r=O(),c&&c.c(),a=Ce(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),u||(f=Y(l,"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(l,"id",o),m[0]&1&&re(l,d[0]),d[0]&&!d[6]?c||(c=Yh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function Kh(n){let e;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Jh(n){let e,t,i,s,l,o=n[9].length&&Zh(n),r=n[4].length&&Qh(n),a=n[8].length&&n_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=O(),i=b("div"),o&&o.c(),s=O(),r&&r.c(),l=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Zh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Qh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=n_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Zh(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Wh(n,s,o),a=l(r);t.set(a,e[o]=Xh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=wt(e,r,l,1,o,s,t,i.parentNode,es,Xh,i,Wh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Gh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=z("("),s=z(i),l=z(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function Xh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Gh(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",s=O(),l=b("strong"),r=z(o),a=O(),f&&f.c(),u=O(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=Gh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Qh(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=Uh(n,s,o),a=l(r);t.set(a,e[o]=t_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=wt(e,r,l,1,o,s,t,i.parentNode,es,t_,i,Uh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function xh(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=b("strong"),i=z(t),s=O(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function e_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=b("small"),t=z("("),s=z(i),l=z(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function t_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&xh(e),m=e[35].new.id&&e_(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",s=O(),l=b("div"),d&&d.c(),o=O(),r=b("strong"),u=z(a),f=O(),m&&m.c(),c=O(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(h,_){S(h,t,_),g(t,i),g(t,s),g(t,l),d&&d.m(l,null),g(l,o),g(l,r),g(r,u),g(l,f),m&&m.m(l,null),g(t,c)},p(h,_){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,_):(d=xh(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),_[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,_):(m=e_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(h){h&&w(t),d&&d.d(),m&&m.d()}}}function n_(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Bh(n,s,o),a=l(r);t.set(a,e[o]=s_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=wt(e,r,l,1,o,s,t,i.parentNode,es,s_,i,Bh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function i_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=z("("),s=z(i),l=z(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function s_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&i_(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Added",s=O(),l=b("strong"),r=z(o),a=O(),f&&f.c(),u=O(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=i_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function l_(n){let e,t,i,s,l,o,r,a;return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=b("div"),s.innerHTML=`<string>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.</string>`,l=O(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:X,d(u){u&&w(e),r=!1,a()}}}function o_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function WA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[BA,zA],h=[];function _(v,k){return v[5]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=z(n[15]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=_(v),f===y?h[f].p(v,k):(ae(),P(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),A(c,1),c.m(u,null))},i(v){d||(A(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function YA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[WA]},$$scope:{ctx:n}}});let r={};return l=new VA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function KA(n,e,t){let i,s,l,o,r,a,u;Ye(n,$t,J=>t(15,u=J)),Kt($t,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],v=!0,k=[],y=!1;$();async function $(){t(5,y=!0);try{t(2,_=await me.collections.getFullList(200));for(let J of _)delete J.created,delete J.updated}catch(J){me.errorResponseHandler(J)}t(5,y=!1)}function T(){if(t(4,k=[]),!!i)for(let J of h){const fe=V.findByKey(_,"id",J.id);!(fe!=null&&fe.id)||!V.hasCollectionChanges(fe,J,v)||k.push({new:J,old:fe})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=V.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=V.filterDuplicatesByKey(J.schema)}function C(){var J,fe;for(let Z of h){const de=V.findByKey(_,"name",Z.name)||V.findByKey(_,"id",Z.id);if(!de)continue;const ve=Z.id,Te=de.id;Z.id=Te;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const ye of Re){const Se=V.findByKey(Ne,"name",ye.name);Se&&Se.id&&(ye.id=Se.id)}for(let ye of h)if(Array.isArray(ye.schema))for(let Se of ye.schema)(J=Se.options)!=null&&J.collectionId&&((fe=Se.options)==null?void 0:fe.collectionId)===ve&&(Se.options.collectionId=Te)}t(0,d=JSON.stringify(h,null,4))}function D(J){t(12,m=!0);const fe=new FileReader;fe.onload=async Z=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(dl("Invalid collections configuration."),E())},fe.onerror=Z=>{console.warn(Z),dl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(J)}function E(){t(0,d=""),t(10,f.value="",f),In({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&D(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>C(),x=()=>E(),U=()=>c==null?void 0:c.show(_,h,v);function G(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(J=>i&&v&&!V.findByKey(h,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(J=>i&&!V.findByKey(_,"id",J.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof v<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!y&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(J=>{let fe=V.findByKey(_,"name",J.name)||V.findByKey(_,"id",J.id);if(!fe)return!1;if(fe.id!=J.id)return!0;const Z=Array.isArray(fe.schema)?fe.schema:[],de=Array.isArray(J.schema)?J.schema:[];for(const ve of de){if(V.findByKey(Z,"id",ve.id))continue;const Ne=V.findByKey(Z,"name",ve.name);if(Ne&&ve.id!=Ne.id)return!0}return!1}))},[d,h,_,v,k,y,i,o,l,s,f,c,m,a,r,u,C,D,E,I,L,N,F,R,K,x,U,G,ne]}class JA extends be{constructor(e){super(),ge(this,e,KA,YA,he,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Di("/"):!0}],ZA={"/login":Dt({component:UO,conditions:Pt.coLine truncated
<span class="txt">Manage admins</span>`,t=O(),i=b("hr"),s=O(),l=b("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:X,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function f6(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=V.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&u_(n);return o=new _1({props:{routes:ZA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new i6({}),f=new a6({}),{c(){t=O(),i=b("div"),d&&d.c(),s=O(),l=b("div"),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,_){S(h,t,_),S(h,i,_),d&&d.m(i,null),g(i,s),g(i,l),q(o,l,null),g(l,r),q(a,l,null),S(h,u,_),q(f,h,_),c=!0},p(h,[_]){var v;(!c||_&12)&&e!==(e=V.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,_),_&3&&A(d,1)):(d=u_(h),d.c(),A(d,1),d.m(i,s)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function c6(n,e,t){let i,s,l,o;Ye(n,Cs,m=>t(8,i=m)),Ye(n,ko,m=>t(2,s=m)),Ye(n,Oa,m=>t(0,l=m)),Ye(n,$t,m=>t(3,o=m));let r,a=!1;function u(m){var h,_,v,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(_=m==null?void 0:m.detail)==null?void 0:_.userData)!=null&&v.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt($t,o="",o),In({}),Ib())}function f(){Di("/")}async function c(){var m,h;if(l!=null&&l.id)try{const _=await me.settings.getAll({$cancelKey:"initialAppSettings"});Kt(ko,s=((m=_==null?void 0:_.meta)==null?void 0:m.appName)||"",s),Kt(Cs,i=!!((h=_==null?void 0:_.meta)!=null&&h.hideControls),i)}catch(_){_!=null&&_.isAbort||console.warn("Failed to load app settings.",_)}}function d(){me.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class d6 extends be{constructor(e){super(),ge(this,e,c6,f6,he,{})}}new d6({target:document.getElementById("app")});export{Pe as A,jt as B,V as C,Di as D,Ce as E,Eg as F,ba as G,_u as H,Ye as I,Ai as J,Ct as K,Zt as L,se as M,Ob as N,wt as O,es as P,ln as Q,pn as R,be as S,Lr as T,P as a,O as b,H as c,j as d,b as e,p as f,S as g,g as h,ge as i,Ie as j,ae as k,xt as l,q as m,ue as n,w as o,me as p,pe as q,Q as r,he as s,A as t,Y as u,ft as v,z as w,le as x,X as y,re as z};
+1 -1
View File
@@ -44,7 +44,7 @@
window.Prism = window.Prism || {}; window.Prism = window.Prism || {};
window.Prism.manual = true; window.Prism.manual = true;
</script> </script>
<script type="module" crossorigin src="./assets/index-04665dfb.js"></script> <script type="module" crossorigin src="./assets/index-e5419a23.js"></script>
<link rel="stylesheet" href="./assets/index-39aca13b.css"> <link rel="stylesheet" href="./assets/index-39aca13b.css">
</head> </head>
<body> <body>
@@ -48,9 +48,9 @@
<i class={icon} /> <i class={icon} />
{/if} {/if}
<span class="txt">{title}</span> <span class="txt">{title}</span>
<code title="Provider key"> <em class="txt-hint">
{key.substring(0, key.length - 4)} ({key.substring(0, key.length - 4)})
</code> </em>
</div> </div>
<div class="flex-fill" /> <div class="flex-fill" />
@@ -96,7 +96,7 @@
name="{key}.clientSecret" name="{key}.clientSecret"
let:uniqueId let:uniqueId
> >
<label for={uniqueId}>Client Secret</label> <label for={uniqueId}>Client secret</label>
<RedactedPasswordInput <RedactedPasswordInput
bind:value={config.clientSecret} bind:value={config.clientSecret}
id={uniqueId} id={uniqueId}
@@ -117,14 +117,15 @@
</form> </form>
<svelte:fragment slot="footer"> <svelte:fragment slot="footer">
<button type="button" class="btn btn-transparent" on:click={hide} disabled={isSubmitting}>Close</button> <button type="button" class="btn btn-transparent" on:click={hide} disabled={isSubmitting}
>Close</button
>
<button <button
type="submit" type="submit"
form={formId} form={formId}
class="btn btn-expanded" class="btn btn-expanded"
class:btn-loading={isSubmitting} class:btn-loading={isSubmitting}
disabled={!canSubmit || isSubmitting} disabled={!canSubmit || isSubmitting}
on:click={() => submit()}
> >
<i class="ri-mail-send-line" /> <i class="ri-mail-send-line" />
<span class="txt">Send</span> <span class="txt">Send</span>
@@ -22,6 +22,8 @@
$: hasChanges = initialHash != JSON.stringify(formSettings); $: hasChanges = initialHash != JSON.stringify(formSettings);
$: totalHidden = Object.values(providersList).filter((provider) => provider.hidden).length;
loadSettings(); loadSettings();
async function loadSettings() { async function loadSettings() {
@@ -115,7 +117,7 @@
on:click={() => (showHidden = true)} on:click={() => (showHidden = true)}
> >
<i class="ri-arrow-down-s-line" /> <i class="ri-arrow-down-s-line" />
<span class="txt">Show all</span> <span class="txt">Show all ({totalHidden})</span>
</button> </button>
{/if} {/if}
@@ -0,0 +1,24 @@
<script>
import AppleSecretPopup from "@/components/settings/providers/AppleSecretPopup.svelte";
export let key = "";
export let config = {};
let generatorPopup;
</script>
<button
type="button"
class="btn btn-sm btn-secondary btn-provider-{key}"
on:click={() => generatorPopup?.show({ clientId: config.clientId })}
>
<i class="ri-key-line" />
<span class="txt">Generate secret</span>
</button>
<AppleSecretPopup
bind:this={generatorPopup}
on:submit={(e) => {
config.clientSecret = e.detail?.secret || "";
}}
/>
@@ -0,0 +1,156 @@
<script>
import { createEventDispatcher } from "svelte";
import ApiClient from "@/utils/ApiClient";
import CommonHelper from "@/utils/CommonHelper";
import { addSuccessToast } from "@/stores/toasts";
import { setErrors } from "@/stores/errors";
import tooltip from "@/actions/tooltip";
import OverlayPanel from "@/components/base/OverlayPanel.svelte";
import Field from "@/components/base/Field.svelte";
const dispatch = createEventDispatcher();
const formId = "apple_secret_" + CommonHelper.randomString(5);
const maxDuration = 15777000; // 6 months
let panel;
let clientId;
let teamId;
let keyId;
let privateKey;
let duration;
let isSubmitting = false;
$: canSubmit = true;
export function show(config = {}) {
clientId = config.clientId || "";
teamId = config.teamId || "";
keyId = config.keyId || "";
privateKey = config.privateKey || "";
duration = config.duration || maxDuration;
setErrors({}); // reset any previous errors
panel?.show();
}
export function hide() {
return panel?.hide();
}
async function submit() {
isSubmitting = true;
try {
// @todo replace with dedicated SDK method
const result = await ApiClient.send("/api/settings/apple/generate-client-secret", {
method: "POST",
body: {
teamId: teamId,
clientId: clientId,
keyId: keyId,
privateKey: privateKey.trim(),
duration: duration,
},
});
isSubmitting = false;
addSuccessToast("Successfully generated client secret.");
dispatch("submit", result);
panel?.hide();
} catch (err) {
ApiClient.errorResponseHandler(err);
}
isSubmitting = false;
}
</script>
<OverlayPanel
bind:this={panel}
overlayClose={!isSubmitting}
escClose={!isSubmitting}
beforeHide={() => !isSubmitting}
popup
on:show
on:hide
>
<svelte:fragment slot="header">
<h4 class="center txt-break">Generate Apple client secret</h4>
</svelte:fragment>
<form id={formId} autocomplete="off" on:submit|preventDefault={() => submit()}>
<div class="grid">
<div class="col-lg-6">
<Field class="form-field required" name="clientId" let:uniqueId>
<label for={uniqueId}>Client ID</label>
<input type="text" id={uniqueId} bind:value={clientId} required />
</Field>
</div>
<div class="col-lg-6">
<Field class="form-field required" name="teamId" let:uniqueId>
<label for={uniqueId}>Team ID</label>
<input type="text" id={uniqueId} bind:value={teamId} required />
</Field>
</div>
<div class="col-lg-6">
<Field class="form-field required" name="keyId" let:uniqueId>
<label for={uniqueId}>Key ID</label>
<input type="text" id={uniqueId} bind:value={keyId} required />
</Field>
</div>
<div class="col-lg-6">
<Field class="form-field required" name="duration" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Duration (in seconds)</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: `Max ${maxDuration} seconds (~${
(maxDuration / (60 * 60 * 24 * 30)) << 0
} months).`,
position: "top",
}}
/>
</label>
<input type="text" id={uniqueId} max={maxDuration} bind:value={duration} required />
</Field>
</div>
<Field class="form-field required" name="privateKey" let:uniqueId>
<label for={uniqueId}>Private key</label>
<textarea
id={uniqueId}
required
rows="8"
placeholder={"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"}
bind:value={privateKey}
/>
<div class="help-block">
The key is not stored on the server and it is used only for generating the signed JWT.
</div>
</Field>
</div>
</form>
<svelte:fragment slot="footer">
<button type="button" class="btn btn-transparent" on:click={hide} disabled={isSubmitting}
>Close</button
>
<button
type="submit"
form={formId}
class="btn btn-expanded"
class:btn-loading={isSubmitting}
disabled={!canSubmit || isSubmitting}
>
<i class="ri-key-line" />
<span class="txt">Generate and set secret</span>
</button>
</svelte:fragment>
</OverlayPanel>
@@ -19,7 +19,7 @@
<div class="col-lg-12"> <div class="col-lg-12">
<Field class="form-field {config.enabled ? 'required' : ''}" name="{key}.tokenUrl" let:uniqueId> <Field class="form-field {config.enabled ? 'required' : ''}" name="{key}.tokenUrl" let:uniqueId>
<label for={uniqueId}>Token URL</label> <label for={uniqueId}>Token URL</label>
<input type="text" id={uniqueId} bind:value={config.tokenUrl} required={config.enabled} /> <input type="url" id={uniqueId} bind:value={config.tokenUrl} required={config.enabled} />
<div class="help-block"> <div class="help-block">
Eg. {`https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token`} Eg. {`https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token`}
</div> </div>
@@ -17,14 +17,14 @@
<div class="col-lg-12"> <div class="col-lg-12">
<Field class="form-field {config.enabled ? 'required' : ''}" name="{key}.tokenUrl" let:uniqueId> <Field class="form-field {config.enabled ? 'required' : ''}" name="{key}.tokenUrl" let:uniqueId>
<label for={uniqueId}>Token URL</label> <label for={uniqueId}>Token URL</label>
<input type="text" id={uniqueId} bind:value={config.tokenUrl} required={config.enabled} /> <input type="url" id={uniqueId} bind:value={config.tokenUrl} required={config.enabled} />
<div class="help-block">Eg. https://example.com/token/</div> <div class="help-block">Eg. https://example.com/token/</div>
</Field> </Field>
</div> </div>
<div class="col-lg-12"> <div class="col-lg-12">
<Field class="form-field {config.enabled ? 'required' : ''}" name="{key}.userApiUrl" let:uniqueId> <Field class="form-field {config.enabled ? 'required' : ''}" name="{key}.userApiUrl" let:uniqueId>
<label for={uniqueId}>User API URL</label> <label for={uniqueId}>User API URL</label>
<input type="text" id={uniqueId} bind:value={config.userApiUrl} required={config.enabled} /> <input type="url" id={uniqueId} bind:value={config.userApiUrl} required={config.enabled} />
<div class="help-block">Eg. https://example.com/userinfo/</div> <div class="help-block">Eg. https://example.com/userinfo/</div>
</Field> </Field>
</div> </div>
@@ -16,13 +16,13 @@
<div class="col-lg-4"> <div class="col-lg-4">
<Field class="form-field" name="{key}.tokenUrl" let:uniqueId> <Field class="form-field" name="{key}.tokenUrl" let:uniqueId>
<label for={uniqueId}>Token URL</label> <label for={uniqueId}>Token URL</label>
<input type="text" id={uniqueId} bind:value={config.tokenUrl} /> <input type="url" id={uniqueId} bind:value={config.tokenUrl} />
</Field> </Field>
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<Field class="form-field" name="{key}.userApiUrl" let:uniqueId> <Field class="form-field" name="{key}.userApiUrl" let:uniqueId>
<label for={uniqueId}>User API URL</label> <label for={uniqueId}>User API URL</label>
<input type="text" id={uniqueId} bind:value={config.userApiUrl} /> <input type="url" id={uniqueId} bind:value={config.userApiUrl} />
</Field> </Field>
</div> </div>
</div> </div>
+35 -29
View File
@@ -1,6 +1,7 @@
import SelfHostedOptions from "@/components/settings/providers/SelfHostedOptions.svelte"; import SelfHostedOptions from "@/components/settings/providers/SelfHostedOptions.svelte";
import MicrosoftOptions from "@/components/settings/providers/MicrosoftOptions.svelte"; import MicrosoftOptions from "@/components/settings/providers/MicrosoftOptions.svelte";
import OIDCOptions from "@/components/settings/providers/OIDCOptions.svelte"; import OIDCOptions from "@/components/settings/providers/OIDCOptions.svelte";
import AppleOptions from "@/components/settings/providers/AppleOptions.svelte";
// Object list with all supported OAuth2 providers in the format: // Object list with all supported OAuth2 providers in the format:
// ``` // ```
@@ -11,10 +12,20 @@ import OIDCOptions from "@/components/settings/providers/OIDCOptions.svelte";
// - `key` - the provider settings key (eg. "gitlabAuth") // - `key` - the provider settings key (eg. "gitlabAuth")
// - `config` - the provider settings config that is currently being updated // - `config` - the provider settings config that is currently being updated
export default { export default {
appleAuth: {
title: "Apple",
icon: "ri-apple-fill",
optionsComponent: AppleOptions,
},
googleAuth: { googleAuth: {
title: "Google", title: "Google",
icon: "ri-google-fill", icon: "ri-google-fill",
}, },
microsoftAuth: {
title: "Microsoft",
icon: "ri-microsoft-fill",
optionsComponent: MicrosoftOptions,
},
facebookAuth: { facebookAuth: {
title: "Facebook", title: "Facebook",
icon: "ri-facebook-fill", icon: "ri-facebook-fill",
@@ -32,31 +43,6 @@ export default {
icon: "ri-gitlab-fill", icon: "ri-gitlab-fill",
optionsComponent: SelfHostedOptions, optionsComponent: SelfHostedOptions,
}, },
discordAuth: {
title: "Discord",
icon: "ri-discord-fill",
},
microsoftAuth: {
title: "Microsoft",
icon: "ri-microsoft-fill",
optionsComponent: MicrosoftOptions,
},
spotifyAuth: {
title: "Spotify",
icon: "ri-spotify-fill",
},
kakaoAuth: {
title: "Kakao",
icon: "ri-kakao-talk-fill",
},
twitchAuth: {
title: "Twitch",
icon: "ri-twitch-fill",
},
stravaAuth: {
title: "Strava",
icon: "ri-riding-fill",
},
giteeAuth: { giteeAuth: {
title: "Gitee", title: "Gitee",
icon: "ri-git-repository-fill", icon: "ri-git-repository-fill",
@@ -66,23 +52,43 @@ export default {
icon: "ri-cup-fill", icon: "ri-cup-fill",
optionsComponent: SelfHostedOptions, optionsComponent: SelfHostedOptions,
}, },
discordAuth: {
title: "Discord",
icon: "ri-discord-fill",
},
kakaoAuth: {
title: "Kakao",
icon: "ri-kakao-talk-fill",
},
spotifyAuth: {
title: "Spotify",
icon: "ri-spotify-fill",
},
twitchAuth: {
title: "Twitch",
icon: "ri-twitch-fill",
},
stravaAuth: {
title: "Strava",
icon: "ri-riding-fill",
},
livechatAuth: { livechatAuth: {
title: "LiveChat", title: "LiveChat",
icon: "ri-chat-1-fill", icon: "ri-chat-1-fill",
}, },
oidcAuth: { oidcAuth: {
title: "OpenID Connect (Authentik, Keycloak, Okta, ...)", title: "OpenID Connect - Authentik, Keycloak, Okta, etc.",
icon: "ri-lock-fill", icon: "ri-lock-fill",
optionsComponent: OIDCOptions, optionsComponent: OIDCOptions,
}, },
oidc2Auth: { oidc2Auth: {
title: "(2) OpenID Connect (Authentik, Keycloak, Okta, ...)", title: "(2) OpenID Connect - Authentik, Keycloak, Okta, etc.",
icon: "ri-lock-fill", icon: "ri-lock-fill",
hidden: true, hidden: true,
optionsComponent: OIDCOptions, optionsComponent: OIDCOptions,
}, },
oidc3Auth: { oidc3Auth: {
title: "(3) OpenID Connect (Authentik, Keycloak, Okta, ...)", title: "(3) OpenID Connect - Authentik, Keycloak, Okta, etc.",
icon: "ri-lock-fill", icon: "ri-lock-fill",
hidden: true, hidden: true,
optionsComponent: OIDCOptions, optionsComponent: OIDCOptions,