mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-09-30 03:22:04 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
099230a552 | ||
|
|
5e0718176d | ||
|
|
9cbb2e750e | ||
|
|
6385c5e646 | ||
|
|
32393990bb | ||
|
|
838ed661ce | ||
|
|
d84e57174b | ||
|
|
a6cafd1ed7 | ||
|
|
b0db2399b8 | ||
|
|
81d0af6e80 | ||
|
|
5f5f0ed793 | ||
|
|
353248c34a | ||
|
|
93d48a85ac | ||
|
|
b84930f21a | ||
|
|
3cbab96f51 | ||
|
|
6c005c4a9a | ||
|
|
ccc3707fb6 | ||
|
|
3d36ff7e96 | ||
|
|
0b2eb24c6f | ||
|
|
954067860c | ||
|
|
9a8c9dd115 | ||
|
|
a1ad5004f8 | ||
|
|
7006e1f5d7 | ||
|
|
8be8f3f3cb | ||
|
|
00fd007d50 | ||
|
|
96bfc69c8e | ||
|
|
e542b0d8c5 | ||
|
|
9814dda8e4 | ||
|
|
978fdd3ce7 | ||
|
|
9cf89870e7 | ||
|
|
b8c54568e3 | ||
|
|
843bbf99cc | ||
|
|
daffb0f86e | ||
|
|
1f5c3328e5 | ||
|
|
ed5f3b86f5 | ||
|
|
1ba2d14231 | ||
|
|
6cda610ede | ||
|
|
2fa5233fa6 | ||
|
|
030dfc2690 | ||
|
|
8c11e2ef01 | ||
|
|
4b64e0910b | ||
|
|
4a6bc453de |
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
open_collective: pocketbase
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '>=1.19.0'
|
||||
go-version: '>=1.19.3'
|
||||
|
||||
# This step usually is not needed because the /ui/dist is pregenerated locally
|
||||
# but its here to ensure that each release embeds the latest admin ui artifacts.
|
||||
|
||||
@@ -121,7 +121,11 @@ PocketBase is free and open source project licensed under the [MIT License](LICE
|
||||
You could help continuing its development by:
|
||||
|
||||
- [Contribute to the source code](CONTRIBUTING.md)
|
||||
|
||||
> **NB! PR for new features will not be merged until we manage to complete the users refactoring in [#376](https://github.com/pocketbase/pocketbase/issues/376)!**
|
||||
|
||||
- [Suggest new features and report issues](https://github.com/pocketbase/pocketbase/issues)
|
||||
|
||||
- [Donate a small amount](https://pocketbase.io/support-us)
|
||||
|
||||
> Please note that PocketBase was initially created to serve as a new backend for my other open source project - [Presentator](https://presentator.io) (see [#183](https://github.com/presentator/presentator/issues/183)),
|
||||
|
||||
+8
-5
@@ -48,6 +48,9 @@ func (api *realtimeApi) connect(c echo.Context) error {
|
||||
c.Response().Header().Set("Content-Type", "text/event-stream; charset=UTF-8")
|
||||
c.Response().Header().Set("Cache-Control", "no-store")
|
||||
c.Response().Header().Set("Connection", "keep-alive")
|
||||
// https://github.com/pocketbase/pocketbase/discussions/480#discussioncomment-3657640
|
||||
// https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering
|
||||
c.Response().Header().Set("X-Accel-Buffering", "no")
|
||||
|
||||
event := &core.RealtimeConnectEvent{
|
||||
HttpContext: c,
|
||||
@@ -59,7 +62,7 @@ func (api *realtimeApi) connect(c echo.Context) error {
|
||||
}
|
||||
|
||||
if api.app.IsDebug() {
|
||||
log.Printf("Realtime connection establisehd: %s\n", client.Id())
|
||||
log.Printf("Realtime connection established: %s\n", client.Id())
|
||||
}
|
||||
|
||||
// signalize established connection (aka. fire "connect" message)
|
||||
@@ -163,7 +166,7 @@ func (api *realtimeApi) bindEvents() {
|
||||
adminTable := (&models.Admin{}).TableName()
|
||||
|
||||
// update user/admin auth state
|
||||
api.app.OnModelAfterUpdate().Add(func(e *core.ModelEvent) error {
|
||||
api.app.OnModelAfterUpdate().PreAdd(func(e *core.ModelEvent) error {
|
||||
modelTable := e.Model.TableName()
|
||||
|
||||
var contextKey string
|
||||
@@ -187,7 +190,7 @@ func (api *realtimeApi) bindEvents() {
|
||||
})
|
||||
|
||||
// remove user/admin client(s)
|
||||
api.app.OnModelAfterDelete().Add(func(e *core.ModelEvent) error {
|
||||
api.app.OnModelAfterDelete().PreAdd(func(e *core.ModelEvent) error {
|
||||
modelTable := e.Model.TableName()
|
||||
|
||||
var contextKey string
|
||||
@@ -210,14 +213,14 @@ func (api *realtimeApi) bindEvents() {
|
||||
return nil
|
||||
})
|
||||
|
||||
api.app.OnModelAfterCreate().Add(func(e *core.ModelEvent) error {
|
||||
api.app.OnModelAfterCreate().PreAdd(func(e *core.ModelEvent) error {
|
||||
if record, ok := e.Model.(*models.Record); ok {
|
||||
api.broadcastRecord("create", record)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
api.app.OnModelAfterUpdate().Add(func(e *core.ModelEvent) error {
|
||||
api.app.OnModelAfterUpdate().PreAdd(func(e *core.ModelEvent) error {
|
||||
if record, ok := e.Model.(*models.Record); ok {
|
||||
api.broadcastRecord("update", record)
|
||||
}
|
||||
|
||||
+4
-4
@@ -125,7 +125,7 @@ type BaseApp struct {
|
||||
// NewBaseApp creates and returns a new BaseApp instance
|
||||
// configured with the provided arguments.
|
||||
//
|
||||
// To initialize the app, you need to call `app.Bootsrap()`.
|
||||
// To initialize the app, you need to call `app.Bootstrap()`.
|
||||
func NewBaseApp(dataDir string, encryptionEnv string, isDebug bool) *BaseApp {
|
||||
app := &BaseApp{
|
||||
dataDir: dataDir,
|
||||
@@ -716,7 +716,7 @@ func (app *BaseApp) initLogsDB() error {
|
||||
return connectErr
|
||||
}
|
||||
|
||||
app.logsDao = app.createDao(app.logsDB)
|
||||
app.logsDao = daos.New(app.logsDB)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -740,12 +740,12 @@ func (app *BaseApp) initDataDB() error {
|
||||
}
|
||||
}
|
||||
|
||||
app.dao = app.createDao(app.db)
|
||||
app.dao = app.createDaoWithHooks(app.db)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (app *BaseApp) createDao(db dbx.Builder) *daos.Dao {
|
||||
func (app *BaseApp) createDaoWithHooks(db dbx.Builder) *daos.Dao {
|
||||
dao := daos.New(db)
|
||||
|
||||
dao.BeforeCreateFunc = func(eventDao *daos.Dao, m models.Model) error {
|
||||
|
||||
+13
-2
@@ -4,19 +4,30 @@ package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/pocketbase/dbx"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
func connectDB(dbPath string) (*dbx.DB, error) {
|
||||
pragmas := "_foreign_keys=1&_journal_mode=WAL&_synchronous=NORMAL&_busy_timeout=8000"
|
||||
// note: the busy_timeout pragma must be first because
|
||||
// the connection needs to be set to block on busy before WAL mode
|
||||
// is set in case it hasn't been already set by another connection
|
||||
pragmas := "_busy_timeout=10000&_journal_mode=WAL&_foreign_keys=1&_synchronous=NORMAL"
|
||||
|
||||
db, openErr := dbx.MustOpen("sqlite3", fmt.Sprintf("%s?%s", dbPath, pragmas))
|
||||
if openErr != nil {
|
||||
return nil, openErr
|
||||
}
|
||||
|
||||
// use a fixed connection pool to limit the SQLITE_BUSY errors
|
||||
// and reduce the open file descriptors
|
||||
// (the limits are arbitrary and may change in the future)
|
||||
db.DB().SetMaxOpenConns(500)
|
||||
db.DB().SetMaxIdleConns(30)
|
||||
db.DB().SetConnMaxIdleTime(5 * time.Minute)
|
||||
|
||||
// additional pragmas not supported through the dsn string
|
||||
_, err := db.NewQuery(`
|
||||
pragma journal_size_limit = 100000000;
|
||||
|
||||
+20
-2
@@ -4,13 +4,31 @@ package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
_ "modernc.org/sqlite"
|
||||
)
|
||||
|
||||
func connectDB(dbPath string) (*dbx.DB, error) {
|
||||
pragmas := "_pragma=foreign_keys(1)&_pragma=journal_mode(WAL)&_pragma=synchronous(NORMAL)&_pragma=busy_timeout(8000)&_pragma=journal_size_limit(100000000)"
|
||||
// note: the busy_timeout pragma must be first because
|
||||
// the connection needs to be set to block on busy before WAL mode
|
||||
// is set in case it hasn't been already set by another connection
|
||||
pragmas := "_pragma=busy_timeout(10000)&_pragma=journal_mode(WAL)&_pragma=foreign_keys(1)&_pragma=synchronous(NORMAL)&_pragma=journal_size_limit(100000000)"
|
||||
|
||||
return dbx.MustOpen("sqlite", fmt.Sprintf("%s?%s", dbPath, pragmas))
|
||||
db, err := dbx.MustOpen("sqlite", fmt.Sprintf("%s?%s", dbPath, pragmas))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// use a fixed connection pool to limit the SQLITE_BUSY errors and
|
||||
// reduce the open file descriptors
|
||||
// (the limits are arbitrary and may change in the future)
|
||||
//
|
||||
// @see https://gitlab.com/cznic/sqlite/-/issues/115
|
||||
db.DB().SetMaxOpenConns(500)
|
||||
db.DB().SetMaxIdleConns(30)
|
||||
db.DB().SetConnMaxIdleTime(5 * time.Minute)
|
||||
|
||||
return db, nil
|
||||
}
|
||||
+1
-1
@@ -76,7 +76,7 @@ func (dao *Dao) FindCollectionsWithUserFields() ([]*models.Collection, error) {
|
||||
// relation schema fields referencing the provided collection.
|
||||
//
|
||||
// If the provided collection has reference to itself then it will be
|
||||
// also included in the result. To exlude it, pass the collection id
|
||||
// also included in the result. To exclude it, pass the collection id
|
||||
// as the excludeId argument.
|
||||
func (dao *Dao) FindCollectionReferences(collection *models.Collection, excludeId string) (map[*models.Collection][]*schema.SchemaField, error) {
|
||||
collections := []*models.Collection{}
|
||||
|
||||
+30
-1
@@ -114,12 +114,41 @@ func (dao *Dao) expandRecords(records []*models.Record, expandPath string, fetch
|
||||
|
||||
expandData := model.GetExpand()
|
||||
|
||||
// normalize and set the expanded relations
|
||||
// normalize access to the previously expanded rel records (if any)
|
||||
var oldExpandedRels []*models.Record
|
||||
switch v := expandData[relField.Name].(type) {
|
||||
case nil:
|
||||
// no old expands
|
||||
case *models.Record:
|
||||
oldExpandedRels = []*models.Record{v}
|
||||
case []*models.Record:
|
||||
oldExpandedRels = v
|
||||
}
|
||||
|
||||
// merge expands
|
||||
for _, oldExpandedRel := range oldExpandedRels {
|
||||
// find a matching rel record
|
||||
for _, rel := range validRels {
|
||||
if rel.Id != oldExpandedRel.Id {
|
||||
continue
|
||||
}
|
||||
|
||||
oldRelExpand := oldExpandedRel.GetExpand()
|
||||
newRelExpand := rel.GetExpand()
|
||||
for k, v := range oldRelExpand {
|
||||
newRelExpand[k] = v
|
||||
}
|
||||
rel.SetExpand(newRelExpand)
|
||||
}
|
||||
}
|
||||
|
||||
// update the expanded data
|
||||
if relFieldOptions.MaxSelect == 1 {
|
||||
expandData[relField.Name] = validRels[0]
|
||||
} else {
|
||||
expandData[relField.Name] = validRels
|
||||
}
|
||||
|
||||
model.SetExpand(expandData)
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,18 @@ func TestExpandRecords(t *testing.T) {
|
||||
9,
|
||||
0,
|
||||
},
|
||||
// expand multiple relations sharing a common root path
|
||||
{
|
||||
[]string{
|
||||
"i15r5aa28ad06c8",
|
||||
},
|
||||
[]string{"manyrels.onerel.manyrels.onerel", "manyrels.onerel.onerel"},
|
||||
func(c *models.Collection, ids []string) ([]*models.Record, error) {
|
||||
return app.Dao().FindRecordsByIds(c, ids, nil)
|
||||
},
|
||||
4,
|
||||
0,
|
||||
},
|
||||
// single expand
|
||||
{
|
||||
[]string{
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ func (dao *Dao) LoadProfile(user *models.User) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// LoadProfiles loads the profile records associated to the provied users list.
|
||||
// LoadProfiles loads the profile records associated to the provided users list.
|
||||
func (dao *Dao) LoadProfiles(users []*models.User) error {
|
||||
collection, err := dao.FindCollectionByNameOrId(models.ProfileCollectionName)
|
||||
if err != nil {
|
||||
|
||||
+23
-3
@@ -2,20 +2,40 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/pocketbase"
|
||||
"github.com/pocketbase/pocketbase/apis"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
func defaultPublicDir() string {
|
||||
if strings.HasPrefix(os.Args[0], os.TempDir()) {
|
||||
// most likely ran with go run
|
||||
return "./pb_public"
|
||||
}
|
||||
|
||||
return filepath.Join(os.Args[0], "../pb_public")
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := pocketbase.New()
|
||||
|
||||
var publicDirFlag string
|
||||
|
||||
// add "--publicDir" option flag
|
||||
app.RootCmd.PersistentFlags().StringVar(
|
||||
&publicDirFlag,
|
||||
"publicDir",
|
||||
defaultPublicDir(),
|
||||
"the directory to serve static files",
|
||||
)
|
||||
|
||||
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
||||
// serves static files from the provided public dir (if exists)
|
||||
subFs := echo.MustSubFS(e.Router.Filesystem, "pb_public")
|
||||
e.Router.GET("/*", apis.StaticDirectoryHandler(subFs, false))
|
||||
e.Router.GET("/*", apis.StaticDirectoryHandler(os.DirFS(publicDirFlag), false))
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -241,7 +241,7 @@ func TestAdminUpsertSubmit(t *testing.T) {
|
||||
true,
|
||||
},
|
||||
{
|
||||
// update succcess - new email
|
||||
// update success - new email
|
||||
"2b4a97cc-3f83-4d01-a26b-3d77bc842d3c",
|
||||
`{
|
||||
"email": "test_update@example.com"
|
||||
@@ -249,7 +249,7 @@ func TestAdminUpsertSubmit(t *testing.T) {
|
||||
false,
|
||||
},
|
||||
{
|
||||
// update succcess - new password
|
||||
// update success - new password
|
||||
"2b4a97cc-3f83-4d01-a26b-3d77bc842d3c",
|
||||
`{
|
||||
"password": "1234567890",
|
||||
|
||||
@@ -3,8 +3,8 @@ module github.com/pocketbase/pocketbase
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/AlecAivazis/survey/v2 v2.3.5
|
||||
github.com/aws/aws-sdk-go v1.44.85
|
||||
github.com/AlecAivazis/survey/v2 v2.3.6
|
||||
github.com/aws/aws-sdk-go v1.44.102
|
||||
github.com/disintegration/imaging v1.6.2
|
||||
github.com/domodwyer/mailyak/v3 v3.3.4
|
||||
github.com/fatih/color v1.13.0
|
||||
@@ -18,32 +18,33 @@ require (
|
||||
github.com/spf13/cast v1.5.0
|
||||
github.com/spf13/cobra v1.5.0
|
||||
gocloud.dev v0.26.0
|
||||
golang.org/x/crypto v0.0.0-20220824171710-5757bc0c5503
|
||||
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c
|
||||
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094
|
||||
modernc.org/sqlite v1.18.1
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0
|
||||
golang.org/x/net v0.0.0-20220921155015-db77216a4ee9
|
||||
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1
|
||||
modernc.org/sqlite v1.19.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.16.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.17.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.14 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.27 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 // indirect
|
||||
github.com/aws/smithy-go v1.12.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.16.16 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.17.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.20 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.14 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.18 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.23 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.19 // indirect
|
||||
github.com/aws/smithy-go v1.13.3 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
@@ -60,26 +61,26 @@ require (
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.1 // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
golang.org/x/image v0.0.0-20220722155232-062f8c9fd539 // indirect
|
||||
golang.org/x/image v0.0.0-20220902085622-e7cb96979f69 // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
||||
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect
|
||||
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
|
||||
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
|
||||
golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 // indirect
|
||||
golang.org/x/tools v0.1.12 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
|
||||
google.golang.org/api v0.94.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||
google.golang.org/api v0.96.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect
|
||||
google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006 // indirect
|
||||
google.golang.org/grpc v1.49.0 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
lukechampine.com/uint128 v1.2.0 // indirect
|
||||
modernc.org/cc/v3 v3.36.3 // indirect
|
||||
modernc.org/cc/v3 v3.39.0 // indirect
|
||||
modernc.org/ccgo/v3 v3.16.9 // indirect
|
||||
modernc.org/libc v1.17.0 // indirect
|
||||
modernc.org/libc v1.19.0 // indirect
|
||||
modernc.org/mathutil v1.5.0 // indirect
|
||||
modernc.org/memory v1.2.0 // indirect
|
||||
modernc.org/memory v1.4.0 // indirect
|
||||
modernc.org/opt v0.1.3 // indirect
|
||||
modernc.org/strutil v1.1.2 // indirect
|
||||
modernc.org/token v1.0.0 // indirect
|
||||
modernc.org/strutil v1.1.3 // indirect
|
||||
modernc.org/token v1.0.1 // indirect
|
||||
)
|
||||
@@ -78,6 +78,8 @@ contrib.go.opencensus.io/integrations/ocsql v0.1.7/go.mod h1:8DsSdjz3F+APR+0z0Wk
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.5 h1:A8cYupsAZkjaUmhtTYv3sSqc7LO5mp1XDfqe5E/9wRQ=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.5/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.6 h1:NvTuVHISgTHEHeBFqt6BHOe4Ny/NwGZr7w+F8S9ziyw=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.6/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3cWNXgWXOhllqvI=
|
||||
github.com/Azure/azure-amqp-common-go/v3 v3.2.1/go.mod h1:O6X1iYHP7s2x7NjUKsXVhkwWrQhxrd+d8/3rRadj4CI=
|
||||
github.com/Azure/azure-amqp-common-go/v3 v3.2.2/go.mod h1:O6X1iYHP7s2x7NjUKsXVhkwWrQhxrd+d8/3rRadj4CI=
|
||||
github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U=
|
||||
@@ -124,51 +126,83 @@ github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zK
|
||||
github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/aws/aws-sdk-go v1.44.85 h1:JM2rkKY/GtTDCQXW0StkImbLn6n4Q/Dm2bj+u1rm7Kw=
|
||||
github.com/aws/aws-sdk-go v1.44.85/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/aws/aws-sdk-go v1.44.102 h1:6tUCTGL2UDbFZae1TLGk8vTgeXuzkb8KbAe2FiAeKHc=
|
||||
github.com/aws/aws-sdk-go v1.44.102/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/aws/aws-sdk-go-v2 v1.16.2/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU=
|
||||
github.com/aws/aws-sdk-go-v2 v1.16.11 h1:xM1ZPSvty3xVmdxiGr7ay/wlqv+MWhH0rMlyLdbC0YQ=
|
||||
github.com/aws/aws-sdk-go-v2 v1.16.11/go.mod h1:WTACcleLz6VZTp7fak4EO5b9Q4foxbn+8PIz3PmyKlo=
|
||||
github.com/aws/aws-sdk-go-v2 v1.16.16 h1:M1fj4FE2lB4NzRb9Y0xdWsn2P0+2UHVxwKyOa4YJNjk=
|
||||
github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1/go.mod h1:n8Bs1ElDD2wJ9kCRTczA83gYbBmjSwZp3umc6zF4EeM=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4 h1:zfT11pa7ifu/VlLDpmc5OY2W4nYmnKkFDGeMVnmqAI0=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4/go.mod h1:ES0I1GBs+YYgcDS1ek47Erbn4TOL811JKqBXtgzqyZ8=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8 h1:tcFliCWne+zOuUfKNRn8JdFBuWPDuISDH08wD2ULkhk=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8/go.mod h1:JTnlBSot91steJeti4ryyu/tLd4Sk84O5W22L7O2EQU=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.15.3/go.mod h1:9YL3v07Xc/ohTsxFXzan9ZpFpdTOFl4X65BAKYaz8jg=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.17.1 h1:BWxTjokU/69BZ4DnLrZco6OvBDii6ToEdfBL/y5I1nA=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.17.1/go.mod h1:uOxDHjBemNTF2Zos+fgG0NNfE86wn1OAHDTGxjMEYi0=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.17.7 h1:odVM52tFHhpqZBKNjVW5h+Zt1tKHbhdTQRb+0WHrNtw=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.17.7/go.mod h1:dN2gja/QXxFF15hQreyrqYhLBaQo1d9ZKe/v/uplQoI=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.11.2/go.mod h1:j8YsY9TXTm31k4eFhspiQicfXPLZ0gYXA50i4gxPE8g=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.14 h1:AtVG/amkjbDBfnPr/tuW2IG18HGNznP6L12Dx0rLz+Q=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.14/go.mod h1:opAndTyq+YN7IpVG57z2CeNuXSQMqTYxGGlYH0m0RMY=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.20 h1:9+ZhlDY7N9dPnUmf7CDfW9In4sW5Ff3bh7oy4DzS1IE=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.20/go.mod h1:UKY5HyIux08bbNA7Blv4PcXQ8cTkGh7ghHMFklaviR4=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.3/go.mod h1:uk1vhHHERfSVCUnqSqz8O48LBYDSC+k6brng09jcMOk=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 h1:wgJBHO58Pc1V1QAnzdVM3JK3WbE/6eUF0JxCZ+/izz0=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12/go.mod h1:aZ4vZnyUuxedC7eD4JyEHpGnCz+O2sHQEx3VvAwklSE=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17 h1:r08j4sbZu/RVi+BNxkBJwPMUYY3P8mgSDuKkZ/ZN1lE=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17/go.mod h1:yIkQcCDYNsZfXpd5UX2Cy+sWA1jPgIhGTw9cOBzfVnQ=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.3/go.mod h1:0dHuD2HZZSiwfJSy1FO5bX1hQ1TxVV1QXXjpn3XUE44=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.27 h1:xFXIMBci0UXStoOHq/8w0XIZPB2hgb9CD7uATJhqt10=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.27/go.mod h1:+tj2cHQkChanggNZn1J2fJ1Cv6RO1TV0AA3472do31I=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.33 h1:fAoVmNGhir6BR+RU0/EI+6+D7abM+MCwWf8v4ip5jNI=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.33/go.mod h1:84XgODVR8uRhmOnUkKGUZKqIMxmjmLOR8Uyp7G/TPwc=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.9/go.mod h1:AnVH5pvai0pAF4lXRq0bmhbes1u9R8wTE+g+183bZNM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 h1:OmiwoVyLKEqqD5GvB683dbSqxiOfvx4U2lDZhG2Esc4=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18/go.mod h1:348MLhzV1GSlZSMusdwQpXKbhD7X2gbI/TxwAPKkYZQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23 h1:s4g/wnzMf+qepSNgTvaQQHNxyMLKSawNhKCPNy++2xY=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfIRy0imBCJv+vZ2X6RKxves6fbnEuSry6b4=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.3/go.mod h1:ssOhaLpRlh88H3UmEcsBoVKq309quMvm3Ds8e9d4eJM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 h1:5mvQDtNWtI6H56+E4LUnLWEmATMB7oEh+Z9RurtIuC0=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12/go.mod h1:ckaCVTEdGAxO6KwTGzgskxR1xM+iJW4lxMyDFVda2Fc=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17 h1:/K482T5A3623WJgWT8w1yRAFK4RzGzEl7y39yhtn9eA=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.10/go.mod h1:8DcYQcz0+ZJaSxANlHIsbbi6S+zMwjwdDqwW3r9AzaE=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 h1:g5qq9sgtEzt2szMaDqQO6fqKe026T6dHTFJp5NsPzkQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19/go.mod h1:cVHo8KTuHjShb9V8/VjH3S/8+xPu16qx8fdGwmotJhE=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24 h1:wj5Rwc05hvUSvKuOF29IYb9QrCLjU+rHAy/x/o0DK2c=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24/go.mod h1:jULHjqqjDlbyTa7pfM7WICATnOv+iOhjletM3N0Xbu8=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.9 h1:agLpf3vtYX1rtKTrOGpevdP3iC2W0hKDmzmhhxJzL+A=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.9/go.mod h1:cv+n1mdyh+0B8tAtlEBzTYFA2Uv15SISEn6kabYhIgE=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.14 h1:ZSIPAkAsCCjYrhqfw2+lNzWDzxzHXEckFkTePL5RSWQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.14/go.mod h1:AyGgqiKv9ECM6IZeNQtdT8NnMvUb3/2wokeq2Fgryto=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.1/go.mod h1:GeUru+8VzrTXV/83XyMJ80KpH8xO89VPoUileyNQ+tc=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.5 h1:g1ITJ9i9ixa+/WVggLNK20KyliAA8ltnuxfZEDfo2hM=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.5/go.mod h1:oehQLbMQkppKLXvpx/1Eo0X47Fe+0971DXC9UjGnKcI=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9 h1:Lh1AShsuIJTwMkoxVCAYPJgNG5H+eN6SmoUn8nOZ5wE=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9/go.mod h1:a9j48l6yL5XINLHLcOKInjdvknN+vWqPBxqeIDw7ktw=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.3/go.mod h1:Seb8KNmD6kVTjwRjVEgOT5hPin6sq+v4C2ycJQDwuH8=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.13 h1:3GamN8jcdz/a3nvL/ZVtoH/6xxeshfsiXj5O+6GW4Rg=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.13/go.mod h1:89CSPn69UECDLVn0H6FwKNgbtirksl8C8i3aBeeeihw=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.18 h1:BBYoNQt2kUZUUK4bIPsKrCcjVPUMNsgQpNAwhznK/zo=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.18/go.mod h1:NS55eQ4YixUJPTC+INxi2/jCqe1y2Uw3rnh9wEOVJxY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.3/go.mod h1:wlY6SVjuwvh3TVRpTqdy4I1JpBFLX4UGeKZdWntaocw=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 h1:7iPTTX4SAI2U2VOogD7/gmHlsgnYSgoNHt7MSQXtG2M=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12/go.mod h1:1TODGhheLWjpQWSuhYuAUWYTCKwEjx2iblIFKDHjeTc=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17 h1:Jrd/oMh0PKQc6+BowB+pLEwLIgaQF29eYbe7E1Av9Ug=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17/go.mod h1:4nYOrY41Lrbk2170/BGkcJKBhws9Pfn8MG3aGqjjeFI=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.3/go.mod h1:Bm/v2IaN6rZ+Op7zX+bOUMdL4fsrYZiD0dsjLhNKwZc=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12 h1:QFjSOmHSb77qRTv7KI9UFon9X5wLWY5/M+6la3dTcZc=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.12/go.mod h1:MADjAN0GHFDuc5lRa5Y5ki+oIO/w7X4qczHy+OUx0IA=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.17 h1:HfVVR1vItaG6le+Bpw6P4midjBDMKnjMyZnw9MXYUcE=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.17/go.mod h1:YqMdV+gEKCQ59NrB7rzrJdALeBIsYiVi8Inj3+KcqHI=
|
||||
github.com/aws/aws-sdk-go-v2/service/kms v1.16.3/go.mod h1:QuiHPBqlOFCi4LqdSskYYAWpQlx3PKmohy+rE2F+o5g=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.26.3/go.mod h1:g1qvDuRsJY+XghsV6zg00Z4KJ7DtFFCx8fJD2a491Ak=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5 h1:h9qqTedYnA9JcWjKyLV6UYIMSdp91ExLCUbjbpDLH7A=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.5/go.mod h1:J8SS5Tp/zeLxaubB0xGfKnVrvssNBNLwTipreTKLhjQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11 h1:3/gm/JTX9bX8CpzTgIlrtYpB3EVBDxyg/GY/QdcIEZw=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11/go.mod h1:fmgDANqTUCxciViKl9hb/zD5LFbvPINFRgWhDbR+vZo=
|
||||
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.15.4/go.mod h1:PJc8s+lxyU8rrre0/4a0pn2wgwiDvOEzoOjcJUBr67o=
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.17.4/go.mod h1:kElt+uCcXxcqFyc+bQqZPFD9DME/eC6oHBXvFzQ9Bcw=
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.18.3/go.mod h1:skmQo0UPvsjsuYYSYMVmrPc1HWCbHUJyrCEp+ZaLzqM=
|
||||
@@ -176,12 +210,20 @@ github.com/aws/aws-sdk-go-v2/service/ssm v1.24.1/go.mod h1:NR/xoKjdbRJ+qx0pMR4mI
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.3/go.mod h1:7UQ/e69kU7LDPtY40OyoHYgRmgfGM4mgsLYtcObdveU=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.17 h1:pXxu9u2z1UqSbjO9YA8kmFJBhFc1EVTDaf7A+S+Ivq8=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.17/go.mod h1:mS5xqLZc/6kc06IpXn5vRxdLaED+jEuaSRv5BxtnsiY=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.23 h1:pwvCchFUEnlceKIgPUouBJwK81aCkQ8UDMORfeFtW10=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.23/go.mod h1:/w0eg9IhFGjGyyncHIQrXtU8wvNsTJOP0R6PPj0wf80=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.5 h1:GUnZ62TevLqIoDyHeiWj2P7EqaosgakBKVvWriIdLQY=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.5/go.mod h1:csZuQY65DAdFBt1oIjO5hhBR49kQqop4+lcuCjf2arA=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.3/go.mod h1:bfBj0iVmsUyUg4weDB4NxktD9rDGeKSVWnjTnwbx9b8=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 h1:dl8T0PJlN92rvEGOEUiD0+YPYdPEaCZK0TqHukvSfII=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.13/go.mod h1:Ru3QVMLygVs/07UQ3YDur1AQZZp2tUNje8wfloFttC0=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.19 h1:9pPi0PsFNAGILFfPCk8Y0iyEBGc6lu6OQ97U7hmdesg=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.19/go.mod h1:h4J3oPZQbxLhzGnk+j9dfYHi5qIOVJ5kczZd658/ydM=
|
||||
github.com/aws/smithy-go v1.11.2/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM=
|
||||
github.com/aws/smithy-go v1.12.1 h1:yQRC55aXN/y1W10HgwHle01DRuV9Dpf31iGkotjt3Ag=
|
||||
github.com/aws/smithy-go v1.12.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
|
||||
github.com/aws/smithy-go v1.13.3 h1:l7LYxGuzK6/K+NzJ2mC+VvLUbae0sL3bXU//04MkmnA=
|
||||
github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
@@ -581,6 +623,8 @@ golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8/go.mod h1:GvvjBRRGRdwPK5y
|
||||
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220824171710-5757bc0c5503 h1:vJ2V3lFLg+bBhgroYuRfyN583UzVveQmIXjc8T/y3to=
|
||||
golang.org/x/crypto v0.0.0-20220824171710-5757bc0c5503/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 h1:a5Yg6ylndHHYJqIPrdq0AhvR6KTvDTAvgBtaidhEevY=
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -596,6 +640,8 @@ golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+o
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20220722155232-062f8c9fd539 h1:/eM0PCrQI2xd471rI+snWuu251/+/jpBpZqir2mPdnU=
|
||||
golang.org/x/image v0.0.0-20220722155232-062f8c9fd539/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY=
|
||||
golang.org/x/image v0.0.0-20220902085622-e7cb96979f69 h1:Lj6HJGCSn5AjxRAH2+r35Mir4icalbqku+CLUtjnvXY=
|
||||
golang.org/x/image v0.0.0-20220902085622-e7cb96979f69/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -672,6 +718,9 @@ golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug
|
||||
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c h1:JVAXQ10yGGVbSyoer5VILysz6YKjdNT2bsvlayjqhes=
|
||||
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.0.0-20220921155015-db77216a4ee9 h1:SdDGdqRuKrF2R4XGcnPzcvZ63c/55GvhoHUus0o+BNI=
|
||||
golang.org/x/net v0.0.0-20220921155015-db77216a4ee9/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -696,6 +745,8 @@ golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j
|
||||
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
|
||||
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8=
|
||||
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
|
||||
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA=
|
||||
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -784,15 +835,20 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 h1:UiNENfZ8gDvpiWw7IpOMQ27spWmThO1RwwdQVbJahJM=
|
||||
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc=
|
||||
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 h1:tPwmk4vmvVCMdr98VgL4JH+qZxPL8fqlUOHnyOM8N3w=
|
||||
golang.org/x/term v0.0.0-20220919170432-7a66f970e087/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -810,6 +866,8 @@ golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxb
|
||||
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ=
|
||||
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 h1:yuLAip3bfURHClMG9VBdzPrQvCWjWiWUTBGV+/fCbUs=
|
||||
golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
@@ -880,6 +938,8 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
|
||||
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0=
|
||||
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
@@ -928,6 +988,8 @@ google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3
|
||||
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
|
||||
google.golang.org/api v0.94.0 h1:KtKM9ru3nzQioV1HLlUf1cR7vMYJIpgls5VhAYQXIwA=
|
||||
google.golang.org/api v0.94.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI=
|
||||
google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM=
|
||||
google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
@@ -1032,6 +1094,8 @@ google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljW
|
||||
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
|
||||
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc h1:Nf+EdcTLHR8qDNN/KfkQL0u0ssxt9OhbaWCl5C0ucEI=
|
||||
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
|
||||
google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006 h1:mmbq5q8M1t7dhkLw320YK4PsOXm6jdnUAkErImaIqOg=
|
||||
google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
@@ -1108,6 +1172,8 @@ lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl
|
||||
modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI=
|
||||
modernc.org/cc/v3 v3.36.3 h1:uISP3F66UlixxWEcKuIWERa4TwrZENHSL8tWxZz8bHg=
|
||||
modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI=
|
||||
modernc.org/cc/v3 v3.39.0 h1:sd+UyMj63acEV1jaFqxFGPQfllSncJgL+roJjFlo6lI=
|
||||
modernc.org/cc/v3 v3.39.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20=
|
||||
modernc.org/ccgo/v3 v3.16.9 h1:AXquSwg7GuMk11pIdw7fmO1Y/ybgazVkMhsZWCV0mHM=
|
||||
modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo=
|
||||
modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk=
|
||||
@@ -1116,23 +1182,33 @@ modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=
|
||||
modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM=
|
||||
modernc.org/libc v1.17.0 h1:nbL2Lv0I323wLc1GmTh/AqVtI9JeBVc7Nhapdg9EONs=
|
||||
modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0=
|
||||
modernc.org/libc v1.19.0 h1:bXyVhGQg6KIClTr8FMVIDPl7jtbcs7aS5WP7vLDaxPs=
|
||||
modernc.org/libc v1.19.0/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0=
|
||||
modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
|
||||
modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
modernc.org/memory v1.2.0 h1:zXehBrt9n+Pjn+4RoRCZ0KqRA/0ePFqcecxZ/hXCIVw=
|
||||
modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw=
|
||||
modernc.org/memory v1.4.0 h1:crykUfNSnMAXaOJnnxcSzbUGMqkLWjklJKkBK2nwZwk=
|
||||
modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
|
||||
modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
|
||||
modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
|
||||
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
|
||||
modernc.org/sqlite v1.18.1 h1:ko32eKt3jf7eqIkCgPAeHMBXw3riNSLhl2f3loEF7o8=
|
||||
modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4=
|
||||
modernc.org/sqlite v1.19.1 h1:8xmS5oLnZtAK//vnd4aTVj8VOeTAccEFOtUnIzfSw+4=
|
||||
modernc.org/sqlite v1.19.1/go.mod h1:UfQ83woKMaPW/ZBruK0T7YaFCrI+IE0LeWVY6pmnVms=
|
||||
modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw=
|
||||
modernc.org/strutil v1.1.2 h1:iFBDH6j1Z0bN/Q9udJnnFoFpENA4252qe/7/5woE5MI=
|
||||
modernc.org/strutil v1.1.2/go.mod h1:OYajnUAcI/MX+XD/Wx7v1bbdvcQSvxgtb0gC+u3d3eg=
|
||||
modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY=
|
||||
modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw=
|
||||
modernc.org/tcl v1.13.1 h1:npxzTwFTZYM8ghWicVIX1cRWzj7Nd8i6AqqX2p+IYao=
|
||||
modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk=
|
||||
modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||
modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg=
|
||||
modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||
modernc.org/z v1.5.1 h1:RTNHdsrOpeoSeOF4FbzTo8gBYByaJ5xT7NgZ9ZqRiJM=
|
||||
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
|
||||
@@ -133,7 +133,7 @@ func (f SchemaField) Validate() error {
|
||||
// init field options (if not already)
|
||||
f.InitOptions()
|
||||
|
||||
// add commonly used filter literals to the exlude names list
|
||||
// add commonly used filter literals to the exclude names list
|
||||
excludeNames := ReservedFieldNames()
|
||||
excludeNames = append(excludeNames, "null", "true", "false")
|
||||
|
||||
|
||||
+76
-71
@@ -26,50 +26,60 @@ type appWrapper struct {
|
||||
|
||||
// PocketBase defines a PocketBase app launcher.
|
||||
//
|
||||
// It implements [core.App] via embedding and all of interface methods
|
||||
// It implements [core.App] via embedding and all of the app interface methods
|
||||
// could be accessed directly through the instance (eg. PocketBase.DataDir()).
|
||||
type PocketBase struct {
|
||||
*appWrapper
|
||||
|
||||
// RootCmd is the main cli command
|
||||
debugFlag bool
|
||||
dataDirFlag string
|
||||
encryptionEnvFlag string
|
||||
hideStartBanner bool
|
||||
|
||||
// RootCmd is the main console command
|
||||
RootCmd *cobra.Command
|
||||
|
||||
// console flags
|
||||
debugFlag bool
|
||||
dataDirFlag string
|
||||
encryptionEnv string
|
||||
|
||||
// console flag fallback values
|
||||
defaultDebug bool
|
||||
defaultDataDir string
|
||||
defaultEncryptionEnv string
|
||||
|
||||
// serve start banner
|
||||
showStartBanner bool
|
||||
}
|
||||
|
||||
// New creates a new PocketBase instance.
|
||||
// Config is the PocketBase initialization config struct.
|
||||
type Config struct {
|
||||
// optional default values for the console flags
|
||||
DefaultDebug bool
|
||||
DefaultDataDir string // if not set, it will fallback to "./pb_data"
|
||||
DefaultEncryptionEnv string
|
||||
|
||||
// hide the default console server info on app startup
|
||||
HideStartBanner bool
|
||||
}
|
||||
|
||||
// New creates a new PocketBase instance with the default configuration.
|
||||
// Use [NewWithConfig()] if you want to provide a custom configuration.
|
||||
//
|
||||
// Note that the application will not be initialized/bootstrapped yet,
|
||||
// aka. DB connections, migrations, app settings, etc. will not be accessible.
|
||||
// Everything will be initialized when Start() is executed.
|
||||
// If you want to initialize the application before calling Start(),
|
||||
// then you'll have to manually call Bootstrap().
|
||||
// Everything will be initialized when [Start()] is executed.
|
||||
// If you want to initialize the application before calling [Start()],
|
||||
// then you'll have to manually call [Bootstrap()].
|
||||
func New() *PocketBase {
|
||||
// try to find the base executable directory and how it was run
|
||||
var withGoRun bool
|
||||
var baseDir string
|
||||
if strings.HasPrefix(os.Args[0], os.TempDir()) {
|
||||
// probably ran with go run...
|
||||
withGoRun = true
|
||||
baseDir, _ = os.Getwd()
|
||||
} else {
|
||||
// probably ran with go build...
|
||||
withGoRun = false
|
||||
baseDir = filepath.Dir(os.Args[0])
|
||||
}
|
||||
_, isUsingGoRun := inspectRuntime()
|
||||
|
||||
defaultDir := filepath.Join(baseDir, "pb_data")
|
||||
return NewWithConfig(Config{
|
||||
DefaultDebug: isUsingGoRun,
|
||||
})
|
||||
}
|
||||
|
||||
// NewWithConfig creates a new PocketBase instance with the provided config.
|
||||
//
|
||||
// Note that the application will not be initialized/bootstrapped yet,
|
||||
// aka. DB connections, migrations, app settings, etc. will not be accessible.
|
||||
// Everything will be initialized when [Start()] is executed.
|
||||
// If you want to initialize the application before calling [Start()],
|
||||
// then you'll have to manually call [Bootstrap()].
|
||||
func NewWithConfig(config Config) *PocketBase {
|
||||
// initialize a default data directory based on the executable baseDir
|
||||
if config.DefaultDataDir == "" {
|
||||
baseDir, _ := inspectRuntime()
|
||||
config.DefaultDataDir = filepath.Join(baseDir, "pb_data")
|
||||
}
|
||||
|
||||
pb := &PocketBase{
|
||||
RootCmd: &cobra.Command{
|
||||
@@ -84,46 +94,31 @@ func New() *PocketBase {
|
||||
DisableDefaultCmd: true,
|
||||
},
|
||||
},
|
||||
defaultDebug: withGoRun,
|
||||
defaultDataDir: defaultDir,
|
||||
defaultEncryptionEnv: "",
|
||||
showStartBanner: true,
|
||||
debugFlag: config.DefaultDebug,
|
||||
dataDirFlag: config.DefaultDataDir,
|
||||
encryptionEnvFlag: config.DefaultEncryptionEnv,
|
||||
hideStartBanner: config.HideStartBanner,
|
||||
}
|
||||
|
||||
// parse base flags
|
||||
// (errors are ignored, since the full flags parsing happens on Execute())
|
||||
pb.eagerParseFlags()
|
||||
pb.eagerParseFlags(config)
|
||||
|
||||
// initialize the app instance
|
||||
pb.appWrapper = &appWrapper{core.NewBaseApp(
|
||||
pb.dataDirFlag,
|
||||
pb.encryptionEnv,
|
||||
pb.encryptionEnvFlag,
|
||||
pb.debugFlag,
|
||||
)}
|
||||
|
||||
return pb
|
||||
}
|
||||
// hide the default help command (allow only `--help` flag)
|
||||
pb.RootCmd.SetHelpCommand(&cobra.Command{Hidden: true})
|
||||
|
||||
// DefaultDebug sets the default --debug flag value.
|
||||
func (pb *PocketBase) DefaultDebug(val bool) *PocketBase {
|
||||
pb.defaultDebug = val
|
||||
return pb
|
||||
}
|
||||
// hook the bootstrap process
|
||||
pb.RootCmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
|
||||
return pb.Bootstrap()
|
||||
}
|
||||
|
||||
// DefaultDataDir sets the default --dir flag value.
|
||||
func (pb *PocketBase) DefaultDataDir(val string) *PocketBase {
|
||||
pb.defaultDataDir = val
|
||||
return pb
|
||||
}
|
||||
|
||||
// DefaultEncryptionEnv sets the default --encryptionEnv flag value.
|
||||
func (pb *PocketBase) DefaultEncryptionEnv(val string) *PocketBase {
|
||||
pb.defaultEncryptionEnv = val
|
||||
return pb
|
||||
}
|
||||
|
||||
// ShowStartBanner shows/hides the web server start banner.
|
||||
func (pb *PocketBase) ShowStartBanner(val bool) *PocketBase {
|
||||
pb.showStartBanner = val
|
||||
return pb
|
||||
}
|
||||
|
||||
@@ -131,7 +126,7 @@ func (pb *PocketBase) ShowStartBanner(val bool) *PocketBase {
|
||||
// commands (serve, migrate, version) and executes pb.RootCmd.
|
||||
func (pb *PocketBase) Start() error {
|
||||
// register system commands
|
||||
pb.RootCmd.AddCommand(cmd.NewServeCommand(pb, pb.showStartBanner))
|
||||
pb.RootCmd.AddCommand(cmd.NewServeCommand(pb, !pb.hideStartBanner))
|
||||
pb.RootCmd.AddCommand(cmd.NewMigrateCommand(pb))
|
||||
|
||||
return pb.Execute()
|
||||
@@ -143,10 +138,6 @@ func (pb *PocketBase) Start() error {
|
||||
// This method differs from pb.Start() by not registering the default
|
||||
// system commands!
|
||||
func (pb *PocketBase) Execute() error {
|
||||
if err := pb.Bootstrap(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
wg.Add(1)
|
||||
@@ -180,27 +171,41 @@ func (pb *PocketBase) onTerminate() error {
|
||||
|
||||
// eagerParseFlags parses the global app flags before calling pb.RootCmd.Execute().
|
||||
// so we can have all PocketBase flags ready for use on initialization.
|
||||
func (pb *PocketBase) eagerParseFlags() error {
|
||||
func (pb *PocketBase) eagerParseFlags(config Config) error {
|
||||
pb.RootCmd.PersistentFlags().StringVar(
|
||||
&pb.dataDirFlag,
|
||||
"dir",
|
||||
pb.defaultDataDir,
|
||||
config.DefaultDataDir,
|
||||
"the PocketBase data directory",
|
||||
)
|
||||
|
||||
pb.RootCmd.PersistentFlags().StringVar(
|
||||
&pb.encryptionEnv,
|
||||
&pb.encryptionEnvFlag,
|
||||
"encryptionEnv",
|
||||
pb.defaultEncryptionEnv,
|
||||
"the env variable whose value of 32 chars will be used \nas encryption key for the app settings (default none)",
|
||||
config.DefaultEncryptionEnv,
|
||||
"the env variable whose value of 32 characters will be used \nas encryption key for the app settings (default none)",
|
||||
)
|
||||
|
||||
pb.RootCmd.PersistentFlags().BoolVar(
|
||||
&pb.debugFlag,
|
||||
"debug",
|
||||
pb.defaultDebug,
|
||||
config.DefaultDebug,
|
||||
"enable debug mode, aka. showing more detailed logs",
|
||||
)
|
||||
|
||||
return pb.RootCmd.ParseFlags(os.Args[1:])
|
||||
}
|
||||
|
||||
// tries to find the base executable directory and how it was run
|
||||
func inspectRuntime() (baseDir string, withGoRun bool) {
|
||||
if strings.HasPrefix(os.Args[0], os.TempDir()) {
|
||||
// probably ran with go run
|
||||
withGoRun = true
|
||||
baseDir, _ = os.Getwd()
|
||||
} else {
|
||||
// probably ran with go build
|
||||
withGoRun = false
|
||||
baseDir = filepath.Dir(os.Args[0])
|
||||
}
|
||||
return
|
||||
}
|
||||
+82
-36
@@ -6,14 +6,19 @@ import (
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
testDir := "./pb_test_data_dir"
|
||||
defer os.RemoveAll(testDir)
|
||||
// copy os.Args
|
||||
originalArgs := []string{}
|
||||
copy(originalArgs, os.Args)
|
||||
defer func() {
|
||||
// restore os.Args
|
||||
copy(os.Args, originalArgs)
|
||||
}()
|
||||
|
||||
// reset os.Args
|
||||
// change os.Args
|
||||
os.Args = os.Args[0:1]
|
||||
os.Args = append(
|
||||
os.Args,
|
||||
"--dir="+testDir,
|
||||
"--dir=test_dir",
|
||||
"--encryptionEnv=test_encryption_env",
|
||||
"--debug=true",
|
||||
)
|
||||
@@ -32,8 +37,8 @@ func TestNew(t *testing.T) {
|
||||
t.Fatal("Expected appWrapper to be initialized, got nil")
|
||||
}
|
||||
|
||||
if app.DataDir() != testDir {
|
||||
t.Fatalf("Expected app.DataDir() %q, got %q", testDir, app.DataDir())
|
||||
if app.DataDir() != "test_dir" {
|
||||
t.Fatalf("Expected app.DataDir() %q, got %q", "test_dir", app.DataDir())
|
||||
}
|
||||
|
||||
if app.EncryptionEnv() != "test_encryption_env" {
|
||||
@@ -45,52 +50,93 @@ func TestNew(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultDebug(t *testing.T) {
|
||||
app := New()
|
||||
func TestNewWithConfig(t *testing.T) {
|
||||
app := NewWithConfig(Config{
|
||||
DefaultDebug: true,
|
||||
DefaultDataDir: "test_dir",
|
||||
DefaultEncryptionEnv: "test_encryption_env",
|
||||
HideStartBanner: true,
|
||||
})
|
||||
|
||||
app.DefaultDebug(true)
|
||||
if app.defaultDebug != true {
|
||||
t.Fatalf("Expected defaultDebug %v, got %v", true, app.defaultDebug)
|
||||
if app == nil {
|
||||
t.Fatal("Expected initialized PocketBase instance, got nil")
|
||||
}
|
||||
|
||||
app.DefaultDebug(false)
|
||||
if app.defaultDebug != false {
|
||||
t.Fatalf("Expected defaultDebug %v, got %v", false, app.defaultDebug)
|
||||
if app.RootCmd == nil {
|
||||
t.Fatal("Expected RootCmd to be initialized, got nil")
|
||||
}
|
||||
|
||||
if app.appWrapper == nil {
|
||||
t.Fatal("Expected appWrapper to be initialized, got nil")
|
||||
}
|
||||
|
||||
if app.hideStartBanner != true {
|
||||
t.Fatal("Expected app.hideStartBanner to be true, got false")
|
||||
}
|
||||
|
||||
if app.DataDir() != "test_dir" {
|
||||
t.Fatalf("Expected app.DataDir() %q, got %q", "test_dir", app.DataDir())
|
||||
}
|
||||
|
||||
if app.EncryptionEnv() != "test_encryption_env" {
|
||||
t.Fatalf("Expected app.DataDir() %q, got %q", "test_encryption_env", app.EncryptionEnv())
|
||||
}
|
||||
|
||||
if app.IsDebug() != true {
|
||||
t.Fatal("Expected app.IsDebug() true, got false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultDataDir(t *testing.T) {
|
||||
app := New()
|
||||
func TestNewWithConfigAndFlags(t *testing.T) {
|
||||
// copy os.Args
|
||||
originalArgs := []string{}
|
||||
copy(originalArgs, os.Args)
|
||||
defer func() {
|
||||
// restore os.Args
|
||||
copy(os.Args, originalArgs)
|
||||
}()
|
||||
|
||||
expected := "test_default"
|
||||
// change os.Args
|
||||
os.Args = os.Args[0:1]
|
||||
os.Args = append(
|
||||
os.Args,
|
||||
"--dir=test_dir_flag",
|
||||
"--encryptionEnv=test_encryption_env_flag",
|
||||
"--debug=false",
|
||||
)
|
||||
|
||||
app.DefaultDataDir(expected)
|
||||
if app.defaultDataDir != expected {
|
||||
t.Fatalf("Expected defaultDataDir %v, got %v", expected, app.defaultDataDir)
|
||||
app := NewWithConfig(Config{
|
||||
DefaultDebug: true,
|
||||
DefaultDataDir: "test_dir",
|
||||
DefaultEncryptionEnv: "test_encryption_env",
|
||||
HideStartBanner: true,
|
||||
})
|
||||
|
||||
if app == nil {
|
||||
t.Fatal("Expected initialized PocketBase instance, got nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultEncryptionEnv(t *testing.T) {
|
||||
app := New()
|
||||
if app.RootCmd == nil {
|
||||
t.Fatal("Expected RootCmd to be initialized, got nil")
|
||||
}
|
||||
|
||||
expected := "test_env"
|
||||
if app.appWrapper == nil {
|
||||
t.Fatal("Expected appWrapper to be initialized, got nil")
|
||||
}
|
||||
|
||||
app.DefaultEncryptionEnv(expected)
|
||||
if app.defaultEncryptionEnv != expected {
|
||||
t.Fatalf("Expected defaultEncryptionEnv %v, got %v", expected, app.defaultEncryptionEnv)
|
||||
if app.hideStartBanner != true {
|
||||
t.Fatal("Expected app.hideStartBanner to be true, got false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestShowStartBanner(t *testing.T) {
|
||||
app := New()
|
||||
if app.DataDir() != "test_dir_flag" {
|
||||
t.Fatalf("Expected app.DataDir() %q, got %q", "test_dir_flag", app.DataDir())
|
||||
}
|
||||
|
||||
app.ShowStartBanner(true)
|
||||
if app.showStartBanner != true {
|
||||
t.Fatalf("Expected showStartBanner %v, got %v", true, app.showStartBanner)
|
||||
if app.EncryptionEnv() != "test_encryption_env_flag" {
|
||||
t.Fatalf("Expected app.DataDir() %q, got %q", "test_encryption_env_flag", app.EncryptionEnv())
|
||||
}
|
||||
|
||||
app.ShowStartBanner(false)
|
||||
if app.showStartBanner != false {
|
||||
t.Fatalf("Expected showStartBanner %v, got %v", false, app.showStartBanner)
|
||||
if app.IsDebug() != false {
|
||||
t.Fatal("Expected app.IsDebug() false, got true")
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ func (r *RecordFieldResolver) Resolve(fieldName string) (resultName string, plac
|
||||
props := strings.Split(fieldName, ".")
|
||||
|
||||
currentCollectionName := r.baseCollection.Name
|
||||
currentTableAlias := currentCollectionName
|
||||
currentTableAlias := inflector.Columnify(currentCollectionName)
|
||||
|
||||
// check for @collection field (aka. non-relational join)
|
||||
// must be in the format "@collection.COLLECTION_NAME.FIELD[.FIELD2....]"
|
||||
@@ -106,14 +106,14 @@ func (r *RecordFieldResolver) Resolve(fieldName string) (resultName string, plac
|
||||
}
|
||||
|
||||
currentCollectionName = props[1]
|
||||
currentTableAlias = "__collection_" + currentCollectionName
|
||||
currentTableAlias = inflector.Columnify("__collection_" + currentCollectionName)
|
||||
|
||||
collection, err := r.loadCollection(currentCollectionName)
|
||||
if err != nil {
|
||||
return "", nil, fmt.Errorf("Failed to load collection %q from field path %q.", currentCollectionName, fieldName)
|
||||
}
|
||||
|
||||
r.addJoin(collection.Name, currentTableAlias, nil)
|
||||
r.addJoin(inflector.Columnify(collection.Name), currentTableAlias, nil)
|
||||
|
||||
props = props[2:] // leave only the collection fields
|
||||
} else if props[0] == "@request" {
|
||||
@@ -123,13 +123,13 @@ func (r *RecordFieldResolver) Resolve(fieldName string) (resultName string, plac
|
||||
}
|
||||
|
||||
// not a profile relational field
|
||||
if len(props) <= 4 || !strings.HasPrefix(fieldName, "@request.user.profile.") {
|
||||
if !strings.HasPrefix(fieldName, "@request.user.profile.") {
|
||||
return r.resolveStaticRequestField(props[1:]...)
|
||||
}
|
||||
|
||||
// resolve the profile collection fields
|
||||
currentCollectionName = models.ProfileCollectionName
|
||||
currentTableAlias = "__user_" + currentCollectionName
|
||||
currentTableAlias = inflector.Columnify("__user_" + currentCollectionName)
|
||||
|
||||
collection, err := r.loadCollection(currentCollectionName)
|
||||
if err != nil {
|
||||
@@ -146,12 +146,16 @@ func (r *RecordFieldResolver) Resolve(fieldName string) (resultName string, plac
|
||||
}
|
||||
|
||||
// join the profile collection
|
||||
r.addJoin(collection.Name, currentTableAlias, dbx.NewExp(fmt.Sprintf(
|
||||
// aka. profiles.id = profileId
|
||||
"[[%s.id]] = %s",
|
||||
inflector.Columnify(currentTableAlias),
|
||||
profileIdPlaceholder,
|
||||
), profileIdPlaceholderParam))
|
||||
r.addJoin(
|
||||
inflector.Columnify(collection.Name),
|
||||
currentTableAlias,
|
||||
dbx.NewExp(fmt.Sprintf(
|
||||
// aka. profiles.id = profileId
|
||||
"[[%s.id]] = %s",
|
||||
currentTableAlias,
|
||||
profileIdPlaceholder,
|
||||
), profileIdPlaceholderParam),
|
||||
)
|
||||
|
||||
props = props[3:] // leave only the profile fields
|
||||
}
|
||||
@@ -168,7 +172,7 @@ func (r *RecordFieldResolver) Resolve(fieldName string) (resultName string, plac
|
||||
|
||||
// base model prop (always available but not part of the collection schema)
|
||||
if list.ExistInSlice(prop, baseModelFields) {
|
||||
return fmt.Sprintf("[[%s.%s]]", inflector.Columnify(currentTableAlias), inflector.Columnify(prop)), nil, nil
|
||||
return fmt.Sprintf("[[%s.%s]]", currentTableAlias, inflector.Columnify(prop)), nil, nil
|
||||
}
|
||||
|
||||
field := collection.Schema.GetFieldByName(prop)
|
||||
@@ -178,7 +182,7 @@ func (r *RecordFieldResolver) Resolve(fieldName string) (resultName string, plac
|
||||
|
||||
// last prop
|
||||
if i == totalProps-1 {
|
||||
return fmt.Sprintf("[[%s.%s]]", inflector.Columnify(currentTableAlias), inflector.Columnify(prop)), nil, nil
|
||||
return fmt.Sprintf("[[%s.%s]]", currentTableAlias, inflector.Columnify(prop)), nil, nil
|
||||
}
|
||||
|
||||
// check if it is a relation field
|
||||
@@ -198,20 +202,27 @@ func (r *RecordFieldResolver) Resolve(fieldName string) (resultName string, plac
|
||||
if relErr != nil {
|
||||
return "", nil, fmt.Errorf("Failed to find field %q collection.", prop)
|
||||
}
|
||||
|
||||
cleanFieldName := inflector.Columnify(field.Name)
|
||||
newCollectionName := relCollection.Name
|
||||
newTableAlias := currentTableAlias + "_" + field.Name
|
||||
newTableAlias := currentTableAlias + "_" + cleanFieldName
|
||||
|
||||
jeTable := currentTableAlias + "_" + cleanFieldName + "_je"
|
||||
jePair := currentTableAlias + "." + cleanFieldName
|
||||
|
||||
r.addJoin(
|
||||
newCollectionName,
|
||||
fmt.Sprintf(
|
||||
// note: the case is used to normalize value access for single and multiple relations.
|
||||
`json_each(CASE WHEN json_valid([[%s]]) THEN [[%s]] ELSE json_array([[%s]]) END)`,
|
||||
jePair, jePair, jePair,
|
||||
),
|
||||
jeTable,
|
||||
nil,
|
||||
)
|
||||
r.addJoin(
|
||||
inflector.Columnify(newCollectionName),
|
||||
newTableAlias,
|
||||
dbx.NewExp(fmt.Sprintf(
|
||||
// 'LIKE' expr is used to handle the case when the reference field supports multiple values (aka. is json array)
|
||||
"[[%s.%s]] LIKE ('%%' || [[%s.%s]] || '%%')",
|
||||
inflector.Columnify(currentTableAlias),
|
||||
inflector.Columnify(field.Name),
|
||||
inflector.Columnify(newTableAlias),
|
||||
inflector.Columnify("id"),
|
||||
)),
|
||||
dbx.NewExp(fmt.Sprintf("[[%s.id]] = [[%s.value]]", newTableAlias, jeTable)),
|
||||
)
|
||||
|
||||
currentCollectionName = newCollectionName
|
||||
@@ -296,11 +307,7 @@ func (r *RecordFieldResolver) loadCollection(collectionNameOrId string) (*models
|
||||
}
|
||||
|
||||
func (r *RecordFieldResolver) addJoin(tableName string, tableAlias string, on dbx.Expression) {
|
||||
tableExpr := fmt.Sprintf(
|
||||
"%s %s",
|
||||
inflector.Columnify(tableName),
|
||||
inflector.Columnify(tableAlias),
|
||||
)
|
||||
tableExpr := fmt.Sprintf("%s %s", tableName, tableAlias)
|
||||
|
||||
join := join{
|
||||
id: tableAlias,
|
||||
|
||||
@@ -52,32 +52,32 @@ func TestRecordFieldResolverUpdateQuery(t *testing.T) {
|
||||
{
|
||||
"single rel",
|
||||
[]string{"onerel.title"},
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN `demo4` `demo4_onerel` ON [[demo4.onerel]] LIKE ('%' || [[demo4_onerel.id]] || '%')",
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN json_each(CASE WHEN json_valid([[demo4.onerel]]) THEN [[demo4.onerel]] ELSE json_array([[demo4.onerel]]) END) `demo4_onerel_je` LEFT JOIN `demo4` `demo4_onerel` ON [[demo4_onerel.id]] = [[demo4_onerel_je.value]]",
|
||||
},
|
||||
{
|
||||
"non-relation field + single rel",
|
||||
[]string{"title", "onerel.title"},
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN `demo4` `demo4_onerel` ON [[demo4.onerel]] LIKE ('%' || [[demo4_onerel.id]] || '%')",
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN json_each(CASE WHEN json_valid([[demo4.onerel]]) THEN [[demo4.onerel]] ELSE json_array([[demo4.onerel]]) END) `demo4_onerel_je` LEFT JOIN `demo4` `demo4_onerel` ON [[demo4_onerel.id]] = [[demo4_onerel_je.value]]",
|
||||
},
|
||||
{
|
||||
"nested incomplete rels",
|
||||
[]string{"manyrels.onerel"},
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN `demo4` `demo4_manyrels` ON [[demo4.manyrels]] LIKE ('%' || [[demo4_manyrels.id]] || '%')",
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN json_each(CASE WHEN json_valid([[demo4.manyrels]]) THEN [[demo4.manyrels]] ELSE json_array([[demo4.manyrels]]) END) `demo4_manyrels_je` LEFT JOIN `demo4` `demo4_manyrels` ON [[demo4_manyrels.id]] = [[demo4_manyrels_je.value]]",
|
||||
},
|
||||
{
|
||||
"nested complete rels",
|
||||
[]string{"manyrels.onerel.title"},
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN `demo4` `demo4_manyrels` ON [[demo4.manyrels]] LIKE ('%' || [[demo4_manyrels.id]] || '%') LEFT JOIN `demo4` `demo4_manyrels_onerel` ON [[demo4_manyrels.onerel]] LIKE ('%' || [[demo4_manyrels_onerel.id]] || '%')",
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN json_each(CASE WHEN json_valid([[demo4.manyrels]]) THEN [[demo4.manyrels]] ELSE json_array([[demo4.manyrels]]) END) `demo4_manyrels_je` LEFT JOIN `demo4` `demo4_manyrels` ON [[demo4_manyrels.id]] = [[demo4_manyrels_je.value]] LEFT JOIN json_each(CASE WHEN json_valid([[demo4_manyrels.onerel]]) THEN [[demo4_manyrels.onerel]] ELSE json_array([[demo4_manyrels.onerel]]) END) `demo4_manyrels_onerel_je` LEFT JOIN `demo4` `demo4_manyrels_onerel` ON [[demo4_manyrels_onerel.id]] = [[demo4_manyrels_onerel_je.value]]",
|
||||
},
|
||||
{
|
||||
"repeated nested rels",
|
||||
[]string{"manyrels.onerel.manyrels.onerel.title"},
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN `demo4` `demo4_manyrels` ON [[demo4.manyrels]] LIKE ('%' || [[demo4_manyrels.id]] || '%') LEFT JOIN `demo4` `demo4_manyrels_onerel` ON [[demo4_manyrels.onerel]] LIKE ('%' || [[demo4_manyrels_onerel.id]] || '%') LEFT JOIN `demo4` `demo4_manyrels_onerel_manyrels` ON [[demo4_manyrels_onerel.manyrels]] LIKE ('%' || [[demo4_manyrels_onerel_manyrels.id]] || '%') LEFT JOIN `demo4` `demo4_manyrels_onerel_manyrels_onerel` ON [[demo4_manyrels_onerel_manyrels.onerel]] LIKE ('%' || [[demo4_manyrels_onerel_manyrels_onerel.id]] || '%')",
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN json_each(CASE WHEN json_valid([[demo4.manyrels]]) THEN [[demo4.manyrels]] ELSE json_array([[demo4.manyrels]]) END) `demo4_manyrels_je` LEFT JOIN `demo4` `demo4_manyrels` ON [[demo4_manyrels.id]] = [[demo4_manyrels_je.value]] LEFT JOIN json_each(CASE WHEN json_valid([[demo4_manyrels.onerel]]) THEN [[demo4_manyrels.onerel]] ELSE json_array([[demo4_manyrels.onerel]]) END) `demo4_manyrels_onerel_je` LEFT JOIN `demo4` `demo4_manyrels_onerel` ON [[demo4_manyrels_onerel.id]] = [[demo4_manyrels_onerel_je.value]] LEFT JOIN json_each(CASE WHEN json_valid([[demo4_manyrels_onerel.manyrels]]) THEN [[demo4_manyrels_onerel.manyrels]] ELSE json_array([[demo4_manyrels_onerel.manyrels]]) END) `demo4_manyrels_onerel_manyrels_je` LEFT JOIN `demo4` `demo4_manyrels_onerel_manyrels` ON [[demo4_manyrels_onerel_manyrels.id]] = [[demo4_manyrels_onerel_manyrels_je.value]] LEFT JOIN json_each(CASE WHEN json_valid([[demo4_manyrels_onerel_manyrels.onerel]]) THEN [[demo4_manyrels_onerel_manyrels.onerel]] ELSE json_array([[demo4_manyrels_onerel_manyrels.onerel]]) END) `demo4_manyrels_onerel_manyrels_onerel_je` LEFT JOIN `demo4` `demo4_manyrels_onerel_manyrels_onerel` ON [[demo4_manyrels_onerel_manyrels_onerel.id]] = [[demo4_manyrels_onerel_manyrels_onerel_je.value]]",
|
||||
},
|
||||
{
|
||||
"multiple rels",
|
||||
[]string{"manyrels.title", "onerel.onefile"},
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN `demo4` `demo4_manyrels` ON [[demo4.manyrels]] LIKE ('%' || [[demo4_manyrels.id]] || '%') LEFT JOIN `demo4` `demo4_onerel` ON [[demo4.onerel]] LIKE ('%' || [[demo4_onerel.id]] || '%')",
|
||||
"SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN json_each(CASE WHEN json_valid([[demo4.manyrels]]) THEN [[demo4.manyrels]] ELSE json_array([[demo4.manyrels]]) END) `demo4_manyrels_je` LEFT JOIN `demo4` `demo4_manyrels` ON [[demo4_manyrels.id]] = [[demo4_manyrels_je.value]] LEFT JOIN json_each(CASE WHEN json_valid([[demo4.onerel]]) THEN [[demo4.onerel]] ELSE json_array([[demo4.onerel]]) END) `demo4_onerel_je` LEFT JOIN `demo4` `demo4_onerel` ON [[demo4_onerel.id]] = [[demo4_onerel_je.value]]",
|
||||
},
|
||||
{
|
||||
"@collection join",
|
||||
@@ -87,7 +87,9 @@ func TestRecordFieldResolverUpdateQuery(t *testing.T) {
|
||||
{
|
||||
"static @request.user.profile fields",
|
||||
[]string{"@request.user.id", "@request.user.profile.id", "@request.data.demo"},
|
||||
"SELECT `demo4`.* FROM `demo4`",
|
||||
"^" +
|
||||
regexp.QuoteMeta("SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN `profiles` `__user_profiles` ON [[__user_profiles.id]] =") +
|
||||
" {:.*}$",
|
||||
},
|
||||
{
|
||||
"relational @request.user.profile fields",
|
||||
@@ -95,12 +97,12 @@ func TestRecordFieldResolverUpdateQuery(t *testing.T) {
|
||||
"^" +
|
||||
regexp.QuoteMeta("SELECT DISTINCT `demo4`.* FROM `demo4` LEFT JOIN `profiles` `__user_profiles` ON [[__user_profiles.id]] =") +
|
||||
" {:.*} " +
|
||||
regexp.QuoteMeta("LEFT JOIN `profiles` `__user_profiles_rel` ON [[__user_profiles.rel]] LIKE ('%' || [[__user_profiles_rel.id]] || '%')") +
|
||||
regexp.QuoteMeta("LEFT JOIN json_each(CASE WHEN json_valid([[__user_profiles.rel]]) THEN [[__user_profiles.rel]] ELSE json_array([[__user_profiles.rel]]) END) `__user_profiles_rel_je` LEFT JOIN `profiles` `__user_profiles_rel` ON [[__user_profiles_rel.id]] = [[__user_profiles_rel_je.value]]") +
|
||||
"$",
|
||||
},
|
||||
}
|
||||
|
||||
for i, s := range scenarios {
|
||||
for _, s := range scenarios {
|
||||
query := app.Dao().RecordQuery(collection)
|
||||
|
||||
r := resolvers.NewRecordFieldResolver(app.Dao(), collection, requestData)
|
||||
@@ -109,14 +111,14 @@ func TestRecordFieldResolverUpdateQuery(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := r.UpdateQuery(query); err != nil {
|
||||
t.Errorf("(%d) UpdateQuery failed with error %v", i, err)
|
||||
t.Errorf("(%s) UpdateQuery failed with error %v", s.name, err)
|
||||
continue
|
||||
}
|
||||
|
||||
rawQuery := query.Build().SQL()
|
||||
|
||||
if !list.ExistInSliceWithRegex(rawQuery, []string{s.expectQuery}) {
|
||||
t.Errorf("(%d) Expected query\n %v \ngot:\n %v", i, s.expectQuery, rawQuery)
|
||||
t.Errorf("(%s) Expected query\n %v \ngot:\n %v", s.name, s.expectQuery, rawQuery)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,6 +163,7 @@ func TestRecordFieldResolverResolveSchemaFields(t *testing.T) {
|
||||
{"manyrels.title", false, "[[demo4_manyrels.title]]"},
|
||||
{"manyrels.onerel.manyrels.onefile", false, "[[demo4_manyrels_onerel_manyrels.onefile]]"},
|
||||
// @request.user.profile relation join:
|
||||
{"@request.user.profile.rel", false, "[[__user_profiles.rel]]"},
|
||||
{"@request.user.profile.rel.name", false, "[[__user_profiles_rel.name]]"},
|
||||
// @collection fieds:
|
||||
{"@collect", true, ""},
|
||||
@@ -247,7 +250,6 @@ func TestRecordFieldResolverResolveStaticRequestDataFields(t *testing.T) {
|
||||
{"@request.user", true, ""},
|
||||
{"@request.user.id", false, `"4d0197cc-2b4a-3f83-a26b-d77bc8423d3c"`},
|
||||
{"@request.user.profile", false, `"{\"id\":\"d13f60a4-5765-48c7-9e1d-3e782340f833\",\"name\":\"test\"}"`},
|
||||
{"@request.user.profile.name", false, `"test"`},
|
||||
}
|
||||
|
||||
for i, s := range scenarios {
|
||||
|
||||
Binary file not shown.
@@ -196,6 +196,12 @@ var inlineServeContentTypes = []string{
|
||||
"application/pdf", "application/x-pdf",
|
||||
}
|
||||
|
||||
// manualExtensionContentTypes is a map of file extensions to content types.
|
||||
var manualExtensionContentTypes = map[string]string{
|
||||
".svg": "image/svg+xml", // (see https://github.com/whatwg/mimesniff/issues/7)
|
||||
".css": "text/css", // (see https://github.com/gabriel-vasile/mimetype/pull/113)
|
||||
}
|
||||
|
||||
// Serve serves the file at fileKey location to an HTTP response.
|
||||
func (s *System) Serve(response http.ResponseWriter, fileKey string, name string) error {
|
||||
r, readErr := s.bucket.NewReader(s.ctx, fileKey, nil)
|
||||
@@ -210,18 +216,22 @@ func (s *System) Serve(response http.ResponseWriter, fileKey string, name string
|
||||
disposition = "inline"
|
||||
}
|
||||
|
||||
// make an exception for svg and force a custom content type
|
||||
// to send in the response so that it can be loaded in an img tag
|
||||
// (see https://github.com/whatwg/mimesniff/issues/7)
|
||||
// make an exception for specific content types and force a custom
|
||||
// content type to send in the response so that it can be loaded directly
|
||||
extContentType := realContentType
|
||||
if extContentType != "image/svg+xml" && filepath.Ext(name) == ".svg" {
|
||||
extContentType = "image/svg+xml"
|
||||
if ct, found := manualExtensionContentTypes[filepath.Ext(name)]; found && extContentType != ct {
|
||||
extContentType = ct
|
||||
}
|
||||
|
||||
// clickjacking shouldn't be a concern when serving uploaded files,
|
||||
// so it safe to unset the global X-Frame-Options to allow files embedding
|
||||
// (see https://github.com/pocketbase/pocketbase/issues/677)
|
||||
response.Header().Del("X-Frame-Options")
|
||||
|
||||
response.Header().Set("Content-Disposition", disposition+"; filename="+name)
|
||||
response.Header().Set("Content-Type", extContentType)
|
||||
response.Header().Set("Content-Length", strconv.FormatInt(r.Size(), 10))
|
||||
response.Header().Set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; sandbox")
|
||||
response.Header().Set("Content-Security-Policy", "default-src 'none'; media-src 'self'; style-src 'unsafe-inline'; sandbox")
|
||||
|
||||
// All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT)
|
||||
// (see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)
|
||||
@@ -271,8 +281,8 @@ func (s *System) CreateThumb(originalKey string, thumbKey, thumbSize string) err
|
||||
}
|
||||
defer r.Close()
|
||||
|
||||
// create imaging object from the origial reader
|
||||
img, decodeErr := imaging.Decode(r)
|
||||
// create imaging object from the original reader
|
||||
img, decodeErr := imaging.Decode(r, imaging.AutoOrientation(true))
|
||||
if decodeErr != nil {
|
||||
return decodeErr
|
||||
}
|
||||
@@ -305,8 +315,15 @@ func (s *System) CreateThumb(originalKey string, thumbKey, thumbSize string) err
|
||||
return writerErr
|
||||
}
|
||||
|
||||
// try to detect the thumb format based on the original file name
|
||||
// (fallbacks to png on error)
|
||||
format, err := imaging.FormatFromFilename(thumbKey)
|
||||
if err != nil {
|
||||
format = imaging.PNG
|
||||
}
|
||||
|
||||
// thumb encode (aka. upload)
|
||||
if err := imaging.Encode(w, thumbImg, imaging.PNG); err != nil {
|
||||
if err := imaging.Encode(w, thumbImg, format); err != nil {
|
||||
w.Close()
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ func TestFileSystemServe(t *testing.T) {
|
||||
"Content-Disposition": "attachment; filename=test_name.txt",
|
||||
"Content-Type": "application/octet-stream",
|
||||
"Content-Length": "0",
|
||||
"Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
|
||||
"Content-Security-Policy": "default-src 'none'; media-src 'self'; style-src 'unsafe-inline'; sandbox",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -192,7 +192,7 @@ func TestFileSystemServe(t *testing.T) {
|
||||
"Content-Disposition": "inline; filename=test_name.png",
|
||||
"Content-Type": "image/png",
|
||||
"Content-Length": "73",
|
||||
"Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
|
||||
"Content-Security-Policy": "default-src 'none'; media-src 'self'; style-src 'unsafe-inline'; sandbox",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -204,7 +204,19 @@ func TestFileSystemServe(t *testing.T) {
|
||||
"Content-Disposition": "attachment; filename=test_name.svg",
|
||||
"Content-Type": "image/svg+xml",
|
||||
"Content-Length": "0",
|
||||
"Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; sandbox",
|
||||
"Content-Security-Policy": "default-src 'none'; media-src 'self'; style-src 'unsafe-inline'; sandbox",
|
||||
},
|
||||
},
|
||||
{
|
||||
// css exception
|
||||
"style.css",
|
||||
"test_name.css",
|
||||
false,
|
||||
map[string]string{
|
||||
"Content-Disposition": "attachment; filename=test_name.css",
|
||||
"Content-Type": "text/css",
|
||||
"Content-Length": "0",
|
||||
"Content-Security-Policy": "default-src 'none'; media-src 'self'; style-src 'unsafe-inline'; sandbox",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -216,7 +228,7 @@ func TestFileSystemServe(t *testing.T) {
|
||||
hasErr := err != nil
|
||||
|
||||
if hasErr != scenario.expectError {
|
||||
t.Errorf("(%s) Expected hasError %v, got %v", scenario.path, scenario.expectError, hasErr)
|
||||
t.Errorf("(%s) Expected hasError %v, got %v (%v)", scenario.path, scenario.expectError, hasErr, err)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -228,6 +240,10 @@ func TestFileSystemServe(t *testing.T) {
|
||||
t.Errorf("(%s) Expected value %q for header %q, got %q", scenario.path, hValue, hName, v)
|
||||
}
|
||||
}
|
||||
|
||||
if v := result.Header.Get("X-Frame-Options"); v != "" {
|
||||
t.Errorf("(%s) Expected the X-Frame-Options header to be unset, got %v", scenario.path, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,5 +337,11 @@ func createTestDir(t *testing.T) string {
|
||||
}
|
||||
file4.Close()
|
||||
|
||||
file5, err := os.OpenFile(filepath.Join(dir, "style.css"), os.O_WRONLY|os.O_CREATE, 0666)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
file5.Close()
|
||||
|
||||
return dir
|
||||
}
|
||||
+12
-1
@@ -17,7 +17,18 @@ type Hook[T any] struct {
|
||||
handlers []Handler[T]
|
||||
}
|
||||
|
||||
// Add registers a new handler to the hook.
|
||||
// PreAdd registers a new handler to the hook by prepending it to the existing queue.
|
||||
func (h *Hook[T]) PreAdd(fn Handler[T]) {
|
||||
h.mux.Lock()
|
||||
defer h.mux.Unlock()
|
||||
|
||||
// minimize allocations by shifting the slice
|
||||
h.handlers = append(h.handlers, nil)
|
||||
copy(h.handlers[1:], h.handlers)
|
||||
h.handlers[0] = fn
|
||||
}
|
||||
|
||||
// Add registers a new handler to the hook by appending it to the existing queue.
|
||||
func (h *Hook[T]) Add(fn Handler[T]) {
|
||||
h.mux.Lock()
|
||||
defer h.mux.Unlock()
|
||||
|
||||
+21
-5
@@ -5,18 +5,34 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAdd(t *testing.T) {
|
||||
func TestAddAndPreAdd(t *testing.T) {
|
||||
h := Hook[int]{}
|
||||
|
||||
if total := len(h.handlers); total != 0 {
|
||||
t.Fatalf("Expected no handlers, found %d", total)
|
||||
}
|
||||
|
||||
h.Add(func(data int) error { return nil })
|
||||
h.Add(func(data int) error { return nil })
|
||||
triggerSequence := ""
|
||||
|
||||
if total := len(h.handlers); total != 2 {
|
||||
t.Fatalf("Expected 2 handlers, found %d", total)
|
||||
f1 := func(data int) error { triggerSequence += "f1"; return nil }
|
||||
f2 := func(data int) error { triggerSequence += "f2"; return nil }
|
||||
f3 := func(data int) error { triggerSequence += "f3"; return nil }
|
||||
f4 := func(data int) error { triggerSequence += "f4"; return nil }
|
||||
|
||||
h.Add(f1)
|
||||
h.Add(f2)
|
||||
h.PreAdd(f3)
|
||||
h.PreAdd(f4)
|
||||
h.Trigger(1)
|
||||
|
||||
if total := len(h.handlers); total != 4 {
|
||||
t.Fatalf("Expected %d handlers, found %d", 4, total)
|
||||
}
|
||||
|
||||
expectedTriggerSequence := "f4f3f1f2"
|
||||
|
||||
if triggerSequence != expectedTriggerSequence {
|
||||
t.Fatalf("Expected trigger sequence %s, got %s", expectedTriggerSequence, triggerSequence)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-2
@@ -13,16 +13,17 @@ import (
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
// FilterData is a filter expession string following the `fexpr` package grammar.
|
||||
// FilterData is a filter expression string following the `fexpr` package grammar.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// var filter FilterData = "id = null || (name = 'test' && status = true)"
|
||||
// resolver := search.NewSimpleFieldResolver("id", "name", "status")
|
||||
// expr, err := filter.BuildExpr(resolver)
|
||||
type FilterData string
|
||||
|
||||
// parsedFilterData holds a cache with previously parsed filter data expressions
|
||||
// (initialized with some prealocated empty data map)
|
||||
// (initialized with some preallocated empty data map)
|
||||
var parsedFilterData = store.New(make(map[string][]fexpr.ExprGroup, 50))
|
||||
|
||||
// BuildExpr parses the current filter data and returns a new db WHERE expression.
|
||||
@@ -103,16 +104,28 @@ func (f FilterData) resolveTokenizedExpr(expr fexpr.Expr, fieldResolver FieldRes
|
||||
case fexpr.SignNeq:
|
||||
return dbx.NewExp(fmt.Sprintf("COALESCE(%s, '') != COALESCE(%s, '')", lName, rName), params), nil
|
||||
case fexpr.SignLike:
|
||||
// both sides are columns and therefore wrap the right side with "%" for contains like behavior
|
||||
if len(params) == 0 {
|
||||
return dbx.NewExp(fmt.Sprintf("%s LIKE ('%%' || %s || '%%')", lName, rName), params), nil
|
||||
}
|
||||
|
||||
// normalize operands and switch sides if the left operand is a number or text
|
||||
if len(lParams) > 0 {
|
||||
return dbx.NewExp(fmt.Sprintf("%s LIKE %s", rName, lName), f.normalizeLikeParams(params)), nil
|
||||
}
|
||||
|
||||
return dbx.NewExp(fmt.Sprintf("%s LIKE %s", lName, rName), f.normalizeLikeParams(params)), nil
|
||||
case fexpr.SignNlike:
|
||||
// both sides are columns and therefore wrap the right side with "%" for not-contains like behavior
|
||||
if len(params) == 0 {
|
||||
return dbx.NewExp(fmt.Sprintf("%s NOT LIKE ('%%' || %s || '%%')", lName, rName), params), nil
|
||||
}
|
||||
|
||||
// normalize operands and switch sides if the left operand is a number or text
|
||||
if len(lParams) > 0 {
|
||||
return dbx.NewExp(fmt.Sprintf("%s NOT LIKE %s", rName, lName), f.normalizeLikeParams(params)), nil
|
||||
}
|
||||
|
||||
return dbx.NewExp(fmt.Sprintf("%s NOT LIKE %s", lName, rName), f.normalizeLikeParams(params)), nil
|
||||
case fexpr.SignLt:
|
||||
return dbx.NewExp(fmt.Sprintf("%s < %s", lName, rName), params), nil
|
||||
|
||||
@@ -32,6 +32,34 @@ func TestFilterDataBuildExpr(t *testing.T) {
|
||||
regexp.QuoteMeta("}") +
|
||||
"$",
|
||||
},
|
||||
// like with 2 columns
|
||||
{"test1 ~ test2", false,
|
||||
"^" +
|
||||
regexp.QuoteMeta("[[test1]] LIKE ('%' || [[test2]] || '%')") +
|
||||
"$",
|
||||
},
|
||||
// reversed like with text
|
||||
{"'lorem' ~ test1", false,
|
||||
"^" +
|
||||
regexp.QuoteMeta("[[test1]] LIKE {:") +
|
||||
".+" +
|
||||
regexp.QuoteMeta("}") +
|
||||
"$",
|
||||
},
|
||||
// not like with 2 columns
|
||||
{"test1 !~ test2", false,
|
||||
"^" +
|
||||
regexp.QuoteMeta("[[test1]] NOT LIKE ('%' || [[test2]] || '%')") +
|
||||
"$",
|
||||
},
|
||||
// reversed not like with text
|
||||
{"'lorem' !~ test1", false,
|
||||
"^" +
|
||||
regexp.QuoteMeta("[[test1]] NOT LIKE {:") +
|
||||
".+" +
|
||||
regexp.QuoteMeta("}") +
|
||||
"$",
|
||||
},
|
||||
// current datetime constant
|
||||
{"test1 > @now", false,
|
||||
"^" +
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
const DefaultPerPage int = 30
|
||||
|
||||
// MaxPerPage specifies the maximum allowed search result items returned in a single page.
|
||||
const MaxPerPage int = 200
|
||||
const MaxPerPage int = 400
|
||||
|
||||
// url search query params
|
||||
const (
|
||||
@@ -46,6 +46,7 @@ type Provider struct {
|
||||
// NewProvider creates and returns a new search provider.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// baseQuery := db.Select("*").From("user")
|
||||
// fieldResolver := search.NewSimpleFieldResolver("id", "name")
|
||||
// models := []*YourDataStruct{}
|
||||
@@ -199,7 +200,7 @@ func (s *Provider) Exec(items any) (*Result, error) {
|
||||
// count
|
||||
var totalCount int64
|
||||
countQuery := modelsQuery
|
||||
countQuery.Distinct(false).Select("COUNT(*)")
|
||||
countQuery.Distinct(false).Select("COUNT(*)").OrderBy() // unset ORDER BY statements
|
||||
if s.countColumn != "" {
|
||||
countQuery.Select("COUNT(DISTINCT(" + s.countColumn + "))")
|
||||
}
|
||||
@@ -241,7 +242,7 @@ func (s *Provider) Exec(items any) (*Result, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ParseAndExec is a short conventient method to trigger both
|
||||
// ParseAndExec is a short convenient method to trigger both
|
||||
// `Parse()` and `Exec()` in a single call.
|
||||
func (s *Provider) ParseAndExec(urlQuery string, modelsSlice any) (*Result, error) {
|
||||
if err := s.Parse(urlQuery); err != nil {
|
||||
|
||||
@@ -238,7 +238,7 @@ func TestProviderExecNonEmptyQuery(t *testing.T) {
|
||||
false,
|
||||
`{"page":1,"perPage":10,"totalItems":2,"totalPages":1,"items":[{"test1":1,"test2":"test2.1","test3":""},{"test1":2,"test2":"test2.2","test3":""}]}`,
|
||||
[]string{
|
||||
"SELECT COUNT(*) FROM `test` WHERE NOT (`test1` IS NULL) ORDER BY `test1` ASC",
|
||||
"SELECT COUNT(*) FROM `test` WHERE NOT (`test1` IS NULL)",
|
||||
"SELECT * FROM `test` WHERE NOT (`test1` IS NULL) ORDER BY `test1` ASC LIMIT 10",
|
||||
},
|
||||
},
|
||||
@@ -252,7 +252,7 @@ func TestProviderExecNonEmptyQuery(t *testing.T) {
|
||||
false,
|
||||
`{"page":1,"perPage":30,"totalItems":2,"totalPages":1,"items":[{"test1":1,"test2":"test2.1","test3":""},{"test1":2,"test2":"test2.2","test3":""}]}`,
|
||||
[]string{
|
||||
"SELECT COUNT(*) FROM `test` WHERE NOT (`test1` IS NULL) ORDER BY `test1` ASC",
|
||||
"SELECT COUNT(*) FROM `test` WHERE NOT (`test1` IS NULL)",
|
||||
"SELECT * FROM `test` WHERE NOT (`test1` IS NULL) ORDER BY `test1` ASC LIMIT 30",
|
||||
},
|
||||
},
|
||||
@@ -288,8 +288,8 @@ func TestProviderExecNonEmptyQuery(t *testing.T) {
|
||||
false,
|
||||
`{"page":1,"perPage":` + fmt.Sprint(MaxPerPage) + `,"totalItems":1,"totalPages":1,"items":[{"test1":2,"test2":"test2.2","test3":""}]}`,
|
||||
[]string{
|
||||
"SELECT COUNT(*) FROM `test` WHERE ((NOT (`test1` IS NULL)) AND (COALESCE(test2, '') != COALESCE(null, ''))) AND (test1 >= 2) ORDER BY `test1` ASC, `test2` DESC",
|
||||
"SELECT * FROM `test` WHERE ((NOT (`test1` IS NULL)) AND (COALESCE(test2, '') != COALESCE(null, ''))) AND (test1 >= 2) ORDER BY `test1` ASC, `test2` DESC LIMIT 200",
|
||||
"SELECT COUNT(*) FROM `test` WHERE ((NOT (`test1` IS NULL)) AND (COALESCE(test2, '') != COALESCE(null, ''))) AND (test1 >= 2)",
|
||||
"SELECT * FROM `test` WHERE ((NOT (`test1` IS NULL)) AND (COALESCE(test2, '') != COALESCE(null, ''))) AND (test1 >= 2) ORDER BY `test1` ASC, `test2` DESC LIMIT 400",
|
||||
},
|
||||
},
|
||||
// valid sort and filter fields (zero results)
|
||||
@@ -302,7 +302,7 @@ func TestProviderExecNonEmptyQuery(t *testing.T) {
|
||||
false,
|
||||
`{"page":1,"perPage":10,"totalItems":0,"totalPages":0,"items":[]}`,
|
||||
[]string{
|
||||
"SELECT COUNT(*) FROM `test` WHERE (NOT (`test1` IS NULL)) AND (COALESCE(test3, '') != COALESCE('', '')) ORDER BY `test1` ASC, `test3` ASC",
|
||||
"SELECT COUNT(*) FROM `test` WHERE (NOT (`test1` IS NULL)) AND (COALESCE(test3, '') != COALESCE('', ''))",
|
||||
"SELECT * FROM `test` WHERE (NOT (`test1` IS NULL)) AND (COALESCE(test3, '') != COALESCE('', '')) ORDER BY `test1` ASC, `test3` ASC LIMIT 10",
|
||||
},
|
||||
},
|
||||
@@ -316,7 +316,7 @@ func TestProviderExecNonEmptyQuery(t *testing.T) {
|
||||
false,
|
||||
`{"page":2,"perPage":1,"totalItems":2,"totalPages":2,"items":[{"test1":2,"test2":"test2.2","test3":""}]}`,
|
||||
[]string{
|
||||
"SELECT COUNT(*) FROM `test` WHERE NOT (`test1` IS NULL) ORDER BY `test1` ASC",
|
||||
"SELECT COUNT(*) FROM `test` WHERE NOT (`test1` IS NULL)",
|
||||
"SELECT * FROM `test` WHERE NOT (`test1` IS NULL) ORDER BY `test1` ASC LIMIT 1 OFFSET 1",
|
||||
},
|
||||
},
|
||||
@@ -330,7 +330,7 @@ func TestProviderExecNonEmptyQuery(t *testing.T) {
|
||||
false,
|
||||
`{"page":2,"perPage":1,"totalItems":2,"totalPages":2,"items":[{"test1":2,"test2":"test2.2","test3":""}]}`,
|
||||
[]string{
|
||||
"SELECT COUNT(DISTINCT(test.test1)) FROM `test` WHERE NOT (`test1` IS NULL) ORDER BY `test1` ASC",
|
||||
"SELECT COUNT(DISTINCT(test.test1)) FROM `test` WHERE NOT (`test1` IS NULL)",
|
||||
"SELECT * FROM `test` WHERE NOT (`test1` IS NULL) ORDER BY `test1` ASC LIMIT 1 OFFSET 1",
|
||||
},
|
||||
},
|
||||
@@ -437,9 +437,9 @@ func TestProviderParseAndExec(t *testing.T) {
|
||||
},
|
||||
// valid query params
|
||||
{
|
||||
"page=3&perPage=555&filter=test1>1&sort=-test2,test3",
|
||||
"page=3&perPage=9999&filter=test1>1&sort=-test2,test3",
|
||||
false,
|
||||
`{"page":1,"perPage":200,"totalItems":1,"totalPages":1,"items":[{"test1":2,"test2":"test2.2","test3":""}]}`,
|
||||
`{"page":1,"perPage":400,"totalItems":1,"totalPages":1,"items":[{"test1":2,"test2":"test2.2","test3":""}]}`,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ func (c *DefaultClient) Unsubscribe(subs ...string) {
|
||||
delete(c.subscriptions, s)
|
||||
}
|
||||
} else {
|
||||
// unsubsribe all
|
||||
// unsubscribe all
|
||||
for s := range c.subscriptions {
|
||||
delete(c.subscriptions, s)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func (d DateTime) IsZero() bool {
|
||||
return d.Time().IsZero()
|
||||
}
|
||||
|
||||
// String serializes the current DateTime instance into a formated
|
||||
// String serializes the current DateTime instance into a formatted
|
||||
// UTC date string.
|
||||
//
|
||||
// The zero value is serialized to an empty string.
|
||||
|
||||
@@ -13,7 +13,7 @@ type JsonArray []any
|
||||
func (m JsonArray) MarshalJSON() ([]byte, error) {
|
||||
type alias JsonArray // prevent recursion
|
||||
|
||||
// inialize an empty map to ensure that `[]` is returned as json
|
||||
// initialize an empty map to ensure that `[]` is returned as json
|
||||
if m == nil {
|
||||
m = JsonArray{}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ type JsonMap map[string]any
|
||||
func (m JsonMap) MarshalJSON() ([]byte, error) {
|
||||
type alias JsonMap // prevent recursion
|
||||
|
||||
// inialize an empty map to ensure that `{}` is returned as json
|
||||
// initialize an empty map to ensure that `{}` is returned as json
|
||||
if m == nil {
|
||||
m = JsonMap{}
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ PB_PROFILE_COLLECTION = "profiles"
|
||||
PB_INSTALLER_PARAM = "installer"
|
||||
PB_RULES_SYNTAX_DOCS = "https://pocketbase.io/docs/manage-collections#rules-filters-syntax"
|
||||
PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases"
|
||||
PB_VERSION = "v0.7.0"
|
||||
PB_VERSION = "v0.7.10"
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import{S as me,i as Te,s as Se,e as be,f as Pe,N as SO,g as Re,y as bO,o as xe,J as ke,L as Xe,M as ye}from"./index.bdac21fd.js";import{P as Ze,N as We,u as je,D as we,v as oO,T as C,I as KO,w as lO,x as o,y as _e,L as QO,z as cO,A as U,B as uO,F as HO,G as dO,H as v,J as ve,K as qe,E as X,M as _,O as ze,Q as Ge,R as m,U as Ce,a as W,h as Ue,b as Ye,c as Ve,d as Ee,e as Ie,s as Ae,f as Ne,g as De,i as Le,r as Fe,j as Je,k as Me,l as Be,m as Ke,n as He,o as Ot,p as et,q as tt,t as PO,C as q}from"./index.c4d07677.js";class I{constructor(O,e,a,i,r,s,n,Q,u,d=0,l){this.p=O,this.stack=e,this.state=a,this.reducePos=i,this.pos=r,this.score=s,this.buffer=n,this.bufferBase=Q,this.curContext=u,this.lookAhead=d,this.parent=l}toString(){return`[${this.stack.filter((O,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,e,a=0){let i=O.parser.context;return new I(O,[],e,a,a,0,[],0,i?new RO(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=O}reduce(O){let e=O>>19,a=O&65535,{parser:i}=this.p,r=i.dynamicPrecedence(a);if(r&&(this.score+=r),e==0){this.pushState(i.getGoto(this.state,a,!0),this.reducePos),a<i.minRepeatTerm&&this.storeNode(a,this.reducePos,this.reducePos,4,!0),this.reduceContext(a,this.reducePos);return}let s=this.stack.length-(e-1)*3-(O&262144?6:0),n=this.stack[s-2],Q=this.stack[s-1],u=this.bufferBase+this.buffer.length-Q;if(a<i.minRepeatTerm||O&131072){let d=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(a,n,d,u+4,!0)}if(O&262144)this.state=this.stack[s];else{let d=this.stack[s-3];this.state=i.getGoto(d,a,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(a,n)}storeNode(O,e,a,i=4,r=!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(e==a)return;if(s.buffer[n-2]>=e){s.buffer[n-2]=a;return}}}if(!r||this.pos==a)this.buffer.push(O,e,a,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>a;)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,i>4&&(i-=4);this.buffer[s]=O,this.buffer[s+1]=e,this.buffer[s+2]=a,this.buffer[s+3]=i}}shift(O,e,a){let i=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if((O&262144)==0){let r=O,{parser:s}=this.p;(a>this.pos||e<=s.maxNode)&&(this.pos=a,s.stateFlag(r,1)||(this.reducePos=a)),this.pushState(r,i),this.shiftContext(e,i),e<=s.maxNode&&this.buffer.push(e,i,a,4)}else this.pos=a,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,a,4)}apply(O,e,a){O&65536?this.reduce(O):this.shift(O,e,a)}useNode(O,e){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let i=this.pos;this.reducePos=this.pos=i+O.length,this.pushState(e,i),this.buffer.push(a,i,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,e=O.buffer.length;for(;e>0&&O.buffer[e-2]>O.reducePos;)e-=4;let a=O.buffer.slice(e),i=O.bufferBase+e;for(;O&&i==O.bufferBase;)O=O.parent;return new I(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,i,this.curContext,this.lookAhead,O)}recoverByDelete(O,e){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,e,4),this.storeNode(0,this.pos,e,a?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(O){for(let e=new at(this);;){let a=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,O);if((a&65536)==0)return!0;if(a==0)return!1;e.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>4<<1||this.stack.length>=120){let i=[];for(let r=0,s;r<e.length;r+=2)(s=e[r+1])!=this.state&&this.p.parser.hasAction(s,O)&&i.push(e[r],s);if(this.stack.length<120)for(let r=0;i.length<4<<1&&r<e.length;r+=2){let s=e[r+1];i.some((n,Q)=>Q&1&&n==s)||i.push(e[r],s)}e=i}let a=[];for(let i=0;i<e.length&&a.length<4;i+=2){let r=e[i+1];if(r==this.state)continue;let s=this.split();s.pushState(r,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(e[i],this.pos),s.score-=200,a.push(s)}return a}forceReduce(){let O=this.p.parser.stateSlot(this.state,5);if((O&65536)==0)return!1;let{parser:e}=this.p;if(!e.validAction(this.state,O)){let a=O>>19,i=O&65535,r=this.stack.length-a*3;if(r<0||e.getGoto(this.stack[r],i,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(O),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{paLine truncated
|
||||
\${}
|
||||
} catch (\${error}) {
|
||||
\${}
|
||||
}`,{label:"try",detail:"/ catch block",type:"keyword"}),m("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),m(`if (\${}) {
|
||||
\${}
|
||||
} else {
|
||||
\${}
|
||||
}`,{label:"if",detail:"/ else block",type:"keyword"}),m(`class \${name} {
|
||||
constructor(\${params}) {
|
||||
\${}
|
||||
}
|
||||
}`,{label:"class",detail:"definition",type:"keyword"}),m('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),m('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],LO=new Ce,ue=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function j(t){return(O,e)=>{let a=O.node.getChild("VariableDefinition");return a&&e(a,t),!0}}const Va=["FunctionDeclaration"],Ea={FunctionDeclaration:j("function"),ClassDeclaration:j("class"),ClassExpression:()=>!0,EnumDeclaration:j("constant"),TypeAliasDeclaration:j("type"),NamespaceDeclaration:j("namespace"),VariableDefinition(t,O){t.matchContext(Va)||O(t,"variable")},TypeDefinition(t,O){O(t,"type")},__proto__:null};function de(t,O){let e=LO.get(O);if(e)return e;let a=[],i=!0;function r(s,n){let Q=t.sliceString(s.from,s.to);a.push({label:Q,type:n})}return O.cursor(KO.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let n=Ea[s.name];if(n&&n(s,r)||ue.has(s.name))return!1}else if(s.to-s.from>8192){for(let n of de(t,s.node))a.push(n);return!1}}),LO.set(O,a),a}const FO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,$e=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName"];function Ia(t){let O=v(t.state).resolveInner(t.pos,-1);if($e.indexOf(O.name)>-1)return null;let e=O.to-O.from<20&&FO.test(t.state.sliceDoc(O.from,O.to));if(!e&&!t.explicit)return null;let a=[];for(let i=O;i;i=i.parent)ue.has(i.name)&&(a=a.concat(de(t.state.doc,i)));return{options:a,from:e?O.from:t.pos,validFor:FO}}const k=QO.define({parser:Ua.configure({props:[cO.add({IfStatement:U({except:/^\s*({|else\b)/}),TryStatement:U({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:ze,SwitchBody:t=>{let O=t.textAfter,e=/^\s*\}/.test(O),a=/^\s*(case|default)\b/.test(O);return t.baseIndent+(e?0:a?1:2)*t.unit},Block:Ge({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":U({except:/^{/}),JSXElement(t){let O=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(O?0:t.unit)},JSXEscape(t){let O=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(O?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),uO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":HO,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Aa=k.configure({dialect:"ts"}),Na=k.configure({dialect:"jsx"}),Da=k.configure({dialect:"jsx ts"}),La="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(t=>({label:t,type:"keyword"}));function he(t={}){let O=t.jsx?t.typescript?Da:Na:t.typescript?Aa:k;return new dO(O,[k.data.of({autocomplete:ve($e,qe(Ya.concat(La)))}),k.data.of({autocomplete:Ia}),t.jsx?Ja:[]])}function JO(t,O,e=t.length){if(!O)return"";let a=O.getChild("JSXIdentifier");return a?t.sliceString(a.from,Math.min(a.to,e)):""}const Fa=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Ja=X.inputHandler.of((t,O,e,a)=>{if((Fa?t.composing:t.compositionStarted)||t.state.readOnly||O!=e||a!=">"&&a!="/"||!k.isActiveAt(t.state,O,-1))return!1;let{state:i}=t,r=i.changeByRange(s=>{var n,Q,u;let{head:d}=s,l=v(i).resolveInner(d,-1),$;if(l.name=="JSXStartTag"&&(l=l.parent),a==">"&&l.name=="JSXFragmentTag")return{range:_.cursor(d+1),changes:{from:d,insert:"><>"}};if(a==">"&&l.name=="JSXIdentifier"){if(((Q=(n=l.parent)===null||n===void 0?void 0:n.lastChild)===null||Q===void 0?void 0:Q.name)!="JSXEndTag"&&($=JO(i.doc,l.parent,d)))return{range:_.cursor(d+1),changes:{from:d,insert:`></${$}>`}}}else if(a=="/"&&l.name=="JSXFragmentTag"){let h=l.parent,p=h==null?void 0:h.parent;if(h.from==d-1&&((u=p.lastChild)===null||u===void 0?void 0:u.name)!="JSXEndTag"&&($=JO(i.doc,p==null?void 0:p.firstChild,d))){let b=`/${$}>`;return{range:_.cursor(d+b.length),changes:{from:d,insert:b}}}}return{range:s}});return r.changes.empty?!1:(t.dispatch(r,{userEvent:"input.type",scrollIntoView:!0}),!0)}),w=["_blank","_self","_top","_parent"],tO=["ascii","utf-8","utf-16","latin1","latin1"],aO=["get","post","put","delete"],iO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],c={},Ma={a:{attrs:{href:null,ping:null,type:null,media:null,target:w,hreflang:null}},abbr:c,acronym:c,address:c,applet:c,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:c,aside:c,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["n
Line truncated
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import{S as me,i as Te,s as Se,e as be,f as Pe,N as SO,g as Re,y as bO,o as xe,J as ke,L as Xe,M as ye}from"./index.21c960f7.js";import{P as Ze,N as We,u as je,D as we,v as lO,T as Y,I as KO,w as QO,x as o,y as _e,L as cO,z as uO,A as V,B as dO,F as HO,G as $O,H as z,J as ve,K as qe,E as X,M as q,O as ze,Q as Ge,R as T,U as Ce,a as w,h as Ue,b as Ye,c as Ve,d as Ee,e as Ie,s as Ae,f as Ne,g as De,i as Le,r as Fe,j as Je,k as Me,l as Be,m as Ke,n as He,o as Ot,p as et,q as tt,t as PO,C as G}from"./index.a9121ab1.js";class N{constructor(O,e,a,i,r,s,n,Q,u,d=0,l){this.p=O,this.stack=e,this.state=a,this.reducePos=i,this.pos=r,this.score=s,this.buffer=n,this.bufferBase=Q,this.curContext=u,this.lookAhead=d,this.parent=l}toString(){return`[${this.stack.filter((O,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,e,a=0){let i=O.parser.context;return new N(O,[],e,a,a,0,[],0,i?new RO(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=O}reduce(O){let e=O>>19,a=O&65535,{parser:i}=this.p,r=i.dynamicPrecedence(a);if(r&&(this.score+=r),e==0){this.pushState(i.getGoto(this.state,a,!0),this.reducePos),a<i.minRepeatTerm&&this.storeNode(a,this.reducePos,this.reducePos,4,!0),this.reduceContext(a,this.reducePos);return}let s=this.stack.length-(e-1)*3-(O&262144?6:0),n=this.stack[s-2],Q=this.stack[s-1],u=this.bufferBase+this.buffer.length-Q;if(a<i.minRepeatTerm||O&131072){let d=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(a,n,d,u+4,!0)}if(O&262144)this.state=this.stack[s];else{let d=this.stack[s-3];this.state=i.getGoto(d,a,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(a,n)}storeNode(O,e,a,i=4,r=!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(e==a)return;if(s.buffer[n-2]>=e){s.buffer[n-2]=a;return}}}if(!r||this.pos==a)this.buffer.push(O,e,a,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>a;)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,i>4&&(i-=4);this.buffer[s]=O,this.buffer[s+1]=e,this.buffer[s+2]=a,this.buffer[s+3]=i}}shift(O,e,a){let i=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if((O&262144)==0){let r=O,{parser:s}=this.p;(a>this.pos||e<=s.maxNode)&&(this.pos=a,s.stateFlag(r,1)||(this.reducePos=a)),this.pushState(r,i),this.shiftContext(e,i),e<=s.maxNode&&this.buffer.push(e,i,a,4)}else this.pos=a,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,a,4)}apply(O,e,a){O&65536?this.reduce(O):this.shift(O,e,a)}useNode(O,e){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let i=this.pos;this.reducePos=this.pos=i+O.length,this.pushState(e,i),this.buffer.push(a,i,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,e=O.buffer.length;for(;e>0&&O.buffer[e-2]>O.reducePos;)e-=4;let a=O.buffer.slice(e),i=O.bufferBase+e;for(;O&&i==O.bufferBase;)O=O.parent;return new N(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,i,this.curContext,this.lookAhead,O)}recoverByDelete(O,e){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,e,4),this.storeNode(0,this.pos,e,a?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(O){for(let e=new at(this);;){let a=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,O);if((a&65536)==0)return!0;if(a==0)return!1;e.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>4<<1||this.stack.length>=120){let i=[];for(let r=0,s;r<e.length;r+=2)(s=e[r+1])!=this.state&&this.p.parser.hasAction(s,O)&&i.push(e[r],s);if(this.stack.length<120)for(let r=0;i.length<4<<1&&r<e.length;r+=2){let s=e[r+1];i.some((n,Q)=>Q&1&&n==s)||i.push(e[r],s)}e=i}let a=[];for(let i=0;i<e.length&&a.length<4;i+=2){let r=e[i+1];if(r==this.state)continue;let s=this.split();s.pushState(r,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(e[i],this.pos),s.score-=200,a.push(s)}return a}forceReduce(){let O=this.p.parser.stateSlot(this.state,5);if((O&65536)==0)return!1;let{parser:e}=this.p;if(!e.validAction(this.state,O)){let a=O>>19,i=O&65535,r=this.stack.length-a*3;if(r<0||e.getGoto(this.stack[r],i,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(O),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{paLine truncated
|
||||
\${}
|
||||
} catch (\${error}) {
|
||||
\${}
|
||||
}`,{label:"try",detail:"/ catch block",type:"keyword"}),T("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),T(`if (\${}) {
|
||||
\${}
|
||||
} else {
|
||||
\${}
|
||||
}`,{label:"if",detail:"/ else block",type:"keyword"}),T(`class \${name} {
|
||||
constructor(\${params}) {
|
||||
\${}
|
||||
}
|
||||
}`,{label:"class",detail:"definition",type:"keyword"}),T('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),T('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],LO=new Ce,ue=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function _(t){return(O,e)=>{let a=O.node.getChild("VariableDefinition");return a&&e(a,t),!0}}const Va=["FunctionDeclaration"],Ea={FunctionDeclaration:_("function"),ClassDeclaration:_("class"),ClassExpression:()=>!0,EnumDeclaration:_("constant"),TypeAliasDeclaration:_("type"),NamespaceDeclaration:_("namespace"),VariableDefinition(t,O){t.matchContext(Va)||O(t,"variable")},TypeDefinition(t,O){O(t,"type")},__proto__:null};function de(t,O){let e=LO.get(O);if(e)return e;let a=[],i=!0;function r(s,n){let Q=t.sliceString(s.from,s.to);a.push({label:Q,type:n})}return O.cursor(KO.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let n=Ea[s.name];if(n&&n(s,r)||ue.has(s.name))return!1}else if(s.to-s.from>8192){for(let n of de(t,s.node))a.push(n);return!1}}),LO.set(O,a),a}const FO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,$e=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName"];function Ia(t){let O=z(t.state).resolveInner(t.pos,-1);if($e.indexOf(O.name)>-1)return null;let e=O.name=="VariableName"||O.to-O.from<20&&FO.test(t.state.sliceDoc(O.from,O.to));if(!e&&!t.explicit)return null;let a=[];for(let i=O;i;i=i.parent)ue.has(i.name)&&(a=a.concat(de(t.state.doc,i)));return{options:a,from:e?O.from:t.pos,validFor:FO}}const k=cO.define({parser:Ua.configure({props:[uO.add({IfStatement:V({except:/^\s*({|else\b)/}),TryStatement:V({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:ze,SwitchBody:t=>{let O=t.textAfter,e=/^\s*\}/.test(O),a=/^\s*(case|default)\b/.test(O);return t.baseIndent+(e?0:a?1:2)*t.unit},Block:Ge({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":V({except:/^{/}),JSXElement(t){let O=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(O?0:t.unit)},JSXEscape(t){let O=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(O?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),dO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":HO,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Aa=k.configure({dialect:"ts"}),Na=k.configure({dialect:"jsx"}),Da=k.configure({dialect:"jsx ts"}),La="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(t=>({label:t,type:"keyword"}));function he(t={}){let O=t.jsx?t.typescript?Da:Na:t.typescript?Aa:k;return new $O(O,[k.data.of({autocomplete:ve($e,qe(Ya.concat(La)))}),k.data.of({autocomplete:Ia}),t.jsx?Ja:[]])}function JO(t,O,e=t.length){if(!O)return"";let a=O.getChild("JSXIdentifier");return a?t.sliceString(a.from,Math.min(a.to,e)):""}const Fa=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Ja=X.inputHandler.of((t,O,e,a)=>{if((Fa?t.composing:t.compositionStarted)||t.state.readOnly||O!=e||a!=">"&&a!="/"||!k.isActiveAt(t.state,O,-1))return!1;let{state:i}=t,r=i.changeByRange(s=>{var n,Q,u;let{head:d}=s,l=z(i).resolveInner(d,-1),$;if(l.name=="JSXStartTag"&&(l=l.parent),a==">"&&l.name=="JSXFragmentTag")return{range:q.cursor(d+1),changes:{from:d,insert:"><>"}};if(a==">"&&l.name=="JSXIdentifier"){if(((Q=(n=l.parent)===null||n===void 0?void 0:n.lastChild)===null||Q===void 0?void 0:Q.name)!="JSXEndTag"&&($=JO(i.doc,l.parent,d)))return{range:q.cursor(d+1),changes:{from:d,insert:`></${$}>`}}}else if(a=="/"&&l.name=="JSXFragmentTag"){let h=l.parent,p=h==null?void 0:h.parent;if(h.from==d-1&&((u=p.lastChild)===null||u===void 0?void 0:u.name)!="JSXEndTag"&&($=JO(i.doc,p==null?void 0:p.firstChild,d))){let P=`/${$}>`;return{range:q.cursor(d+P.length),changes:{from:d,insert:P}}}}return{range:s}});return r.changes.empty?!1:(t.dispatch(r,{userEvent:"input.type",scrollIntoView:!0}),!0)}),v=["_blank","_self","_top","_parent"],aO=["ascii","utf-8","utf-16","latin1","latin1"],iO=["get","post","put","delete"],rO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],c={},Ma={a:{attrs:{href:null,ping:null,type:null,media:null,target:v,hreflang:null}},abbr:c,acronym:c,address:c,applet:c,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:c,aside:c,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-c
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{S as z,i as Q,s as X,e as Y,f as Z,g as j,y as _,o as $,H as ee,I as te,J as ne,K as ie,L as oe,C as L,M as re}from"./index.21c960f7.js";import{C as E,E as w,a as S,h as se,b as le,c as ae,d as ce,e as ue,s as fe,f as de,g as ge,i as he,r as pe,j as ye,k as me,l as be,m as ke,n as xe,o as we,p as Se,q as Ce,t as P,S as Ke}from"./index.a9121ab1.js";function qe(t){G(t,"start");var i={},e=t.languageData||{},d=!1;for(var g in t)if(g!=e&&t.hasOwnProperty(g))for(var p=i[g]=[],s=t[g],o=0;o<s.length;o++){var l=s[o];p.push(new Ie(l,t)),(l.indent||l.dedent)&&(d=!0)}return{startState:function(){return{state:"start",pending:null,indent:d?[]:null}},copyState:function(u){var y={state:u.state,pending:u.pending,indent:u.indent&&u.indent.slice(0)};return u.stack&&(y.stack=u.stack.slice(0)),y},token:ve(i),indent:Re(i,e),languageData:e}}function G(t,i){if(!t.hasOwnProperty(i))throw new Error("Undefined state "+i+" in simple mode")}function Le(t,i){if(!t)return/(?:)/;var e="";return t instanceof RegExp?(t.ignoreCase&&(e="i"),t=t.source):t=String(t),new RegExp((i===!1?"":"^")+"(?:"+t+")",e)}function Ee(t){if(!t)return null;if(t.apply)return t;if(typeof t=="string")return t.replace(/\./g," ");for(var i=[],e=0;e<t.length;e++)i.push(t[e]&&t[e].replace(/\./g," "));return i}function Ie(t,i){(t.next||t.push)&&G(i,t.next||t.push),this.regex=Le(t.regex),this.token=Ee(t.token),this.data=t}function ve(t){return function(i,e){if(e.pending){var d=e.pending.shift();return e.pending.length==0&&(e.pending=null),i.pos+=d.text.length,d.token}for(var g=t[e.state],p=0;p<g.length;p++){var s=g[p],o=(!s.data.sol||i.sol())&&i.match(s.regex);if(o){s.data.next?e.state=s.data.next:s.data.push?((e.stack||(e.stack=[])).push(e.state),e.state=s.data.push):s.data.pop&&e.stack&&e.stack.length&&(e.state=e.stack.pop()),s.data.indent&&e.indent.push(i.indentation()+i.indentUnit),s.data.dedent&&e.indent.pop();var l=s.token;if(l&&l.apply&&(l=l(o)),o.length>2&&s.token&&typeof s.token!="string"){e.pending=[];for(var u=2;u<o.length;u++)o[u]&&e.pending.push({text:o[u],token:s.token[u-1]});return i.backUp(o[0].length-(o[1]?o[1].length:0)),l[0]}else return l&&l.join?l[0]:l}}return i.next(),null}}function Re(t,i){return function(e,d){if(e.indent==null||i.dontIndentStates&&i.doneIndentState.indexOf(e.state)>-1)return null;var g=e.indent.length-1,p=t[e.state];e:for(;;){for(var s=0;s<p.length;s++){var o=p[s];if(o.data.dedent&&o.data.dedentIfLineStart!==!1){var l=o.regex.exec(d);if(l&&l[0]){g--,(o.next||o.push)&&(p=t[o.next||o.push]),d=d.slice(l[0].length);continue e}}}break}return g<0?0:e.indent[g]}}function _e(t){let i;return{c(){i=Y("div"),Z(i,"class","code-editor")},m(e,d){j(e,i,d),t[13](i)},p:_,i:_,o:_,d(e){e&&$(i),t[13](null)}}}function Ae(t,i,e){let d,g;ee(t,te,n=>e(12,g=n));const p=ne();let{id:s=""}=i,{value:o=""}=i,{disabled:l=!1}=i,{placeholder:u=""}=i,{baseCollection:y=new ie}=i,{singleLine:C=!1}=i,{extraAutocompleteKeys:I=[]}=i,{disableRequestKeys:k=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,b,A=new E,M=new E,F=new E,O=new E;function v(){f==null||f.focus()}function J(n){let r=n.slice();return L.pushOrReplaceByKey(r,y,"id"),r}function B(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function W(){if(!s)return;const n=document.querySelectorAll('[for="'+s+'"]');for(let r of n)r.removeEventListener("click",v)}function D(){if(!s)return;W();const n=document.querySelectorAll('[for="'+s+'"]');for(let r of n)r.addEventListener("click",v)}function R(n,r="",a=0){let m=d.find(c=>c.name==n||c.id==n);if(!m||a>=4)return[];let h=[r+"id",r+"created",r+"updated"];for(const c of m.schema){const x=r+c.name;if(c.type==="relation"&&c.options.collectionId){const q=R(c.options.collectionId,x+".",a+1);q.length?h=h.concat(q):h.push(x)}else h.push(x)}return h}function H(n=!0,r=!0){let a=[].concat(I);const m=R(y.name);for(const h of m)a.push(h);if(n&&(a.push("@request.method"),a.push("@request.query."),a.push("@request.data."),a.push("@request.user.id"),a.push("@request.user.email"),a.push("@request.user.verified"),a.push("@request.user.created"),a.push("@request.user.updated")),n||r)for(const h of d){let c="";if(h.name==="profiles"){if(!n)continue;c="@request.user.profile."}else{if(!r)continue;c="@collection."+h.name+"."}const x=R(h.name,c);for(const q of x)a.push(q)}return a.sort(function(h,c){return c.length-h.length}),a}function N(n){let r=n.matchBefore(/[\@\w\.]*/);if(r.from==r.to&&!n.explicit)return null;let a=[{label:"false"},{label:"true"},{label:"@now"}];K||a.push({label:"@collection.*",apply:"@collection."});const m=["@request.user.profile.userId","@request.user.profile.created","@request.user.profile.updated"],h=H(!k,!k&&r.text.startsWith("@c"));for(const c of h)m.includes(c)||a.push({label:c.endsWith(".")?c+"*":c,apply:c});return{from:r.from,options:a}}function T(){const n=[{regex:L.escapeRegExp("@now"),token:"keyword"}],r=H(!k,!K);for(const a of r){let m;a.endsWith(".")?m=L.escapeRegExp(a)+"\\w+[\\w.]*":m=L.escapeRegExp(a),n.push(Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
import{S as z,i as Q,s as X,e as Y,f as Z,g as j,y as _,o as $,H as ee,I as te,J as ne,K as ie,L as oe,C as L,M as re}from"./index.bdac21fd.js";import{C as E,E as w,a as S,h as se,b as le,c as ae,d as ce,e as ue,s as fe,f as de,g as ge,i as he,r as pe,j as ye,k as me,l as be,m as ke,n as xe,o as we,p as Se,q as Ce,t as P,S as qe}from"./index.c4d07677.js";function Ke(t){G(t,"start");var i={},e=t.languageData||{},d=!1;for(var g in t)if(g!=e&&t.hasOwnProperty(g))for(var p=i[g]=[],r=t[g],o=0;o<r.length;o++){var l=r[o];p.push(new Ie(l,t)),(l.indent||l.dedent)&&(d=!0)}return{startState:function(){return{state:"start",pending:null,indent:d?[]:null}},copyState:function(u){var y={state:u.state,pending:u.pending,indent:u.indent&&u.indent.slice(0)};return u.stack&&(y.stack=u.stack.slice(0)),y},token:ve(i),indent:Re(i,e),languageData:e}}function G(t,i){if(!t.hasOwnProperty(i))throw new Error("Undefined state "+i+" in simple mode")}function Le(t,i){if(!t)return/(?:)/;var e="";return t instanceof RegExp?(t.ignoreCase&&(e="i"),t=t.source):t=String(t),new RegExp((i===!1?"":"^")+"(?:"+t+")",e)}function Ee(t){if(!t)return null;if(t.apply)return t;if(typeof t=="string")return t.replace(/\./g," ");for(var i=[],e=0;e<t.length;e++)i.push(t[e]&&t[e].replace(/\./g," "));return i}function Ie(t,i){(t.next||t.push)&&G(i,t.next||t.push),this.regex=Le(t.regex),this.token=Ee(t.token),this.data=t}function ve(t){return function(i,e){if(e.pending){var d=e.pending.shift();return e.pending.length==0&&(e.pending=null),i.pos+=d.text.length,d.token}for(var g=t[e.state],p=0;p<g.length;p++){var r=g[p],o=(!r.data.sol||i.sol())&&i.match(r.regex);if(o){r.data.next?e.state=r.data.next:r.data.push?((e.stack||(e.stack=[])).push(e.state),e.state=r.data.push):r.data.pop&&e.stack&&e.stack.length&&(e.state=e.stack.pop()),r.data.indent&&e.indent.push(i.indentation()+i.indentUnit),r.data.dedent&&e.indent.pop();var l=r.token;if(l&&l.apply&&(l=l(o)),o.length>2&&r.token&&typeof r.token!="string"){e.pending=[];for(var u=2;u<o.length;u++)o[u]&&e.pending.push({text:o[u],token:r.token[u-1]});return i.backUp(o[0].length-(o[1]?o[1].length:0)),l[0]}else return l&&l.join?l[0]:l}}return i.next(),null}}function Re(t,i){return function(e,d){if(e.indent==null||i.dontIndentStates&&i.doneIndentState.indexOf(e.state)>-1)return null;var g=e.indent.length-1,p=t[e.state];e:for(;;){for(var r=0;r<p.length;r++){var o=p[r];if(o.data.dedent&&o.data.dedentIfLineStart!==!1){var l=o.regex.exec(d);if(l&&l[0]){g--,(o.next||o.push)&&(p=t[o.next||o.push]),d=d.slice(l[0].length);continue e}}}break}return g<0?0:e.indent[g]}}function _e(t){let i;return{c(){i=Y("div"),Z(i,"class","code-editor")},m(e,d){j(e,i,d),t[13](i)},p:_,i:_,o:_,d(e){e&&$(i),t[13](null)}}}function Ae(t,i,e){let d,g;ee(t,te,n=>e(12,g=n));const p=ne();let{id:r=""}=i,{value:o=""}=i,{disabled:l=!1}=i,{placeholder:u=""}=i,{baseCollection:y=new ie}=i,{singleLine:C=!1}=i,{extraAutocompleteKeys:I=[]}=i,{disableRequestKeys:k=!1}=i,{disableIndirectCollectionsKeys:q=!1}=i,f,b,A=new E,F=new E,M=new E,O=new E;function v(){f==null||f.focus()}function J(n){let s=n.slice();return L.pushOrReplaceByKey(s,y,"id"),s}function B(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function W(){if(!r)return;const n=document.querySelectorAll('[for="'+r+'"]');for(let s of n)s.removeEventListener("click",v)}function D(){if(!r)return;W();const n=document.querySelectorAll('[for="'+r+'"]');for(let s of n)s.addEventListener("click",v)}function R(n,s="",a=0){let m=d.find(c=>c.name==n||c.id==n);if(!m||a>=4)return[];let h=[s+"id",s+"created",s+"updated"];for(const c of m.schema){const x=s+c.name;if(c.type==="relation"&&c.options.collectionId){const K=R(c.options.collectionId,x+".",a+1);K.length?h=h.concat(K):h.push(x)}else h.push(x)}return h}function H(n=!0,s=!0){let a=[].concat(I);const m=R(y.name);for(const h of m)a.push(h);if(n&&(a.push("@request.method"),a.push("@request.query."),a.push("@request.data."),a.push("@request.user.id"),a.push("@request.user.email"),a.push("@request.user.verified"),a.push("@request.user.created"),a.push("@request.user.updated")),n||s)for(const h of d){let c="";if(h.name==="profiles"){if(!n)continue;c="@request.user.profile."}else{if(!s)continue;c="@collection."+h.name+"."}const x=R(h.name,c);for(const K of x)a.push(K)}return a.sort(function(h,c){return c.length-h.length}),a}function N(n){let s=n.matchBefore(/[\@\w\.]*/);if(s.from==s.to&&!n.explicit)return null;let a=[{label:"false"},{label:"true"},{label:"@now"}];q||a.push({label:"@collection.*",apply:"@collection."});const m=["@request.user.profile.id","@request.user.profile.userId","@request.user.profile.created","@request.user.profile.updated"],h=H(!k,!k&&s.text.startsWith("@c"));for(const c of h)m.includes(c)||a.push({label:c.endsWith(".")?c+"*":c,apply:c});return{from:s.from,options:a}}function T(){const n=[{regex:L.escapeRegExp("@now"),token:"keyword"}],s=H(!k,!q);for(const a of s){let m;a.endsWith(".")?m=L.escapeRegExp(a)+"\\w+[\\w.]*":Line truncated
|
||||
+2
-2
@@ -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 k,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.bdac21fd.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=k(),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=k(),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,C,v,P,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=k(),A(r.$$.fragment),p=k(),A(d.$$.fragment),n=k(),i=c("button"),g=c("span"),g.textContent="Set new password",R=k(),C=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(C,"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,C,$),_(C,v),P=!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),(!P||$&4)&&(i.disabled=a[2]),$&4&&L(i,"btn-loading",a[2])},i(a){P||(H(r.$$.fragment,a),H(d.$$.fragment,a),P=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),P=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(C),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};
|
||||
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.21c960f7.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};
|
||||
@@ -0,0 +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.21c960f7.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\u2019ll 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,2 +0,0 @@
|
||||
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.bdac21fd.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\u2019ll 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]),$&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};
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import{S as G,i as J,s as M,F as N,c as T,m as L,t as v,a as y,d as z,C as R,E as U,g as _,k as W,n as Y,o as b,G as j,p as A,q as B,e as m,w as C,b as h,f as d,r as F,h as k,u as q,v as D,y as E,x as I,z as H}from"./index.bdac21fd.js";function K(r){let e,t,s,l,n,o,c,a,i,u,g,$,p=r[3]&&S(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[Q,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),s=m("h5"),l=C(`Type your password to confirm changing your email address
|
||||
`),p&&p.c(),n=h(),T(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],F(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,t),k(t,s),k(s,l),p&&p.m(s,null),k(e,n),L(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||($=q(e,"submit",D(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=S(f),p.c(),p.m(s,null)):p&&(p.d(1),p=null);const P={};w&769&&(P.$$scope={dirty:w,ctx:f}),o.$set(P),(!u||w&2)&&(a.disabled=f[1]),w&2&&F(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(),z(o),g=!1,$()}}}function O(r){let e,t,s,l,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
import{S as G,i as J,s as M,F as N,c as T,m as L,t as v,a as y,d as z,C as R,E as U,g as _,k as W,n as Y,o as b,G as j,p as A,q as B,e as m,w as C,b as h,f as d,r as F,h as k,u as q,v as D,y as E,x as I,z as H}from"./index.21c960f7.js";function K(r){let e,t,s,l,n,o,c,a,i,u,g,$,p=r[3]&&S(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[Q,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),s=m("h5"),l=C(`Type your password to confirm changing your email address
|
||||
`),p&&p.c(),n=h(),T(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],F(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,t),k(t,s),k(s,l),p&&p.m(s,null),k(e,n),L(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||($=q(e,"submit",D(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=S(f),p.c(),p.m(s,null)):p&&(p.d(1),p=null);const P={};w&769&&(P.$$scope={dirty:w,ctx:f}),o.$set(P),(!u||w&2)&&(a.disabled=f[1]),(!u||w&2)&&F(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(),z(o),g=!1,$()}}}function O(r){let e,t,s,l,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>
|
||||
<p>You can now sign in with your new email address.</p></div>`,t=h(),s=m("button"),s.textContent="Close",d(e,"class","alert alert-success"),d(s,"type","button"),d(s,"class","btn btn-secondary btn-block")},m(o,c){_(o,e,c),_(o,t,c),_(o,s,c),l||(n=q(s,"click",r[6]),l=!0)},p:E,i:E,o:E,d(o){o&&b(e),o&&b(t),o&&b(s),l=!1,n()}}}function S(r){let e,t,s;return{c(){e=C("to "),t=m("strong"),s=C(r[3]),d(t,"class","txt-nowrap")},m(l,n){_(l,e,n),_(l,t,n),k(t,s)},p(l,n){n&8&&I(s,l[3])},d(l){l&&b(e),l&&b(t)}}}function Q(r){let e,t,s,l,n,o,c,a;return{c(){e=m("label"),t=C("Password"),l=h(),n=m("input"),d(e,"for",s=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,l,u),_(i,n,u),H(n,r[0]),n.focus(),c||(a=q(n,"input",r[7]),c=!0)},p(i,u){u&256&&s!==(s=i[8])&&d(e,"for",s),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&H(n,i[0])},d(i){i&&b(e),i&&b(l),i&&b(n),c=!1,a()}}}function V(r){let e,t,s,l;const n=[O,K],o=[];function c(a,i){return a[2]?0:1}return e=c(r),t=o[e]=n[e](r),{c(){t.c(),s=U()},m(a,i){o[e].m(a,i),_(a,s,i),l=!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(s.parentNode,s))},i(a){l||(v(t),l=!0)},o(a){y(t),l=!1},d(a){o[e].d(a),a&&b(s)}}}function X(r){let e,t;return e=new N({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:r}}}),{c(){T(e.$$.fragment)},m(s,l){L(e,s,l),t=!0},p(s,[l]){const n={};l&527&&(n.$$scope={dirty:l,ctx:s}),e.$set(n)},i(s){t||(v(e.$$.fragment,s),t=!0)},o(s){y(e.$$.fragment,s),t=!1},d(s){z(e,s)}}}function Z(r,e,t){let s,{params:l}=e,n="",o=!1,c=!1;async function a(){if(o)return;t(1,o=!0);const g=new j("../");try{await g.users.confirmEmailChange(l==null?void 0:l.token,n),t(2,c=!0)}catch($){A.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,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&t(3,s=R.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[n,o,c,s,a,l,i,u]}class ee extends G{constructor(e){super(),J(this,e,Z,X,M,{params:5})}}export{ee as default};
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import{S as M,i as U,s as W,F as Y,c as H,m as N,t as P,a as q,d as L,C as j,E as A,g as _,k as B,n as D,o as m,G as I,p as K,q as E,e as b,w as y,b as C,f as c,r as G,h as w,u as S,v as O,y as F,x as Q,z as R}from"./index.bdac21fd.js";function V(i){let e,l,s,n,t,o,p,u,r,a,v,g,k,h,d=i[4]&&J(i);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),u=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=y(`Reset your user password
|
||||
`),d&&d.c(),t=C(),H(o.$$.fragment),p=C(),H(u.$$.fragment),r=C(),a=b("button"),v=b("span"),v.textContent="Set new password",c(l,"class","content txt-center m-b-base"),c(v,"class","txt"),c(a,"type","submit"),c(a,"class","btn btn-lg btn-block"),a.disabled=i[2],G(a,"btn-loading",i[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,p),N(u,e,null),w(e,r),w(e,a),w(a,v),g=!0,k||(h=S(e,"submit",O(i[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=J(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),u.$set(z),(!g||$&4)&&(a.disabled=f[2]),$&4&&G(a,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(u.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(u.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),L(o),L(u),k=!1,h()}}}function X(i){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
import{S as M,i as U,s as W,F as Y,c as H,m as N,t as P,a as q,d as L,C as j,E as A,g as _,k as B,n as D,o as m,G as I,p as K,q as E,e as b,w as y,b as C,f as c,r as G,h as w,u as S,v as O,y as F,x as Q,z as R}from"./index.21c960f7.js";function V(i){let e,l,s,n,t,o,p,u,r,a,v,k,g,h,d=i[4]&&J(i);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),u=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=y(`Reset your user password
|
||||
`),d&&d.c(),t=C(),H(o.$$.fragment),p=C(),H(u.$$.fragment),r=C(),a=b("button"),v=b("span"),v.textContent="Set new password",c(l,"class","content txt-center m-b-base"),c(v,"class","txt"),c(a,"type","submit"),c(a,"class","btn btn-lg btn-block"),a.disabled=i[2],G(a,"btn-loading",i[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,p),N(u,e,null),w(e,r),w(e,a),w(a,v),k=!0,g||(h=S(e,"submit",O(i[5])),g=!0)},p(f,$){f[4]?d?d.p(f,$):(d=J(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),u.$set(z),(!k||$&4)&&(a.disabled=f[2]),(!k||$&4)&&G(a,"btn-loading",f[2])},i(f){k||(P(o.$$.fragment,f),P(u.$$.fragment,f),k=!0)},o(f){q(o.$$.fragment,f),q(u.$$.fragment,f),k=!1},d(f){f&&m(e),d&&d.d(),L(o),L(u),g=!1,h()}}}function X(i){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>
|
||||
<p>You can now sign in with your new password.</p></div>`,l=C(),s=b("button"),s.textContent="Close",c(e,"class","alert alert-success"),c(s,"type","button"),c(s,"class","btn btn-secondary btn-block")},m(o,p){_(o,e,p),_(o,l,p),_(o,s,p),n||(t=S(s,"click",i[7]),n=!0)},p:F,i:F,o:F,d(o){o&&m(e),o&&m(l),o&&m(s),n=!1,t()}}}function J(i){let e,l,s;return{c(){e=y("for "),l=b("strong"),s=y(i[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&Q(s,n[4])},d(n){n&&m(e),n&&m(l)}}}function Z(i){let e,l,s,n,t,o,p,u;return{c(){e=b("label"),l=y("New password"),n=C(),t=b("input"),c(e,"for",s=i[10]),c(t,"type","password"),c(t,"id",o=i[10]),t.required=!0,t.autofocus=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,t,a),R(t,i[0]),t.focus(),p||(u=S(t,"input",i[8]),p=!0)},p(r,a){a&1024&&s!==(s=r[10])&&c(e,"for",s),a&1024&&o!==(o=r[10])&&c(t,"id",o),a&1&&t.value!==r[0]&&R(t,r[0])},d(r){r&&m(e),r&&m(n),r&&m(t),p=!1,u()}}}function x(i){let e,l,s,n,t,o,p,u;return{c(){e=b("label"),l=y("New password confirm"),n=C(),t=b("input"),c(e,"for",s=i[10]),c(t,"type","password"),c(t,"id",o=i[10]),t.required=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,t,a),R(t,i[1]),p||(u=S(t,"input",i[9]),p=!0)},p(r,a){a&1024&&s!==(s=r[10])&&c(e,"for",s),a&1024&&o!==(o=r[10])&&c(t,"id",o),a&2&&t.value!==r[1]&&R(t,r[1])},d(r){r&&m(e),r&&m(n),r&&m(t),p=!1,u()}}}function ee(i){let e,l,s,n;const t=[X,V],o=[];function p(u,r){return u[3]?0:1}return e=p(i),l=o[e]=t[e](i),{c(){l.c(),s=A()},m(u,r){o[e].m(u,r),_(u,s,r),n=!0},p(u,r){let a=e;e=p(u),e===a?o[e].p(u,r):(B(),q(o[a],1,1,()=>{o[a]=null}),D(),l=o[e],l?l.p(u,r):(l=o[e]=t[e](u),l.c()),P(l,1),l.m(s.parentNode,s))},i(u){n||(P(l),n=!0)},o(u){q(l),n=!1},d(u){o[e].d(u),u&&m(s)}}}function te(i){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[ee]},$$scope:{ctx:i}}}),{c(){H(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){L(e,s)}}}function se(i,e,l){let s,{params:n}=e,t="",o="",p=!1,u=!1;async function r(){if(p)return;l(2,p=!0);const k=new I("../");try{await k.users.confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,u=!0)}catch(h){K.errorResponseHandler(h)}l(2,p=!1)}const a=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return i.$$set=k=>{"params"in k&&l(6,n=k.params)},i.$$.update=()=>{i.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,p,u,s,r,n,a,v,g]}class ne extends M{constructor(e){super(),U(this,e,se,te,W,{params:6})}}export{ne as default};
|
||||
<p>You can now sign in with your new password.</p></div>`,l=C(),s=b("button"),s.textContent="Close",c(e,"class","alert alert-success"),c(s,"type","button"),c(s,"class","btn btn-secondary btn-block")},m(o,p){_(o,e,p),_(o,l,p),_(o,s,p),n||(t=S(s,"click",i[7]),n=!0)},p:F,i:F,o:F,d(o){o&&m(e),o&&m(l),o&&m(s),n=!1,t()}}}function J(i){let e,l,s;return{c(){e=y("for "),l=b("strong"),s=y(i[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&Q(s,n[4])},d(n){n&&m(e),n&&m(l)}}}function Z(i){let e,l,s,n,t,o,p,u;return{c(){e=b("label"),l=y("New password"),n=C(),t=b("input"),c(e,"for",s=i[10]),c(t,"type","password"),c(t,"id",o=i[10]),t.required=!0,t.autofocus=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,t,a),R(t,i[0]),t.focus(),p||(u=S(t,"input",i[8]),p=!0)},p(r,a){a&1024&&s!==(s=r[10])&&c(e,"for",s),a&1024&&o!==(o=r[10])&&c(t,"id",o),a&1&&t.value!==r[0]&&R(t,r[0])},d(r){r&&m(e),r&&m(n),r&&m(t),p=!1,u()}}}function x(i){let e,l,s,n,t,o,p,u;return{c(){e=b("label"),l=y("New password confirm"),n=C(),t=b("input"),c(e,"for",s=i[10]),c(t,"type","password"),c(t,"id",o=i[10]),t.required=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,t,a),R(t,i[1]),p||(u=S(t,"input",i[9]),p=!0)},p(r,a){a&1024&&s!==(s=r[10])&&c(e,"for",s),a&1024&&o!==(o=r[10])&&c(t,"id",o),a&2&&t.value!==r[1]&&R(t,r[1])},d(r){r&&m(e),r&&m(n),r&&m(t),p=!1,u()}}}function ee(i){let e,l,s,n;const t=[X,V],o=[];function p(u,r){return u[3]?0:1}return e=p(i),l=o[e]=t[e](i),{c(){l.c(),s=A()},m(u,r){o[e].m(u,r),_(u,s,r),n=!0},p(u,r){let a=e;e=p(u),e===a?o[e].p(u,r):(B(),q(o[a],1,1,()=>{o[a]=null}),D(),l=o[e],l?l.p(u,r):(l=o[e]=t[e](u),l.c()),P(l,1),l.m(s.parentNode,s))},i(u){n||(P(l),n=!0)},o(u){q(l),n=!1},d(u){o[e].d(u),u&&m(s)}}}function te(i){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[ee]},$$scope:{ctx:i}}}),{c(){H(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){L(e,s)}}}function se(i,e,l){let s,{params:n}=e,t="",o="",p=!1,u=!1;async function r(){if(p)return;l(2,p=!0);const g=new I("../");try{await g.users.confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,u=!0)}catch(h){K.errorResponseHandler(h)}l(2,p=!1)}const a=()=>window.close();function v(){t=this.value,l(0,t)}function k(){o=this.value,l(1,o)}return i.$$set=g=>{"params"in g&&l(6,n=g.params)},i.$$.update=()=>{i.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,p,u,s,r,n,a,v,k]}class ne extends M{constructor(e){super(),U(this,e,se,te,W,{params:6})}}export{ne as default};
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,G as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.bdac21fd.js";function P(c){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
|
||||
import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,G as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.21c960f7.js";function P(c){let t,s,e,n,i;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=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,o){r(l,t,o),r(l,s,o),r(l,e,o),n||(i=_(e,"click",c[4]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function S(c){let t,s,e,n,i;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=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,o){r(l,t,o),r(l,s,o),r(l,e,o),n||(i=_(e,"click",c[3]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function T(c){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 F(c){let t;function s(i,l){return i[1]?T:i[0]?S:P}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(i,l){n.m(i,l),r(i,t,l)},p(i,l){e===(e=s(i))&&n?n.p(i,l):(n.d(1),n=e(i),n&&(n.c(),n.m(t.parentNode,t)))},d(i){n.d(i),i&&a(t)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[F]},$$scope:{ctx:c}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const i={};n&67&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){s||(g(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,i=!1;l();async function l(){s(1,i=!0);const d=new H("../");try{await d.users.confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,i=!1)}const o=()=>window.close(),b=()=>window.close();return c.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,i,e,o,b]}class I extends k{constructor(t){super(),v(this,t,q,V,y,{params:2})}}export{I as default};
|
||||
Vendored
+661
@@ -0,0 +1,661 @@
|
||||
(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 se(){}const Sl=n=>n;function at(n,e){for(const t in e)n[t]=e[t];return n}function Hm(n){return n()}function su(){return Object.create(null)}function Ye(n){n.forEach(Hm)}function Jn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function ti(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function mb(n){return Object.keys(n).length===0}function jm(n,...e){if(n==null)return se;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function rt(n,e,t){n.$$.on_destroy.push(jm(e,t))}function $n(n,e,t,i){if(n){const s=qm(n,e,t,i);return n[0](s)}}function qm(n,e,t,i){return n[1]&&i?at(t.ctx.slice(),n[1](i(e))):t.ctx}function Sn(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 Cn(n,e,t,i,s,l){if(s){const o=qm(e,t,i,l);n.p(o,s)}}function Mn(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 li(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Bt(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 lu(n){return n==null?"":n}function tn(n,e,t){return n.set(t),e}function We(n){return n&&Jn(n.destroy)?n.destroy:se}const Vm=typeof window<"u";let Ho=Vm?()=>window.performance.now():()=>Date.now(),ga=Vm?n=>requestAnimationFrame(n):se;const ws=new Set;function zm(n){ws.forEach(e=>{e.c(n)||(ws.delete(e),e.f())}),ws.size!==0&&ga(zm)}function jo(n){let e;return ws.size===0&&ga(zm),{promise:new Promise(t=>{ws.add(e={c:n,f:t})}),abort(){ws.delete(e)}}}function m(n,e){n.appendChild(e)}function Bm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function gb(n){const e=_("style");return _b(Bm(n),e),e.sheet}function _b(n,e){return m(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function nn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function N(n){return document.createTextNode(n)}function D(){return N(" ")}function Ue(){return N("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ni(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Um(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function mi(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 bb(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function ou(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ne(n,e,t){n.classList[t?"add":"remove"](e)}function Wm(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const go=new Map;let _o=0;function vb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function yb(n,e){const t={stylesheet:gb(e),rules:{}};return go.set(n,t),t}function dl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
|
||||
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
|
||||
`}const f=u+`100% {${o(t,1-t)}}
|
||||
}`,c=`__svelte_${vb(f)}_${r}`,d=Bm(n),{stylesheet:h,rules:g}=go.get(d)||yb(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,_o+=1,c}function pl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),_o-=s,_o||kb())}function kb(){ga(()=>{_o||(go.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),go.clear())})}function wb(n,e,t,i){if(!e)return se;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return se;const{delay:l=0,duration:o=300,easing:r=Sl,start:a=Ho()+l,end:u=a+o,tick:f=se,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=dl(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&pl(n,g),d=!1}return jo(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const $=y-a,C=0+1*r($/o);f(C,1-C)}return!0}),v(),f(0,1),b}function $b(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,Ym(n,s)}}function Ym(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let hl;function il(n){hl=n}function qo(){if(!hl)throw new Error("Function called outside component initialization");return hl}function Nn(n){qo().$$.on_mount.push(n)}function Sb(n){qo().$$.after_update.push(n)}function Cb(n){qo().$$.on_destroy.push(n)}function Qt(){const n=qo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Wm(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function xe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Qs=[],me=[],uo=[],Hr=[],Km=Promise.resolve();let jr=!1;function Jm(){jr||(jr=!0,Km.then(Zm))}function Zn(){return Jm(),Km}function Tt(n){uo.push(n)}function He(n){Hr.push(n)}const or=new Set;let Vl=0;function Zm(){const n=hl;do{for(;Vl<Qs.length;){const e=Qs[Vl];Vl++,il(e),Mb(e.$$)}for(il(null),Qs.length=0,Vl=0;me.length;)me.pop()();for(let e=0;e<uo.length;e+=1){const t=uo[e];or.has(t)||(or.add(t),t())}uo.length=0}while(Qs.length);for(;Hr.length;)Hr.pop()();jr=!1,or.clear(),il(n)}function Mb(n){if(n.fragment!==null){n.update(),Ye(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let qs;function _a(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function ns(n,e,t){n.dispatchEvent(Wm(`${e?"intro":"outro"}${t}`))}const fo=new Set;let ci;function Ae(){ci={r:0,c:[],p:ci}}function Pe(){ci.r||Ye(ci.c),ci=ci.p}function A(n,e){n&&n.i&&(fo.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(fo.has(n))return;fo.add(n),ci.c.push(()=>{fo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function Gm(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&pl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=Sl,tick:g=se,css:v}=i||ba;v&&(l=dl(n,0,1,d,c,h,v,r++)),g(0,1);const b=Ho()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ns(n,!0,"start")),o=jo($=>{if(s){if($>=y)return g(1,0),ns(n,!0,"end"),a(),s=!1;if($>=b){const C=h(($-b)/d);g(C,1-C)}}return s})}let f=!1;return{start(){f||(f=!0,pl(n),Jn(i)?(i=i(),_a().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Xm(n,e,t){let i=e(n,t),s=!0,l;const o=ci;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=Sl,tick:c=se,css:d}=i||ba;d&&(l=dl(n,1,0,u,a,f,d));const h=Ho()+a,g=h+u;Tt(()=>ns(n,!1,"start")),jo(v=>{if(s){if(v>=g)return c(0,1),ns(n,!1,"end"),--o.r||Ye(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Jn(i)?_a().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&pl(n,l),s=!1)}}}function nt(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&pl(n,a)}function f(d,h){const g=d.b-l;return h*=Math.abs(g),{a:l,b:d.b,d:g,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:g=300,easing:v=Sl,tick:b=se,css:y}=s||ba,$={start:Ho()+h,b:d};d||($.group=ci,ci.r+=1),o||r?r=$:(y&&(u(),a=dl(n,l,d,g,h,v,y)),d&&b(0,1),o=f($,g),Tt(()=>ns(n,d,"start")),jo(C=>{if(r&&C>r.start&&(o=f(r,g),r=null,ns(n,o.b,"start"),y&&(u(),a=dl(n,l,o.b,o.duration,0,v,s.css))),o){if(C>=o.end)b(l=o.b,1-l),ns(n,o.b,"end"),r||(o.b?u():--o.group.r||Ye(o.group.c)),o=null;else if(C>=o.start){const S=C-o.start;l=o.a+o.d*v(S/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Jn(s)?_a().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function pn(n,e){n.d(1),e.delete(n.key)}function Ut(n,e){L(n,1,1,()=>{e.delete(n.key)})}function Tb(n,e){n.f(),Ut(n,e)}function ct(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const v={};for(;g--;)v[n[g].ke
Line truncated
|
||||
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function x0(n){let e,t,i,s=!n[0]&&qu();const l=n[1].default,o=$n(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=D(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=qu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Cn(o,l,r,r[2],i?Sn(l,r[2],a,null):Mn(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function ev(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[x0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function tv(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 o_ extends Ee{constructor(e){super(),Oe(this,e,tv,ev,De,{nobranding:0})}}function Vu(n,e,t){const i=n.slice();return i[11]=e[t],i}const nv=n=>({}),zu=n=>({uniqueId:n[3]});function iv(n){let e=(n[11]||wo)+"",t;return{c(){t=N(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||wo)+"")&&ue(t,e)},d(i){i&&k(t)}}}function sv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||wo)+"",i;return{c(){e=_("pre"),i=N(t)},m(o,r){w(o,e,r),m(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)||wo)+"")&&ue(i,t)},d(o){o&&k(e)}}}function Bu(n){let e,t;function i(o,r){return typeof o[11]=="object"?sv:iv}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function lv(n){let e,t,i,s,l;const o=n[7].default,r=$n(o,n,n[6],zu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Bu(Vu(n,a,f));return{c(){e=_("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),ne(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=J(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Cn(r,o,f,f[6],i?Sn(o,f[6],c,nv):Mn(f[6]),zu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Vu(f,a,d);u[d]?u[d].p(h,c):(u[d]=Bu(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),(!i||c&5)&&ne(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){L(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),nn(u,f),n[9](null),s=!1,l()}}}const wo="Invalid value";function ov(n,e,t){let i;rt(n,Vi,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+B.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Ea(r)}Nn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){xe.call(this,n,g)}function h(g){me[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=B.toArray(B.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Ne extends Ee{constructor(e){super(),Oe(this,e,ov,lv,De,{name:4,class:0})}}function rv(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0]),l.focus(),r||(a=J(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]&&Me(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function av(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("Password"),s=D(),l=_("input"),r=D(),a=_("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Me(l,n[1]),w(c,r,d),w(c,a,d),u||(f=J(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]&&Me(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function uv(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Password confirm"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[2]),r||(a=J(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]&&Me(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Line truncated
|
||||
<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"),ne(f,"btn-disabled",n[3]),ne(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),H(a,e,null),m(e,u),m(e,f),c=!0,d||(h=J(e,"submit",Yt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&1540&&($.$$scope={dirty:v,ctx:g}),a.$set($),(!c||v&8)&&ne(f,"btn-disabled",g[3]),(!c||v&8)&&ne(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),c=!1},d(g){g&&k(e),j(s),j(o),j(a),d=!1,h()}}}function cv(n,e,t){const i=Qt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await we.admins.create({email:s,password:l,passwordConfirm:o}),await we.admins.authViaEmail(s,l),i("submit")}catch(d){we.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 dv extends Ee{constructor(e){super(),Oe(this,e,cv,fv,De,{})}}function Uu(n){let e,t;return e=new o_({props:{$$slots:{default:[pv]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function pv(n){let e,t;return e=new dv({}),e.$on("submit",n[1]),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:se,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function hv(n){let e,t,i=n[0]&&Uu(n);return{c(){i&&i.c(),e=Ue()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Uu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Ae(),L(i,1,1,()=>{i=null}),Pe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function mv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){we.logout(!1),t(0,i=!0);return}we.authStore.isValid?Ci("/collections"):we.logout()}return[i,async()=>{t(0,i=!1),await Zn(),window.location.search=""}]}class gv extends Ee{constructor(e){super(),Oe(this,e,mv,hv,De,{})}}const Nt=Gn(""),$o=Gn(""),us=Gn(!1);function Zo(n){const e=n-1;return e*e*e+1}function So(n,{delay:e=0,duration:t=400,easing:i=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Wn(n,{delay:e=0,duration:t=400,easing:i=Zo,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 on(n,{delay:e=0,duration:t=400,easing:i=Zo}={}){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:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Tn(n,{delay:e=0,duration:t=400,easing:i=Zo,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 _v(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Me(e,n[7]),i||(s=J(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]&&Me(e,l[7])},i:se,o:se,d(l){l&&k(e),n[13](null),i=!1,s()}}}function bv(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=new o(r(n)),me.push(()=>Re(e,"value",l)),e.$on("submit",n[10])),{c(){e&&q(e.$$.fragment),i=Ue()},m(a,u){e&&H(e,a,u),w(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],He(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;L(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),me.push(()=>Re(e,"value",l)),e.$on("submit",a[10]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(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=_("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=J(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&&(Ae(),L(r,1,1,()=>{r=null}),Pe())},i(a){s||(A(r),a&&Tt(()=>{i||(i=nt(t,Wn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){L(r),a&&(i||(i=nt(t,Wn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Yu(n){let e,t,i;return{c(){e=_("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){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=nt(e,Wn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=nt(e,Wn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function vv(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[bv,_v],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Wu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=D(),r.c(),a=D(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[J(t,"submit",Yt(n[10])),J(e,"click",ni(n[11]))],f=!0)},p(b,[y]){let $=o;o=g(b),o===$?h[o].p(b,y):(Ae(),L(h[$],1,1,()=>{h[$]=null}),Pe(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Wu(b),v.c(),A(v,1),v.m(t,null)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){u||(A(r),A(v),u=!0)},o(b){L(r),L(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Ye(c)}}}function yv(n,e,t){const i=Qt(),s="search_"+B.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new dn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(T=!0){t(7,d=""),T&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Pi(()=>import("./FilterAutocompleteInput.32676e11.js"),["FilterAutocompleteInput.32676e11.js","index.a9121ab1.js"],import.meta.url)).default),t(5,f=!1))}Nn(()=>{v()});function b(T){xe.call(this,n,T)}function y(T){d=T,t(7,d),t(0,l)}function $(T){me[T?"unshift":"push"](()=>{c=T,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const S=()=>{h(!1),g()};return n.$$set=T=>{"value"in T&&t(0,l=T.value),"placeholder"in T&&t(1,o=T.placeholder),"autocompleteCollection"in T&&t(2,r=T.autocompleteCollection),"extraAutocompleteKeys"in T&&t(3,a=T.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,b,y,$,C,S]}class Go extends Ee{constructor(e){super(),Oe(this,e,yv,vv,De,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Xr,Ki;const Qr="app-tooltip";function Ku(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ri(){return Ki=Ki||document.querySelector("."+Qr),Ki||(Ki=document.createElement("div"),Ki.classList.add(Qr),document.body.appendChild(Ki)),Ki}function r_(n,e){let t=Ri();if(!t.classList.contains("active")||!(e!=null&&e.text)){xr();return}t.textContent=e.text,t.className=Qr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o
Line truncated
|
||||
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Av(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Pv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Lv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Iv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Zu(n){let e;function t(l,o){return l[6]?Fv:Nv}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Nv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Gu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Gu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Fv(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Gu(n){let e,t,i;return{c(){e=_("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){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Xu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Qu(n,e){var ve,_e,ge;let t,i,s,l=((ve=e[21].method)==null?void 0:ve.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,$=(e[21].referer||"N/A")+"",C,S,T,M,O,E=e[21].status+"",P,I,F,V,X,te,Z,ee,U,Y,G=(((_e=e[21].meta)==null?void 0:_e.errorMessage)||((ge=e[21].meta)==null?void 0:ge.errorData))&&Xu();V=new Si({props:{date:e[21].created}});function de(){return e[16](e[21])}function x(...K){return e[17](e[21],...K)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=N(l),a=D(),u=_("td"),f=_("span"),d=N(c),g=D(),G&&G.c(),v=D(),b=_("td"),y=_("span"),C=N($),T=D(),M=_("td"),O=_("span"),P=N(E),I=D(),F=_("td"),q(V.$$.fragment),X=D(),te=_("td"),te.innerHTML='<i class="ri-arrow-right-line"></i>',Z=D(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",S=e[21].referer),ne(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),ne(O,"label-danger",e[21].status>=400),p(M,"class","col-type-number col-field-status"),p(F,"class","col-type-date col-field-created"),p(te,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,ye){w(K,t,ye),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),G&&G.m(u,null),m(t,v),m(t,b),m(b,y),m(y,C),m(t,T),m(t,M),m(M,O),m(O,P),m(t,I),m(t,F),H(V,F,null),m(t,X),m(t,te),m(t,Z),ee=!0,U||(Y=[J(t,"click",de),J(t,"keydown",x)],U=!0)},p(K,ye){var W,ce,ae;e=K,(!ee||ye&8)&&l!==(l=((W=e[21].method)==null?void 0:W.toUpperCase())+"")&&ue(o,l),(!ee||ye&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!ee||ye&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!ee||ye&8&&h!==(h=e[21].url))&&p(f,"title",h),((ce=e[21].meta)==null?void 0:ce.errorMessage)||((ae=e[21].meta)==null?void 0:ae.errorData)?G||(G=Xu(),G.c(),G.m(u,null)):G&&(G.d(1),G=null),(!ee||ye&8)&&$!==($=(e[21].referer||"N/A")+"")&&ue(C,$),(!ee||ye&8&&S!==(S=e[21].referer))&&p(y,"title",S),(!ee||ye&8)&&ne(y,"txt-hint",!e[21].referer),(!ee||ye&8)&&E!==(E=e[21].status+"")&&ue(P,E),(!ee||ye&8)&&ne(O,"label-danger",e[21].status>=400);const oe={};ye&8&&(oe.date=e[21].created),V.$set(oe)},i(K){ee||(A(V.$$.fragment,K),ee=!0)},o(K){L(V.$$.fragment,K),ee=!1},d(K){K&&k(t),G&&G.d(),j(V),U=!1,Ye(Y)}}}function xu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function ef(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[6]),ne(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c&64&&ne(t,"btn-loading",f[6]),c&64&&ne(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function Rv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O=[],E=new Map,P,I,F,V;function X(W){n[11](W)}let te={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Ev]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),l=new an({props:te}),me.push(()=>Re(l,"sort",X));function Z(W){n[12](W)}let ee={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Av]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),a=new an({props:ee}),me.push(()=>Re(a,"sort",Z));function U(W){n[13](W)}let Y={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Pv]},$$scope:{ctx:n}};n[1]!==void 0&&(Y.sort=n[1]),c=new an({props:Y}),me.push(()=>Re(c,"sort",U));function G(W){n[14](W)}let de={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Lv]},$$scope:{ctx:n}};n[1]!==void 0&&(de.sort=n[1]),g=new an({props:de}),me.push(()=>Re(g,"sort",G));function x(W){n[15](W)}let ve={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Iv]},$$scope:{ctx:n}};n[1]!==void 0&&(ve.sort=n[1]),y=new an({props:ve}),me.push(()=>Re(y,"sort",x));let _e=n[3];const ge=W=>W[21].id;for(let W=0;W<_e.length;W+=1){let ce=Ju(n,_e,W),ae=ge(ce);E.set(ae,O[W]=Qu(ae,ce))}let K=null;_e.le
Line truncated
|
||||
* Chart.js v3.9.1
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/function _i(){}const qv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function It(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function mt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Kt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Hn(n,e){return Kt(n)?n:e}function vt(n,e){return typeof n>"u"?e:n}const Vv=(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 Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Et(n,e,t,i){let s,l,o;if(It(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(mt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function Co(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 Mo(n){if(It(n))return n.map(Mo);if(mt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=Mo(n[t[s]]);return e}return n}function u_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function zv(n,e,t,i){if(!u_(n))return;const s=e[n],l=t[n];mt(s)&&mt(l)?gl(s,l,i):e[n]=Mo(l)}function gl(n,e,t){const i=It(e)?e:[e],s=i.length;if(!mt(n))return n;t=t||{};const l=t.merger||zv;for(let o=0;o<s;++o){if(e=i[o],!mt(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 ol(n,e){return gl(n,e,{merger:Bv})}function Bv(n,e,t){if(!u_(n))return;const i=e[n],s=t[n];mt(i)&&mt(s)?ol(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Mo(s))}const tf={"":n=>n,x:n=>n.x,y:n=>n.y};function ji(n,e){return(tf[e]||(tf[e]=Uv(e)))(n)}function Uv(n){const e=Wv(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Wv(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 Pa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Yn=n=>typeof n<"u",qi=n=>typeof n=="function",nf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Yv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Wt=Math.PI,At=2*Wt,Kv=At+Wt,To=Number.POSITIVE_INFINITY,Jv=Wt/180,zt=Wt/2,Ws=Wt/4,sf=Wt*2/3,Bn=Math.log10,pi=Math.sign;function lf(n){const e=Math.round(n);n=rl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Bn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Zv(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 Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function rl(n,e,t){return Math.abs(n-e)<t}function Gv(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function f_(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 ei(n){return n*(Wt/180)}function La(n){return n*(180/Wt)}function of(n){if(!Kt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function c_(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*Wt&&(l+=At),{angle:l,distance:s}}function ea(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Xv(n,e){return(n-e+Kv)%At-Wt}function Pn(n){return(n%At+At)%At}function _l(n,e,t,i){const s=Pn(n),l=Pn(e),o=Pn(t),r=Pn(l-s),a=Pn(o-s),u=Pn(s-l),f=Pn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function cn(n,e,t){return Math.max(e,Math.min(t,n))}function Qv(n){return cn(n,-32768,32767)}function bl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ia(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 ts=(n,e,t,i)=>Ia(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),xv=(n,e,t)=>Ia(n,t,i=>n[i][e]>=t);function ey(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 d_=["push","pop","shift","splice","unshift"];function ty(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),d_.forEach(t=>{const i="_onData"+Pa(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 rf(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)&&(d_.forEach(l=>{delete n[l]}),delete n._chartjs)}function p_(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 h_=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 Ni=(n,e,t)=>Math.max(Math.min(n,t),e);function tl(n){return Ni(Ol(n*2.55),0,255)}function Hi(n){return Ni(Ol(n*255),0,255)}function yi(n){return Ni(Ol(n/2.55)/100,0,1)}function cf(n){return Ni(Ol(n*100),0,100)}const Rn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ta=[..."0123456789ABCDEF"],sy=n=>ta[n&15],ly=n=>ta[(n&240)>>4]+ta[n&15],Zl=n=>(n&240)>>4===(n&15),oy=n=>Zl(n.r)&&Zl(n.g)&&Zl(n.b)&&Zl(n.a);function ry(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Rn[n[1]]*17,g:255&Rn[n[2]]*17,b:255&Rn[n[3]]*17,a:e===5?Rn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Rn[n[1]]<<4|Rn[n[2]],g:Rn[n[3]]<<4|Rn[n[4]],b:Rn[n[5]]<<4|Rn[n[6]],a:e===9?Rn[n[7]]<<4|Rn[n[8]]:255})),t}const ay=(n,e)=>n<255?e(n):"";function uy(n){var e=oy(n)?sy:ly;return n?"#"+e(n.r)+e(n.g)+e(n.b)+ay(n.a,e):void 0}const fy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function b_(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 cy(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 dy(n,e,t){const i=b_(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 py(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=py(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(Hi)}function Ra(n,e,t){return Fa(b_,n,e,t)}function hy(n,e,t){return Fa(dy,n,e,t)}function my(n,e,t){return Fa(cy,n,e,t)}function v_(n){return(n%360+360)%360}function gy(n){const e=fy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?tl(+e[5]):Hi(+e[5]));const s=v_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=hy(s,l,o):e[1]==="hsv"?i=my(s,l,o):i=Ra(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function _y(n,e){var t=Na(n);t[0]=v_(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function by(n){if(!n)return;const e=Na(n),t=e[0],i=cf(e[1]),s=cf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const df={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"},pf={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 vy(){const n={},e=Object.keys(pf),t=Object.keys(df);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 kk{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=h_.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 bi=new kk;const Cf="transparent",wk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=mf(n||Cf),s=i.valid&&mf(e||Cf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class $k{constructor(e,t,i,s){const l=t[i];s=Ql([e.to,s,l,e.from]);const o=Ql([e.from,l,s]);this._active=!0,this._fn=e.fn||wk[e.type||typeof o],this._easing=al[e.easing]||al.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Ql([e.to,t,s,e.from]),this._from=Ql([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 Sk=["x","y","borderWidth","radius","tension"],Ck=["color","borderColor","backgroundColor"];kt.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 Mk=Object.keys(kt.animation);kt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});kt.set("animations",{colors:{type:"color",properties:Ck},numbers:{type:"number",properties:Sk}});kt.describe("animations",{_fallback:"animation"});kt.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 I_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!mt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!mt(s))return;const l={};for(const o of Mk)l[o]=s[o];(It(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Dk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Tk(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 $k(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 bi.add(this._chart,i),!0}}function Tk(n,e){const t=[]Line truncated
|
||||
`)>-1?n.split(`
|
||||
`):n}function zw(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 nc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Kn(e.padding);let v=g.height,b=0,y=i.reduce((S,T)=>S+T.before.length+T.lines.length+T.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const S=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*S+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let $=0;const C=function(S){b=Math.max(b,t.measureText(S).width+$)};return t.save(),t.font=u.string,Et(n.title,C),t.font=a.string,Et(n.beforeBody.concat(n.afterBody),C),$=e.displayColors?o+2+e.boxPadding:0,Et(i,S=>{Et(S.before,C),Et(S.lines,C),Et(S.after,C)}),$=0,t.font=f.string,Et(n.footer,C),t.restore(),b+=g.width,{width:b,height:v}}function Bw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Uw(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 Ww(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"),Uw(u,n,e,t)&&(u="center"),u}function ic(n,e,t){const i=t.yAlign||e.yAlign||Bw(n,t);return{xAlign:t.xAlign||e.xAlign||Ww(n,e,t,i),yAlign:i}}function Yw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Kw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function sc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=Ss(o);let g=Yw(e,r);const v=Kw(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:cn(g,0,i.width-e.width),y:cn(v,0,i.height-e.height)}}function lo(n,e,t){const i=Kn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function lc(n){return fi([],vi(n))}function Jw(n,e,t){return zi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function oc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class fa extends Mi{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 I_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Jw(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=fi(r,vi(s)),r=fi(r,vi(l)),r=fi(r,vi(o)),r}getBeforeBody(e,t){return lc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Et(e,l=>{const o={before:[],lines:[],after:[]},r=oc(i,l);fi(o.before,vi(r.beforeLabel.call(this,l))),fi(o.lines,r.label.call(this,l)),fi(o.after,vi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return lc(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=fi(r,vi(s)),r=fi(r,vi(l)),r=fi(r,vi(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(zw(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))),Et(r,f=>{const c=oc(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.2.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 chartjs-adapter-luxon Contributors
|
||||
* Released under the MIT license
|
||||
*/const m$={datetime:Ge.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ge.TIME_WITH_SECONDS,minute:Ge.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};j_._date.override({_id:"luxon",_create:function(n){return Ge.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return m$},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=Ge.fromFormat(n,e,t):n=Ge.fromISO(n,t):n instanceof Date?n=Ge.fromJSDate(n,t):i==="object"&&!(n instanceof Ge)&&(n=Ge.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 hc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=nt(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=nt(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function g$(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=N(n[1]),t=D(),s=N(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function _$(n){let e;return{c(){e=N("Loading...")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function b$(n){let e,t,i,s,l,o=n[2]&&hc();function r(f,c){return f[2]?_$:g$}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=D(),i=_("canvas"),s=D(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),ou(i,"height","250px"),ou(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ne(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=hc(),o.c(),A(o,1),o.m(e,t)):o&&(Ae(),L(o,1,1,()=>{o=null}),Pe()),c&4&&ne(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){L(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function v$(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),we.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:B.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),we.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Nn(()=>(No.register(Bi,tr,xo,xa,Ll,Vw,Zw),t(6,o=new No(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){me[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class y$ extends Ee{constructor(e){super(),Oe(this,e,v$,b$,De,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var mc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lb={exports:{}};(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 $(C){return C instanceof a?new a(C.type,$(C.content),C.alias):Array.isArray(C)?C.map($):C.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(C,S){S=S||{};var T,M;switch(r.util.type(C)){case"Object":if(M=r.util.objId(C),S[M])return S[M];T={},S[M]=T;for(var O in C)C.hasOwnProperty(O)&&(T[O]=$(C[O],S));return T;case"Array":return M=r.util.objId(C),S[M]?S[M]:(T=[],S[M]=T,C.forEach(function(E,P){T[P]=$(E,S)}),T);default:return C}},getLanguage:function($){for(;$;){var C=s.exec($.className);if(C)return C[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,C){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(T){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if($){var C=document.getElementsByTagName("script");for(var S in C)if(C[S].src==$)return C[S]}return null}},isActive:function($,C,S){for(var T="no-"+C;$;){var M=$.classList;if(M.contains(C))return!0;if(M.contains(T))return!1;$=$.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,C){var S=r.util.clone(r.languages[$]);for(var T in C)S[T]=C[T];return S},insertBefore:function($,C,S,T){T=T||r.languages;var M=T[$],O={};for(var E in M)if(M.hasOwnProperty(E)){if(E==C)for(var P in S)S.hasOwnProperty(P)&&(O[P]=S[P]);S.hasOwnProperty(E)||(O[E]=M[E])}var I=T[$];return T[$]=O,r.languages.DFS(r.languages,function(F,V){V===I&&F!=$&&(this[F]=O)}),O},DFS:function $(C,S,T,M){M=M||{};var O=r.util.objId;for(var E in C)if(C.hasOwnProperty(E)){S.call(C,E,C[E],T||E);var P=C[E],I=r.util.type(P);I==="Object"&&!M[O(P)]?(M[O(P)]=!0,$(P,S,null,M)):I==="Array"&&!M[O(P)]&&(M[O(P)]=!0,$(P,S,E,M))}}},plugins:{},highlightAll:function($,C){r.highlightAllUnder(document,$,C)},highlightAllUnder:function($,C,S){var T={callback:S,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),r.hooks.run("before-all-elements-highlight",T);for(var M=0,O;O=T.elements[M++];)r.highlightElement(O,C===!0,T.callback)},highlightElement:function($,C,S){var T=r.util.getLanguage($),M=r.languages[T];r.util.setLanguage($,T);var O=$.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,T);var E=$.textContent,P={element:$,language:T,grammar:M,code:E};function I(V){P.highlightedCode=V,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),S&&S.call(P.element)}if(r.hooks.run("before-sanity-check",P),O=P.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),S&&S.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){I(r.util.encode(P.code));return}if(C&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(V){I(V.data)},F.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else I(r.highlight(P.code,P.grammar,P.language))},highlight:function($,C,S){var T={code:$,grammar:C,language:S};if(r.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=r.tokenize(T.code,T.grammar),r.hooks.run("after-tokenize",T),a.stringify(r.util.encode(T.tokens),T.language)},tokenize:function($,C){var S=C.rest;if(S){for(var T in S)C[T]=S[T];delete C.rest}var M=new c;return d(M,M.head,$),f($,M,C,M.head,0),g(M)},hooks:{all:{},add:function($,C){var S=r.hooks.all;S[$]=S[$]||[],S[$].push(C)},run:function($,C){var S=r.hooks.all[$];if(!(!S||!S.length))for(var T=0,M;M=S[T++];)M(C)}},Token:a};i.Prism=r;function a($,C,S,T){this.type=$,this.content=C,this.alias=S,this.length=(T||"").length|0}a.stringify=function $(C,S){if(typeof C=="string")return C;if(Array.isArray(C)){var T="";return C.forEach(function(I){T+=$(I,S)}),T}var M={type:C.type,content:$(C.content,S),tag:"span",classes:["token",C.type],attributes:{},language:S},O=C.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(M.classes,O):M.classes.push(O)),r.hooks.run("wrap",M);var E="";for(var P in M.attributes)E+=" "+P+'="'+(M.attributes[P]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+E+">"+M.content+"</"+M.tag+">"};function u($,C,S,T){$.lastIndex=C;var M=$.exec(S);if(M&&T&&M[1]){var O=M[1].length;M.index+=O,M[0]=M[0].slice(O)}return M}funLine truncated
|
||||
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}y.textContent=M,t.highlightElement(y)},function(M){b.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),$=0,C;C=y[$++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(lb);const Xs=lb.exports;var k$={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<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 h=s(f[d]);c+=h,c>r&&(f[d]=`
|
||||
`+f[d],c=h)}a[u]=f.join("")}return a.join(`
|
||||
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",g="",v=!1,b=0;b<d.length;++b){var y=d[b];y==o.element?v=!0:y.nodeName==="#text"&&(v?g+=y.nodeValue:h+=y.nodeValue,a.removeChild(y),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+g,o.code=r.normalize(o.code,o.settings);else{var $=h+o.element.innerHTML+g;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(k$);(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 w$(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(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-1ua9m3i")&&p(e,"class",i)},i:se,o:se,d(s){s&&k(e)}}}function $$(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Xs.highlight(a,Xs.languages[l]||Xs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class bn extends Ee{constructor(e){super(),Oe(this,e,$$,w$,De,{class:0,content:2,language:3})}}const S$=n=>({}),gc=n=>({}),C$=n=>({}),_c=n=>({});function bc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C=n[4]&&!n[2]&&vc(n);const S=n[18].header,T=$n(S,n,n[17],_c);let M=n[4]&&n[2]&&yc(n);const O=n[18].default,E=$n(O,n,n[17],null),P=n[18].footer,I=$n(P,n,n[17],gc);return{c(){e=_("div"),t=_("div"),s=D(),l=_("div"),o=_("div"),C&&C.c(),r=D(),T&&T.c(),a=D(),M&&M.c(),u=D(),f=_("div"),E&&E.c(),c=D(),d=_("div"),I&&I.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),ne(l,"popup",n[2]),p(e,"class","overlay-panel-container"),ne(e,"padded",n[2]),ne(e,"active",n[0])},m(F,V){w(F,e,V),m(e,t),m(e,s),m(e,l),m(l,o),C&&C.m(o,null),m(o,r),T&&T.m(o,null),m(o,a),M&&M.m(o,null),m(l,u),m(l,f),E&&E.m(f,null),n[20](f),m(l,c),m(l,d),I&&I.m(d,null),b=!0,y||($=[J(t,"click",Yt(n[19])),J(f,"scroll",n[21])],y=!0)},p(F,V){n=F,n[4]&&!n[2]?C?C.p(n,V):(C=vc(n),C.c(),C.m(o,r)):C&&(C.d(1),C=null),T&&T.p&&(!b||V&131072)&&Cn(T,S,n,n[17],b?Sn(S,n[17],V,C$):Mn(n[17]),_c),n[4]&&n[2]?M?M.p(n,V):(M=yc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),E&&E.p&&(!b||V&131072)&&Cn(E,O,n,n[17],b?Sn(O,n[17],V,null):Mn(n[17]),null),I&&I.p&&(!b||V&131072)&&Cn(I,P,n,n[17],b?Sn(P,n[17],V,S$)
Line truncated
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const $={};y&16&&($.id=b[4]),y&1&&($.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function PS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("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(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=We(yt.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(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const $={};y&16&&($.id=b[4]+".options.onlyDomains"),y&1&&($.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function LS(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[AS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[PS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),H(i,t,null),m(e,s),m(e,l),H(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){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(i),j(o)}}}function IS(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 ub extends Ee{constructor(e){super(),Oe(this,e,IS,LS,De,{key:1,options:0})}}function NS(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 ub({props:r}),me.push(()=>Re(e,"key",l)),me.push(()=>Re(e,"options",o)),{c(){q(e.$$.fragment)},m(a,u){H(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function FS(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 RS extends Ee{constructor(e){super(),Oe(this,e,FS,NS,De,{key:0,options:1})}}var Or=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Cs={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<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},kl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to togg
Line truncated
|
||||
<span class='flatpickr-weekday'>
|
||||
`+z.join("</span><span class='flatpickr-weekday'>")+`
|
||||
</span>
|
||||
`}}function de(){t.calendarContainer.classList.add("hasWeeks");var R=St("div","flatpickr-weekwrapper");R.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return R.appendChild(z),{weekWrapper:R,weekNumbers:z}}function x(R,z){z===void 0&&(z=!0);var ie=z?R:R-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ke("onYearChange"),X()),V(),Ke("onMonthChange"),ot())}function ve(R,z){if(R===void 0&&(R=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Lr(t.config),re=ie.hours,Le=ie.minutes,le=ie.seconds;h(re,Le,le)}t.redraw(),R&&Ke("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")),Ke("onClose")}function ge(){t.config!==void 0&&Ke("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function K(R){return t.calendarContainer.contains(R)}function ye(R){if(t.isOpen&&!t.config.inline){var z=En(R),ie=K(z),re=z===t.input||z===t.altInput||t.element.contains(z)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Le=!re&&!ie&&!K(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(pe){return pe.contains(z)});Le&&le&&(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 oe(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var z=R,ie=t.currentYear!==z;t.currentYear=z||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),Ke("onYearChange"),X())}}function W(R,z){var ie;z===void 0&&(z=!0);var re=t.parseDate(R,void 0,z);if(t.config.minDate&&re&&An(re,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&re&&An(re,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(re===void 0)return!1;for(var Le=!!t.config.enable,le=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,pe=0,ke=void 0;pe<le.length;pe++){if(ke=le[pe],typeof ke=="function"&&ke(re))return Le;if(ke instanceof Date&&re!==void 0&&ke.getTime()===re.getTime())return Le;if(typeof ke=="string"){var fe=t.parseDate(ke,void 0,!0);return fe&&fe.getTime()===re.getTime()?Le:!Le}else if(typeof ke=="object"&&re!==void 0&&ke.from&&ke.to&&re.getTime()>=ke.from.getTime()&&re.getTime()<=ke.to.getTime())return Le}return!Le}function ce(R){return t.daysContainer!==void 0?R.className.indexOf("hidden")===-1&&R.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(R):!1}function ae(R){var z=R.target===t._input,ie=t._input.value.trimEnd()!==Ht();z&&ie&&!(R.relatedTarget&&K(R.relatedTarget))&&t.setDate(t._input.value,!0,R.target===t.altInput?t.config.altFormat:t.config.dateFormat)}functi
Line truncated
|
||||
Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,P){(!C||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].mimeTypes,He(()=>a=!1)),r.$set(I);const F={};P&2049&&(F.$$scope={dirty:P,ctx:E}),$.$set(F)},i(E){C||(A(r.$$.fragment,E),A($.$$.fragment,E),C=!0)},o(E){L(r.$$.fragment,E),L($.$$.fragment,E),C=!1},d(E){E&&k(e),E&&k(o),j(r,E),E&&k(u),E&&k(f),j($),S=!1,T()}}}function f3(n){let e;return{c(){e=_("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){w(t,e,i)},p:se,d(t){t&&k(e)}}}function c3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;function M(E){n[9](E)}let O={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(O.value=n[0].thumbs),r=new hs({props:O}),me.push(()=>Re(r,"value",M)),$=new Ti({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[f3]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=D(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=D(),b=_("i"),y=D(),q($.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,P){w(E,e,P),m(e,t),m(e,i),m(e,s),w(E,o,P),H(r,E,P),w(E,u,P),w(E,f,P),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),H($,h,null),C=!0,S||(T=We(yt.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"})),S=!0)},p(E,P){(!C||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].thumbs,He(()=>a=!1)),r.$set(I);const F={};P&2048&&(F.$$scope={dirty:P,ctx:E}),$.$set(F)},i(E){C||(A(r.$$.fragment,E),A($.$$.fragment,E),C=!0)},o(E){L(r.$$.fragment,E),L($.$$.fragment,E),C=!1},d(E){E&&k(e),E&&k(o),j(r,E),E&&k(u),E&&k(f),j($),S=!1,T()}}}function d3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[o3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[r3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[u3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[c3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(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(g,v){w(g,e,v),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&2&&($.name="schema."+g[1]+".options.mimeTypes"),v&3073&&($.$$scope={dirty:v,ctx:g}),u.$set($);const C={};v&2&&(C.name="schema."+g[1]+".options.thumbs"),v&3073&&(C.$$scope={dirty:v,ctx:g}),d.$set(C)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(u.$$.fragment,g),L(d.$$.fragment,g),h=!1},d(g){g&&k(e),j(i),j(o),j(u),j(d)}}}function p3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Pt(this.value),t(0,s)}function o(){s.maxSelect=Pt(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{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)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d]}class h3 extends Ee{constructor(e){super(),Oe(this,e,p3,d3,De,{key:1,options:0})}}function m3(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new ps({props:u}),me.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=N("Collection"),s=D(),q(l.$$.fraLine truncated
|
||||
form-field
|
||||
required
|
||||
`+(n[5]?"":"invalid")+`
|
||||
`+(n[0].id&&n[0].system?"disabled":"")+`
|
||||
`,name:"schema."+n[1]+".name",$$slots:{default:[T3,({uniqueId:V})=>({38:V}),({uniqueId:V})=>[0,V?128:0]]},$$scope:{ctx:n}}});const O=[H3,R3,F3,N3,I3,L3,P3,A3,E3,O3,D3],E=[];function P(V,X){return V[0].type==="text"?0:V[0].type==="number"?1:V[0].type==="bool"?2:V[0].type==="email"?3:V[0].type==="url"?4:V[0].type==="date"?5:V[0].type==="select"?6:V[0].type==="json"?7:V[0].type==="file"?8:V[0].type==="relation"?9:V[0].type==="user"?10:-1}~(f=P(n))&&(c=E[f]=O[f](n)),g=new Ne({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[j3,({uniqueId:V})=>({38:V}),({uniqueId:V})=>[0,V?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Kc(n),F=!n[0].toDelete&&Jc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),q(s.$$.fragment),l=D(),o=_("div"),q(r.$$.fragment),a=D(),u=_("div"),c&&c.c(),d=D(),h=_("div"),q(g.$$.fragment),v=D(),b=_("div"),I&&I.c(),y=D(),F&&F.c(),$=D(),C=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(C,"type","submit"),p(C,"class","hidden"),p(C,"tabindex","-1"),p(e,"class","field-form")},m(V,X){w(V,e,X),m(e,t),m(t,i),H(s,i,null),m(t,l),m(t,o),H(r,o,null),m(t,a),m(t,u),~f&&E[f].m(u,null),m(t,d),m(t,h),H(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),F&&F.m(t,null),m(e,$),m(e,C),S=!0,T||(M=J(e,"submit",Yt(n[31])),T=!0)},p(V,X){const te={};X[0]&1&&(te.class="form-field required "+(V[0].id?"disabled":"")),X[0]&2&&(te.name="schema."+V[1]+".type"),X[0]&1|X[1]&384&&(te.$$scope={dirty:X,ctx:V}),s.$set(te);const Z={};X[0]&33&&(Z.class=`
|
||||
form-field
|
||||
required
|
||||
`+(V[5]?"":"invalid")+`
|
||||
`+(V[0].id&&V[0].system?"disabled":"")+`
|
||||
`),X[0]&2&&(Z.name="schema."+V[1]+".name"),X[0]&33|X[1]&384&&(Z.$$scope={dirty:X,ctx:V}),r.$set(Z);let ee=f;f=P(V),f===ee?~f&&E[f].p(V,X):(c&&(Ae(),L(E[ee],1,1,()=>{E[ee]=null}),Pe()),~f?(c=E[f],c?c.p(V,X):(c=E[f]=O[f](V),c.c()),A(c,1),c.m(u,null)):c=null);const U={};X[0]&1|X[1]&384&&(U.$$scope={dirty:X,ctx:V}),g.$set(U),V[0].type!=="file"?I?(I.p(V,X),X[0]&1&&A(I,1)):(I=Kc(V),I.c(),A(I,1),I.m(b,null)):I&&(Ae(),L(I,1,1,()=>{I=null}),Pe()),V[0].toDelete?F&&(Ae(),L(F,1,1,()=>{F=null}),Pe()):F?(F.p(V,X),X[0]&1&&A(F,1)):(F=Jc(V),F.c(),A(F,1),F.m(t,null))},i(V){S||(A(s.$$.fragment,V),A(r.$$.fragment,V),A(c),A(g.$$.fragment,V),A(I),A(F),S=!0)},o(V){L(s.$$.fragment,V),L(r.$$.fragment,V),L(c),L(g.$$.fragment,V),L(I),L(F),S=!1},d(V){V&&k(e),j(s),j(r),~f&&E[f].d(),j(g),I&&I.d(),F&&F.d(),T=!1,M()}}}function Gc(n){let e,t,i,s,l=n[0].system&&Xc(),o=!n[0].id&&Qc(n),r=n[0].required&&xc(),a=n[0].unique&&ed();return{c(){e=_("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Xc(),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=Qc(u),o.c(),o.m(e,i)),u[0].required?r||(r=xc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ed(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Xc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Qc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ne(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ne(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function xc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ed(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function td(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(yt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=nt(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=nt(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function nd(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=J(e,"click",ni(n[15])),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function B3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&Gc(n),$=n[7]&&!n[0].system&&td(),C=n[0].toDelete&&nd(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=D(),o=_("strong"),a=N(r),f=D(),y&&y.c(),c=D(),d=_("div"),h=D(),$&&$.c(),g=D(),C&&C.c(),v=Ue(),p(i,"class",s=lu(B.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),ne(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w(S,f,T),y&&y.m(S,T),w(S,c,T),w(S,d,T),w(S,h,T),$&&$.m(S,T),w(S,g,T),C&&C.m(S,T),w(S,v,T),b=!0},p(S,T){(!b||T[0]&1&&s!==(s=lu(B.getFieldTypeIcon(S[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||T[0]&1)&&r!==(r=(S[0].name||"-")+"")&&ue(a,r),(!b||T[0]&1&&u!==(u=S[0].name))&&p(o,"title",u),(!b||T[0]&1)&&ne(o,"txt-strikethrough",S[0].toDelete),S[0].toDelete?y&&(y.d(1),y=null):y?y.p(S,T):(y=Gc(S),y.c(),y.m(c.parentNode,c)),S[7]&&!S[0].system?$?T[0]&129&&A($,1):($=td(),$.c(),A($,1),$.m(g.parentNode,g)):$&&(Ae(),L($,1,1,()=>{$=null}),Pe()),S[0].toDelete?C?C.p(S,T):(C=nd(S),C.c(),C.m(v.parentNode,v)):C&&(C.d(1),C=null)},i(S){b||(A($),b=!0)},o(S){L($),b=!1},d(S){S&&k(e),S&&k(f),y&&y.d(S),S&&k(c),S&&k(d),S&&k(h),$&&$.d(S),S&&k(g),C&&C.d(S),S&&k(v)}}}function U3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[B3],default:[z3]},$$scope:{ctx:n}};return e=new sr({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&256&&(o.interactive=s[8]),l[0]&5&&(o.class=s[2]||s[0].toDelete||s[0].system?"field-accordion disabled":"field-accordion"),l[0]&483|l[1]&256&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[32](null),j(e,s)}}}function W3(n,e,t){let i,s,l,o,r;rt(n,Vi,K=>t(14,r=K));const a=Qt();let{key:u="0"}=e,{field:f=new Dn}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,h,g=f.type;function v(){h==null||h.expand()}function b(){h==null||h.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function $(K){if(K=(""+K).toLowerCase(),!K)return!1;for(const
Line truncated
|
||||
<code>@request.query.*</code>
|
||||
<code>@request.data.*</code>
|
||||
<code>@request.user.*</code>`,C=D(),S=_("hr"),T=D(),M=_("p"),M.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=D(),E=_("div"),E.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",P=D(),I=_("hr"),F=D(),V=_("p"),V.innerHTML=`Example rule:
|
||||
<br/>
|
||||
<code>@request.user.id!="" && created>"2022-01-01 00:00:00"</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p($,"class","inline-flex flex-gap-5"),p(S,"class","m-t-10 m-b-5"),p(M,"class","m-b-0"),p(E,"class","inline-flex flex-gap-5"),p(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(U,Y){w(U,e,Y),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let G=0;G<ee.length;G+=1)ee[G].m(o,null);m(i,h),m(i,g),m(i,v),m(i,b),m(i,y),m(i,$),m(i,C),m(i,S),m(i,T),m(i,M),m(i,O),m(i,E),m(i,P),m(i,I),m(i,F),m(i,V),te=!0},p(U,Y){if(Y&1){Z=U[0].schema;let G;for(G=0;G<Z.length;G+=1){const de=od(U,Z,G);ee[G]?ee[G].p(de,Y):(ee[G]=ad(de),ee[G].c(),ee[G].m(o,null))}for(;G<ee.length;G+=1)ee[G].d(1);ee.length=Z.length}},i(U){te||(U&&Tt(()=>{X||(X=nt(e,on,{duration:150},!0)),X.run(1)}),te=!0)},o(U){U&&(X||(X=nt(e,on,{duration:150},!1)),X.run(0)),te=!1},d(U){U&&k(e),nn(ee,U),U&&X&&X.end()}}}function G3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=N(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function X3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=N(t),s=N(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function ad(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?X3:G3}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Q3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r<l.length;r+=1){let a=ld(n,l,r),u=o(a);t.set(u,e[r]=ud(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Ue()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&131163&&(l=Object.entries(r[6]),Ae(),e=ct(e,a,o,1,r,l,t,i.parentNode,Ut,ud,i,ld),Pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)L(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function x3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function eC(n){let e,t,i;function s(){return n[9](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[We(yt.call(null,e,"Lock and set to Admins only")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ye(i)}}}function tC(n){let e,t,i;function s(){return n[8](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[We(yt.call(null,e,"Unlock and set custom rule")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ye(i)}}}function nC(n){let e;return{c(){e=N("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function iC(n){let e;return{c(){e=N("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sC(n){let e,t=n[14]+"",i,s,l=Ii(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function $(E){n[11](E,n[13])}var C=n[4];function S(E){let P={id:E[17],baseCollection:E[0],disabled:Ii(E[0][E[13]])};return E[0][E[13]]!==void 0&&(P.value=E[0][E[13]]),{props:P}}C&&(u=new C(S(n)),b(),me.push(()=>Re(u,"value",$)));function T(E,P){return P&1&&(g=null),g==null&&(g=!!Ii(E[0][E[13]])),g?iC:nC}let M=T(n,-1),O=M(n);return{c(){e=_("label"),i=N(t),s=N(" - "),o=N(l),a=D(),u&&q(u.$$.fragment),d=D(),h=_("div"),O.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(E,P){w(E,e,P),m(e,i),m(e,s),m(e,o),w(E,a,P),u&&H(u,E,P),w(E,d,P),w(E,h,P),O.m(h,null),v=!0},p(E,P){n=E,(!v||P&1)&&l!==(l=Ii(n[0][n[13]])?"Admins only":"Custom rule")&&ue(o,l),(!v||P&131072&&r!==(r=n[17]))&&p(e,"for",r),f!==n[13]&&(y(),f=n[13],b());const I={};if(P&131072&&(I.id=n[17]),P&1&&(I.baseCollection=n[0]),P&1&&(I.disabled=Ii(n[0][n[13]])),!c&&P&65&&(c=!0,I.value=n[0][n[13]],He(()=>c=!1)),C!==(C=n[4])){if(u){Ae();const F=u;L(F.$$.fragment,1,0,()=>{j(F,1)}),Pe()}C?(u=new C(S(n)),b(),me.push(()=>Re(u,"value",$)),q(u.$$.fragment),A(u.$$.fragment,1),H(u,d.parentNode,d)):u=null}else C&&u.$set(I);M!==(M=T(n,P))&&(O.d(1),O=M(n),O&&(O.c(),O.m(h,null)))},i(E){v||(u&&A(u.$$.fragment,E),v=!0)},o(E){u&&L(u.$$.fragment,E),v=!1},d(E){E&&k(e),E&&k(a),y(),u&&j(u,E),E&&k(d),E&&k(h),O.d()}}}function ud(n,e){let t,i,s,l,o,r,a,u;function f(h,g){return g&1&&(l=null),l==null&&(l=!!Ii(h[0][h[13]])),l?tC:eC}let c=f(e,-1),d=c(e);return r=new Ne({props:{class:"form-field rule-field m-0 "+(Ii(e[0][e[13]])?"disabled":""),name:e[13],$$slots:{default:[sC,({uniqueId:h})=>({17:h}),({Line truncated
|
||||
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
|
||||
</a>.`,s=D(),l=_("span"),r=N(o),a=D(),b&&b.c(),u=D(),c.c(),d=Ue(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w(S,u,T),$[f].m(S,T),w(S,d,T),h=!0,g||(v=J(l,"click",n[7]),g=!0)},p(S,[T]){(!h||T&4)&&o!==(o=S[2]?"Hide available fields":"Show available fields")&&ue(r,o),S[2]?b?(b.p(S,T),T&4&&A(b,1)):(b=rd(S),b.c(),A(b,1),b.m(e,null)):b&&(Ae(),L(b,1,1,()=>{b=null}),Pe());let M=f;f=C(S),f===M?$[f].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),c=$[f],c?c.p(S,T):(c=$[f]=y[f](S),c.c()),A(c,1),c.m(d.parentNode,d))},i(S){h||(A(b),A(c),h=!0)},o(S){L(b),L(c),h=!1},d(S){S&&k(e),b&&b.d(),S&&k(u),$[f].d(S),S&&k(d),g=!1,v()}}}function Ii(n){return n===null}function oC(n,e,t){let{collection:i=new dn}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Pi(()=>import("./FilterAutocompleteInput.32676e11.js"),["FilterAutocompleteInput.32676e11.js","index.a9121ab1.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Nn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await Zn(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){me[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class rC extends Ee{constructor(e){super(),Oe(this,e,oC,lC,De,{collection:0})}}function fd(n,e,t){const i=n.slice();return i[14]=e[t],i}function cd(n,e,t){const i=n.slice();return i[14]=e[t],i}function dd(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=N(`Renamed collection
|
||||
`),s=_("strong"),o=N(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=N(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(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&ue(o,l),g&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function hd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=N(`Renamed field
|
||||
`),s=_("strong"),o=N(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=N(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(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&ue(o,l),g&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function md(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=N("Removed field "),i=_("span"),l=N(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ue(l,s)},d(r){r&&k(e)}}}function aC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&dd(),g=n[5]&&pd(n),v=n[4],b=[];for(let C=0;C<v.length;C+=1)b[C]=hd(cd(n,v,C));let y=n[3],$=[];for(let C=0;C<y.length;C+=1)$[C]=md(fd(n,y,C));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
|
||||
update it manually!`,o=D(),h&&h.c(),r=D(),a=_("h6"),a.textContent="Changes:",u=D(),f=_("ul"),g&&g.c(),c=D();for(let C=0;C<b.length;C+=1)b[C].c();d=D();for(let C=0;C<$.length;C+=1)$[C].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(C,S){w(C,e,S),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),h&&h.m(s,null),w(C,r,S),w(C,a,S),w(C,u,S),w(C,f,S),g&&g.m(f,null),m(f,c);for(let T=0;T<b.length;T+=1)b[T].m(f,null);m(f,d);for(let T=0;T<$.length;T+=1)$[T].m(f,null)},p(C,S){if(C[3].length?h||(h=dd(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),C[5]?g?g.p(C,S):(g=pd(C),g.c(),g.m(f,c)):g&&(g.d(1),g=null),S&16){v=C[4];let T;for(T=0;T<v.length;T+=1){const M=cd(C,v,T);b[T]?b[T].p(M,S):(b[T]=hd(M),b[T].c(),b[T].m(f,d))}for(;T<b.length;T+=1)b[T].d(1);b.length=v.length}if(S&8){y=C[3];let T;for(T=0;T<y.length;T+=1){const M=fd(C,y,T);$[T]?$[T].p(M,S):($[T]=md(M),$[T].c(),$[T].m(f,null))}for(;T<$.length;T+=1)$[T].d(1);$.length=y.length}},d(C){C&&k(e),h&&h.d(),C&&k(r),C&&k(a),C&&k(u),C&&k(f),g&&g.d(),nn(b,C),nn($,C)}}}function uC(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function fC(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[J(e,"click",n[8]),J(i,"click",n[9])],s=!0)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Ye(l)}}}function cC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[fC],header:[uC],default:[aC]},$$scope:{ctx:n}};return e=new ui({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function dC(n,e,t){let i,s,l;const o=Qt();let r,a;async function u(y){t(1,a=y),await Zn(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){me[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){xe.call(this,n,y)}function b(y){xe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class pC extends Ee{constructor(e){super(),Oe(this,e,dC,cC,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function gd(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new rC({props:o}),me.push(()=>Re(t,"collection",l)),{c(){e=_("div"),q(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),j(t)}}}function hC(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new Z3({props:a}),me.push(()=>Re(i,"collection",r));let u=n[9]===wl&&gd(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),l=D(),u&&u.c(),p(t,"class","tab-item"),ne(t,"active",n[9]===rs),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),H(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),(!o||c[0]&512)&&ne(t,"active",f[9]===rs),f[9]===wl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=gd(f),u.c(),A(u,1),u.m(e,null)):u&&(Ae(),L(u,1,1,()=>{u=null}),Pe())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){L(i.$$.fragment,f),L(u),o=!1},d(f){f&&k(e),j(i),u&&u.d()}}}function _d(n){let e,t,i,s,l,o,r;return o=new Ti({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[mC]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=D(),i=_("button"),s=_("i"),l=D(),q(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),j(o)}}}function mC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[20]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function bd(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function gC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&bd();return{c(){e=_("label"),t=N("Name"),s=D(),l=_("input"),u=D(),h&&h.c(),f=Ue(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=J(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=bd(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function vd(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=We(t=yt.call(null,e,n[12])),l=!0)},p(r,a){t&&Jn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=nt(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=nt(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function yd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(yt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=nt(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=nt(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function _C(n){var F,V,X,te,Z,ee;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!B.isEmpty((F=n[4])==null?void 0:F.schema),b,y,$,C,S=!B.isEmpty((V=n[4])==null?void 0:V.listRule)||!B.isEmpty((X=n[4])==null?void 0:X.viewRule)||!B.isEmpty((te=n[4])==null?void 0:te.createRule)||!B.isEmpty((Z=n[4])==null?void 0:Z.updateRule)||!B.isEmpty((ee=n[4])==null?void 0:ee.deleteRule),T,M,O,E=!n[2].isNew&&!n[2].system&&_d(n);r=new Ne({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[gC,({uniqueId:U})=>({38:U}),({uniqueId:U})=>[0,U?128:0]]},$$scope:{ctx:n}}});let P=v&&vd(n),I=S&&yd();return{c(){e=_("h4"),i=N(t),s=D(),E&&E.c(),l=D(),o=_("form"),q(r.$$.fragment),a=D(),u=_("input"),f=D(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=D(),P&&P.c(),b=D(),y=_("button"),$=_("span"),$.textContent="API Rules",C=D(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ne(d,"active",n[9]===rs),p($,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ne(y,"active",n[9]===wl),p(c,"class","tabs-header stretched")},m(U,Y){w(U,e,Y),m(e,i),w(U,s,Y),E&&E.m(U,Y),w(U,l,Y),w(U,o,Y),H(r,o,null),m(o,a),m(o,u),w(U,f,Y),w(U,c,Y),m(c,d),m(d,h),m(d,g),P&&P.m(d,null),m(c,b),m(c,y),m(y,$),m(y,C),I&&I.m(y,null),T=!0,M||(O=[J(o,"submit",Yt(n[22])),J(d,"click",n[23]),J(y,"click",n[24])],M=!0)},p(U,Y){var de,x,ve,_e,ge,K;(!T||Y[0]&4)&&t!==(t=U[2].isNew?"New collection":"Edit collection")&&ue(i,t),!U[2].isNew&&!U[2].system?E?(E.p(U,Y),Y[0]&4&&A(E,1)):(E=_d(U),E.c(),A(E,1),E.m(l.parentNode,l)):E&&(Ae(),L(E,1,1,()=>{E=null}),Pe());const G={};Y[0]&2048&&(G.class="form-field required m-b-0 "+(U[11]?"disabled":"")),Y[0]&2052|Y[1]&384&&(G.$$scope={dirty:Y,ctx:U}),r.$set(G),Y[0]&16&&(v=!B.isEmpty((de=U[4])==null?void 0:de.schema)),v?P?(P.p(U,Y),Y[0]&16&&A(P,1)):(P=vd(U),P.c(),A(P,1),P.m(d,null)):P&&(Ae(),L(P,1,1,()=>{P=null}),Pe()),(!T||Y[0]&512)&&ne(d,"active",U[9]===rs),Y[0]&16&&(S=!B.isEmpty((x=U[4])==null?void 0:x.listRule)||!B.isEmpty((ve=U[4])==null?void 0:ve.viewRule)||!B.isEmpty((_e=U[4])==null?void 0:_e.createRule)||!B.isEmpty((ge=U[4])==null?void 0:ge.updateRule)||!B.isEmpty((K=U[4])==null?void 0:K.deleteRule)),S?I?Y[0]&16&&A(I,1):(I=yd(),I.c(),A(I,1),I.m(y,null)):I&&(Ae(),L(I,1,1,()=>{I=null}),Pe()),(!T||Y[0]&512)&&ne(y,"active",U[9]===wl)},i(U){T||(A(E),A(r.$$.fragment,U),A(P),A(I),T=!0)},o(U){L(E),L(r.$$.fragment,U),L(P),L(I),T=!1},d(U){U&&k(e),U&&k(s),E&&E.d(U),U&&k(l),U&&k(o),j(r),U&&k(f),U&&k(c),P&&P.d(),I&&I.d(),M=!1,Ye(O)}}}function bC(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),r=N(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ne(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=[J(e,"click",n[18]),J(s,"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){w(l,e,o),m(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:se,d(l){l&&k(e),i=!1,s()}}}function $C(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,v,b,y,$,C,S=n[3];const T=P=>P[14].id;for(let P=0;P<S.length;P+=1){let I=kd(n,S,P),F=T(I);h.set(F,d[P]=Sd(F,I))}let M=null;S.length||(M=wd(n));let O=!n[6]&&Cd(n),E={};return b=new nu({props:E}),n[13](b),{c(){e=_("aside"),t=_("header"),i=_("div"),s=_("div"),l=_("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=_("input"),a=D(),u=_("hr"),f=D(),c=_("div");for(let P=0;P<d.length;P+=1)d[P].c();M&&M.c(),g=D(),O&&O.c(),v=D(),q(b.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ne(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"),ne(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(e,"class","page-sidebar collection-sidebar")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Me(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let F=0;F<d.length;F+=1)d[F].m(c,null);M&&M.m(c,null),m(e,g),O&&O.m(e,null),w(P,v,I),H(b,P,I),y=!0,$||(C=[J(l,"click",n[9]),J(r,"input",n[10])],$=!0)},p(P,[I]){(!y||I&16)&&ne(l,"hidden",!P[4]),I&1&&r.value!==P[0]&&Me(r,P[0]),(!y||I&16)&&ne(i,"active",P[4]),I&170&&(S=P[3],d=ct(d,I,T,1,P,S,h,c,pn,Sd,null,kd),!S.length&&M?M.p(P,I):S.length?M&&(M.d(1),M=null):(M=wd(P),M.c(),M.m(c,null))),P[6]?O&&(O.d(1),O=null):O?O.p(P,I):(O=Cd(P),O.c(),O.m(e,null));const F={};b.$set(F)},i(P){y||(A(b.$$.fragment,P),y=!0)},o(P){L(b.$$.fragment,P),y=!1},d(P){P&&k(e);for(let I=0;I<d.length;I+=1)d[I].d();M&&M.d(),O&&O.d(),P&&k(v),n[13](null),j(b,P),$=!1,Ye(C)}}}function SC(n,e,t){let i,s,l,o,r,a;rt(n,hi,y=>t(5,o=y)),rt(n,Ps,y=>t(8,r=y)),rt(n,us,y=>t(6,a=y));let u,f="";function c(y){tn(hi,o=y,o)}const d=()=>t(0,f="");function h(){f=this.value,t(0,f)}const g=y=>c(y),v=()=>u==null?void 0:u.show();function b(y){me[y?"unshift":"push"](()=>{u=y,t(2,u)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=f.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=f!==""),n.$$.dirty&259&&t(3,l=r.filter(y=>y.name!="profiles"&&(y.id==f||y.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[f,i,u,l,s,o,a,c,r,d,h,g,v,b]}class CC extends Ee{constructor(e){super(),Oe(this,e,SC,$C,De,{})}}function MC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x,ve,_e,ge,K,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
|
||||
<code><span class="txt-success">OPERAND</span>
|
||||
<span class="txt-danger">OPERATOR</span>
|
||||
<span class="txt-success">OPERAND</span></code>, where:`,t=D(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
|
||||
quoted), number, null, true, false`,l=D(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=N(` - is one of:
|
||||
`),u=_("br"),f=D(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=D(),v=_("span"),v.textContent="Equal",b=D(),y=_("li"),$=_("code"),$.textContent="!=",C=D(),S=_("span"),S.textContent="NOT equal",T=D(),M=_("li"),O=_("code"),O.textContent=">",E=D(),P=_("span"),P.textContent="Greater than",I=D(),F=_("li"),V=_("code"),V.textContent=">=",X=D(),te=_("span"),te.textContent="Greater than or equal",Z=D(),ee=_("li"),U=_("code"),U.textContent="<",Y=D(),G=_("span"),G.textContent="Less than or equal",de=D(),x=_("li"),ve=_("code"),ve.textContent="<=",_e=D(),ge=_("span"),ge.textContent="Less than or equal",K=D(),ye=_("li"),oe=_("code"),oe.textContent="~",W=D(),ce=_("span"),ce.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||||
match)`,ae=D(),Se=_("li"),Q=_("code"),Q.textContent="!~",$e=D(),Be=_("span"),Be.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,Xe=D(),ut=_("p"),ut.innerHTML=`To group and combine several expressions you could use brackets
|
||||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p($,"class","filter-op svelte-1w7s5nw"),p(S,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(P,"class","txt-hint"),p(V,"class","filter-op svelte-1w7s5nw"),p(te,"class","txt-hint"),p(U,"class","filter-op svelte-1w7s5nw"),p(G,"class","txt-hint"),p(ve,"class","filter-op svelte-1w7s5nw"),p(ge,"class","txt-hint"),p(oe,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint"),p(Q,"class","filter-op svelte-1w7s5nw"),p(Be,"class","txt-hint")},m(it,Je){w(it,e,Je),w(it,t,Je),w(it,i,Je),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,h),m(d,g),m(d,v),m(c,b),m(c,y),m(y,$),m(y,C),m(y,S),m(c,T),m(c,M),m(M,O),m(M,E),m(M,P),m(c,I),m(c,F),m(F,V),m(F,X),m(F,te),m(c,Z),m(c,ee),m(ee,U),m(ee,Y),m(ee,G),m(c,de),m(c,x),m(x,ve),m(x,_e),m(x,ge),m(c,K),m(c,ye),m(ye,oe),m(ye,W),m(ye,ce),m(c,ae),m(c,Se),m(Se,Q),m(Se,$e),m(Se,Be),w(it,Xe,Je),w(it,ut,Je)},p:se,i:se,o:se,d(it){it&&k(e),it&&k(t),it&&k(i),it&&k(Xe),it&&k(ut)}}}class TC extends Ee{constructor(e){super(),Oe(this,e,null,MC,De,{})}}function Md(n,e,t){const i=n.slice();return i[5]=e[t],i}function Td(n,e,t){const i=n.slice();return i[5]=e[t],i}function Dd(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=N(s),o=D(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ne(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=J(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&ne(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function Od(n,e){let t,i,s,l;return i=new bn({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item svelte-1maocj6"),ne(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),(!l||r&3)&&ne(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function DC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;g<f.length;g+=1){let v=Td(n,f,g),b=c(v);s.set(b,i[g]=Dd(b,v))}let d=n[1];const h=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=Md(n,d,g),b=h(v);a.set(b,r[g]=Od(b,v))}return{c(){e=_("div"),t=_("div");for(let g=0;g<i.length;g+=1)i[g].c();l=D(),o=_("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact left"),p(o,"class","tabs-content"),p(e,"class","tabs sdk-tabs m-b-lg svelte-1maocj6")},m(g,v){w(g,e,v),m(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);m(e,l),m(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=ct(i,v,c,1,g,f,s,t,pn,Dd,null,Td)),v&3&&(d=g[1],Ae(),r=ct(r,v,h,1,g,d,a,o,Ut,Od,null,Md),Pe())},i(g){if(!u){for(let v=0;v<d.length;v+=1)A(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)L(r[v]);u=!1},d(g){g&&k(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const Ed="pb_sdk_preference";function OC(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(Ed)||"javascript";const r=a=>t(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(Ed,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class js extends Ee{constructor(e){super(),Oe(this,e,OC,DC,De,{js:2,dart:3})}}function Ad(n,e,t){const i=n.slice();return i[6]=e[t],i}function Pd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ld(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Id(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("div"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Nd(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,(!l||r&20)&&ne(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function EC(n){var gi,Il,ms,Nl;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",$,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x,ve,_e,ge,K,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut,it,Je,et,Te,Ve,Ze,tt,dt,be,Fe,pt,Dt,ht,st,Lt,_t,Ft,Ot,Ke,Ce,ze,lt,ot,Ht,Ct,ft,xt,R,z,ie,re=[],Le=new Map,le,pe,ke=[Line truncated
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
const resultList = await client.records.getList('${(gi=n[0])==null?void 0:gi.name}', 1, 50, {
|
||||
filter: 'created >= "2022-01-01 00:00:00"',
|
||||
});
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
const records = await client.records.getFullList('${(Il=n[0])==null?void 0:Il.name}', 200 /* batch size */, {
|
||||
sort: '-created',
|
||||
});
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
final result = await client.records.getList(
|
||||
'${(ms=n[0])==null?void 0:ms.name}',
|
||||
page: 1,
|
||||
perPage: 50,
|
||||
filter: 'created >= "2022-01-01 00:00:00"',
|
||||
);
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
final records = await client.records.getFullList('${(Nl=n[0])==null?void 0:Nl.name}', batch: 200, sort: '-created');
|
||||
`}}),Q=new bn({props:{content:`
|
||||
// DESC by created and ASC by id
|
||||
?sort=-created,id
|
||||
`}}),Ve=new bn({props:{content:`
|
||||
?filter=(id='abc' && created>'2022-01-01')
|
||||
`}}),tt=new TC({}),_t=new bn({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let gt=n[4];const un=je=>je[6].code;for(let je=0;je<gt.length;je+=1){let Qe=Pd(n,gt,je),Gt=un(Qe);Le.set(Gt,re[je]=Id(Gt,Qe))}let jt=n[4];const Di=je=>je[6].code;for(let je=0;je<jt.length;je+=1){let Qe=Ad(n,jt,je),Gt=Di(Qe);fe.set(Gt,ke[je]=Nd(Gt,Qe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=D(),Ie&&Ie.c(),d=D(),h=_("div"),g=_("p"),v=N("Fetch a paginated "),b=_("strong"),$=N(y),C=N(" records list."),S=D(),T=_("div"),T.textContent="Client SDKs example",M=D(),q(O.$$.fragment),E=D(),P=_("div"),P.textContent="Query parameters",I=D(),F=_("table"),V=_("thead"),V.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,X=D(),te=_("tbody"),Z=_("tr"),Z.innerHTML=`<td>page</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,ee=D(),U=_("tr"),U.innerHTML=`<td>perPage</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>Specify the max returned records per page (default to 30).</td>`,Y=D(),G=_("tr"),de=_("td"),de.textContent="sort",x=D(),ve=_("td"),ve.innerHTML='<span class="label">String</span>',_e=D(),ge=_("td"),K=N("Specify the records order attribute(s). "),ye=_("br"),oe=N(`
|
||||
Add `),W=_("code"),W.textContent="-",ce=N(" / "),ae=_("code"),ae.textContent="+",Se=N(` (default) in front of the attribute for DESC / ASC order.
|
||||
Ex.:
|
||||
`),q(Q.$$.fragment),$e=D(),Be=_("tr"),Xe=_("td"),Xe.textContent="filter",ut=D(),it=_("td"),it.innerHTML='<span class="label">String</span>',Je=D(),et=_("td"),Te=N(`Filter the returned records. Ex.:
|
||||
`),q(Ve.$$.fragment),Ze=D(),q(tt.$$.fragment),dt=D(),be=_("tr"),Fe=_("td"),Fe.textContent="expand",pt=D(),Dt=_("td"),Dt.innerHTML='<span class="label">String</span>',ht=D(),st=_("td"),Lt=N(`Auto expand record relations. Ex.:
|
||||
`),q(_t.$$.fragment),Ft=N(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Ot=_("br"),Ke=N(`
|
||||
The expanded relations will be appended to each individual record under the
|
||||
`),Ce=_("code"),Ce.textContent="@expand",ze=N(" property (eg. "),lt=_("code"),lt.textContent='"@expand": {"rel1": {...}, ...}',ot=N(`). Only the
|
||||
relations that the user has permissions to `),Ht=_("strong"),Ht.textContent="view",Ct=N(" will be expanded."),ft=D(),xt=_("div"),xt.textContent="Responses",R=D(),z=_("div"),ie=_("div");for(let je=0;je<re.length;je+=1)re[je].c();le=D(),pe=_("div");for(let je=0;je<ke.length;je+=1)ke[je].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","section-title"),p(F,"class","table-compact table-border m-b-lg"),p(xt,"class","section-title"),p(ie,"class","tabs-header compact left"),p(pe,"class","tabs-content"),p(z,"class","tabs")},m(je,Qe){w(je,e,Qe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Ie&&Ie.m(e,null),w(je,d,Qe),w(je,h,Qe),m(h,g),m(g,v),m(g,b),m(b,$),m(g,C),w(je,S,Qe),w(je,T,Qe),w(je,M,Qe),H(O,je,Qe),w(je,E,Qe),w(je,P,Qe),w(je,I,Qe),w(je,F,Qe),m(F,V),m(F,X),m(F,te),m(te,Z),m(te,ee),m(te,U),m(te,Y),m(te,G),m(G,de),m(G,x),m(G,ve),m(G,_e),m(G,ge),m(ge,K),m(ge,ye),m(ge,oe),m(ge,W),m(ge,ce),m(ge,ae),m(ge,Se),H(Q,ge,null),m(te,$e),m(te,Be),m(Be,Xe),m(Be,ut),m(Be,it),m(Be,Je),m(Be,et),m(et,Te),H(Ve,et,null),m(et,Ze),H(tt,et,null),m(te,dt),m(te,be),m(be,Fe),m(be,pt),m(be,Dt),m(be,ht),m(be,st),m(st,Lt),H(_t,st,null),m(st,Ft),m(st,Ot),m(st,Ke),m(st,Ce),m(st,ze),m(st,lt),m(st,ot),m(st,Ht),m(st,Ct),w(je,ft,Qe),w(je,xt,Qe),w(je,R,Qe),w(je,z,Qe),m(z,ie);for(let Gt=0;Gt<re.length;Gt+=1)re[Gt].m(ie,null);m(z,le),m(z,pe);for(let Gt=0;Gt<ke.length;Gt+=1)ke[Gt].m(pe,null);he=!0},p(je,[Qe]){var Fl,Rl,Hl,jl;(!he||Qe&1)&&a!==(a=je[0].name+"")&&ue(u,a),je[1]?Ie||(Ie=Ld(),Ie.c(),Ie.m(e,null)):Ie&&(Ie.d(1),Ie=null),(!he||Qe&1)&&y!==(y=je[0].name+"")&&ue($,y);const Gt={};Qe&9&&(Gt.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${je[3]}');
|
||||
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
const resultList = await client.records.getList('${(Fl=je[0])==null?void 0:Fl.name}', 1, 50, {
|
||||
filter: 'created >= "2022-01-01 00:00:00"',
|
||||
});
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
const records = await client.records.getFullList('${(Rl=je[0])==null?void 0:Rl.name}', 200 /* batch size */, {
|
||||
sort: '-created',
|
||||
});
|
||||
`),Qe&9&&(Gt.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${je[3]}');
|
||||
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
final result = await client.records.getList(
|
||||
'${(Hl=je[0])==null?void 0:Hl.name}',
|
||||
page: 1,
|
||||
perPage: 50,
|
||||
filter: 'created >= "2022-01-01 00:00:00"',
|
||||
);
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
final records = await client.records.getFullList('${(jl=je[0])==null?void 0:jl.name}', batch: 200, sort: '-created');
|
||||
`),O.$set(Gt),Qe&20&&(gt=je[4],re=ct(re,Qe,un,1,je,gt,Le,ie,pn,Id,null,Pd)),Qe&20&&(jt=je[4],Ae(),ke=ct(ke,Qe,Di,1,je,jt,fe,pe,Ut,Nd,null,Ad),Pe())},i(je){if(!he){A(O.$$.fragment,je),A(Q.$$.fragment,je),A(Ve.$$.fragment,je),A(tt.$$.fragment,je),A(_t.$$.fragment,je);for(let Qe=0;Qe<jt.length;Qe+=1)A(ke[Qe]);he=!0}},o(je){L(O.$$.fragment,je),L(Q.$$.fragment,je),L(Ve.$$.fragment,je),L(tt.$$.fragment,je),L(_t.$$.fragment,je);for(let Qe=0;Qe<ke.length;Qe+=1)L(ke[Qe]);he=!1},d(je){je&&k(e),Ie&&Ie.d(),je&&k(d),je&&k(h),je&&k(S),je&&k(T),je&&k(M),j(O,je),je&&k(E),je&&k(P),je&&k(I),je&&k(F),j(Q),j(Ve),j(tt),j(_t),je&&k(ft),je&&k(xt),je&&k(R),je&&k(z);for(let Qe=0;Qe<re.length;Qe+=1)re[Qe].d();for(let Qe=0;Qe<ke.length;Qe+=1)ke[Qe].d()}}}function AC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[B.dummyCollectionRecord(l),B.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Something went wrong while processing your request. Invalid filter.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}))},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class PC extends Ee{constructor(e){super(),Oe(this,e,AC,EC,De,{collection:0})}}function Fd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function jd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function qd(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,(!l||r&20)&&ne(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function LC(n){var Ot,Ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x,ve,_e,ge,K,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut,it,Je,et,Te,Ve,Ze=[],tt=new Map,dt,be,Fe=[],pt=new Map,Dt,ht=n[1]&&Hd();E=new js({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
const record = await client.records.getOne('${(Ot=n[0])==null?void 0:Ot.name}', 'RECORD_ID', {
|
||||
expand: 'some_relation'
|
||||
});
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
final record = await client.records.getOne('${(Ke=n[0])==null?void 0:Ke.name}', 'RECORD_ID', query: {
|
||||
'expand': 'some_relation',
|
||||
});
|
||||
`}}),oe=new bn({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let st=n[4];const Lt=Ce=>Ce[6].code;for(let Ce=0;Ce<st.length;Ce+=1){let ze=Rd(n,st,Ce),lt=Lt(ze);tt.set(lt,Ze[Ce]=jd(lt,ze))}let _t=n[4];const Ft=Ce=>Ce[6].code;for(let Ce=0;Ce<_t.length;Ce+=1){let ze=Fd(n,_t,Ce),lt=Ft(ze);pt.set(lt,Fe[Ce]=qd(lt,ze))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),ht&&ht.c(),h=D(),g=_("div"),v=_("p"),b=N("Fetch a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("div"),M.textContent="Client SDKs example",O=D(),q(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path Parameters",F=D(),V=_("table"),V.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to view.</td></tr></tbody>`,X=D(),te=_("div"),te.textContent="Query parameters",Z=D(),ee=_("table"),U=_("thead"),U.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,Y=D(),G=_("tbody"),de=_("tr"),x=_("td"),x.textContent="expand",ve=D(),_e=_("td"),_e.innerHTML='<span class="label">String</span>',ge=D(),K=_("td"),ye=N(`Auto expand record relations. Ex.:
|
||||
`),q(oe.$$.fragment),W=N(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),ce=_("br"),ae=N(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),Se=_("code"),Se.textContent="@expand",Q=N(" property (eg. "),$e=_("code"),$e.textContent='"@expand": {"rel1": {...}, ...}',Be=N(`). Only the
|
||||
relations that the user has permissions to `),Xe=_("strong"),Xe.textContent="view",ut=N(" will be expanded."),it=D(),Je=_("div"),Je.textContent="Responses",et=D(),Te=_("div"),Ve=_("div");for(let Ce=0;Ce<Ze.length;Ce+=1)Ze[Ce].c();dt=D(),be=_("div");for(let Ce=0;Ce<Fe.length;Ce+=1)Fe[Ce].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(M,"class","section-title"),p(I,"class","section-title"),p(V,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(ee,"class","table-compact table-border m-b-lg"),p(Je,"class","section-title"),p(Ve,"class","tabs-header compact left"),p(be,"class","tabs-content"),p(Te,"class","tabs")},m(Ce,ze){w(Ce,e,ze),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),ht&&ht.m(e,null),w(Ce,h,ze),w(Ce,g,ze),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),w(Ce,T,ze),w(Ce,M,ze),w(Ce,O,ze),H(E,Ce,ze),w(Ce,P,ze),w(Ce,I,ze),w(Ce,F,ze),w(Ce,V,ze),w(Ce,X,ze),w(Ce,te,ze),w(Ce,Z,ze),w(Ce,ee,ze),m(ee,U),m(ee,Y),m(ee,G),m(G,de),m(de,x),m(de,ve),m(de,_e),m(de,ge),m(de,K),m(K,ye),H(oe,K,null),m(K,W),m(K,ce),m(K,ae),m(K,Se),m(K,Q),m(K,$e),m(K,Be),m(K,Xe),m(K,ut),w(Ce,it,ze),w(Ce,Je,ze),w(Ce,et,ze),w(Ce,Te,ze),m(Te,Ve);for(let lt=0;lt<Ze.length;lt+=1)Ze[lt].m(Ve,null);m(Te,dt),m(Te,be);for(let lt=0;lt<Fe.length;lt+=1)Fe[lt].m(be,null);Dt=!0},p(Ce,[ze]){var ot,Ht;(!Dt||ze&1)&&a!==(a=Ce[0].name+"")&&ue(u,a),Ce[1]?ht||(ht=Hd(),ht.c(),ht.m(e,null)):ht&&(ht.d(1),ht=null),(!Dt||ze&1)&&$!==($=Ce[0].name+"")&&ue(C,$);const lt={};ze&9&&(lt.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${Ce[3]}');
|
||||
|
||||
...
|
||||
|
||||
const record = await client.records.getOne('${(ot=Ce[0])==null?void 0:ot.name}', 'RECORD_ID', {
|
||||
expand: 'some_relation'
|
||||
});
|
||||
`),ze&9&&(lt.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${Ce[3]}');
|
||||
|
||||
...
|
||||
|
||||
final record = await client.records.getOne('${(Ht=Ce[0])==null?void 0:Ht.name}', 'RECORD_ID', query: {
|
||||
'expand': 'some_relation',
|
||||
});
|
||||
`),E.$set(lt),ze&20&&(st=Ce[4],Ze=ct(Ze,ze,Lt,1,Ce,st,tt,Ve,pn,jd,null,Rd)),ze&20&&(_t=Ce[4],Ae(),Fe=ct(Fe,ze,Ft,1,Ce,_t,pt,be,Ut,qd,null,Fd),Pe())},i(Ce){if(!Dt){A(E.$$.fragment,Ce),A(oe.$$.fragment,Ce);for(let ze=0;ze<_t.length;ze+=1)A(Fe[ze]);Dt=!0}},o(Ce){L(E.$$.fragment,Ce),L(oe.$$.fragment,Ce);for(let ze=0;ze<Fe.length;ze+=1)L(Fe[ze]);Dt=!1},d(Ce){Ce&&k(e),ht&&ht.d(),Ce&&k(h),Ce&&k(g),Ce&&k(T),Ce&&k(M),Ce&&k(O),j(E,Ce),Ce&&k(P),Ce&&k(I),Ce&&k(F),Ce&&k(V),Ce&&k(X),Ce&&k(te),Ce&&k(Z),Ce&&k(ee),j(oe),Ce&&k(it),Ce&&k(Je),Ce&&k(et),Ce&&k(Te);for(let ze=0;ze<Ze.length;ze+=1)Ze[ze].d();for(let ze=0;ze<Fe.length;ze+=1)Fe[ze].d()}}}function IC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}))},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class NC extends Ee{constructor(e){super(),Oe(this,e,IC,LC,De,{collection:0})}}function Vd(n,e,t){const i=n.slice();return i[6]=e[t],i}function zd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Bd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ud(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function FC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function RC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function HC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function jC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function qC(n){let e,t,i,s,l;return{c(){e=N("File object."),t=_("br"),i=N(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function VC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function zC(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function BC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function UC(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function WC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Wd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=B.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?RC:FC}let $=y(e),C=$(e);function S(O,E){if(O[11].type==="text")return WC;if(O[11].type==="number")return UC;if(O[11].type==="json")return BC;if(O[11].type==="email")return zC;if(O[11].type==="url")return VC;if(O[11].type==="file")return qC;if(O[11].type==="relation")return jC;if(O[11].type==="user")return HC}let T=S(e),M=T&&T(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=D(),o=_("span"),a=N(r),u=D(),f=_("td"),c=_("span"),h=N(d),g=D(),v=_("td"),M&&M.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),M&&M.m(v,null),m(t,b)},p(O,E){e=O,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=B.getFieldValueType(e[11])+"")&&ue(h,d),T===(T=S(e))&&M?M.p(e,E):(M&&M.d(1),M=T&&T(e),M&&(M.c(),M.m(v,null)))},d(O){O&&k(t),C.d(),M&&M.d()}}}function Yd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ne(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Kd(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),(!l||r&6)&&ne(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function YC(n){var ie,re,Le;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",$,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x=[],ve=new Map,_e,ge,K,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut,it,Je,et,Te,Ve,Ze,tt,dt,be,Fe,pt,Dt,ht,st,Lt,_t=[],Ft=new Map,Ot,Ke,Ce=[],ze=new Map,lt,ot=n[4]&&Ud();F=new js({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
const data = { ... };
|
||||
|
||||
const record = await client.records.create('${(ie=n[0])==null?void 0:ie.name}', data);
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
final body = <String, dynamic>{ ... };
|
||||
|
||||
final record = await client.records.create('${(re=n[0])==null?void 0:re.name}', body: body);
|
||||
`}});let Ht=(Le=n[0])==null?void 0:Le.schema;const Ct=le=>le[11].name;for(let le=0;le<Ht.length;le+=1){let pe=Bd(n,Ht,le),ke=Ct(pe);ve.set(ke,x[le]=Wd(ke,pe))}it=new bn({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let ft=n[2];const xt=le=>le[6].code;for(let le=0;le<ft.length;le+=1){let pe=zd(n,ft,le),ke=xt(pe);Ft.set(ke,_t[le]=Yd(ke,pe))}let R=n[2];const z=le=>le[6].code;for(let le=0;le<R.length;le+=1){let pe=Vd(n,R,le),ke=z(pe);ze.set(ke,Ce[le]=Kd(ke,pe))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=D(),ot&&ot.c(),d=D(),h=_("div"),g=_("p"),v=N("Create a new "),b=_("strong"),$=N(y),C=N(" record."),S=D(),T=_("p"),T.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,M=D(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=D(),P=_("div"),P.textContent="Client SDKs example",I=D(),q(F.$$.fragment),V=D(),X=_("div"),X.textContent="Body Parameters",te=D(),Z=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,U=D(),Y=_("tbody"),G=_("tr"),G.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
|
||||
<span>id</span></div></td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td><strong>15 characters string</strong> to store as record ID.
|
||||
<br/>
|
||||
If not set, it will be auto generated.</td>`,de=D();for(let le=0;le<x.length;le+=1)x[le].c();_e=D(),ge=_("div"),ge.textContent="Query parameters",K=D(),ye=_("table"),oe=_("thead"),oe.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,W=D(),ce=_("tbody"),ae=_("tr"),Se=_("td"),Se.textContent="expand",Q=D(),$e=_("td"),$e.innerHTML='<span class="label">String</span>',Be=D(),Xe=_("td"),ut=N(`Auto expand relations when returning the created record. Ex.:
|
||||
`),q(it.$$.fragment),Je=N(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),et=_("br"),Te=N(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),Ve=_("code"),Ve.textContent="@expand",Ze=N(" property (eg. "),tt=_("code"),tt.textContent='"@expand": {"rel1": {...}, ...}',dt=N(`). Only the
|
||||
relations that the user has permissions to `),be=_("strong"),be.textContent="view",Fe=N(" will be expanded."),pt=D(),Dt=_("div"),Dt.textContent="Responses",ht=D(),st=_("div"),Lt=_("div");for(let le=0;le<_t.length;le+=1)_t[le].c();Ot=D(),Ke=_("div");for(let le=0;le<Ce.length;le+=1)Ce[le].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(P,"class","section-title"),p(X,"class","section-title"),p(Z,"class","table-compact table-border m-b-lg"),p(ge,"class","section-title"),p(ye,"class","table-compact table-border m-b-lg"),p(Dt,"class","section-title"),p(Lt,"class","tabs-header compact left"),p(Ke,"class","tabs-content"),p(st,"class","tabs")},m(le,pe){w(le,e,pe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),ot&&ot.m(e,null),w(le,d,pe),w(le,h,pe),m(h,g),m(g,v),m(g,b),m(b,$),m(g,C),m(h,S),m(h,T),m(h,M),m(h,O),w(le,E,pe),w(le,P,pe),w(le,I,pe),H(F,le,pe),w(le,V,pe),w(le,X,pe),w(le,te,pe),w(le,Z,pe),m(Z,ee),m(Z,U),m(Z,Y),m(Y,G),m(Y,de);for(let ke=0;ke<x.length;ke+=1)x[ke].m(Y,null);w(le,_e,pe),w(le,ge,pe),w(le,K,pe),w(le,ye,pe),m(ye,oe),m(ye,W),m(ye,ce),m(ce,ae),m(ae,Se),m(ae,Q),m(ae,$e),m(ae,Be),m(ae,Xe),m(Xe,ut),H(it,Xe,null),m(Xe,Je),m(Xe,et),m(Xe,Te),m(Xe,Ve),m(Xe,Ze),m(Xe,tt),m(Xe,dt),m(Xe,be),m(Xe,Fe),w(le,pt,pe),w(le,Dt,pe),w(le,ht,pe),w(le,st,pe),m(st,Lt);for(let ke=0;ke<_t.length;ke+=1)_t[ke].m(Lt,null);m(st,Ot),m(st,Ke);for(let ke=0;ke<Ce.length;ke+=1)Ce[ke].m(Ke,null);lt=!0},p(le,[pe]){var fe,he,Ie;(!lt||pe&1)&&a!==(a=le[0].name+"")&&ue(u,a),le[4]?ot||(ot=Ud(),ot.c(),ot.m(e,null)):ot&&(ot.d(1),ot=null),(!lt||pe&1)&&y!==(y=le[0].name+"")&&ue($,y);const ke={};pe&9&&(ke.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${le[3]}');
|
||||
|
||||
...
|
||||
|
||||
const data = { ... };
|
||||
|
||||
const record = await client.records.create('${(fe=le[0])==null?void 0:fe.name}', data);
|
||||
`),pe&9&&(ke.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${le[3]}');
|
||||
|
||||
...
|
||||
|
||||
final body = <String, dynamic>{ ... };
|
||||
|
||||
final record = await client.records.create('${(he=le[0])==null?void 0:he.name}', body: body);
|
||||
`),F.$set(ke),pe&1&&(Ht=(Ie=le[0])==null?void 0:Ie.schema,x=ct(x,pe,Ct,1,le,Ht,ve,Y,pn,Wd,null,Bd)),pe&6&&(ft=le[2],_t=ct(_t,pe,xt,1,le,ft,Ft,Lt,pn,Yd,null,zd)),pe&6&&(R=le[2],Ae(),Ce=ct(Ce,pe,z,1,le,R,ze,Ke,Ut,Kd,null,Vd),Pe())},i(le){if(!lt){A(F.$$.fragment,le),A(it.$$.fragment,le);for(let pe=0;pe<R.length;pe+=1)A(Ce[pe]);lt=!0}},o(le){L(F.$$.fragment,le),L(it.$$.fragment,le);for(let pe=0;pe<Ce.length;pe+=1)L(Ce[pe]);lt=!1},d(le){le&&k(e),ot&&ot.d(),le&&k(d),le&&k(h),le&&k(E),le&&k(P),le&&k(I),j(F,le),le&&k(V),le&&k(X),le&&k(te),le&&k(Z);for(let pe=0;pe<x.length;pe+=1)x[pe].d();le&&k(_e),le&&k(ge),le&&k(K),le&&k(ye),j(it),le&&k(pt),le&&k(Dt),le&&k(ht),le&&k(st);for(let pe=0;pe<_t.length;pe+=1)_t[pe].d();for(let pe=0;pe<Ce.length;pe+=1)Ce[pe].d()}}}function KC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to create record.",
|
||||
"data": {
|
||||
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`}])},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,o,r,s,i,a]}class JC extends Ee{constructor(e){super(),Oe(this,e,KC,YC,De,{collection:0})}}function Jd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Zd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Xd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ZC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function GC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function XC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function QC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function xC(n){let e,t,i,s,l;return{c(){e=N("File object."),t=_("br"),i=N(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function e4(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function t4(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function n4(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function i4(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function s4(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Qd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=B.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?GC:ZC}let $=y(e),C=$(e);function S(O,E){if(O[11].type==="text")return s4;if(O[11].type==="number")return i4;if(O[11].type==="json")return n4;if(O[11].type==="email")return t4;if(O[11].type==="url")return e4;if(O[11].type==="file")return xC;if(O[11].type==="relation")return QC;if(O[11].type==="user")return XC}let T=S(e),M=T&&T(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=D(),o=_("span"),a=N(r),u=D(),f=_("td"),c=_("span"),h=N(d),g=D(),v=_("td"),M&&M.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),M&&M.m(v,null),m(t,b)},p(O,E){e=O,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=B.getFieldValueType(e[11])+"")&&ue(h,d),T===(T=S(e))&&M?M.p(e,E):(M&&M.d(1),M=T&&T(e),M&&(M.c(),M.m(v,null)))},d(O){O&&k(t),C.d(),M&&M.d()}}}function xd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ne(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function ep(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),(!l||r&6)&&ne(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function l4(n){var le,pe,ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x,ve,_e,ge=[],K=new Map,ye,oe,W,ce,ae,Se,Q,$e,Be,Xe,ut,it,Je,et,Te,Ve,Ze,tt,dt,be,Fe,pt,Dt,ht,st,Lt,_t,Ft,Ot,Ke=[],Ce=new Map,ze,lt,ot=[],Ht=new Map,Ct,ft=n[4]&&Xd();V=new js({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
const data = { ... };
|
||||
|
||||
const record = await client.records.update('${(le=n[0])==null?void 0:le.name}', 'RECORD_ID', data);
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
final body = <String, dynamic>{ ... };
|
||||
|
||||
final record = await client.records.update('${(pe=n[0])==null?void 0:pe.name}', 'RECORD_ID', body: body);
|
||||
`}});let xt=(ke=n[0])==null?void 0:ke.schema;const R=fe=>fe[11].name;for(let fe=0;fe<xt.length;fe+=1){let he=Gd(n,xt,fe),Ie=R(he);K.set(Ie,ge[fe]=Qd(Ie,he))}Te=new bn({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let z=n[2];const ie=fe=>fe[6].code;for(let fe=0;fe<z.length;fe+=1){let he=Zd(n,z,fe),Ie=ie(he);Ce.set(Ie,Ke[fe]=xd(Ie,he))}let re=n[2];const Le=fe=>fe[6].code;for(let fe=0;fe<re.length;fe+=1){let he=Jd(n,re,fe),Ie=Le(he);Ht.set(Ie,ot[fe]=ep(Ie,he))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),ft&&ft.c(),h=D(),g=_("div"),v=_("p"),b=N("Update a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,O=D(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",P=D(),I=_("div"),I.textContent="Client SDKs example",F=D(),q(V.$$.fragment),X=D(),te=_("div"),te.textContent="Path parameters",Z=D(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to update.</td></tr></tbody>`,U=D(),Y=_("div"),Y.textContent="Body Parameters",G=D(),de=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,ve=D(),_e=_("tbody");for(let fe=0;fe<ge.length;fe+=1)ge[fe].c();ye=D(),oe=_("div"),oe.textContent="Query parameters",W=D(),ce=_("table"),ae=_("thead"),ae.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,Se=D(),Q=_("tbody"),$e=_("tr"),Be=_("td"),Be.textContent="expand",Xe=D(),ut=_("td"),ut.innerHTML='<span class="label">String</span>',it=D(),Je=_("td"),et=N(`Auto expand relations when returning the updated record. Ex.:
|
||||
`),q(Te.$$.fragment),Ve=N(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Ze=_("br"),tt=N(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),dt=_("code"),dt.textContent="@expand",be=N(" property (eg. "),Fe=_("code"),Fe.textContent='"@expand": {"rel1": {...}, ...}',pt=N(`). Only the
|
||||
relations that the user has permissions to `),Dt=_("strong"),Dt.textContent="view",ht=N(" will be expanded."),st=D(),Lt=_("div"),Lt.textContent="Responses",_t=D(),Ft=_("div"),Ot=_("div");for(let fe=0;fe<Ke.length;fe+=1)Ke[fe].c();ze=D(),lt=_("div");for(let fe=0;fe<ot.length;fe+=1)ot[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(I,"class","section-title"),p(te,"class","section-title"),p(ee,"class","table-compact table-border m-b-lg"),p(Y,"class","section-title"),p(de,"class","table-compact table-border m-b-lg"),p(oe,"class","section-title"),p(ce,"class","table-compact table-border m-b-lg"),p(Lt,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(lt,"class","tabs-content"),p(Ft,"class","tabs")},m(fe,he){w(fe,e,he),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),ft&&ft.m(e,null),w(fe,h,he),w(fe,g,he),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),m(g,T),m(g,M),m(g,O),m(g,E),w(fe,P,he),w(fe,I,he),w(fe,F,he),H(V,fe,he),w(fe,X,he),w(fe,te,he),w(fe,Z,he),w(fe,ee,he),w(fe,U,he),w(fe,Y,he),w(fe,G,he),w(fe,de,he),m(de,x),m(de,ve),m(de,_e);for(let Ie=0;Ie<ge.length;Ie+=1)ge[Ie].m(_e,null);w(fe,ye,he),w(fe,oe,he),w(fe,W,he),w(fe,ce,he),m(ce,ae),m(ce,Se),m(ce,Q),m(Q,$e),m($e,Be),m($e,Xe),m($e,ut),m($e,it),m($e,Je),m(Je,et),H(Te,Je,null),m(Je,Ve),m(Je,Ze),m(Je,tt),m(Je,dt),m(Je,be),m(Je,Fe),m(Je,pt),m(Je,Dt),m(Je,ht),w(fe,st,he),w(fe,Lt,he),w(fe,_t,he),w(fe,Ft,he),m(Ft,Ot);for(let Ie=0;Ie<Ke.length;Ie+=1)Ke[Ie].m(Ot,null);m(Ft,ze),m(Ft,lt);for(let Ie=0;Ie<ot.length;Ie+=1)ot[Ie].m(lt,null);Ct=!0},p(fe,[he]){var gt,un,jt;(!Ct||he&1)&&a!==(a=fe[0].name+"")&&ue(u,a),fe[4]?ft||(ft=Xd(),ft.c(),ft.m(e,null)):ft&&(ft.d(1),ft=null),(!Ct||he&1)&&$!==($=fe[0].name+"")&&ue(C,$);const Ie={};he&9&&(Ie.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${fe[3]}');
|
||||
|
||||
...
|
||||
|
||||
const data = { ... };
|
||||
|
||||
const record = await client.records.update('${(gt=fe[0])==null?void 0:gt.name}', 'RECORD_ID', data);
|
||||
`),he&9&&(Ie.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${fe[3]}');
|
||||
|
||||
...
|
||||
|
||||
final body = <String, dynamic>{ ... };
|
||||
|
||||
final record = await client.records.update('${(un=fe[0])==null?void 0:un.name}', 'RECORD_ID', body: body);
|
||||
`),V.$set(Ie),he&1&&(xt=(jt=fe[0])==null?void 0:jt.schema,ge=ct(ge,he,R,1,fe,xt,K,_e,pn,Qd,null,Gd)),he&6&&(z=fe[2],Ke=ct(Ke,he,ie,1,fe,z,Ce,Ot,pn,xd,null,Zd)),he&6&&(re=fe[2],Ae(),ot=ct(ot,he,Le,1,fe,re,Ht,lt,Ut,ep,null,Jd),Pe())},i(fe){if(!Ct){A(V.$$.fragment,fe),A(Te.$$.fragment,fe);for(let he=0;he<re.length;he+=1)A(ot[he]);Ct=!0}},o(fe){L(V.$$.fragment,fe),L(Te.$$.fragment,fe);for(let he=0;he<ot.length;he+=1)L(ot[he]);Ct=!1},d(fe){fe&&k(e),ft&&ft.d(),fe&&k(h),fe&&k(g),fe&&k(P),fe&&k(I),fe&&k(F),j(V,fe),fe&&k(X),fe&&k(te),fe&&k(Z),fe&&k(ee),fe&&k(U),fe&&k(Y),fe&&k(G),fe&&k(de);for(let he=0;he<ge.length;he+=1)ge[he].d();fe&&k(ye),fe&&k(oe),fe&&k(W),fe&&k(ce),j(Te),fe&&k(st),fe&&k(Lt),fe&&k(_t),fe&&k(Ft);for(let he=0;he<Ke.length;he+=1)Ke[he].d();for(let he=0;he<ot.length;he+=1)ot[he].d()}}}function o4(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to update record.",
|
||||
"data": {
|
||||
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`},{code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}])},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,o,r,s,i,a]}class r4 extends Ee{constructor(e){super(),Oe(this,e,o4,l4,De,{collection:0})}}function tp(n,e,t){const i=n.slice();return i[6]=e[t],i}function np(n,e,t){const i=n.slice();return i[6]=e[t],i}function ip(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sp(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ne(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function lp(n,e){let t,i,s,l;return i=new bn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,(!l||r&20)&&ne(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function a4(n){var ae,Se;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y=[],G=new Map,de,x,ve=[],_e=new Map,ge,K=n[1]&&ip();E=new js({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
await client.records.delete('${(ae=n[0])==null?void 0:ae.name}', 'RECORD_ID');
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
await client.records.delete('${(Se=n[0])==null?void 0:Se.name}', 'RECORD_ID');
|
||||
`}});let ye=n[4];const oe=Q=>Q[6].code;for(let Q=0;Q<ye.length;Q+=1){let $e=np(n,ye,Q),Be=oe($e);G.set(Be,Y[Q]=sp(Be,$e))}let W=n[4];const ce=Q=>Q[6].code;for(let Q=0;Q<W.length;Q+=1){let $e=tp(n,W,Q),Be=ce($e);_e.set(Be,ve[Q]=lp(Be,$e))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),K&&K.c(),h=D(),g=_("div"),v=_("p"),b=N("Delete a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("div"),M.textContent="Client SDKs example",O=D(),q(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path parameters",F=D(),V=_("table"),V.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to delete.</td></tr></tbody>`,X=D(),te=_("div"),te.textContent="Responses",Z=D(),ee=_("div"),U=_("div");for(let Q=0;Q<Y.length;Q+=1)Y[Q].c();de=D(),x=_("div");for(let Q=0;Q<ve.length;Q+=1)ve[Q].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(M,"class","section-title"),p(I,"class","section-title"),p(V,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(U,"class","tabs-header compact left"),p(x,"class","tabs-content"),p(ee,"class","tabs")},m(Q,$e){w(Q,e,$e),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),K&&K.m(e,null),w(Q,h,$e),w(Q,g,$e),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),w(Q,T,$e),w(Q,M,$e),w(Q,O,$e),H(E,Q,$e),w(Q,P,$e),w(Q,I,$e),w(Q,F,$e),w(Q,V,$e),w(Q,X,$e),w(Q,te,$e),w(Q,Z,$e),w(Q,ee,$e),m(ee,U);for(let Be=0;Be<Y.length;Be+=1)Y[Be].m(U,null);m(ee,de),m(ee,x);for(let Be=0;Be<ve.length;Be+=1)ve[Be].m(x,null);ge=!0},p(Q,[$e]){var Xe,ut;(!ge||$e&1)&&a!==(a=Q[0].name+"")&&ue(u,a),Q[1]?K||(K=ip(),K.c(),K.m(e,null)):K&&(K.d(1),K=null),(!ge||$e&1)&&$!==($=Q[0].name+"")&&ue(C,$);const Be={};$e&9&&(Be.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${Q[3]}');
|
||||
|
||||
...
|
||||
|
||||
await client.records.delete('${(Xe=Q[0])==null?void 0:Xe.name}', 'RECORD_ID');
|
||||
`),$e&9&&(Be.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${Q[3]}');
|
||||
|
||||
...
|
||||
|
||||
await client.records.delete('${(ut=Q[0])==null?void 0:ut.name}', 'RECORD_ID');
|
||||
`),E.$set(Be),$e&20&&(ye=Q[4],Y=ct(Y,$e,oe,1,Q,ye,G,U,pn,sp,null,np)),$e&20&&(W=Q[4],Ae(),ve=ct(ve,$e,ce,1,Q,W,_e,x,Ut,lp,null,tp),Pe())},i(Q){if(!ge){A(E.$$.fragment,Q);for(let $e=0;$e<W.length;$e+=1)A(ve[$e]);ge=!0}},o(Q){L(E.$$.fragment,Q);for(let $e=0;$e<ve.length;$e+=1)L(ve[$e]);ge=!1},d(Q){Q&&k(e),K&&K.d(),Q&&k(h),Q&&k(g),Q&&k(T),Q&&k(M),Q&&k(O),j(E,Q),Q&&k(P),Q&&k(I),Q&&k(F),Q&&k(V),Q&&k(X),Q&&k(te),Q&&k(Z),Q&&k(ee);for(let $e=0;$e<Y.length;$e+=1)Y[$e].d();for(let $e=0;$e<ve.length;$e+=1)ve[$e].d()}}}function u4(n,e,t){let i,s,{collection:l=new dn}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:`
|
||||
null
|
||||
`}),r.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}))},t(3,s=B.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class f4 extends Ee{constructor(e){super(),Oe(this,e,u4,a4,De,{collection:0})}}function c4(n){var h,g,v,b,y,$,C,S;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new js({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[1]}');
|
||||
|
||||
...
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.users.authViaEmail('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.realtime.subscribe('${(g=n[0])==null?void 0:g.name}/RECORD_ID', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.realtime.unsubscribe() // remove all subscriptions
|
||||
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
|
||||
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[1]}');
|
||||
|
||||
...
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.users.authViaEmail('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) {
|
||||
print(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.realtime.subscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID', (e) {
|
||||
print(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.realtime.unsubscribe() // remove all subscriptions
|
||||
client.realtime.unsubscribe('${(C=n[0])==null?void 0:C.name}') // remove only the collection subscription
|
||||
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}/RECORD_ID') // remove only the record subscription
|
||||
`}}),c=new bn({props:{content:JSON.stringify({action:"create",record:B.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||||
<div class="content"><p>/api/realtime</p></div>`,t=D(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||||
<p>Events are sent for <strong>create</strong>, <strong>update</strong>
|
||||
and <strong>delete</strong> record operations (see "Event data format" section below).</p>
|
||||
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
|
||||
<p>When you subscribe to a <strong>single record</strong>, the collection's
|
||||
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p>
|
||||
<p>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||||
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p></div></div>`,s=D(),l=_("div"),l.textContent="Client SDKs example",o=D(),q(r.$$.fragment),a=D(),u=_("div"),u.textContent="Event data format",f=D(),q(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(T,M){w(T,e,M),w(T,t,M),w(T,i,M),w(T,s,M),w(T,l,M),w(T,o,M),H(r,T,M),w(T,a,M),w(T,u,M),w(T,f,M),H(c,T,M),d=!0},p(T,[M]){var P,I,F,V,X,te,Z,ee;const O={};M&3&&(O.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${T[1]}');
|
||||
|
||||
...
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.users.authViaEmail('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.realtime.subscribe('${(P=T[0])==null?void 0:P.name}', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.realtime.subscribe('${(I=T[0])==null?void 0:I.name}/RECORD_ID', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.realtime.unsubscribe() // remove all subscriptions
|
||||
client.realtime.unsubscribe('${(F=T[0])==null?void 0:F.name}') // remove only the collection subscription
|
||||
client.realtime.unsubscribe('${(V=T[0])==null?void 0:V.name}/RECORD_ID') // remove only the record subscription
|
||||
`),M&3&&(O.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${T[1]}');
|
||||
|
||||
...
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.users.authViaEmail('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.realtime.subscribe('${(X=T[0])==null?void 0:X.name}', (e) {
|
||||
print(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.realtime.subscribe('${(te=T[0])==null?void 0:te.name}/RECORD_ID', (e) {
|
||||
print(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.realtime.unsubscribe() // remove all subscriptions
|
||||
client.realtime.unsubscribe('${(Z=T[0])==null?void 0:Z.name}') // remove only the collection subscription
|
||||
client.realtime.unsubscribe('${(ee=T[0])==null?void 0:ee.name}/RECORD_ID') // remove only the record subscription
|
||||
`),r.$set(O);const E={};M&1&&(E.content=JSON.stringify({action:"create",record:B.dummyCollectionRecord(T[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(E)},i(T){d||(A(r.$$.fragment,T),A(c.$$.fragment,T),d=!0)},o(T){L(r.$$.fragment,T),L(c.$$.fragment,T),d=!1},d(T){T&&k(e),T&&k(t),T&&k(i),T&&k(s),T&&k(l),T&&k(o),j(r,T),T&&k(a),T&&k(u),T&&k(f),j(c,T)}}}function d4(n,e,t){let i,{collection:s=new dn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=B.getApiExampleUrl(we.baseUrl)),[s,i]}class p4 extends Ee{constructor(e){super(),Oe(this,e,d4,c4,De,{collection:0})}}function op(n,e,t){const i=n.slice();return i[14]=e[t],i}function rp(n,e,t){const i=n.slice();return i[14]=e[t],i}function ap(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&q(t.$$.fragment),i=D(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&H(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Ae();const f=t;L(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(t=new l(o(r)),q(t.$$.fragment),A(t.$$.fragment,1),H(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&L(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&j(t)}}}function up(n,e){let t,i,s,l=e[4]===e[14].id&&ap(e);return{key:n,first:null,c(){t=Ue(),l&&l.c(),i=Ue(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=ap(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function h4(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=op(n,l,r),u=o(a);i.set(u,t[r]=up(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Ae(),t=ct(t,a,o,1,r,l,i,e,Ut,up,null,op),Pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)L(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function fp(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=N(s),o=D(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ne(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[J(t,"click",u),J(t,"keydown",Um(f))],r=!0)},p(c,d){e=c,d&48&&ne(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,Ye(a)}}}function m4(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=rp(n,f,d),g=c(h);u.set(g,a[d]=fp(g,h))}return{c(){e=_("h4"),t=_("strong"),s=N(i),l=N(" records API"),o=D(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(r,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,o,h),w(d,r,h);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ue(s,i),h&114&&(f=d[5],a=ct(a,h,c,1,d,f,u,r,pn,fp,null,rp))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function g4(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[8]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function _4(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[g4],header:[m4],default:[h4]},$$scope:{ctx:n}};return e=new ui({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function b4(n,e,t){const i=[{id:"list",label:"List",component:PC},{id:"view",label:"View",component:NC},{id:"create",label:"Create",component:JC},{id:"update",label:"Update",component:r4},{id:"delete",label:"Delete",component:f4},{id:"realtime",label:"Realtime",component:p4}];let s,l=new dn,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,$){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u($))}const c=()=>a(),d=y=>u(y.id),h=(y,$)=>f($,y.id);function g(y){me[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){xe.call(this,n,y)}function b(y){xe.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,h,g,v,b]}class v4 extends Ee{constructor(e){super(),Oe(this,e,b4,_4,De,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function y4(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=at(l,s[o]);return{c(){e=_("textarea"),mi(e,l),ne(e,"svelte-1x1pbts",!0)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[5](e),Me(e,n[0]),t||(i=[
Line truncated
|
||||
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[J(t,"change",n[17]),J(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Ye(o)}}}function bM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const y=M=>M[25];for(let M=0;M<b.length;M+=1){let O=pp(n,b,M),E=y(O);d.set(E,c[M]=hp(E,O))}let $=n[0],C=[];for(let M=0;M<$.length;M+=1)C[M]=mp(dp(n,$,M));const S=M=>L(C[M],1,1,()=>{C[M]=null});let T=!n[8]&&gp(n);return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),f=_("div");for(let M=0;M<c.length;M+=1)c[M].c();h=D();for(let M=0;M<C.length;M+=1)C[M].c();g=D(),T&&T.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(M,O){w(M,e,O),m(e,t),m(e,s),m(e,l),m(l,r),w(M,u,O),w(M,f,O);for(let E=0;E<c.length;E+=1)c[E].m(f,null);m(f,h);for(let E=0;E<C.length;E+=1)C[E].m(f,null);m(f,g),T&&T.m(f,null),n[19](f),v=!0},p(M,O){if((!v||O&8&&i!==(i=B.getFieldTypeIcon(M[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=M[3].name+"")&&ue(r,o),(!v||O&2097152&&a!==(a=M[21]))&&p(e,"for",a),O&1558&&(b=M[4],Ae(),c=ct(c,O,y,1,M,b,d,f,Ut,hp,h,pp),Pe()),O&2049){$=M[0];let E;for(E=0;E<$.length;E+=1){const P=dp(M,$,E);C[E]?(C[E].p(P,O),A(C[E],1)):(C[E]=mp(P),C[E].c(),A(C[E],1),C[E].m(f,g))}for(Ae(),E=$.length;E<C.length;E+=1)S(E);Pe()}M[8]?T&&(T.d(1),T=null):T?T.p(M,O):(T=gp(M),T.c(),T.m(f,null))},i(M){if(!v){for(let O=0;O<b.length;O+=1)A(c[O]);for(let O=0;O<$.length;O+=1)A(C[O]);v=!0}},o(M){for(let O=0;O<c.length;O+=1)L(c[O]);C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)L(C[O]);v=!1},d(M){M&&k(e),M&&k(u),M&&k(f);for(let O=0;O<c.length;O+=1)c[O].d();nn(C,M),T&&T.d(),n[19](null)}}}function vM(n){let e,t;return e=new Ne({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[bM,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function yM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(E){B.removeByValue(u,E),t(1,u)}function g(E){B.pushUnique(u,E),t(1,u)}function v(E){B.isEmpty(a[E])||a.splice(E,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=E=>h(E),$=E=>g(E),C=E=>v(E);function S(E){me[E?"unshift":"push"](()=>{c=E,t(6,c)})}const T=()=>{for(let E of c.files)a.push(E);t(0,a),t(6,c.value=null,c)},M=()=>c==null?void 0:c.click();function O(E){me[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,P;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=B.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=B.toArray(u))),n.$$.dirty&8&&t(5,i=((E=f.options)==null?void 0:E.maxSelect)>1),n.$$.dirty&4128&&B.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=B.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((P=f.options)==null?void 0:P.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,y,$,C,S,T,M,O]}class kM extends Ee{constructor(e){super(),Oe(this,e,yM,vM,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function _p(n){let e,t;return{c(){e=_("small"),t=N(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function wM(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&_p(n);return{c(){e=_("i"),i=D(),s=_("div"),l=_("div"),r=N(o),a=D(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=We(t=yt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Jn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&o!==(o=d[0].id+"")&&ue(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,h):(c=_p(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:se,o:se,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function $M(n,e,t){let i;const s=["id","created","updated","@collectionId","@collectionName"];let{item:l={}}=e;function o(r){r=r||{};const a=["name","title","label","key","email","heading","content",...ObjectLine truncated
|
||||
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function UM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new zM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function WM(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new PM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function YM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new kM({props:u}),me.push(()=>Re(e,"value",o)),me.push(()=>Re(e,"uploadedFiles",r)),me.push(()=>Re(e,"deletedFileIndexes",a)),{c(){q(e.$$.fragment)},m(f,c){H(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function KM(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new eM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function JM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new G4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ZM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new Y4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function GM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new z4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function XM(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new H4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function QM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new I4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function xM(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new E4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function eT(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new M4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;
Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function iT(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&Tp(n);return{c(){e=_("h4"),i=N(t),s=D(),o=N(l),r=N(" record"),a=D(),c&&c.c(),u=Ue()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=Tp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function sT(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),r=N(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ne(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=J(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ne(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function lT(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[sT],header:[iT],default:[tT]},$$scope:{ctx:n}};return e=new ui({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[33](null),j(e,s)}}}function Dp(n){return JSON.stringify(n)}function oT(n,e,t){let i,s,l,o;const r=Qt(),a="record_"+B.randomString(5);let{collection:u}=e,f,c=null,d=new bo,h=!1,g=!1,v={},b={},y="";function $(oe){return S(oe),t(8,g=!0),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function S(oe){ri({}),c=oe||{},t(2,d=oe!=null&&oe.clone?oe.clone():new bo),t(3,v={}),t(4,b={}),await Zn(),t(15,y=Dp(d))}function T(){if(h||!l)return;t(7,h=!0);const oe=O();let W;d.isNew?W=we.records.create(u==null?void 0:u.id,oe):W=we.records.update(u==null?void 0:u.id,d.id,oe),W.then(async ce=>{sn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),C(),r("save",ce)}).catch(ce=>{we.errorResponseHandler(ce)}).finally(()=>{t(7,h=!1)})}function M(){!(c!=null&&c.id)||si("Do you really want to delete the selected record?",()=>we.records.delete(c["@collectionId"],c.id).then(()=>{C(),sn("Successfully deleted record."),r("delete",c)}).catch(oe=>{we.errorResponseHandler(oe)}))}function O(){const oe=(d==null?void 0:d.export())||{},W=new FormData,ce={};for(const ae of(u==null?void 0:u.schema)||[])ce[ae.name]=ae;for(const ae in oe)!ce[ae]||(typeof oe[ae]>"u"&&(oe[ae]=null),B.addValueToFormData(W,ae,oe[ae]));for(const ae in v){const Se=B.toArray(v[ae]);for(const Q of Se)W.append(ae,Q)}for(const ae in b){const Se=B.toArray(b[ae]);for(const Q of Se)W.append(ae+"."+Q,"")}return W}const E=()=>C(),P=()=>M();function I(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function F(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function V(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function X(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function te(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function Z(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function ee(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function U(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function Y(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function G(oe,W){n.$$.not_equal(v[W.name],oe)&&(v[W.name]=oe,t(3,v))}function de(oe,W){n.$$.not_equal(b[W.name],oe)&&(b[W.name]=oe,t(4,b))}function x(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}function ve(oe,W){n.$$.not_equal(d[W.name],oe)&&(d[W.name]=oe,t(2,d))}const _e=()=>s&&g?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),C()}),!1):!0;function ge(oe){me[oe?"unshift":"push"](()=>{f=oe,t(6,f)})}function K(oe){xe.call(this,n,oe)}function ye(oe){xe.call(this,n,oe)}return n.$$set=oe=>{"collection"in oe&&t(0,u=oe.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=B.hasNonEmptyProps(v)||B.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=Dp(d)),n.$$.dirty[0]&36&&t(9,l=d.isNew||s),n.$$.dirty[0]&1&&t(10,o=(u==null?void 0:u.name)!=="profiles")},[u,C,d,v,b,s,f,h,g,l,o,a,T,M,$,y,i,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x,ve,_e,ge,K,ye]}class pb extends Ee{constructor(e){super(),Oe(this,e,oT,lT,De,{collection:0,show:14,hide:1},null,[-1,-1])}get sLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function qp(n){let e,t,i;return{c(){e=_("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){w(s,e,l),t||(i=J(e,"click",n[29]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Vp(n,e){let t,i,s;return i=new hb({props:{record:e[36],field:e[39]}}),{key:n,first:null,c(){t=Ue(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[36]),o[0]&4096&&(r.field=e[39]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function zp(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,$,C,S,T,M,O,E,P,I,F,V;function X(){return e[26](e[36])}h=new lr({props:{id:e[36].id}});let te=e[12];const Z=Y=>Y[39].name;for(let Y=0;Y<te.length;Y+=1){let G=Fp(e,te,Y),de=Z(G);b.set(de,v[Y]=Vp(de,G))}C=new Si({props:{date:e[36].created}}),M=new Si({props:{date:e[36].updated}});function ee(){return e[27](e[36])}function U(...Y){return e[28](e[36],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=D(),u=_("label"),c=D(),d=_("td"),q(h.$$.fragment),g=D();for(let Y=0;Y<v.length;Y+=1)v[Y].c();y=D(),$=_("td"),q(C.$$.fragment),S=D(),T=_("td"),q(M.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[36].id),l.checked=r=e[5][e[36].id],p(u,"for",f="checkbox_"+e[36].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p($,"class","col-type-date col-field-created"),p(T,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,G){w(Y,t,G),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),H(h,d,null),m(t,g);for(let de=0;de<v.length;de+=1)v[de].m(t,null);m(t,y),m(t,$),H(C,$,null),m(t,S),m(t,T),H(M,T,null),m(t,O),m(t,E),m(t,P),I=!0,F||(V=[J(l,"change",X),J(s,"click",ni(e[20])),J(t,"click",ee),J(t,"keydown",U)],F=!0)},p(Y,G){e=Y,(!I||G[0]&8&&o!==(o="checkbox_"+e[36].id))&&p(l,"id",o),(!I||G[0]&40&&r!==(r=e[5][e[36].id]))&&(l.checked=r),(!I||G[0]&8&&f!==(f="checkbox_"+e[36].id))&&p(u,"for",f);const de={};G[0]&8&&(de.id=e[36].id),h.$set(de),G[0]&4104&&(te=e[12],Ae(),v=ct(v,G,Z,1,e,te,b,t,Ut,Vp,y,Fp),Pe());const x={};G[0]&8&&(x.date=e[36].created),C.$set(x);const ve={};G[0]&8&&(ve.date=e[36].updated),M.$set(ve)},i(Y){if(!I){A(h.$$.fragment,Y);for(let G=0;G<te.length;G+=1)A(v[G]);A(C.$$.fragment,Y),A(M.$$.fragment,Y),I=!0}},o(Y){L(h.$$.fragment,Y);for(let G=0;G<v.length;G+=1)L(v[G]);L(C.$$.fragment,Y),L(M.$$.fragment,Y),I=!1},d(Y){Y&&k(t),j(h);for(let G=0;G<v.length;G+=1)v[G].d();j(C),j(M),F=!1,Ye(V)}}}function Bp(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&ue(s,i),a[0]&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Up(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[8]),ne(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[30]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c[0]&256&&ne(t,"btn-loading",f[8]),c[0]&256&&ne(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Wp(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,v,b,y,$;return{c(){e=_("div"),t=_("div"),i=N("Selected "),s=_("strong"),l=N(n[6]),o=D(),a=N(r),u=D(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=D(),d=_("div"),h=D(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ne(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary btn-danger"),ne(g,"btn-loading",n[9]),ne(g,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(C,S){w(C,e,S),m(e,t),m(t,i),m(t,s),m(s,l),m(t,o),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,h),m(e,g),b=!0,y||($=[J(f,"click",n[31]),J(g,"click",n[32])],y=!0)},p(C,S){(!b||S[0]&64)&&ue(l,C[6]),(!b||S[0]&64)&&r!==(r=C[6]===1?"record":"records")&&ue(a,r),(!b||S[0]&512)&&ne(f,"btn-disabled",C[9]),(!b||S[0]&512)&&ne(g,"btn-loading",C[9]),(!b||S[0]&512)&&ne(g,"btn-disabled",C[9])},i(C){b||(C&&Tt(()=>{v||(v=nt(e,Wn,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o(C){C&&(v||(v=nt(e,Wn,{duration:150,y:5},!1)),v.run(0)),b=!1},d(C){C&&k(e),C&&v&&v.end(),y=!1,Ye($)}}}function ET(n){let e,t,i,s,l,o,r,a,u,f=[],c=new Map,d,h,g,v,b,y,$,C,S,T,M=[],O=new Map,E,P,I,F,V;function X(ae,Se){return ae[8]?$T:wT}let te=X(n),Z=te(n);function ee(ae){n[22](ae)}
Line truncated
|
||||
<span class="txt">API Preview</span>`,v=D(),b=_("button"),b.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New record</span>`,y=D(),q($.$$.fragment),C=D(),q(S.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(b,"type","button"),p(b,"class","btn btn-expanded"),p(h,"class","btns-group"),p(e,"class","page-header")},m(te,Z){w(te,e,Z),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),I&&I.m(u,null),m(u,f),H(c,u,null),m(e,d),m(e,h),m(h,g),m(h,v),m(h,b),w(te,y,Z),H($,te,Z),w(te,C,Z),H(S,te,Z),O=!0,E||(P=[J(g,"click",n[15]),J(b,"click",n[16])],E=!0)},p(te,Z){(!O||Z[0]&4)&&o!==(o=te[2].name+"")&&ue(r,o),te[9]?I&&(I.d(1),I=null):I?I.p(te,Z):(I=Yp(te),I.c(),I.m(u,f));const ee={};Z[0]&1&&(ee.value=te[0]),Z[0]&4&&(ee.autocompleteCollection=te[2]),$.$set(ee);const U={};Z[0]&4&&(U.collection=te[2]),!T&&Z[0]&1&&(T=!0,U.filter=te[0],He(()=>T=!1)),!M&&Z[0]&2&&(M=!0,U.sort=te[1],He(()=>M=!1)),S.$set(U)},i(te){O||(A(c.$$.fragment,te),A($.$$.fragment,te),A(S.$$.fragment,te),O=!0)},o(te){L(c.$$.fragment,te),L($.$$.fragment,te),L(S.$$.fragment,te),O=!1},d(te){te&&k(e),I&&I.d(),j(c),te&&k(y),j($,te),te&&k(C),n[18](null),j(S,te),E=!1,Ye(P)}}}function RT(n){let e,t,i,s,l;return{c(){e=_("h1"),e.textContent="Create your first collection to add records!",t=D(),i=_("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){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=J(i,"click",n[12]),s=!0)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function HT(n){let e;return{c(){e=_("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function jT(n){let e,t,i;function s(r,a){return r[9]?HT:RT}let l=s(n),o=l(n);return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),m(e,t),m(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function qT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function VT(n){let e,t,i,s,l,o,r,a,u;const f=[NT,IT,LT],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new nu({props:h}),n[22](s);let g={};o=new v4({props:g}),n[23](o);let v={collection:n[2]};return a=new pb({props:v}),n[24](a),a.$on("save",n[25]),a.$on("delete",n[26]),{c(){t.c(),i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),H(s,b,y),w(b,l,y),H(o,b,y),w(b,r,y),H(a,b,y),u=!0},p(b,y){let $=e;e=d(b),e===$?c[e].p(b,y):(Ae(),L(c[$],1,1,()=>{c[$]=null}),Pe(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const S={};o.$set(S);const T={};y[0]&4&&(T.collection=b[2]),a.$set(T)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){L(t),L(s.$$.fragment,b),L(o.$$.fragment,b),L(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[22](null),j(s,b),b&&k(l),n[23](null),j(o,b),b&&k(r),n[24](null),j(a,b)}}}function zT(n,e,t){let i,s,l,o,r,a,u;rt(n,hi,Y=>t(2,s=Y)),rt(n,Ps,Y=>t(11,l=Y)),rt(n,zo,Y=>t(27,o=Y)),rt(n,Nt,Y=>t(28,r=Y)),rt(n,pa,Y=>t(8,a=Y)),rt(n,us,Y=>t(9,u=Y)),tn(Nt,r="Collections",r);const f=new URLSearchParams(o);let c,d,h,g,v=f.get("filter")||"",b=f.get("sort")||"-created",y=f.get("collectionId")||"";function $(){t(10,y=s.id),t(1,b="-created"),t(0,v="")}W$(y);const C=()=>c==null?void 0:c.show(),S=()=>c==null?void 0:c.show(s),T=()=>g==null?void 0:g.load(),M=()=>d==null?void 0:d.show(s),O=()=>h==null?void 0:h.show(),E=Y=>t(0,v=Y.detail);function P(Y){me[Y?"unshift":"push"](()=>{g=Y,t(6,g)})}function I(Y){v=Y,t(0,v)}function F(Y){b=Y,t(1,b)}const V=Y=>h==null?void 0:h.show(Y==null?void 0:Y.detail);function X(Y){me[Y?"unshift":"push"](()=>{c=Y,t(3,c)})}function te(Y){me[Y?"unshift":"push"](()=>{d=Y,t(4,d)})}function Z(Y){me[Y?"unshift":"push"](()=>{h=Y,t(5,h)})}const ee=()=>g==null?void 0:g.reloadLoadedPages(),U=()=>g==null?void 0:g.reloadLoadedPages();return n.$$.update=()=>{if(n.$$.dirty[0]&2048&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty[0]&1028&&(s==null?void 0:s.id)&&y!=s.id&&$(),n.$$.dirty[0]&7&&(b||v||(s==null?void 0:s.id))){const Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:b}).toString();Ci("/collections?"+Y)}},[v,b,s,c,d,h,g,i,a,u,y,l,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U]}class BT extends Ee{constructor(e){super(),Oe(this,e,zT,VT,De,{},null,[-1,-1])}}const $l={googleAuth:{title:"Google",icon:"ri-google-fill"},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",selfHosted:!0},discordAuth:{title:"Discord",icon:"ri-discord-fill"}};function Kp(n,e,t){const i=n.slice();return i[9]=e[t],i}function UT(n){let e;return{c(){e=_("p"),e.textContent="No authorized OAuth2 providers.",p(e,"class","txt-hint txt-center")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function WT(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=Jp(Kp(n,t,s));return{c(){e=_("div");for(let s=0;s<i.length;s+=1)i[s].c();p(e,"class","list")},m(s,l){w(s,e,l);for(let o=0;o<i.length;o+=1)i[o].m(e,null)},p(s,l){if(l&58){t=s[1];let o;for(o=0;o<t.length;o+=1){const r=Kp(s,t,o);i[o]?i[o].p(r,l):(i[o]=Jp(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){s&&k(e),nn(i,s)}}}function YT(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Jp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,h,g,v,b,y;function $(){return n[6](n[9])}return{c(){e=_("div"),t=_("i"),s=D(),l=_("span"),r=N(o),a=D(),u=_("div"),f=N("ID: "),d=N(c),h=D(),g=_("button"),g.innerHTML='<i class="ri-close-line"></i>',v=D(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-secondary link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(C,S){w(C,e,S),m(e,t),m(e,s),m(e,l),m(l,r),m(e,a),m(e,u),m(u,f),m(u,d),m(e,h),m(e,g),m(e,v),b||(y=J(g,"click",$),b=!0)},p(C,S){n=C,S&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),S&2&&o!==(o=n[3](n[9].provider)+"")&&ue(r,o),S&2&&c!==(c=n[9].providerId+"")&&ue(d,c)},d(C){C&&k(e),b=!1,y()}}}function KT(n){let e;function t(l,o){var r;return l[2]?YT:((r=l[0])==null?void 0:r.id)&&l[1].length?WT:UT}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:se,o:se,d(l){s.d(l),l&&k(e)}}}function JT(n,e,t){const i=Qt();let{user:s}=e,l=[],o=!1;function r(d){var h;return((h=$l[d+"Auth"])==null?void 0:h.title)||B.sentenize(auth.provider,!1)}function a(d){var h;return((h=$l[d+"Auth"])==null?void 0:h.icon)||`ri-${d}-line`}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);returLine truncated
|
||||
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function iD(n){let e,t,i,s,l=!n[1].verified&&n[1].email&&ih(n);return{c(){l&&l.c(),e=D(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=J(t,"click",n[19]),i=!0)},p(o,r){!o[1].verified&&o[1].email?l?l.p(o,r):(l=ih(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function sD(n){let e,t=n[1].isNew?"New user":"Edit user",i,s,l,o,r=!n[1].isNew&&nh(n);return{c(){e=_("h4"),i=N(t),s=D(),r&&r.c(),l=Ue()},m(a,u){w(a,e,u),m(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u[0]&2)&&t!==(t=a[1].isNew?"New user":"Edit user")&&ue(i,t),a[1].isNew?r&&(Ae(),L(r,1,1,()=>{r=null}),Pe()):r?(r.p(a,u),u[0]&2&&A(r,1)):(r=nh(a),r.c(),A(r,1),r.m(l.parentNode,l))},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&k(e),a&&k(s),r&&r.d(a),a&&k(l)}}}function sh(n){let e,t,i=n[1].isNew?"Create":"Save changes",s,l;return{c(){e=_("button"),t=_("span"),s=N(i),p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[12]),p(e,"class","btn btn-expanded"),e.disabled=l=!n[11]||n[5],ne(e,"btn-loading",n[5])},m(o,r){w(o,e,r),m(e,t),m(t,s)},p(o,r){r[0]&2&&i!==(i=o[1].isNew?"Create":"Save changes")&&ue(s,i),r[0]&2080&&l!==(l=!o[11]||o[5])&&(e.disabled=l),r[0]&32&&ne(e,"btn-loading",o[5])},d(o){o&&k(e)}}}function lD(n){let e,t,i,s,l,o,r=n[10]===wi&&sh(n);return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),r&&r.c(),s=Ue(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[5]},m(a,u){w(a,e,u),m(e,t),w(a,i,u),r&&r.m(a,u),w(a,s,u),l||(o=J(e,"click",n[17]),l=!0)},p(a,u){u[0]&32&&(e.disabled=a[5]),a[10]===wi?r?r.p(a,u):(r=sh(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(a){a&&k(e),a&&k(i),r&&r.d(a),a&&k(s),l=!1,o()}}}function oD(n){let e,t,i={class:"user-panel",popup:n[1].isNew,beforeHide:n[27],$$slots:{footer:[lD],header:[sD],default:[nD]},$$scope:{ctx:n}};return e=new ui({props:i}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&2&&(o.popup=s[1].isNew),l[0]&2112&&(o.beforeHide=s[27]),l[0]&4014|l[1]&16&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[28](null),j(e,s)}}}const wi="account",Ls="providers";function rD(n,e,t){let i;const s=Qt(),l="user_"+B.randomString(5);let o,r=new Ts,a=!1,u=!1,f="",c="",d="",h=!1,g=!0,v=wi;function b(x){return $(x),t(6,u=!0),t(10,v=r.isNew||r.email?wi:Ls),o==null?void 0:o.show()}function y(){return o==null?void 0:o.hide()}function $(x){ri({}),t(1,r=x!=null&&x.clone?x.clone():new Ts),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const x={email:f};(r.isNew||h)&&(x.password=c,x.passwordConfirm=d);let ve;r.isNew?ve=we.users.create(x):ve=we.users.update(r.id,x),ve.then(async _e=>{t(1,r=_e),g&&M(!1),t(6,u=!1),y(),sn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",_e)}).catch(_e=>{we.errorResponseHandler(_e)}).finally(()=>{t(5,a=!1)})}function T(){!(r!=null&&r.id)||si("Do you really want to delete the selected user?",()=>we.users.delete(r.id).then(()=>{t(6,u=!1),y(),sn("Successfully deleted user."),s("delete",r)}).catch(x=>{we.errorResponseHandler(x)}))}function M(x=!0){return we.users.requestVerification(r.email||f).then(()=>{t(6,u=!1),y(),x&&sn(`Successfully sent verification email to ${r.email}.`)}).catch(ve=>{we.errorResponseHandler(ve)})}const O=()=>y(),E=()=>M(),P=()=>T(),I=()=>t(10,v=wi),F=()=>t(10,v=Ls);function V(){f=this.value,t(2,f)}function X(){h=this.checked,t(3,h)}function te(){c=this.value,t(7,c)}function Z(){d=this.value,t(8,d)}function ee(){g=this.checked,t(9,g)}const U=()=>i&&u?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),y()}),!1):!0;function Y(x){me[x?"unshift":"push"](()=>{o=x,t(4,o)})}function G(x){xe.call(this,n,x)}function de(x){xe.call(this,n,x)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(11,i=r.isNew&&f!=""||h||f!==r.email)},[y,r,f,h,o,a,u,c,d,g,v,i,l,S,T,M,b,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de]}class aD extends Ee{constructor(e){super(),Oe(this,e,rD,oD,De,{show:16,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[0]}}function lh(n,e,t){const i=n.slice();return i[41]=e[t],i}function oh(n,e,t){const i=n.slice();return i[44]=e[t],i}function rh(n,e,t){const i=n.slice();return i[44]=e[t],i}function uD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P=[],I=new Map,F,V,X,te,Z,ee,U,Y,G,de,x=[],ve=new Map,_e,ge,K,ye,oe,W,ce=!n[15]&&ah(n);r=new Xo({}),r.$on("refresh",n[18]),h=new Go({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),h.$on("submit",n[20]);function ae(be){n[21](be)}let Se={class:"col-type-text col-field-id",name:"id",$$slots:{default:[cD]},$$scope:{ctx:n}};n[4]!==void 0&&(Se.sort=n[4]),C=new an({props:Se}),me.push(()=>Re(C,"sort",ae));function Q(be){n[22](be)}let $e={class:"col-type-email col-field-email",name:"email"Line truncated
|
||||
<span class="txt">New user</span>`,d=D(),q(h.$$.fragment),g=D(),v=_("div"),b=_("table"),y=_("thead"),$=_("tr"),q(C.$$.fragment),T=D(),q(M.$$.fragment),E=D();for(let be=0;be<P.length;be+=1)P[be].c();F=D(),q(V.$$.fragment),te=D(),q(Z.$$.fragment),U=D(),Y=_("th"),G=D(),de=_("tbody");for(let be=0;be<x.length;be+=1)x[be].c();Ze&&Ze.c(),_e=D(),tt&&tt.c(),ge=D(),dt&&dt.c(),K=Ue(),p(i,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(e,"class","page-header"),p(Y,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[10]),p(v,"class","table-wrapper")},m(be,Fe){w(be,e,Fe),m(e,t),m(t,i),m(i,s),m(e,l),ce&&ce.m(e,null),m(e,o),H(r,e,null),m(e,a),m(e,u),m(e,f),m(e,c),w(be,d,Fe),H(h,be,Fe),w(be,g,Fe),w(be,v,Fe),m(v,b),m(b,y),m(y,$),H(C,$,null),m($,T),H(M,$,null),m($,E);for(let pt=0;pt<P.length;pt+=1)P[pt].m($,null);m($,F),H(V,$,null),m($,te),H(Z,$,null),m($,U),m($,Y),m(b,G),m(b,de);for(let pt=0;pt<x.length;pt+=1)x[pt].m(de,null);Ze&&Ze.m(de,null),w(be,_e,Fe),tt&&tt.m(be,Fe),w(be,ge,Fe),dt&&dt.m(be,Fe),w(be,K,Fe),ye=!0,oe||(W=J(c,"click",n[19]),oe=!0)},p(be,Fe){(!ye||Fe[0]&16384)&&ue(s,be[14]),be[15]?ce&&(ce.d(1),ce=null):ce?ce.p(be,Fe):(ce=ah(be),ce.c(),ce.m(e,o));const pt={};Fe[0]&8&&(pt.value=be[3]),h.$set(pt);const Dt={};Fe[1]&262144&&(Dt.$$scope={dirty:Fe,ctx:be}),!S&&Fe[0]&16&&(S=!0,Dt.sort=be[4],He(()=>S=!1)),C.$set(Dt);const ht={};Fe[1]&262144&&(ht.$$scope={dirty:Fe,ctx:be}),!O&&Fe[0]&16&&(O=!0,ht.sort=be[4],He(()=>O=!1)),M.$set(ht),Fe[0]&4096&&(Be=be[12],P=ct(P,Fe,Xe,1,be,Be,I,$,pn,uh,F,rh));const st={};Fe[1]&262144&&(st.$$scope={dirty:Fe,ctx:be}),!X&&Fe[0]&16&&(X=!0,st.sort=be[4],He(()=>X=!1)),V.$set(st);const Lt={};Fe[1]&262144&&(Lt.$$scope={dirty:Fe,ctx:be}),!ee&&Fe[0]&16&&(ee=!0,Lt.sort=be[4],He(()=>ee=!1)),Z.$set(Lt),Fe[0]&5450&&(Te=be[1],Ae(),x=ct(x,Fe,Ve,1,be,Te,ve,de,Ut,hh,null,lh),Pe(),!Te.length&&Ze?Ze.p(be,Fe):Te.length?Ze&&(Ze.d(1),Ze=null):(Ze=fh(be),Ze.c(),Ze.m(de,null))),(!ye||Fe[0]&1024)&&ne(b,"table-loading",be[10]),be[1].length?tt?tt.p(be,Fe):(tt=mh(be),tt.c(),tt.m(ge.parentNode,ge)):tt&&(tt.d(1),tt=null),be[1].length&&be[13]?dt?dt.p(be,Fe):(dt=gh(be),dt.c(),dt.m(K.parentNode,K)):dt&&(dt.d(1),dt=null)},i(be){if(!ye){A(r.$$.fragment,be),A(h.$$.fragment,be),A(C.$$.fragment,be),A(M.$$.fragment,be),A(V.$$.fragment,be),A(Z.$$.fragment,be);for(let Fe=0;Fe<Te.length;Fe+=1)A(x[Fe]);ye=!0}},o(be){L(r.$$.fragment,be),L(h.$$.fragment,be),L(C.$$.fragment,be),L(M.$$.fragment,be),L(V.$$.fragment,be),L(Z.$$.fragment,be);for(let Fe=0;Fe<x.length;Fe+=1)L(x[Fe]);ye=!1},d(be){be&&k(e),ce&&ce.d(),j(r),be&&k(d),j(h,be),be&&k(g),be&&k(v),j(C),j(M);for(let Fe=0;Fe<P.length;Fe+=1)P[Fe].d();j(V),j(Z);for(let Fe=0;Fe<x.length;Fe+=1)x[Fe].d();Ze&&Ze.d(),be&&k(_e),tt&&tt.d(be),be&&k(ge),dt&&dt.d(be),be&&k(K),oe=!1,W()}}}function fD(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function ah(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle")},m(s,l){w(s,e,l),t||(i=[We(yt.call(null,e,{text:"Edit profile collection",position:"right"})),J(e,"click",n[17])],t=!0)},p:se,d(s){s&&k(e),t=!1,Ye(i)}}}function cD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function dD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function uh(n,e){let t,i,s,l,o,r,a,u=e[44].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=D(),r=_("span"),a=N("profile."),f=N(u),p(s,"class",l=B.getFieldTypeIcon(e[44].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[44].type+" col-field-"+e[44].name),p(t,"name",d=e[44].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=B.getFieldTypeIcon(e[44].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[44].name+"")&&ue(f,u),g[0]&4096&&c!==(c="col-type-"+e[44].type+" col-field-"+e[44].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[44].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function pD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function hD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function fh(n){let e;function t(l,o){return l[10]?gD:mD}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function mD(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&ch(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=ch(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function gD(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function ch(n){let e,t,i;return{c(){e=_("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){w(s,e,l),t||(i=J(e,"click",n[27]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function _D(n){let e,t,i,s=n[41].verified&&dh();return{c(){e=_("div"),e.textContent="N/A",t=D(),s&&s.c(),i=Ue(),p(e,"class","txt-hint")},m(l,o){w(l,e,o),w(l,t,o),s&&s.m(l,o),w(l,i,o)},p(l,o){l[41].verified?s||(s=dh(),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(l){l&&k(e),l&&k(t),s&&s.d(l),l&&k(i)}}}function bD(n){let e,t=n[41].email+"",i,s,l,o,r=n[41].verified?"Verified":"Unverified",a;return{c(){e=_("span"),i=N(t),l=D(),o=_("span"),a=N(r),p(e,"class","txt"),p(e,"title",s=n[41].email),p(o,"class","label"),ne(o,"label-success",n[41].verified),ne(o,"label-warning",!n[41].verified)},m(u,f){w(u,e,f),m(e,i),w(u,l,f),w(u,o,f),m(o,a)},p(u,f){f[0]&2&&t!==(t=u[41].email+"")&&ue(i,t),f[0]&2&&s!==(s=u[41].email)&&p(e,"title",s),f[0]&2&&r!==(r=u[41].verified?"Verified":"Unverified")&&ue(a,r),f[0]&2&&ne(o,"label-success",u[41].verified),f[0]&2&&ne(o,"label-warning",!u[41].verified)},d(u){u&&k(e),u&&k(l),u&&k(o)}}}function dh(n){let e;return{c(){e=_("span"),e.textContent="OAuth2 verified",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ph(n,e){let t,i,s;return i=new hb({props:{field:e[44],record:e[41].profile||{}}}),{key:n,first:null,c(){t=Ue(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[44]),o[0]&2&&(r.record=e[41].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function hh(n,e){let t,i,s,l,o,r,a,u=[],f=new Map,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P;s=new lr({props:{id:e[41].id}});function I(U,Y){return U[41].email?bD:_D}let F=I(e),V=F(e),X=e[12];const te=U=>U[44].name;for(let U=0;U<X.length;U+=1){let Y=oh(e,X,U),G=te(Y);f.set(G,u[U]=ph(G,Y))}h=new Si({props:{date:e[41].created}}),b=new Si({props:{date:e[41].updated}});function Z(){return e[25](e[41])}function ee(){return e[26](e[41])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),q(s.$$.fragment),l=D(),o=_("td"),r=_("div"),V.c(),a=D();for(let U=0;U<u.length;U+=1)u[U].c();c=D(),d=_("td"),q(h.$$.fragment),g=D(),v=_("td"),q(b.$$.fragment),y=D(),$=_("td"),C=_("button"),C.innerHTML=`<i class="ri-user-settings-line"></i>
|
||||
<span class="txt">Edit user</span>`,S=D(),T=_("button"),T.innerHTML=`<i class="ri-profile-line"></i>
|
||||
<span class="txt">Edit profile</span>`,M=D(),p(i,"class","col-type-text col-field-id"),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p(d,"class","col-type-date col-field-created"),p(v,"class","col-type-date col-field-updated"),p(C,"type","button"),p(C,"class","btn btn-sm btn-outline"),p(T,"type","button"),p(T,"class","btn btn-sm m-l-10"),p($,"class","col-type-action min-width"),this.first=t},m(U,Y){w(U,t,Y),m(t,i),H(s,i,null),m(t,l),m(t,o),m(o,r),V.m(r,null),m(t,a);for(let G=0;G<u.length;G+=1)u[G].m(t,null);m(t,c),m(t,d),H(h,d,null),m(t,g),m(t,v),H(b,v,null),m(t,y),m(t,$),m($,C),m($,S),m($,T),m(t,M),O=!0,E||(P=[J(C,"click",ni(Z)),J(T,"click",ni(ee))],E=!0)},p(U,Y){e=U;const G={};Y[0]&2&&(G.id=e[41].id),s.$set(G),F===(F=I(e))&&V?V.p(e,Y):(V.d(1),V=F(e),V&&(V.c(),V.m(r,null))),Y[0]&4098&&(X=e[12],Ae(),u=ct(u,Y,te,1,e,X,f,t,Ut,ph,c,oh),Pe());const de={};Y[0]&2&&(de.date=e[41].created),h.$set(de);const x={};Y[0]&2&&(x.date=e[41].updated),b.$set(x)},i(U){if(!O){A(s.$$.fragment,U);for(let Y=0;Y<X.length;Y+=1)A(u[Y]);A(h.$$.fragment,U),A(b.$$.fragment,U),O=!0}},o(U){L(s.$$.fragment,U);for(let Y=0;Y<u.length;Y+=1)L(u[Y]);L(h.$$.fragment,U),L(b.$$.fragment,U),O=!1},d(U){U&&k(t),j(s),V.d();for(let Y=0;Y<u.length;Y+=1)u[Y].d();j(h),j(b),E=!1,Ye(P)}}}function mh(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&ue(s,i),a[0]&4&&ue(o,r[2])},d(r){r&&k(e)}}}function gh(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[10]),ne(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[28]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ue(o,l),c[0]&1024&&ne(t,"btn-loading",f[10]),c[0]&1024&&ne(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function vD(n){let e,t,i,s;const l=[fD,uD],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ue()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Ae(),L(o[f],1,1,()=>{o[f]=null}),Pe(),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){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function yD(n){let e,t,i,s,l,o,r,a;e=new On({props:{$$slots:{default:[vD]},$$scope:{ctx:n}}});let u={};i=new aD({props:u}),n[29](i),i.$on("save",n[30]),i.$on("delete",n[31]);let f={};l=new nu({props:f}),n[32](l),l.$on("save",n[33]);let c={collection:n[5]};return r=new pb({props:c}),n[34](r),r.$on("save",n[35]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment),o=D(),q(r.$$.fragment)},m(d,h){H(e,d,h),w(d,t,h),H(i,d,h),w(d,s,h),H(l,d,h),w(d,o,h),H(r,d,h),a=!0},p(d,h){const g={};h[0]&65534|h[1]&262144&&(g.$$scope={dirty:h,ctx:d}),e.$set(g);const v={};i.$set(v);const b={};l.$set(b);const y={};h[0]&32&&(y.collection=d[5]),r.$set(y)},i(d){a||(A(e.$$.fragment,d),A(i.$$.fragment,d),A(l.$$.fragment,d),A(r.$$.fragment,d),a=!0)},o(d){L(e.$$.fragment,d),L(i.$$.fragment,d),L(l.$$.fragment,d),L(r.$$.fragment,d),a=!1},d(d){j(e,d),d&&k(t),n[29](null),j(i,d),d&&k(s),n[32](null),j(l,d),d&&k(o),n[34](null),j(r,d)}}}function kD(n,e,t){let i,s,l,o,r;rt(n,zo,W=>t(36,l=W)),rt(n,Nt,W=>t(14,o=W)),rt(n,us,W=>t(15,r=W)),tn(Nt,o="Users",o);const a=new URLSearchParams(l),u=["id","userId","created","updated"];let f,c,d,h=[],g=1,v=0,b=!1,y=a.get("filter")||"",$=a.get("sort")||"-created",C=new dn,S=!1;E();async function T(W=1){return t(10,b=!0),W<=1&&M(),we.users.getList(W,50,{sort:$||"-created",filter:y}).then(ce=>{t(10,b=!1),t(1,h=h.concat(ce.items)),t(9,g=ce.page),t(2,v=ce.totalItems)}).catch(ce=>{ce!=null&&ce.isAbort||(t(10,b=!1),console.warn(ce),M(),we.errorResponseHandler(ce,!1))})}function M(){t(1,h=[]),t(9,g=1),t(2,v=0)}function O(W){const ce=h.find(ae=>ae.id===(W==null?void 0:W.userId));ce&&(ce.profile=W),t(1,h)}async function E(){t(11,S=!0);try{t(5,C=await we.collections.getOne("profiles"))}catch(W){we.errorResponseHandler(W)}t(11,S=!1)}const P=()=>c==null?void 0:c.show(C),I=()=>T(),F=()=>f==null?void 0:f.show(),V=W=>t(3,y=W.detail);function X(W){$=W,t(4,$)}function te(W){$=W,t(4,$)}function Z(W){$=W,t(4,$)}function ee(W){$=W,t(4,$)}const U=W=>f==null?void 0:f.show(W),Y=W=>d==null?void 0:d.show(W.profile),G=()=>t(3,y=""),de=()=>T(g+1);function x(W){me[W?"unshift":"push"](()=>{f=W,t(6,f)})}const ve=()=>T(),_e=()=>T();function ge(W){me[W?"unshift":"push"](()=>{c=W,t(7,c)})}const K=W=>t(5,C=W.detail);function ye(W){me[W?"unshift":"push"](()=>{d=W,t(8,d)})}const oe=W=>O(W.detail);return n.$$.update=()=>{var W;if(n.$$.dirty[0]&24&&$!==-1&&y!==-1){const ce=new URLSearchParams({filter:y,sort:$}).toString();Ci("/users?"+cLine truncated
|
||||
<span class="txt">Application</span>`,o=D(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||||
<span class="txt">Mail settings</span>`,a=D(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||||
<span class="txt">Files storage</span>`,f=D(),c=_("div"),c.innerHTML=`<span class="txt">Sync</span>
|
||||
<small class="label label-danger label-sm">Experimental</small>`,d=D(),h=_("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
|
||||
<span class="txt">Export collections</span>`,g=D(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
|
||||
<span class="txt">Import collections</span>`,b=D(),y=_("div"),y.textContent="Authentication",$=D(),C=_("a"),C.innerHTML=`<i class="ri-lock-password-line"></i>
|
||||
<span class="txt">Auth providers</span>`,S=D(),T=_("a"),T.innerHTML=`<i class="ri-key-line"></i>
|
||||
<span class="txt">Token options</span>`,M=D(),O=_("a"),O.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(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(C,"href","/settings/auth-providers"),p(C,"class","sidebar-list-item"),p(T,"href","/settings/tokens"),p(T,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,v),m(t,b),m(t,y),m(t,$),m(t,C),m(t,S),m(t,T),m(t,M),m(t,O),E||(P=[We(qn.call(null,l,{path:"/settings"})),We(gn.call(null,l)),We(qn.call(null,r,{path:"/settings/mail/?.*"})),We(gn.call(null,r)),We(qn.call(null,u,{path:"/settings/storage/?.*"})),We(gn.call(null,u)),We(qn.call(null,h,{path:"/settings/export-collections/?.*"})),We(gn.call(null,h)),We(qn.call(null,v,{path:"/settings/import-collections/?.*"})),We(gn.call(null,v)),We(qn.call(null,C,{path:"/settings/auth-providers/?.*"})),We(gn.call(null,C)),We(qn.call(null,T,{path:"/settings/tokens/?.*"})),We(gn.call(null,T)),We(qn.call(null,O,{path:"/settings/admins/?.*"})),We(gn.call(null,O))],E=!0)},p:se,i:se,o:se,d(I){I&&k(e),E=!1,Ye(P)}}}class Ui extends Ee{constructor(e){super(),Oe(this,e,null,$D,De,{})}}function _h(n,e,t){const i=n.slice();return i[31]=e[t],i}function bh(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[SD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function SD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="ID",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function vh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=D(),ti(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[J(e,"click",a),J(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Ye(r)}}}function CD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Email",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Me(r,n[3]),u||(f=J(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Me(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function yh(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[MD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function MD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function kh(n){let e,t,i,s,l,o,r,a,u;return s=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[TD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[DD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),q(s.$$.fragment),l=D(),o=_("div"),q(r.$$.fragment),p(i,"class","col-sm-6"),p(o,Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function PD(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&wh(n);return{c(){h&&h.c(),e=D(),t=_("button"),i=_("span"),i.textContent="Cancel",s=D(),l=_("button"),o=_("span"),a=N(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),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],ne(l,"btn-loading",n[6])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=J(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?h&&(Ae(),L(h,1,1,()=>{h=null}),Pe()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=wh(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),(!f||v[0]&64)&&ne(l,"btn-loading",g[6])},i(g){f||(A(h),f=!0)},o(g){L(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function LD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[PD],header:[ED],default:[OD]},$$scope:{ctx:n}};return e=new ui({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),j(e,s)}}}function ID(n,e,t){let i;const s=Qt(),l="admin_"+B.randomString(5);let o,r=new as,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function v(U){return y(U),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(U){ri({}),t(1,r=U!=null&&U.clone?U.clone():new as),$()}function $(){t(4,g=!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,h="")}function C(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||g)&&(U.password=d,U.passwordConfirm=h);let Y;r.isNew?Y=we.admins.create(U):Y=we.admins.update(r.id,U),Y.then(async G=>{var de;t(7,u=!1),b(),sn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",G),((de=we.authStore.model)==null?void 0:de.id)===G.id&&we.authStore.save(we.authStore.token,G)}).catch(G=>{we.errorResponseHandler(G)}).finally(()=>{t(6,a=!1)})}function S(){!(r!=null&&r.id)||si("Do you really want to delete the selected admin?",()=>we.admins.delete(r.id).then(()=>{t(7,u=!1),b(),sn("Successfully deleted admin."),s("delete",r)}).catch(U=>{we.errorResponseHandler(U)}))}const T=()=>S(),M=()=>b(),O=U=>t(2,f=U),E=(U,Y)=>{(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),t(2,f=U))};function P(){c=this.value,t(3,c)}function I(){g=this.checked,t(4,g)}function F(){d=this.value,t(8,d)}function V(){h=this.value,t(9,h)}const X=()=>i&&u?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function te(U){me[U?"unshift":"push"](()=>{o=U,t(5,o)})}function Z(U){xe.call(this,n,U)}function ee(U){xe.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,h,i,l,C,S,v,T,M,O,E,P,I,F,V,X,te,Z,ee]}class ND extends Ee{constructor(e){super(),Oe(this,e,ID,LD,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function $h(n,e,t){const i=n.slice();return i[24]=e[t],i}function FD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function RD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function HD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function jD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Sh(n){let e;function t(l,o){return l[5]?VD:qD}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function qD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Ch(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txtLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Ch(n){let e,t,i;return{c(){e=_("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){w(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Mh(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Th(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g=e[24].email+"",v,b,y,$,C,S,T,M,O,E,P,I,F,V;u=new lr({props:{id:e[24].id}});let X=e[24].id===e[7].id&&Mh();C=new Si({props:{date:e[24].created}}),M=new Si({props:{date:e[24].updated}});function te(){return e[15](e[24])}function Z(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=D(),a=_("td"),q(u.$$.fragment),f=D(),X&&X.c(),c=D(),d=_("td"),h=_("span"),v=N(g),y=D(),$=_("td"),q(C.$$.fragment),S=D(),T=_("td"),q(M.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),ti(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(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(T,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,U){w(ee,t,U),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),H(u,a,null),m(a,f),X&&X.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,y),m(t,$),H(C,$,null),m(t,S),m(t,T),H(M,T,null),m(t,O),m(t,E),m(t,P),I=!0,F||(V=[J(t,"click",te),J(t,"keydown",Z)],F=!0)},p(ee,U){e=ee,(!I||U&16&&!ti(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Y={};U&16&&(Y.id=e[24].id),u.$set(Y),e[24].id===e[7].id?X||(X=Mh(),X.c(),X.m(a,null)):X&&(X.d(1),X=null),(!I||U&16)&&g!==(g=e[24].email+"")&&ue(v,g),(!I||U&16&&b!==(b=e[24].email))&&p(h,"title",b);const G={};U&16&&(G.date=e[24].created),C.$set(G);const de={};U&16&&(de.date=e[24].updated),M.$set(de)},i(ee){I||(A(u.$$.fragment,ee),A(C.$$.fragment,ee),A(M.$$.fragment,ee),I=!0)},o(ee){L(u.$$.fragment,ee),L(C.$$.fragment,ee),L(M.$$.fragment,ee),I=!1},d(ee){ee&&k(t),j(u),X&&X.d(),j(C),j(M),F=!1,Ye(V)}}}function Dh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),r=N(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&ue(s,i),u&16&&o!==(o=a[4].length+"")&&ue(r,o)},d(a){a&&k(e)}}}function zD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y,G,de,x=[],ve=new Map,_e,ge,K,ye,oe;a=new Xo({}),a.$on("refresh",n[8]),g=new Go({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]);function W(Te){n[11](Te)}let ce={class:"col-type-text",name:"id",$$slots:{default:[FD]},$$scope:{ctx:n}};n[2]!==void 0&&(ce.sort=n[2]),M=new an({props:ce}),me.push(()=>Re(M,"sort",W));function ae(Te){n[12](Te)}let Se={class:"col-type-email col-field-email",name:"email",$$slots:{default:[RD]},$$scope:{ctx:n}};n[2]!==void 0&&(Se.sort=n[2]),P=new an({props:Se}),me.push(()=>Re(P,"sort",ae));function Q(Te){n[13](Te)}let $e={class:"col-type-date col-field-created",name:"created",$$slots:{default:[HD]},$$scope:{ctx:n}};n[2]!==void 0&&($e.sort=n[2]),V=new an({props:$e}),me.push(()=>Re(V,"sort",Q));function Be(Te){n[14](Te)}let Xe={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[jD]},$$scope:{ctx:n}};n[2]!==void 0&&(Xe.sort=n[2]),Z=new an({props:Xe}),me.push(()=>Re(Z,"sort",Be));let ut=n[4];const it=Te=>Te[24].id;for(let Te=0;Te<ut.length;Te+=1){let Ve=$h(n,ut,Te),Ze=it(Ve);ve.set(Ze,x[Te]=Th(Ze,Ve))}let Je=null;ut.length||(Je=Sh(n));let et=n[4].length&&Dh(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[6]),r=D(),q(a.$$.fragment),u=D(),f=_("div"),c=D(),d=_("button"),d.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New admin</span>`,h=D(),q(g.$$.fragment),v=D(),b=_("div"),y=_("table"),$=_("thead"),C=_("tr"),S=_("th"),T=D(),q(M.$$.fragment),E=D(),q(P.$$.fragment),F=D(),q(V.$$.fragment),te=D(),q(Z.$$.fragment),U=D(),Y=_("th"),G=D(),de=_("tbody");for(let Te=0;Te<x.length;Te+=1)x[Te].c();Je&&Je.c(),_e=D(),et&&et.c(),ge=Ue(),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(S,"class","min-width"),p(Y,"class","col-type-action min-width"),p(y,"class","table"),ne(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Te,Ve){w(Te,e,Ve),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),H(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(Te,h,Ve),H(g,Te,Ve),w(Te,v,Ve),w(Te,b,Ve),m(b,y),m(y,$),m($,C),m(C,S),m(C,T),H(M,C,null),m(C,E),H(P,C,null),m(C,F),H(V,C,null),m(C,te),H(Z,C,null),m(C,U),m(C,Y),m(y,G),m(y,de);for(let Ze=0;Ze<x.length;Ze+=1)x[Ze].m(de,null);Je&&Je.m(de,null),w(Te,_e,Ve),et&&et.m(Te,Ve),w(Te,ge,Ve),K=!0,ye||(oe=J(d,"click",n[9]),ye=!0)},p(Te,Ve){(!K||Ve&64)&&ue(o,Te[6]);const Ze={};Ve&2&&(Ze.value=Te[1]),g.$set(Ze);const tt={};Ve&134217728&&(tt.$$scope={dirty:Ve,ctx:Te}),!O&&Ve&4&&(O=!0,tt.sort=Te[2],He(()=>O=!1)),M.$set(tt);const dt={};Ve&134217728&&(dt.$$scope={dirty:Ve,ctx:Te}),!I&&Ve&4&&(I=!0,dt.sort=Te[2],He(()=>I=!1)),P.$set(dt);const be={};Ve&134217728&&(be.$$scope={dirty:Ve,ctx:Te}),!X&&Ve&4&&(X=!0,be.sort=Te[2],He(()=>X=!1)),V.$set(be);const Fe={};Ve&134217728&&(Fe.$$scope={dirty:Ve,ctx:Te}),!ee&&Ve&4&&(ee=!0,Fe.sort=Te[2],He(()=>ee=!1)),Z.$set(Fe),Ve&186&&(ut=Te[4],Ae(),x=ct(x,Ve,it,1,Te,ut,ve,de,Ut,Th,null,$h),Pe(),!ut.length&&Je?Je.p(Te,Ve):ut.length?Je&&(Je.d(1),Je=null):(Je=Sh(Te),Je.c(),Je.m(de,null))),(!K||Ve&32)&&ne(y,"table-loading",Te[5]),Te[4].length?et?et.p(Te,Ve):(et=Dh(Te),et.c(),et.m(ge.parentNode,ge)):et&&(et.d(1),et=null)},i(Te){if(!K){A(a.$$.fragment,Te),A(g.$$.fragment,Te),A(M.$$.fragment,Te),A(P.$$.fragment,Te),A(V.$$.fragment,Te),A(Z.$$.fragment,Te);for(let Ve=0;Ve<ut.length;Ve+=1)A(x[Ve]);K=!0}},o(Te){L(a.$$.fragment,Te),L(g.$$.fragment,Te),L(M.$$.fragment,Te),L(P.$$.fragment,Te),L(V.$$.fragment,Te),L(Z.$$.fragment,Te);for(let Ve=0;Ve<x.length;Ve+=1)L(x[Ve]);K=!1},d(Te){Te&&k(e),j(a),Te&&k(h),j(g,Te),Te&&k(v),Te&&k(b),j(M),j(P),j(V),j(Z);for(let Ve=0;Ve<x.length;Ve+=1)x[Ve].d();Je&&Je.d(),Te&&k(_e),et&&et.d(Te),Te&&k(ge),ye=!1,oe()}}}function BD(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[zD]},$$scope:{ctx:n}}});let r={};return l=new ND({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[18](null),j(l,a)}}}function UD(n,e,t){let i,s,l;rt(n,zo,F=>t(21,i=F)),rt(n,Nt,F=>t(6,s=F)),rt(n,Aa,F=>t(7,l=F)),tn(Nt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),we.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),we.errorResponseHandler(F,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}function C(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}const T=F=>r==null?void 0:r.show(F),M=(F,V)=>{(V.code==="Enter"||V.code==="Space")&&(V.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function E(F){me[F?"unshift":"push"](()=>{r=F,t(3,r)})}const P=()=>d(),I=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Ci("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,$,C,S,T,M,O,E,P,I]}class WD extends Ee{constructor(e){super(),Oe(this,e,UD,BD,De,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function YD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=D(),l=_("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0]),l.focus(),r||(a=J(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]&&Me(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function KD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=N("Password"),s=D(),l=_("input"),r=D(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),MLine truncated
|
||||
<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"),ne(a,"btn-disabled",n[2]),ne(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),m(e,a),u=!0,f||(c=J(e,"submit",Yt(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),(!u||h&4)&&ne(a,"btn-disabled",d[2]),(!u||h&4)&&ne(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),j(s),j(o),f=!1,c()}}}function ZD(n){let e,t;return e=new o_({props:{$$slots:{default:[JD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function GD(n,e,t){let i;rt(n,zo,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),we.admins.authViaEmail(l,o).then(()=>{Ci("/")}).catch(()=>{ml("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 XD extends Ee{constructor(e){super(),Oe(this,e,GD,ZD,De,{})}}function QD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;i=new Ne({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[eO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[tO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[nO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new Ne({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[iO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Oh(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),c=D(),d=_("div"),h=_("div"),g=D(),M&&M.c(),v=D(),b=_("button"),y=_("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],ne(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),H(a,e,null),m(e,u),H(f,e,null),m(e,c),m(e,d),m(d,h),m(d,g),M&&M.m(d,null),m(d,v),m(d,b),m(b,y),C=!0,S||(T=J(b,"click",n[13]),S=!0)},p(O,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&1572865&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),a.$set(F);const V={};E&1572865&&(V.$$scope={dirty:E,ctx:O}),f.$set(V),O[3]?M?M.p(O,E):(M=Oh(O),M.c(),M.m(d,v)):M&&(M.d(1),M=null),(!C||E&12&&$!==($=!O[3]||O[2]))&&(b.disabled=$),(!C||E&4)&&ne(b,"btn-loading",O[2])},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),C=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),L(f.$$.fragment,O),C=!1},d(O){O&&k(e),j(i),j(o),j(a),j(f),M&&M.d(),S=!1,T()}}}function xD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function eO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application name"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.appName),r||(a=J(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&&Me(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function tO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application url"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.appUrl),r||(a=J(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&&Me(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Logs max days retention"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].logs.maxDays),r||(a=J(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&&Me(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function iO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("input"),i=D(),s=_("label"),l=_("spanLine truncated
|
||||
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=_("div"),s=_("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),m(i,s),c[l].m(s,null),r=!0,a||(u=J(s,"submit",Yt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Ae(),L(c[v],1,1,()=>{c[v]=null}),Pe(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){L(o),r=!1},d(h){h&&k(e),h&&k(t),h&&k(i),c[l].d(),a=!1,u()}}}function lO(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[sO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function oO(n,e,t){let i,s,l,o;rt(n,us,M=>t(14,s=M)),rt(n,$o,M=>t(15,l=M)),rt(n,Nt,M=>t(16,o=M)),tn(Nt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const M=await we.settings.getAll()||{};g(M)}catch(M){we.errorResponseHandler(M)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const M=await we.settings.update(B.filterRedactedProps(a));g(M),sn("Successfully saved application settings.")}catch(M){we.errorResponseHandler(M)}t(2,f=!1)}}function g(M={}){var O,E;tn($o,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),tn(us,s=!!((E=M==null?void 0:M.meta)!=null&&E.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function v(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=Pt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const S=()=>v(),T=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,v,r,c,b,y,$,C,S,T]}class rO extends Ee{constructor(e){super(),Oe(this,e,oO,lO,De,{})}}function aO(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=at(l,s[o]);return{c(){e=_("input"),mi(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Me(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){mi(e,l=hn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Me(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function uO(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=at(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),mi(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[We(yt.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){mi(s,a=hn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Ye(o)}}}function fO(n){let e;function t(l,o){return l[3]?uO:aO}let i=t(n),s=i(n);return{c(){s.c(),e=Ue()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:se,o:se,d(l){s.d(l),l&&k(e)}}}function cO(n,e,t){const i=["value","mask"];let s=Bt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await Zn(),r==null||r.focus()}const f=()=>u();function c(h){me[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=at(at({},e),li(h)),t(5,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class iu extends Ee{constructor(e){super(),Oe(this,e,cO,fO,De,{value:0,mask:1})}}function dO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;return{c(){e=_("label"),t=N("Subject"),s=D(),l=_("input"),r=D(),a=_("div"),u=N(`Available placeholder parameters:
|
||||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||||
`,c=N(`,
|
||||
`),d=_("span"),d.textContent=`{APP_URL}
|
||||
`,h=N("."),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,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){w(b,e,y),m(e,t),w(b,s,y),w(b,l,y),Me(l,n[0].subject),w(b,r,y),w(b,a,y),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),g||(v=[J(l,"input",n[13]),J(f,"click",n[14]),J(d,"click",n[15])],g=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&Me(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),g=!1,Ye(v)}}}function pO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y;return{c(){e=_("label"),t=N("Action URL"),s=D(),l=_("input"),r=D(),a=_("div"),u=N(`Available placeholder parameters:
|
||||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||||
`,c=N(`,
|
||||
`),d=_("span"),d.textContent=`{APP_URL}
|
||||
`,h=N(`,
|
||||
`),g=_("span"),g.textContent="{TOKEN}",v=N("."),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,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m($,C){w($,e,C),m(e,t),w($,s,C),w($,l,C),Me(l,n[0].actionUrl),w($,r,C),w($,a,C),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),b||(y=[J(l,"input",n[16]),J(f,"click",n[17]),J(d,"click",n[18]),J(g,"click",n[19])],b=!0)},p($,C){C[1]&1&&i!==(i=$[31])&&p(e,"for",i),C[1]&1&&o!==(o=$[31])&&p(l,"id",o),C[0]&1&&l.value!==$[0].actionUrl&&Me(l,$[0].actionUrl)},d($){$&&k(e),$&&k(s),$&&k(l),$&&k(r),$&&k(a),b=!1,Ye(y)}}}function hO(n){let e,t,i,s;return{c(){e=_("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),Me(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&Me(e,l[0].body)},i:se,o:se,d(l){l&&k(e),i=!1,s()}}}function mO(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=new o(r(n)),me.push(()=>Re(e,"value",l))),{c(){e&&q(e.$$.fragment),i=Ue()},m(a,u){e&&H(e,a,u),w(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,He(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;L(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),me.push(()=>Re(e,"value",l)),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&j(e,a)}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S;const T=[mO,hO],M=[];function O(E,P){return E[4]&&!E[5]?0:1}return l=O(n),o=M[l]=T[l](n),{c(){e=_("label"),t=N("Body (HTML)"),s=D(),o.c(),r=D(),a=_("div"),u=N(`Available placeholder parameters:
|
||||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||||
`,c=N(`,
|
||||
`),d=_("span"),d.textContent=`{APP_URL}
|
||||
`,h=N(`,
|
||||
`),g=_("span"),g.textContent=`{TOKEN}
|
||||
`,v=N(`,
|
||||
`),b=_("span"),b.textContent=`{ACTION_URL}
|
||||
`,y=N("."),p(e,"for",i=n[31]),p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(E,P){w(E,e,P),m(e,t),w(E,s,P),M[l].m(E,P),w(E,r,P),w(E,a,P),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),m(a,b),m(a,y),$=!0,C||(S=[J(f,"click",n[22]),J(d,"click",n[23]),J(g,"click",n[24]),J(b,"click",n[25])],C=!0)},p(E,P){(!$||P[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let I=l;l=O(E),l===I?M[l].p(E,P):(Ae(),L(M[I],1,1,()=>{M[I]=null}),Pe(),o=M[l],o?o.p(E,P):(o=M[l]=T[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){$||(A(o),$=!0)},o(E){L(o),$=!1},d(E){E&&k(e),E&&k(s),M[l].d(E),E&&k(r),E&&k(a),C=!1,Ye(S)}}}function _O(n){let e,t,i,s,l,o;return e=new Ne({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[dO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new Ne({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[pO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new Ne({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[gO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&k(t),j(i,r),r&&k(s),j(l,r)}}}function Eh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(yt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=nt(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=nt(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function bO(n){let e,t,i,s,l,o,r,a,u,f,c=n[6]&&Eh();return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),l=N(n[2]),o=D(),r=_("div"),a=D(),c&&c.c(),u=Ue(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),w(d,o,h),w(d,r,h),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&ue(l,d[2]),d[6]?c?h[0]&64&&A(c,1):(c=Eh(),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(a),c&&c.d(d),d&&k(u)}}}function vO(n){let e,t;const i=[n[8]];let s={$$slots:{header:[bO],default:[_O]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(s,i[l]);return e=new sr({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,o){const r=o[0]&256?hn(i,[oi(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){L(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}function yO(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;rt(n,Vi,G=>t(12,o=G));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function v(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await Pi(()=>import("./CodeEditor.fef87cfd.js"),["CodeEditor.fef87cfd.js","index.a9121ab1.js"],import.meta.url)).default),t(5,d=!1))}function y(G){B.copyToClipboard(G),s_(`Copied ${G} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),S=()=>y("{APP_URL}");function T(){u.actionUrl=this.value,t(0,u)}const M=()=>y("{APP_NAME}"),O=()=>y("{APP_URL}"),E=()=>y("{TOKEN}");function P(G){n.$$.not_equal(u.body,G)&&(u.body=G,t(0,u))}function I(){u.body=this.value,t(0,u)}const F=()=>y("{APP_NAME}"),V=()=>y("{APP_URL}"),X=()=>y("{TOKEN}"),te=()=>y("{ACTION_URL}");function Z(G){me[G?"unshift":"push"](()=>{f=G,t(3,f)})}function ee(G){xe.call(this,n,G)}function U(G){xe.call(this,n,G)}function Y(G){xe.call(this,n,G)}return n.$$set=G=>{e=at(at({},e),li(G)),t(8,l=Bt(e,s)),"key"in G&&t(1,r=G.key),"title"in G&&t(2,a=G.title),"config"in G&&t(0,u=G.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!B.isEmpty(B.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Ea(r))},[u,r,a,f,c,d,i,y,l,h,g,v,o,$,C,S,T,M,O,E,P,I,F,V,X,te,Z,ee,U,Y]}class Nr extends Ee{constructor(e){super(),Oe(this,e,yO,vO,De,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get colla
Line truncated
|
||||
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[24]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function qO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary 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],ne(s,"btn-loading",n[3])},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),m(s,l),r||(a=[J(e,"click",n[22]),J(s,"click",n[23])],r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f&8&&ne(s,"btn-loading",u[3])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,Ye(a)}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[EO,OO],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[5]),r=D(),a=_("div"),u=_("form"),f=_("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Yt(n[25])),v=!0)},p(S,T){(!g||T&32)&&ue(o,S[5]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function zO(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[VO]},$$scope:{ctx:n}}});let r={};return l=new DO({props:r}),n[26](l),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&1073741887&&(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[26](null),j(l,a)}}}function BO(n,e,t){let i,s,l;rt(n,Nt,ee=>t(5,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}];tn(Nt,l="Mail settings",l);let r,a={},u={},f=!1,c=!1;d();async function d(){t(2,f=!0);try{const ee=await we.settings.getAll()||{};g(ee)}catch(ee){we.errorResponseHandler(ee)}t(2,f=!1)}async function h(){if(!(c||!s)){t(3,c=!0);try{const ee=await we.settings.update(B.filterRedactedProps(u));g(ee),ri({}),sn("Successfully saved mail settings.")}catch(ee){we.errorResponseHandler(ee)}t(3,c=!1)}}function g(ee={}){t(0,u={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),t(9,a=JSON.parse(JSON.stringify(u)))}function v(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function b(){u.meta.senderName=this.value,t(0,u)}function y(){u.meta.senderAddress=this.value,t(0,u)}function $(ee){n.$$.not_equal(u.meta.verificationTemplate,ee)&&(u.meta.verificationTemplate=ee,t(0,u))}function C(ee){n.$$.not_equal(u.meta.resetPasswordTemplate,ee)&&(u.meta.resetPasswordTemplate=ee,t(0,u))}function S(ee){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,ee)&&(u.meta.confirmEmailChangeTemplate=ee,t(0,u))}function T(){u.smtp.enabled=this.checked,t(0,u)}function M(){u.smtp.host=this.value,t(0,u)}function O(){u.smtp.port=Pt(this.value),t(0,u)}function E(ee){n.$$.not_equal(u.smtp.tls,ee)&&(u.smtp.tls=ee,t(0,u))}function P(){u.smtp.username=this.value,t(0,u)}function I(ee){n.$$.not_equal(u.smtp.password,ee)&&(u.smtp.password=ee,t(0,u))}const F=()=>v(),V=()=>h(),X=()=>r==null?void 0:r.show(),te=()=>h();function Z(ee){me[ee?"unshift":"push"](()=>{r=ee,t(1,r)})}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(4,s=i!=JSON.stringify(u))},[u,r,f,c,s,l,o,h,v,a,i,b,y,$,C,S,T,M,O,E,P,I,F,V,X,te,Z]}class UO extends Ee{constructor(e){super(),Oe(this,e,BO,zO,De,{})}}function WO(n){var S,T;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[KO,({uniqueId:M})=>({25:M}),({uniqueId:M})=>M?33554432:0]},$$scope:{ctx:n}}});let b=((S=n[0].s3)==null?void 0:S.enabled)!=n[1].s3.enabled&&Nh(n),y=n[1].s3.enabled&&Fh(n),$=((T=n[1].s3)==null?void 0:T.enabled)&&!n[6]&&!n[3]&&Rh(n),C=n[6]&&Hh(n);return{c(){q(e.$$.fragment),t=D(),b&&b.c(),i=D(),y&&y.c(),s=D(),l=_("div"),o=_("div"),r=D(),$&&$.c(),a=D(),C&&C.c(),u=D(),f=_("button"),c=_("span"),c.textContent="Save changes",p(o,"class","flex-fill"),p(c,"class","txt"),p(f,"type","submit"),p(f,"class","btn btn-expanded"),f.disabled=d=!n[6]||n[3],ne(f,"btn-loading",n[3]),p(l,"class","flex")},m(M,O){H(e,M,O),w(M,t,O),b&&b.m(M,O),w(M,i,O),y&&y.m(M,O),w(M,s,O),w(M,l,O),m(l,o),m(l,r),Line truncated
|
||||
the
|
||||
`),r=_("strong"),u=N(a),f=N(`
|
||||
to the
|
||||
`),c=_("strong"),h=N(d),g=N(`.
|
||||
`),v=_("br"),b=N(`
|
||||
There are numerous command line tools that can help you, such as:
|
||||
`),y=_("a"),y.textContent=`rclone
|
||||
`,$=N(`,
|
||||
`),C=_("a"),C.textContent=`s5cmd
|
||||
`,S=N(", etc."),T=D(),M=_("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,h),m(l,g),m(l,v),m(l,b),m(l,y),m(l,$),m(l,C),m(l,S),m(e,T),m(e,M),E=!0},p(I,F){var V;(!E||F&1)&&a!==(a=(V=I[0].s3)!=null&&V.enabled?"S3 storage":"local file system")&&ue(u,a),(!E||F&2)&&d!==(d=I[1].s3.enabled?"S3 storage":"local file system")&&ue(h,d)},i(I){E||(I&&Tt(()=>{O||(O=nt(e,on,{duration:150},!0)),O.run(1)}),E=!0)},o(I){I&&(O||(O=nt(e,on,{duration:150},!1)),O.run(0)),E=!1},d(I){I&&k(e),I&&O&&O.end()}}}function Fh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M;return i=new Ne({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[JO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[ZO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"s3.region",$$slots:{default:[GO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[XO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[QO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),$=new Ne({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[xO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(d.$$.fragment),h=D(),g=_("div"),q(v.$$.fragment),b=D(),y=_("div"),q($.$$.fragment),C=D(),S=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(S,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),m(e,h),m(e,g),H(v,g,null),m(e,b),m(e,y),H($,y,null),m(e,C),m(e,S),M=!0},p(O,E){const P={};E&100663298&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&100663298&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),u.$set(F);const V={};E&100663298&&(V.$$scope={dirty:E,ctx:O}),d.$set(V);const X={};E&100663298&&(X.$$scope={dirty:E,ctx:O}),v.$set(X);const te={};E&100663298&&(te.$$scope={dirty:E,ctx:O}),$.$set(te)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(v.$$.fragment,O),A($.$$.fragment,O),O&&Tt(()=>{T||(T=nt(e,on,{duration:150},!0)),T.run(1)}),M=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(u.$$.fragment,O),L(d.$$.fragment,O),L(v.$$.fragment,O),L($.$$.fragment,O),O&&(T||(T=nt(e,on,{duration:150},!1)),T.run(0)),M=!1},d(O){O&&k(e),j(i),j(o),j(u),j(d),j(v),j($),O&&T&&T.end()}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Endpoint"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[1].s3.endpoint),r||(a=J(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&&Me(l,u[1].s3.endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function ZO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Bucket"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[1].s3.bucket),r||(a=J(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&&Me(l,u[1].s3.bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function GO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Region"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[1].s3.region),r||(a=J(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&&Me(l,u[1].s3.region)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function XO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Access key"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[1].s3.accessKey),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",
Line truncated
|
||||
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function tE(n){let e,t,i,s;return{c(){e=_("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;w(l,e,o),i||(s=We(t=yt.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Jn(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function nE(n){let e;return{c(){e=_("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Hh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),m(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function iE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[YO,WO],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[7]),r=D(),a=_("div"),u=_("form"),f=_("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(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Yt(n[20])),v=!0)},p(S,T){(!g||T&128)&&ue(o,S[7]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function sE(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[iE]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}const Rr="s3_test_request";function lE(n,e,t){let i,s,l;rt(n,Nt,V=>t(7,l=V)),tn(Nt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;h();async function h(){t(2,a=!0);try{const V=await we.settings.getAll()||{};b(V)}catch(V){we.errorResponseHandler(V)}t(2,a=!1)}async function g(){if(t(5,c=null),!!r.s3.enabled){t(4,f=!0);try{await we.settings.testS3({$cancelKey:Rr})}catch(V){t(5,c=V)}t(4,f=!1)}}async function v(){if(!(u||!s)){t(3,u=!0),clearTimeout(d),d=setTimeout(()=>{we.cancelRequest(Rr),addErrorToast("S3 test connection timeout.")},3e4);try{we.cancelRequest(Rr);const V=await we.settings.update(B.filterRedactedProps(r));ri({}),await b(V),Z0(),c?J0("Successfully saved but failed to establish S3 connection."):sn("Successfully saved files storage settings.")}catch(V){we.errorResponseHandler(V)}clearTimeout(d),t(3,u=!1)}}async function b(V={}){t(1,r={s3:(V==null?void 0:V.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await g()}async function y(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await g()}function $(){r.s3.enabled=this.checked,t(1,r)}function C(){r.s3.endpoint=this.value,t(1,r)}function S(){r.s3.bucket=this.value,t(1,r)}function T(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function O(V){n.$$.not_equal(r.s3.secret,V)&&(r.s3.secret=V,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>y(),I=()=>v(),F=()=>v();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,v,y,i,$,C,S,T,M,O,E,P,I,F]}class oE extends Ee{constructor(e){super(),Oe(this,e,lE,sE,De,{})}}function rE(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function jh(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Ne({props:{class:"form-field required",name:"emailAuth.minPasswordLength",$$slots:{default:[aE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field "+(B.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailAuth.exceptDomains",$$slots:{default:[uE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field "+(B.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailAuth.onlyDomains",$$slots:{default:[fE,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const v={};h&1&&(v.class="form-field "+(B.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(B.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=nt(e,on,{duration:150},!0)),f.run(1)}),c=!0)},o(d){L(i.$$.fragment,d),L(o.$$.fragment,d),L(u.$$.fragment,d),d&&(f||(f=nt(e,on,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),j(i),j(o),j(u),d&&f&&f.end()}}}function aE(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Minimum password length"),s=D(),l=_("input"),p(e,"for",i=n[16]),p(l,"type","number"),p(l,"id",o=n[16]),l.required=!0,p(l,"min","5"),p(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].minPassworLine truncated
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&p(e,"for",l);const $={};y&65536&&($.id=b[16]),y&1&&($.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function fE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=We(yt.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(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const $={};y&65536&&($.id=b[16]+".config.onlyDomains"),y&1&&($.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function cE(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-toggle m-b-0",name:"emailAuth.enabled",$$slots:{default:[rE,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&jh(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Ue()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=jh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){j(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function dE(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pE(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=We(yt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=nt(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=nt(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function hE(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?pE:dE}let u=a(n),f=u(n),c=n[2]&&qh();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||||
<span class="txt">Email/Password</span>`,t=D(),f.c(),i=D(),s=_("div"),l=D(),c&&c.c(),o=Ue(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&A(c,1):(c=qh(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){r||(A(c),r=!0)},o(d){L(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function mE(n){let e,t;const i=[n[3]];let s={$$slots:{header:[hE],default:[cE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(s,i[l]);return e=new sr({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,[o]){const r=o&8?hn(i,[oi(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[12](null),j(e,l)}}}function gE(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;rt(n,Vi,S=>t(7,o=S));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function h(){r.minPasswordLength=Pt(this.value),t(0,r)}function g(S){n.$$.not_equal(r.exceptDomains,S)&&(r.exceptDomains=S,t(0,r))}function v(S){n.$$.not_equal(r.onlyDomains,S)&&(r.onlyDomains=S,t(0,r))}function b(S){me[S?"unshift":"push"](()=>{a=S,t(1,a)})}function y(S){xe.call(this,n,S)}function $(S){xe.call(this,n,S)}function C(S){xe.call(this,n,S)}return n.$$set=S=>{e=at(at({},e),li(S)),t(3,l=Bt(e,s)),"config"in S&&t(0,r=S.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!B.isEmpty(o==null?void 0:o.emailAuth))},[r,a,i,l,u,f,c,o,d,h,g,v,b,y,$,C]}class _E extends Ee{constructor(e){super(),Oe(this,e,gE,mE,De,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function bE(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[12]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Vh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;l=new Ne({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[vE,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[yE,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),c=new Ne({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[kE,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}});let v=n[4]&&zh(n);return{c(){e=_("div"),t=_("div"),i=D(),s=_("div"),q(l.$$.fragment),o=D(),r=_("div"),q(a.$$.fragment),u=D(),f=_("div"),q(c.$$.fragment),d=D(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),H(l,s,null),m(e,o),m(e,r),H(a,r,null),m(e,u),m(e,f),H(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const $={};y&2&&($.name=b[1]+".clientId"),y&25165825&&($.$$scope={dirty:y,ctx:b}),l.$set($);const C={};y&2&&(C.name=b[1]+".clientSecret"),y&25165825&&(C.$$scope={dirty:y,ctx:b}),a.$set(C);const S={};y&2&&(S.name=b[1]+".allowRegistrations"),y&25165825&&(S.$$scope={dirty:y,ctx:b}),c.$set(S),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=zh(b),v.c(),A(v,1),v.m(e,null)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{h||(h=nt(e,on,{duration:200},!0)),h.run(1)}),g=!0)},o(b){L(l.$$.fragment,b),L(a.$$.fragment,b),L(c.$$.fragment,b),L(v),b&&(h||(h=nt(e,on,{duration:200},!1)),h.run(0)),g=!1},d(b){b&&k(e),j(l),j(a),j(c),v&&v.d(),b&&h&&h.end()}}}function vE(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Client ID"),s=D(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].clientId),r||(a=J(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&&l.value!==u[0].clientId&&Me(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function yE(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[23],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new iu({props:u}),me.push(()=>Re(l,"value",a)),{c(){e=_("label"),t=N("Client Secret"),s=D(),q(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(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&1&&(Line truncated
|
||||
another PocketBase environment.</p>`,t=D(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),q(o.$$.fragment),r=D(),a=_("div"),u=_("div"),f=D(),c=_("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-secondary 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,b){w(v,e,b),w(v,t,b),w(v,i,b),m(i,s),m(i,l),H(o,i,null),n[8](i),w(v,r,b),w(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(A(o.$$.fragment,v),d=!0)},o(v){L(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),j(o),n[8](null),v&&k(r),v&&k(a),h=!1,Ye(g)}}}function YE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function KE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[YE,WE],g=[];function v(b,y){return b[1]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[3]),r=D(),a=_("div"),u=_("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(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&ue(o,b[3]);let $=f;f=v(b),f===$?g[f].p(b,y):(Ae(),L(g[$],1,1,()=>{g[$]=null}),Pe(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function JE(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[KE]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function ZE(n,e,t){let i,s;rt(n,Nt,b=>t(3,s=b)),tn(Nt,s="Export collections",s);const l="export_"+B.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await we.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){we.errorResponseHandler(b)}t(1,a=!1)}function f(){B.downloadJson(r,"pb_schema")}function c(){B.copyToClipboard(i),s_("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){me[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),$=document.createRange();$.selectNodeContents(o),y.removeAllRanges(),y.addRange($)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,v]}class GE extends Ee{constructor(e){super(),Oe(this,e,ZE,JE,De,{})}}function Xh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function xh(n,e,t){const i=n.slice();return i[14]=e[t],i}function em(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function tm(n,e,t){const i=n.slice();return i[14]=e[t],i}function nm(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function im(n,e,t){const i=n.slice();return i[30]=e[t],i}function XE(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&sm(),a=n[0].name!==n[1].name&&lm(n);return{c(){e=_("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=_("strong"),o=N(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),m(e,t),a&&a.m(e,null),m(e,i),m(e,s),m(s,o)},p(u,f){u[9]?r||(r=sm(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=lm(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&ue(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function QE(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=D(),i=_("strong"),l=N(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&ue(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function xE(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Added",t=D(),i=_("strong"),l=N(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&ue(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function sm(n){let e;return{c(){e=_("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function lm(n){let e,t=n[0].name+"",i,s,l;return{c(){e=_("strong"),i=N(t),s=D(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function om(n){var b,y;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+""Line truncated
|
||||
<th width="10%" class="svelte-lmkr38">Old</th>
|
||||
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=_("tbody");for(let S=0;S<g.length;S+=1)g[S].c();r=D(),v&&v.c(),a=D();for(let S=0;S<y.length;S+=1)y[S].c();u=D();for(let S=0;S<C.length;S+=1)C[S].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(S,T){w(S,e,T),d.m(e,null),w(S,t,T),w(S,i,T),m(i,s),m(i,l),m(i,o);for(let M=0;M<g.length;M+=1)g[M].m(o,null);m(o,r),v&&v.m(o,null),m(o,a);for(let M=0;M<y.length;M+=1)y[M].m(o,null);m(o,u);for(let M=0;M<C.length;M+=1)C[M].m(o,null)},p(S,T){if(c===(c=f(S))&&d?d.p(S,T):(d.d(1),d=c(S),d&&(d.c(),d.m(e,null))),T[0]&7203){h=S[11];let M;for(M=0;M<h.length;M+=1){const O=im(S,h,M);g[M]?g[M].p(O,T):(g[M]=om(O),g[M].c(),g[M].m(o,r))}for(;M<g.length;M+=1)g[M].d(1);g.length=h.length}if(S[2]||S[5]?v?v.p(S,T):(v=rm(S),v.c(),v.m(o,a)):v&&(v.d(1),v=null),T[0]&4248){b=S[7];let M;for(M=0;M<b.length;M+=1){const O=xh(S,b,M);y[M]?y[M].p(O,T):(y[M]=dm(O),y[M].c(),y[M].m(o,u))}for(;M<y.length;M+=1)y[M].d(1);y.length=b.length}if(T[0]&4352){$=S[8];let M;for(M=0;M<$.length;M+=1){const O=Xh(S,$,M);C[M]?C[M].p(O,T):(C[M]=hm(O),C[M].c(),C[M].m(o,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=$.length}},i:se,o:se,d(S){S&&k(e),d.d(),S&&k(t),S&&k(i),nn(g,S),v&&v.d(),nn(y,S),nn(C,S)}}}function Vn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function yn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function t5(n,e,t){let i,s,l,{collectionA:o=new dn}=e,{collectionB:r=new dn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const g=Object.keys(new dn().export()).filter(y=>!["schema","created","updated"].includes(y));function v(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find($=>y.id==$.id))))}function b(y){return typeof y>"u"?"":B.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&v(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find($=>y.id==$.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find($=>$.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find($=>$.id==y.id))),n.$$.dirty[0]&7&&t(9,l=B.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,b]}class n5 extends Ee{constructor(e){super(),Oe(this,e,t5,e5,De,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function mm(n,e,t){const i=n.slice();return i[17]=e[t],i}function gm(n){let e,t;return e=new n5({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function i5(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=gm(mm(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Ue()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(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=mm(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=gm(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);Pe()}},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)L(s[r]);t=!1},d(o){nn(s,o),o&&k(e)}}}function s5(n){let e;return{c(){e=_("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function l5(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=N("Close"),i=D(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=n[4],ne(s,"btn-loading",n[4])},m(a,u){w(a,e,u),m(e,t),w(a,i,u),w(a,s,u),m(s,l),o||(r=[J(e,"click",n[0]),J(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&ne(s,"btn-loading",a[4])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,Ye(r)}}}function o5(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[l5],header:[s5],default:[i5]},$$scope:{ctx:n}};return e=new ui({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(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){L(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function r5(n,e,t){const i=Qt();let s,Line truncated
|
||||
- ${S.join(`
|
||||
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await we.collections.import(o,a),sn("Successfully imported collections configuration."),i("submit")}catch(S){we.errorResponseHandler(S)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y(S){me[S?"unshift":"push"](()=>{s=S,t(1,s)})}function $(S){xe.call(this,n,S)}function C(S){xe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,$,C]}class a5 extends Ee{constructor(e){super(),Oe(this,e,r5,o5,De,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function _m(n,e,t){const i=n.slice();return i[32]=e[t],i}function bm(n,e,t){const i=n.slice();return i[35]=e[t],i}function vm(n,e,t){const i=n.slice();return i[32]=e[t],i}function u5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O;a=new Ne({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[c5,({uniqueId:X})=>({40:X}),({uniqueId:X})=>[0,X?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&km(),I=n[6]&&n[1].length&&n[7]&&wm(n),F=n[13].length&&Lm(n),V=!!n[0]&&Im(n);return{c(){e=_("input"),t=D(),i=_("div"),s=_("p"),l=N(`Paste below the collections configuration you want to import or
|
||||
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),q(a.$$.fragment),u=D(),f=D(),P&&P.c(),c=D(),I&&I.c(),d=D(),F&&F.c(),h=D(),g=_("div"),V&&V.c(),v=D(),b=_("div"),y=D(),$=_("button"),C=_("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ne(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(C,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=S=!n[14],p(g,"class","flex m-t-base")},m(X,te){w(X,e,te),n[19](e),w(X,t,te),w(X,i,te),m(i,s),m(s,l),m(s,o),w(X,r,te),H(a,X,te),w(X,u,te),w(X,f,te),P&&P.m(X,te),w(X,c,te),I&&I.m(X,te),w(X,d,te),F&&F.m(X,te),w(X,h,te),w(X,g,te),V&&V.m(g,null),m(g,v),m(g,b),m(g,y),m(g,$),m($,C),T=!0,M||(O=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(X,te){(!T||te[0]&4096)&&ne(o,"btn-loading",X[12]);const Z={};te[0]&64&&(Z.class="form-field "+(X[6]?"":"field-error")),te[0]&65|te[1]&1536&&(Z.$$scope={dirty:te,ctx:X}),a.$set(Z),X[6]&&X[1].length&&!X[7]?P||(P=km(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),X[6]&&X[1].length&&X[7]?I?I.p(X,te):(I=wm(X),I.c(),I.m(d.parentNode,d)):I&&(I.d(1),I=null),X[13].length?F?F.p(X,te):(F=Lm(X),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null),X[0]?V?V.p(X,te):(V=Im(X),V.c(),V.m(g,v)):V&&(V.d(1),V=null),(!T||te[0]&16384&&S!==(S=!X[14]))&&($.disabled=S)},i(X){T||(A(a.$$.fragment,X),A(E),T=!0)},o(X){L(a.$$.fragment,X),L(E),T=!1},d(X){X&&k(e),n[19](null),X&&k(t),X&&k(i),X&&k(r),j(a,X),X&&k(u),X&&k(f),P&&P.d(X),X&&k(c),I&&I.d(X),X&&k(d),F&&F.d(X),X&&k(h),X&&k(g),V&&V.d(),M=!1,Ye(O)}}}function f5(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function ym(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function c5(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&ym();return{c(){e=_("label"),t=N("Collections"),s=D(),l=_("textarea"),r=D(),c&&c.c(),a=Ue(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Me(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=J(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Me(l,d[0]),!!d[0]&&!d[6]?c||(c=ym(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function km(n){let e;return{c(){e=_("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){w(t,e,i)},d(t){t&&k(e)}}}function wm(n){let e,t,i,s,l,o=n[9].length&&$m(n),r=n[4].length&&Mm(n),a=n[8].length&&Em(n);return{c(){e=_("h5"),e.textContent="Detected changes",t=D(),i=_("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),m(i,s),r&&r.m(i,null),m(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=$m(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Mm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Em(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function $m(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=vm(n,s,o),a=l(r);t.set(a,e[o]=Cm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ue()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=ct(e,r,l,1,o,s,t,i.parentNode,pn,Cm,i,vm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Sm(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Cm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Sm(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=D(),l=_("strong"),r=N(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=Sm(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Mm(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=bm(n,s,o),a=l(r);t.set(a,e[o]=Om(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ue()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=ct(e,r,l,1,o,s,t,i.parentNode,pn,Om,i,bm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Tm(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=_("strong"),i=N(t),s=D(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function Dm(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Om(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&&Tm(e),h=e[35].new.id&&Dm(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Changed",s=D(),l=_("div"),d&&d.c(),o=D(),r=_("strong"),u=N(a),f=D(),h&&h.c(),c=D(),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(g,v){w(g,t,v),m(t,i),m(t,s),m(t,l),d&&d.m(l,null),m(l,o),m(l,r),m(r,u),m(l,f),h&&h.m(l,null),m(t,c)},p(g,v){e=g,e[35].old.name!==e[35].new.name?d?d.p(e,v):(d=Tm(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),v[0]&16&&a!==(a=e[35].new.name+"")&&ue(u,a),e[35].new.id?h?h.p(e,v):(h=Dm(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&k(t),d&&d.d(),h&&h.d()}}}function Em(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=_m(n,s,o),a=l(r);t.set(a,e[o]=Pm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ue()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=ct(e,r,l,1,o,s,t,i.parentNode,pn,Pm,i,_m))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Am(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Pm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Am(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Added",s=D(),l=_("strong"),r=N(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=Am(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Lm(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=_("div"),s.innerHTML=`<string>Some of the imported collections shares 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=_("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){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:se,d(u){u&&k(e),r=!1,a()}}}function Im(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-secondary link-hint")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function d5(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[f5,u5],g=[];function v(b,y){return b[5]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[15]),r=D(),a=_("div"),u=_("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(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&ue(o,b[15]);let $=f;f=v(b),f===$?g[f].p(b,y):(Ae(),L(g[$],1,1,()=>{g[$]=null}),Pe(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function p5(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[d5]},$$scope:{ctx:n}}});let r={};return l=new a5({props:r}),n[27](l),l.$on("submit",n[28]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[27](null),j(l,a)}}}function h5(n,e,t){let i,s,l,o,r,a,u;rt(n,Nt,G=>t(15,u=G)),tn(Nt,u="Import collections",u);let f,c,d="",h=!1,g=[],v=[],b=!0,y=[],$=!1;C();async function C(){t(5,$=!0);try{t(2,v=await we.collections.getFullList(200));for(let G of v)delete G.created,delete G.updated}catch(G){we.errorResponseHandler(G)}t(5,$=!1)}function S(){if(t(4,y=[]),!!i)for(let G of g){const de=B.findByKey(v,"id",G.id);!(de!=null&&de.id)||!B.hasCollectionChanges(de,G,b)||y.push({new:G,old:de})}}function T(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=B.filterDuplicatesByKey(g)):t(1,g=[]);for(let G of g)delete G.created,delete G.updated,G.schema=B.filterDuplicatesByKey(G.schema)}function M(){var G,de;for(let x of g){const ve=B.findByKey(v,"name",x.name)||B.findByKey(v,"id",x.id);if(!ve)continue;const _e=x.id,ge=ve.id;x.id=ge;const K=Array.isArray(ve.schema)?ve.schema:[],ye=Array.isArray(x.schema)?x.schema:[];for(const oe of ye){const W=B.findByKey(K,"name",oe.name);W&&W.id&&(oe.id=W.id)}for(let oe of g)if(!!Array.isArray(oe.schema))for(let W of oe.schema)((G=W.options)==null?void 0:G.collectionId)&&((de=W.options)==null?void 0:de.collectionId)===_e&&(W.options.collectionId=ge)}t(0,d=JSON.stringify(g,null,4))}function O(G){t(12,h=!0);const de=new FileReader;de.onload=async x=>{t(12,h=!1),t(10,f.value="",f),t(0,d=x.target.result),await Zn(),g.length||(ml("Invalid collections configuration."),E())},de.onerror=x=>{console.warn(x),ml("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},de.readAsText(G)}function E(){t(0,d=""),t(10,f.value="",f),ri({})}function P(G){me[G?"unshift":"push"](()=>{f=G,t(10,f)})}const I=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function V(){d=this.value,t(0,d)}function X(){b=this.checked,t(3,b)}const te=()=>M(),Z=()=>E(),ee=()=>c==null?void 0:c.show(v,g,b);function U(G){me[G?"unshift":"push"](()=>{c=G,t(11,c)})}const Y=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&T(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(G=>!!G.id&&!!G.name).length),n.$$.dirty[0]&78&&t(9,s=v.filter(G=>i&&b&&!B.findByKey(g,"id",G.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(G=>i&&!B.findByKey(v,"id",G.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof b<"u")&&S(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!$&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(G=>{let de=B.findByKey(v,"name",G.name)||B.findByKey(v,"id",G.id);if(!de)return!1;if(de.id!=G.id)return!0;const x=Array.isArray(de.schema)?de.schema:[],ve=Array.isArray(G.schema)?G.schema:[];for(const _e of ve){if(B.findByKey(x,"id",_e.id))continue;const K=B.findByKey(x,"name",_e.name);if(K&&_e.id!=K.id)return!0}return!1}))},[d,g,v,b,y,$,i,o,l,s,f,c,h,a,r,u,M,O,E,P,I,F,V,X,te,Z,ee,U,Y]}class m5 extends Ee{constructor(e){super(),Oe(this,e,h5,p5,De,{},null,[-1,-1])}}const rn=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ci("/"):!0}],g5={"/login":en({component:XD,conditions:rn.conLine truncated
|
||||
<span class="txt">Manage admins</span>`,t=D(),i=_("hr"),s=D(),l=_("div"),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,"tabindex","0"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[We(gn.call(null,e)),J(l,"click",n[6])],o=!0)},p:se,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Ye(r)}}}function A5(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=B.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&Rm(n);return o=new Nb({props:{routes:g5}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new S5({}),f=new O5({}),{c(){t=D(),i=_("div"),d&&d.c(),s=D(),l=_("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),H(o,l,null),m(l,r),H(a,l,null),w(g,u,v),H(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=B.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=Rm(g),d.c(),A(d,1),d.m(i,s)):d&&(Ae(),L(d,1,1,()=>{d=null}),Pe())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){L(d),L(o.$$.fragment,g),L(a.$$.fragment,g),L(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),j(o),j(a),g&&k(u),j(f,g)}}}function P5(n,e,t){let i,s,l,o;rt(n,us,h=>t(8,i=h)),rt(n,$o,h=>t(2,s=h)),rt(n,Aa,h=>t(0,l=h)),rt(n,Nt,h=>t(3,o=h));let r,a=!1;function u(h){var g,v,b,y;((g=h==null?void 0:h.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((b=(v=h==null?void 0:h.detail)==null?void 0:v.userData)!=null&&b.showAppSidebar)),r=(y=h==null?void 0:h.detail)==null?void 0:y.location,tn(Nt,o="",o),ri({}),rb())}function f(){Ci("/")}async function c(){var h,g;if(!!(l!=null&&l.id))try{const v=await we.settings.getAll({$cancelKey:"initialAppSettings"});tn($o,s=((h=v==null?void 0:v.meta)==null?void 0:h.appName)||"",s),tn(us,i=!!((g=v==null?void 0:v.meta)!=null&&g.hideControls),i)}catch(v){console.warn("Failed to load app settings.",v)}}function d(){we.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class L5 extends Ee{constructor(e){super(),Oe(this,e,P5,A5,De,{})}}new L5({target:document.getElementById("app")});export{Ye as A,sn as B,B as C,Ci as D,Ue as E,o_ as F,ya as G,rt as H,Ps as I,Qt as J,dn as K,Nn as L,me as M,ou as N,Ee as S,L as a,D as b,q as c,j as d,_ as e,p as f,w as g,m as h,Oe as i,We as j,Ae as k,gn as l,H as m,Pe as n,k as o,we as p,Ne as q,ne as r,De as s,A as t,J as u,Yt as v,N as w,ue as x,se as y,Me as z};
|
||||
@@ -1 +1 @@
|
||||
@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2"),url(../fonts/remixicon/remixicon.woff?v=1) format("woff"),url(../fonts/remixicon/remixicon.ttf?v=1) format("truetype"),url(../fonts/remixicon/remixicon.svg?v=1#remixicon) format("svg");font-display:swap}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:400;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:600;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff) format("woff")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #adb3b8;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #ebeff2;--baseAlt2Color: #dee3e8;--baseAlt3Color: #a9b4bc;--baseAlt4Color: #7c868d;--infoColor: #3da9fc;--infoAltColor: #d8eefe;--successColor: #2cb67d;--successAltColor: #d6f5e8;--dangerColor: #ef4565;--dangerAltColor: #fcdee4;--warningColor: #ff8e3c;--warningAltColor: #ffe7d6;--overlayColor: rgba(65, 82, 105, .25);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .05);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 24px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 220px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--entranceAnimationSpeed: .25s;--baseRadius: 3px;--lgRadius: 12px;--btnRadius: 3px;accent-color:var(--primaryColor)}html,body,div,span,applet,object,iframe,h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}i{font-family:remixicon!important;font-style:normal;font-weight:400;font-size:1.1238rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i:before{vertical-align:top;margin-top:1px;display:inline-block}.ri-24-hours-fill:before{content:"\ea01"}.ri-24-hours-line:before{content:"\ea02"}.ri-4k-fill:before{content:"\ea03"}.ri-4k-line:befLine truncated
|
||||
@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2"),url(../fonts/remixicon/remixicon.woff?v=1) format("woff"),url(../fonts/remixicon/remixicon.ttf?v=1) format("truetype"),url(../fonts/remixicon/remixicon.svg?v=1#remixicon) format("svg");font-display:swap}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:400;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:600;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff) format("woff")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #adb3b8;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #ebeff2;--baseAlt2Color: #dee3e8;--baseAlt3Color: #a9b4bc;--baseAlt4Color: #7c868d;--infoColor: #3da9fc;--infoAltColor: #d8eefe;--successColor: #2cb67d;--successAltColor: #d6f5e8;--dangerColor: #ef4565;--dangerAltColor: #fcdee4;--warningColor: #ff8e3c;--warningAltColor: #ffe7d6;--overlayColor: rgba(65, 82, 105, .25);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .05);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 24px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 220px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--entranceAnimationSpeed: .25s;--baseRadius: 3px;--lgRadius: 12px;--btnRadius: 3px;accent-color:var(--primaryColor)}html,body,div,span,applet,object,iframe,h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}i{font-family:remixicon!important;font-style:normal;font-weight:400;font-size:1.1238rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i:before{vertical-align:top;margin-top:1px;display:inline-block}.ri-24-hours-fill:before{content:"\ea01"}.ri-24-hours-line:before{content:"\ea02"}.ri-4k-fill:before{content:"\ea03"}.ri-4k-line:befLine truncated
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
class N{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),ze.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),ze.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ti(this),r=new ti(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ti(this,e)}iterRange(e,t=this.length){return new Xo(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Yo(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?N.empty:e.length<=32?new J(e):ze.from(J.split(e,[]))}}class J extends N{constructor(e,t=Ra(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new La(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new J(yr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Hi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new J(l,o.length+r.length));else{let h=l.length>>1;i.push(new J(l.slice(0,h)),new J(l.slice(h)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof J))return super.replace(e,t,i);let s=Hi(this.text,Hi(i.text,yr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new J(s,r):ze.from(J.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
||||
`){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],h=r+l.length;r>e&&o&&(s+=i),e<h&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=h+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new J(i,s)),i=[],s=-1);return s>-1&&t.push(new J(i,s)),t}}class ze extends N{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,h=i+o.lines-1;if((t?h:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=h+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],h=o+l.length;if(e<=h&&t>=o){let a=s&((o<=e?1:0)|(h>=t?2:0));o>=e&&h<=t&&!a?i.push(l):l.decompose(e-o,t-o,i,a)}o=h+1}}replace(e,t,i){if(i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let h=o.replace(e-r,t-r,i),a=this.lines-o.lines+h.lines;if(h.lines<a>>5-1&&h.lines>a>>5+1){let c=this.children.slice();return c[s]=h,new ze(c,this.length-(t-e)+i.length)}return super.replace(r,l,h)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
||||
`){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],h=o+l.length;o>e&&r&&(s+=i),e<h&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=h+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ze))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let h=this.children[s],a=e.children[r];if(h!=a)return i+h.scanIdentical(a,t);i+=h.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new J(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],h=0,a=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof ze)for(let m of d.children)f(m);else d.lines>o&&(h>o||!h)?(u(),l.push(d)):d instanceof J&&h&&(p=c[c.length-1])instanceof J&&d.lines+p.lines<=32?(h+=d.lines,a+=d.length+1,c[c.length-1]=new J(p.text.concat(d.text),p.length+1+d.length)):(h+d.lines>s&&u(),h+=d.lines,a+=d.length+1,c.push(d))}function u(){h!=0&&(l.push(c.length==1?c[0]:ze.from(c,a)),a=-1,h=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new ze(l,t)}}N.empty=new J([""],0);function Ra(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Hi(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],h=s+l.length;h>=t&&(h>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=h+1}return e}function yr(n,e,t){return Hi(n,[""],e,t)}class ti{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof J?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof J?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
||||
`,this;e--}else if(s instanceof J){let h=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=s.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof J?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Xo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ti(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Yo{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(N.prototype[Symbol.iterator]=function(){return this.iter()},ti.prototype[Symbol.iterator]=Xo.prototype[Symbol.iterator]=Yo.prototype[Symbol.iterator]=function(){return this});class La{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Bt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;n<Bt.length;n++)Bt[n]+=Bt[n-1];function Ea(n){for(let e=1;e<Bt.length;e+=2)if(Bt[e]>n)return Bt[e-1]<=n;return!1}function br(n){return n>=127462&&n<=127487}const wr=8205;function fe(n,e,t=!0,i=!0){return(t?Qo:Ia)(n,e,i)}function Qo(n,e,t){if(e==n.length)return e;e&&Zo(n.charCodeAt(e))&&el(n.charCodeAt(e-1))&&e--;let i=ie(n,e);for(e+=Se(i);e<n.length;){let s=ie(n,e);if(i==wr||s==wr||t&&Ea(s))e+=Se(s),i=s;else if(br(s)){let r=0,o=e-2;for(;o>=0&&br(ie(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Ia(n,e,t){for(;e>0;){let i=Qo(n,e-2,t);if(i<e)return i;e--}return 0}function Zo(n){return n>=56320&&n<57344}function el(n){return n>=55296&&n<56320}function ie(n,e){let t=n.charCodeAt(e);if(!el(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Zo(i)?(t-55296<<10)+(i-56320)+65536:t}function Hs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Se(n){return n<65536?1:2}const Yn=/\r\n?|\n/;var le=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(le||(le={}));class Ke{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Qn(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s
Line truncated
|
||||
`}get readOnly(){return this.facet(cl)}phrase(e,...t){for(let i of this.facet(I.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(sl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Ua(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let h=fe(t,o,!1);if(r(t.slice(h,o))!=z.Word)break;o=h}for(;l<s;){let h=fe(t,l);if(r(t.slice(l,h))!=z.Word)break;l=h}return o==l?null:b.range(o+i,l+i)}}I.allowMultipleSelections=rl;I.tabSize=D.define({combine:n=>n.length?n[0]:4});I.lineSeparator=ol;I.readOnly=cl;I.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});I.languageData=sl;I.changeFilter=ll;I.transactionFilter=hl;I.transactionExtender=al;yn.reconfigure=L.define();function Ct(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class yt{eq(e){return this==e}range(e,t=e){return li.create(e,t,this)}}yt.prototype.startSide=yt.prototype.endSide=0;yt.prototype.point=!1;yt.prototype.mapMode=le.TrackDel;class li{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new li(e,t,i)}}function ss(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class $s{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let h=o+l>>1,a=r[h]-e||(i?this.value[h].endSide:this.value[h].startSide)-t;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let h=0;h<this.value.length;h++){let a=this.value[h],c=this.from[h]+e,f=this.to[h]+e,u,d;if(c==f){let p=t.mapPos(c,a.startSide,a.mapMode);if(p==null||(u=d=p,a.startSide!=a.endSide&&(d=t.mapPos(c,a.endSide),d<u)))continue}else if(u=t.mapPos(c,a.startSide),d=t.mapPos(f,a.endSide),u>d||u==d&&a.startSide>0&&a.endSide<=0)continue;(d-u||a.endSide-a.startSide)<0||(o<0&&(o=u),a.point&&(l=Math.max(l,d-u)),i.push(a),s.push(u-o),r.push(d-o))}return{mapped:i.length?new $s(s,r,i,l):null,pos:o}}}class j{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new j(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ss)),this.isEmpty)return t.length?j.of(t):this;let l=new dl(this,null,-1).goto(0),h=0,a=[],c=new bt;for(;l.value||h<t.length;)if(h<t.length&&(l.from-t[h].from||l.startSide-t[h].value.startSide)>=0){let f=t[h++];c.addInner(f.from,f.to,f.value)||a.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(l.chunkIndex)<t[h].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||a.push(li.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!a.length?j.empty:this.nextLayer.update({add:a,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],h=this.chunk[o],a=e.touchesRange(l,l+h.length);if(a===!1)s=Math.max(s,h.maxPoint),t.push(h),i.push(e.mapPos(l));else if(a===!0){let{mapped:c,pos:f}=h.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new j(i,t,r||j.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return hi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return hi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),h=vr(o,l,i),a=new Ut(o,h,r),c=new Ut(l,h
Line truncated
|
||||
`)}static newName(){let e=Mr[Ar]||1;return Mr[Ar]=e+1,ls+e.toString(36)}static mount(e,t){(e[hs]||new Ja(e)).mount(Array.isArray(t)?t:[t])}}let Ai=null;class Ja{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Ai)return e.adoptedStyleSheets=[Ai.sheet].concat(e.adoptedStyleSheets),e[hs]=Ai;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),Ai=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[hs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let h=0;h<o.rules.length;h++)t.insertRule(o.rules[h],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
|
||||
`;this.styleTag.textContent=r}}}var lt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ai={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Dr=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent);var _a=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xa=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ya=_a||Dr&&+Dr[1]<57;for(var ne=0;ne<10;ne++)lt[48+ne]=lt[96+ne]=String(ne);for(var ne=1;ne<=24;ne++)lt[ne+111]="F"+ne;for(var ne=65;ne<=90;ne++)lt[ne]=String.fromCharCode(ne+32),ai[ne]=String.fromCharCode(ne);for(var Rn in lt)ai.hasOwnProperty(Rn)||(ai[Rn]=lt[Rn]);function Qa(n){var e=Ya&&(n.ctrlKey||n.altKey||n.metaKey)||Xa&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ai:lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Ji(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Et(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Za(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function qi(n,e){if(!e.anchorNode)return!1;try{return Et(n,e.anchorNode)}catch{return!1}}function ci(n){return n.nodeType==3?It(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function _i(n,e,t,i){return t?Or(n,e,t,i,-1)||Or(n,e,t,i,1):!1}function Xi(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Or(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:fi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Xi(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?fi(n):0}else return!1}}function fi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const pl={left:0,right:0,top:0,bottom:0};function bn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function ec(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function tc(n,e,t,i,s,r,o,l){let h=n.ownerDocument,a=h.defaultView||window;for(let c=n;c;)if(c.nodeType==1){let f,u=c==h.body;if(u)f=ec(a);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let m=c.getBoundingClientRect();f={left:m.left,right:m.left+c.clientWidth,top:m.top,bottom:m.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top<f.top?(p=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p<f.top&&(p=-(f.top+p-e.top+o)));else{let m=e.bottom-e.top,g=f.bottom-f.top;p=(s=="center"&&m<=g?e.top+m/2-g/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-g+o)-f.top}if(i=="nearest"?e.left<f.left?(d=-(f.left-e.left+r),t>0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.left<f.left+d&&(d=-(f.left+d-e.left+r))):d=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==l?e.left-r:e.right-(f.right-f.left)+r)-f.left,d||p)if(u)a.scrollBy(d,p);else{let m=0,g=0;if(p){let y=c.scrollTop;c.scrollTop+=p,g=c.scrollTop-y}if(d){let y=c.scrollLeft;c.scrollLeft+=d,m=c.scrollLeft-y}e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g},m&&Math.abs(m-d)<1&&(i="nearest"),g&&Math.abs(g-p)<1&&(s="nearest")}if(u)break;c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}class ic{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Dt=null;function gl(n){if(n.setActive)return n.setActive();if(Dt)return n.focus(Dt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Dt==null?{get preventScroll(){return Dt={preventScroll:!0},!0}}:void 0),!Dt){Dt=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollLine truncated
|
||||
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),a=b.cursor(t?s.from:s.to)}if(h){if(!h(c))return l}else{if(!i)return a;h=i(c)}l=a}}function Tc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==z.Space&&(s=o),s==o}}function Bc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,h=n.contentDOM.getBoundingClientRect(),a=n.coordsAtPos(s),c=n.documentTop;if(a)o==null&&(o=a.left-h.left),l=r<0?a.top:a.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(h.right-h.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=h.left+o,u=i!=null?i:n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=jl(n,{x:f,y:p},!1,r);if(p<h.top||p>h.bottom||(r<0?m<s:m>s))return b.cursor(m,e.assoc,void 0,o)}}function Nn(n,e,t){let i=n.state.facet(Nl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,h)=>{t.from>o&&t.from<l&&(t=e.head>t.from?b.cursor(o,1):b.cursor(l,-1),s=!0)});if(!s)return t}}class Pc{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null;for(let t in Z){let i=Z[t];e.contentDOM.addEventListener(t,s=>{!Kr(e,s)||this.ignoreDuringComposition(s)||t=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,s)?s.preventDefault():i(e,s))},ks[t]),this.registeredEvents.push(t)}A.chrome&&A.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,A.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{!Kr(e,l)||this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Ee(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Ee(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(A.android&&A.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return e.observer.delayAndroidKey(t.key,t.keyCode),!0;let i;return A.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((i=Kl.find(s=>s.keyCode==t.keyCode))&&!t.ctrlKey||Rc.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,ni(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:A.safari&&!A.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const Kl=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Rc="dthko",Ul=[16,17,18,20,91,92,224,225];class Lc{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(I.allowMultipleSelections)&&Ec(e,t),this.dragMove=Ic(e,t),this.dragging=Nc(e,t)&&Xl(t)==1?null:!1,this.dragging===!1&&(t.preventDefault(),this.select(t))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.pr
Line truncated
|
||||
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Ms),Mf={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Wn=null;function Df(){var n;if(Wn==null&&typeof document<"u"&&document.body){let e=document.body.style;Wn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Wn||!1}const ji=D.define({combine(n){let e=Ct(n,{render:null,specialChars:Af,addSpecialChars:null});return(e.replaceTabs=!Df())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ms)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ms)),e}});function ag(n={}){return[ji.of(n),Of()]}let fo=null;function Of(){return fo||(fo=de.fromClass(class{constructor(n){this.view=n,this.decorations=T.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(ji)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Cf({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ie(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,h=bi(o.text,l,i-o.from);return T.replace({widget:new Rf((l-h%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=T.replace({widget:new Pf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(ji);n.startState.facet(ji)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Tf="\u2022";function Bf(n){return n>=32?Tf:n==10?"\u2424":String.fromCharCode(9216+n)}class Pf extends at{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Bf(this.code),i=e.state.phrase("Control character")+" "+(Mf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Rf extends at{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Lf extends at{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function cg(n){return de.fromClass(class{constructor(e){this.view=e,this.placeholder=T.set([T.widget({widget:new Lf(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?T.none:this.placeholder}},{decorations:e=>e.decorations})}const Ds=2e3;function Ef(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Ds||t.off>Ds||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let h=i;h<=s;h++){let a=n.doc.line(h);a.length<=l&&r.push(b.range(a.from+o,a.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let h=i;h<=s;h++){let a=n.doc.line(h),c=os(a.text,o,n.tabSize,!0);if(c>-1){let f=os(a.text,l,n.tabSize);r.push(b.range(a.from+c,a.from+f))}}}return r}function If(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function uo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Ds?-1:s==i.length?If(n,e.clientX):bi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Nf(n,e){let t=uo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=uo(n,s);if(!l)return i;let h=Ef(n.state,t,l);return h.length?o?b.create(h.concat(i.ranges)):b.create(h):i}}:null}function fg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?Nf(t,i):null)}const Hn="-10000px";class Vf{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filt
Line truncated
|
||||
`&&(t="");else{let i=t.indexOf(`
|
||||
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Oh(t,e?e.state.tabSize:4,e?kt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Ph(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=F.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Iu,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new F(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new F(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Ph(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const tr=Object.create(null),pi=[pe.none],Iu=new _s(pi),Oo=[],Rh=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Rh[n]=Eh(tr,e);class Lh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Rh)}resolve(e){return e?this.table[e]||(this.table[e]=Eh(this.extra,e)):0}}const Nu=new Lh(tr);function Un(n,e){Oo.indexOf(n)>-1||(Oo.push(n),console.warn(e))}function Eh(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||x[r];o?typeof o=="function"?t?t=o(t):Un(r,`Modifier ${r} used at start of tag`):t?Un(r,`Tag ${r} used as modifier`):t=o:Un(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=pe.define({id:pi.length,name:i,props:[lu({[i]:t})]});return pi.push(s),s.id}function Vu(n){let e=pe.define({id:pi.length,name:"Document",props:[Ft.add(()=>n)]});return pi.push(e),e}const Fu=n=>{let e=nr(n.state);return e.line?Wu(n):e.block?zu(n):!1};function ir(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const Wu=ir(ju,0),Hu=ir(Ih,0),zu=ir((n,e)=>Ih(n,e,$u(e)),0);function nr(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const _t=50;function qu(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-_t,i),o=n.sliceDoc(s,s+_t),l=/\s*$/.exec(r)[0].length,h=/^\s*/.exec(o)[0].length,a=r.length-l;if(r.slice(a-e.length,a)==e&&o.slice(h,h+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+h,margin:h&&1}};let c,f;s-i<=2*_t?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+_t),f=n.sliceDoc(s-_t,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function $u(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function Ih(n,e,t=e.selection.ranges){let i=t.map(r=>nr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>qu(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let h=i[o],{open:a,close:c}=l;r.push({from:a.pos-h.open.length,to:a.pos+a.margin},{from:c.pos-c.margin,to:c.pos+h.close.length})}return{changes:r}}return null}function ju(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,h=1e9;for(let a=r;a<=o;){let c=e.doc.lineAt(a);if(c.from>s&&(r==o||o>c.from)){s=c.from;let f=nr(e,a).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c
Line truncated
|
||||
`:i=="r"?"\r":i=="t"?" ":"\\"),this.wholeWord=!!e.wholeWord}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new lp(this):new rp(this)}getCursor(e,t=0,i){let s=e.doc?e:I.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Tt(this,s,t,i):Ot(this,s,t,i)}}class ba{constructor(e){this.spec=e}}function Ot(n,e,t,i){return new qt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?sp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function sp(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(fn(s,t-r))!=z.Word||e(un(s,t-r))!=z.Word)&&(e(un(s,i-r))!=z.Word||e(fn(s,i-r))!=z.Word))}class rp extends ba{constructor(e){super(e)}nextMatch(e,t,i){let s=Ot(this.spec,e,i,e.doc.length).nextOverlapping();return s.done&&(s=Ot(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Ot(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=Ot(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Ot(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Tt(n,e,t,i){return new pa(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?op(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function fn(n,e){return n.slice(fe(n,e,!1),e)}function un(n,e){return n.slice(e,fe(n,e))}function op(n){return(e,t,i)=>!i[0].length||(n(fn(i.input,i.index))!=z.Word||n(un(i.input,i.index))!=z.Word)&&(n(un(i.input,i.index+i[0].length))!=z.Word||n(fn(i.input,i.index+i[0].length))!=z.Word)}class lp extends ba{nextMatch(e,t,i){let s=Tt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Tt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Tt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=Tt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Tt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const gi=L.define(),lr=L.define(),st=me.define({create(n){return new _n(Fs(n).create(),null)},update(n,e){for(let t of e.effects)t.is(gi)?n=new _n(t.value.create(),n.panel):t.is(lr)&&(n=new _n(n.query,t.value?hr:null));return n},provide:n=>tn.from(n,e=>e.panel)});class _n{constructor(e,t){this.query=e,this.panel=t}}const hp=T.mark({class:"cm-searchMatch"}),ap=T.mark({class:"cm-searchMatch cm-searchMatch-selected"}),cp=de.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(st))}update(n){let e=n.state.field(st);(e!=n.startState.field(st)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return T.none;let{view:t}=this,i=new bt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:h}=r[s];for(;s<o-1&&h>r[s+1].from-2*250;)h=r[++s].to;n.highlight(t.state,l,h,(a,c)=>{let f=t.state.selection.ranges.some(u=>u.from==a&&u.to==c);i.add(a,c,f?ap:hp)})}return i.finish()}},{decorations:n=>n.decorations});function xi(n){return e=>{let t=e.state.field(st,!1);return t&&t.query.spec.valid?n(e,t):wa(e)}}const dn=xi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:ar(n,i),userEvent:"select.search"}),!0):!1}),pn=xi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:ar(n,s),userEvent:"select.search"}),!0):!1}),fp=xi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),up=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new qt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o),userEvent
Line truncated
|
||||
Vendored
-661
@@ -1,661 +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 se(){}const $l=n=>n;function ut(n,e){for(const t in e)n[t]=e[t];return n}function Rm(n){return n()}function iu(){return Object.create(null)}function Je(n){n.forEach(Rm)}function Nn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let jl;function ti(n,e){return jl||(jl=document.createElement("a")),jl.href=e,n===jl.href}function hb(n){return Object.keys(n).length===0}function Hm(n,...e){if(n==null)return se;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function at(n,e,t){n.$$.on_destroy.push(Hm(e,t))}function $n(n,e,t,i){if(n){const s=jm(n,e,t,i);return n[0](s)}}function jm(n,e,t,i){return n[1]&&i?ut(t.ctx.slice(),n[1](i(e))):t.ctx}function Sn(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 Cn(n,e,t,i,s,l){if(s){const o=jm(e,t,i,l);n.p(o,s)}}function Mn(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 li(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Bt(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 su(n){return n==null?"":n}function nn(n,e,t){return n.set(t),e}function Ye(n){return n&&Nn(n.destroy)?n.destroy:se}const qm=typeof window<"u";let Ro=qm?()=>window.performance.now():()=>Date.now(),ma=qm?n=>requestAnimationFrame(n):se;const ks=new Set;function Vm(n){ks.forEach(e=>{e.c(n)||(ks.delete(e),e.f())}),ks.size!==0&&ma(Vm)}function Ho(n){let e;return ks.size===0&&ma(Vm),{promise:new Promise(t=>{ks.add(e={c:n,f:t})}),abort(){ks.delete(e)}}}function m(n,e){n.appendChild(e)}function zm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function mb(n){const e=_("style");return gb(zm(n),e),e.sheet}function gb(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Yt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function N(n){return document.createTextNode(n)}function D(){return N(" ")}function We(){return N("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Wt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ni(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Bm(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function mi(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 _b(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Se(n,e){n.value=e==null?"":e}function lu(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function te(n,e,t){n.classList[t?"add":"remove"](e)}function Um(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const mo=new Map;let go=0;function bb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function vb(n,e){const t={stylesheet:mb(e),rules:{}};return mo.set(n,t),t}function cl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
|
||||
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
|
||||
`}const f=u+`100% {${o(t,1-t)}}
|
||||
}`,c=`__svelte_${bb(f)}_${r}`,d=zm(n),{stylesheet:h,rules:g}=mo.get(d)||vb(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,go+=1,c}function dl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),go-=s,go||yb())}function yb(){ma(()=>{go||(mo.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),mo.clear())})}function kb(n,e,t,i){if(!e)return se;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return se;const{delay:l=0,duration:o=300,easing:r=$l,start:a=Ro()+l,end:u=a+o,tick:f=se,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=cl(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&dl(n,g),d=!1}return Ho(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const $=y-a,C=0+1*r($/o);f(C,1-C)}return!0}),v(),f(0,1),b}function wb(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,Wm(n,s)}}function Wm(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let pl;function nl(n){pl=n}function jo(){if(!pl)throw new Error("Function called outside component initialization");return pl}function Fn(n){jo().$$.on_mount.push(n)}function $b(n){jo().$$.after_update.push(n)}function Sb(n){jo().$$.on_destroy.push(n)}function xt(){const n=jo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Um(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function tt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Xs=[],me=[],ao=[],Rr=[],Ym=Promise.resolve();let Hr=!1;function Km(){Hr||(Hr=!0,Ym.then(Jm))}function Zn(){return Km(),Ym}function Tt(n){ao.push(n)}function je(n){Rr.push(n)}const lr=new Set;let ql=0;function Jm(){const n=pl;do{for(;ql<Xs.length;){const e=Xs[ql];ql++,nl(e),Cb(e.$$)}for(nl(null),Xs.length=0,ql=0;me.length;)me.pop()();for(let e=0;e<ao.length;e+=1){const t=ao[e];lr.has(t)||(lr.add(t),t())}ao.length=0}while(Xs.length);for(;Rr.length;)Rr.pop()();Hr=!1,lr.clear(),nl(n)}function Cb(n){if(n.fragment!==null){n.update(),Je(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let js;function ga(){return js||(js=Promise.resolve(),js.then(()=>{js=null})),js}function ns(n,e,t){n.dispatchEvent(Um(`${e?"intro":"outro"}${t}`))}const uo=new Set;let ci;function Ae(){ci={r:0,c:[],p:ci}}function Pe(){ci.r||Je(ci.c),ci=ci.p}function A(n,e){n&&n.i&&(uo.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(uo.has(n))return;uo.add(n),ci.c.push(()=>{uo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const _a={duration:0};function Zm(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&dl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=$l,tick:g=se,css:v}=i||_a;v&&(l=cl(n,0,1,d,c,h,v,r++)),g(0,1);const b=Ro()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ns(n,!0,"start")),o=Ho($=>{if(s){if($>=y)return g(1,0),ns(n,!0,"end"),a(),s=!1;if($>=b){const C=h(($-b)/d);g(C,1-C)}}return s})}let f=!1;return{start(){f||(f=!0,dl(n),Nn(i)?(i=i(),ga().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Gm(n,e,t){let i=e(n,t),s=!0,l;const o=ci;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=$l,tick:c=se,css:d}=i||_a;d&&(l=cl(n,1,0,u,a,f,d));const h=Ro()+a,g=h+u;Tt(()=>ns(n,!1,"start")),Ho(v=>{if(s){if(v>=g)return c(0,1),ns(n,!1,"end"),--o.r||Je(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Nn(i)?ga().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&dl(n,l),s=!1)}}}function st(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&dl(n,a)}function f(d,h){const g=d.b-l;return h*=Math.abs(g),{a:l,b:d.b,d:g,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:g=300,easing:v=$l,tick:b=se,css:y}=s||_a,$={start:Ro()+h,b:d};d||($.group=ci,ci.r+=1),o||r?r=$:(y&&(u(),a=cl(n,l,d,g,h,v,y)),d&&b(0,1),o=f($,g),Tt(()=>ns(n,d,"start")),Ho(C=>{if(r&&C>r.start&&(o=f(r,g),r=null,ns(n,o.b,"start"),y&&(u(),a=cl(n,l,o.b,o.duration,0,v,s.css))),o){if(C>=o.end)b(l=o.b,1-l),ns(n,o.b,"end"),r||(o.b?u():--o.group.r||Je(o.group.c)),o=null;else if(C>=o.start){const S=C-o.start;l=o.a+o.d*v(S/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Nn(s)?ga().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function bn(n,e){n.d(1),e.delete(n.key)}function Gt(n,e){L(n,1,1,()=>{e.delete(n.key)})}function Mb(n,e){n.f(),Gt(n,e)}function _t(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=
Line truncated
|
||||
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function Q0(n){let e,t,i,s=!n[0]&&ju();const l=n[1].default,o=$n(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=D(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=ju(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Cn(o,l,r,r[2],i?Sn(l,r[2],a,null):Mn(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function x0(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[Q0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ev(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 l_ extends Ee{constructor(e){super(),Oe(this,e,ev,x0,De,{nobranding:0})}}function qu(n,e,t){const i=n.slice();return i[11]=e[t],i}const tv=n=>({}),Vu=n=>({uniqueId:n[3]});function nv(n){let e=(n[11]||ko)+"",t;return{c(){t=N(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||ko)+"")&&ue(t,e)},d(i){i&&k(t)}}}function iv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||ko)+"",i;return{c(){e=_("pre"),i=N(t)},m(o,r){w(o,e,r),m(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)||ko)+"")&&ue(i,t)},d(o){o&&k(e)}}}function zu(n){let e,t;function i(o,r){return typeof o[11]=="object"?iv:nv}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function sv(n){let e,t,i,s,l;const o=n[7].default,r=$n(o,n,n[6],Vu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=zu(qu(n,a,f));return{c(){e=_("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),te(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=J(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Cn(r,o,f,f[6],i?Sn(o,f[6],c,tv):Mn(f[6]),Vu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=qu(f,a,d);u[d]?u[d].p(h,c):(u[d]=zu(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),c&5&&te(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){L(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),Yt(u,f),n[9](null),s=!1,l()}}}const ko="Invalid value";function lv(n,e,t){let i;at(n,Vi,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+B.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Oa(r)}Fn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){tt.call(this,n,g)}function h(g){me[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=B.toArray(B.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Ne extends Ee{constructor(e){super(),Oe(this,e,lv,sv,De,{name:4,class:0})}}function ov(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0]),l.focus(),r||(a=J(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]&&Se(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function rv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("Password"),s=D(),l=_("input"),r=D(),a=_("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Se(l,n[1]),w(c,r,d),w(c,a,d),u||(f=J(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]&&Se(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function av(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Password confirm"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[2]),r||(a=J(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]&&Se(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function uv(n){Line truncated
|
||||
<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"),te(f,"btn-disabled",n[3]),te(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),H(a,e,null),m(e,u),m(e,f),c=!0,d||(h=J(e,"submit",Wt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&1540&&($.$$scope={dirty:v,ctx:g}),a.$set($),v&8&&te(f,"btn-disabled",g[3]),v&8&&te(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),c=!1},d(g){g&&k(e),j(s),j(o),j(a),d=!1,h()}}}function fv(n,e,t){const i=xt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ye.admins.create({email:s,password:l,passwordConfirm:o}),await ye.admins.authViaEmail(s,l),i("submit")}catch(d){ye.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 cv extends Ee{constructor(e){super(),Oe(this,e,fv,uv,De,{})}}function Bu(n){let e,t;return e=new l_({props:{$$slots:{default:[dv]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function dv(n){let e,t;return e=new cv({}),e.$on("submit",n[1]),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:se,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function pv(n){let e,t,i=n[0]&&Bu(n);return{c(){i&&i.c(),e=We()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Bu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Ae(),L(i,1,1,()=>{i=null}),Pe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function hv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ye.logout(!1),t(0,i=!0);return}ye.authStore.isValid?Ci("/collections"):ye.logout()}return[i,async()=>{t(0,i=!1),await Zn(),window.location.search=""}]}class mv extends Ee{constructor(e){super(),Oe(this,e,hv,pv,De,{})}}const Nt=Gn(""),wo=Gn(""),us=Gn(!1);function Jo(n){const e=n-1;return e*e*e+1}function $o(n,{delay:e=0,duration:t=400,easing:i=$l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Yn(n,{delay:e=0,duration:t=400,easing:i=Jo,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 on(n,{delay:e=0,duration:t=400,easing:i=Jo}={}){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:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Tn(n,{delay:e=0,duration:t=400,easing:i=Jo,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 gv(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Se(e,n[7]),i||(s=J(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]&&Se(e,l[7])},i:se,o:se,d(l){l&&k(e),n[13](null),i=!1,s()}}}function _v(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=new o(r(n)),me.push(()=>Re(e,"value",l)),e.$on("submit",n[10])),{c(){e&&q(e.$$.fragment),i=We()},m(a,u){e&&H(e,a,u),w(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],je(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;L(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),me.push(()=>Re(e,"value",l)),e.$on("submit",a[10]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&j(e,a)}}}function Uu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Wu();return{c(){r&&r.c(),e=D(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=J(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Wu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Ae(),L(r,1,1,()=>{r=null}),Pe())},i(a){s||(A(r),a&&Tt(()=>{i||(i=st(t,Yn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){L(r),a&&(i||(i=st(t,Yn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Wu(n){let e,t,i;return{c(){e=_("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){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=st(e,Yn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=st(e,Yn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function bv(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[_v,gv],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Uu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=D(),r.c(),a=D(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[J(t,"submit",Wt(n[10])),J(e,"click",ni(n[11]))],f=!0)},p(b,[y]){let $=o;o=g(b),o===$?h[o].p(b,y):(Ae(),L(h[$],1,1,()=>{h[$]=null}),Pe(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Uu(b),v.c(),A(v,1),v.m(t,null)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){u||(A(r),A(v),u=!0)},o(b){L(r),L(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Je(c)}}}function vv(n,e,t){const i=xt(),s="search_"+B.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new dn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(T=!0){t(7,d=""),T&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Pi(()=>import("./FilterAutocompleteInput.586413d1.js"),["FilterAutocompleteInput.586413d1.js","index.c4d07677.js"],import.meta.url)).default),t(5,f=!1))}Fn(()=>{v()});function b(T){tt.call(this,n,T)}function y(T){d=T,t(7,d),t(0,l)}function $(T){me[T?"unshift":"push"](()=>{c=T,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const S=()=>{h(!1),g()};return n.$$set=T=>{"value"in T&&t(0,l=T.value),"placeholder"in T&&t(1,o=T.placeholder),"autocompleteCollection"in T&&t(2,r=T.autocompleteCollection),"extraAutocompleteKeys"in T&&t(3,a=T.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,b,y,$,C,S]}class Zo extends Ee{constructor(e){super(),Oe(this,e,vv,bv,De,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Gr,Ki;const Xr="app-tooltip";function Yu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ri(){return Ki=Ki||document.querySelector("."+Xr),Ki||(Ki=document.createElement("div"),Ki.classList.add(Xr),document.body.appendChild(Ki)),Ki}function o_(n,e){let t=Ri();if(!t.classList.contains("active")||!(e!=null&&e.text)){Qr();return}t.textContent=e.text,t.className=Xr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o
Line truncated
|
||||
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Ev(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Av(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Pv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Lv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Ju(n){let e;function t(l,o){return l[6]?Nv:Iv}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Iv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Zu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Zu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Nv(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Zu(n){let e,t,i;return{c(){e=_("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){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Gu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xu(n,e){var oe,Ce,Te;let t,i,s,l=((oe=e[21].method)==null?void 0:oe.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,$=(e[21].referer||"N/A")+"",C,S,T,M,O,E=e[21].status+"",P,I,F,z,Q,ne,G,ee,U,Y,Z=(((Ce=e[21].meta)==null?void 0:Ce.errorMessage)||((Te=e[21].meta)==null?void 0:Te.errorData))&&Gu();z=new Si({props:{date:e[21].created}});function de(){return e[16](e[21])}function x(...K){return e[17](e[21],...K)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=N(l),a=D(),u=_("td"),f=_("span"),d=N(c),g=D(),Z&&Z.c(),v=D(),b=_("td"),y=_("span"),C=N($),T=D(),M=_("td"),O=_("span"),P=N(E),I=D(),F=_("td"),q(z.$$.fragment),Q=D(),ne=_("td"),ne.innerHTML='<i class="ri-arrow-right-line"></i>',G=D(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",S=e[21].referer),te(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),te(O,"label-danger",e[21].status>=400),p(M,"class","col-type-number col-field-status"),p(F,"class","col-type-date col-field-created"),p(ne,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,we){w(K,t,we),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),Z&&Z.m(u,null),m(t,v),m(t,b),m(b,y),m(y,C),m(t,T),m(t,M),m(M,O),m(O,P),m(t,I),m(t,F),H(z,F,null),m(t,Q),m(t,ne),m(t,G),ee=!0,U||(Y=[J(t,"click",de),J(t,"keydown",x)],U=!0)},p(K,we){var W,_e,He;e=K,(!ee||we&8)&&l!==(l=((W=e[21].method)==null?void 0:W.toUpperCase())+"")&&ue(o,l),(!ee||we&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!ee||we&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!ee||we&8&&h!==(h=e[21].url))&&p(f,"title",h),((_e=e[21].meta)==null?void 0:_e.errorMessage)||((He=e[21].meta)==null?void 0:He.errorData)?Z||(Z=Gu(),Z.c(),Z.m(u,null)):Z&&(Z.d(1),Z=null),(!ee||we&8)&&$!==($=(e[21].referer||"N/A")+"")&&ue(C,$),(!ee||we&8&&S!==(S=e[21].referer))&&p(y,"title",S),we&8&&te(y,"txt-hint",!e[21].referer),(!ee||we&8)&&E!==(E=e[21].status+"")&&ue(P,E),we&8&&te(O,"label-danger",e[21].status>=400);const ae={};we&8&&(ae.date=e[21].created),z.$set(ae)},i(K){ee||(A(z.$$.fragment,K),ee=!0)},o(K){L(z.$$.fragment,K),ee=!1},d(K){K&&k(t),Z&&Z.d(),j(z),U=!1,Je(Y)}}}function Qu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function xu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),te(t,"btn-loading",n[6]),te(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c&64&&te(t,"btn-loading",f[6]),c&64&&te(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function Fv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O=[],E=new Map,P,I,F,z;function Q(W){n[11](W)}let ne={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Ov]},$$scope:{ctx:n}};n[1]!==void 0&&(ne.sort=n[1]),l=new an({props:ne}),me.push(()=>Re(l,"sort",Q));function G(W){n[12](W)}let ee={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Ev]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),a=new an({props:ee}),me.push(()=>Re(a,"sort",G));function U(W){n[13](W)}let Y={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Av]},$$scope:{ctx:n}};n[1]!==void 0&&(Y.sort=n[1]),c=new an({props:Y}),me.push(()=>Re(c,"sort",U));function Z(W){n[14](W)}let de={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Pv]},$$scope:{ctx:n}};n[1]!==void 0&&(de.sort=n[1]),g=new an({props:de}),me.push(()=>Re(g,"sort",Z));function x(W){n[15](W)}let oe={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Lv]},$$scope:{ctx:n}};n[1]!==void 0&&(oe.sort=n[1]),y=new an({props:oe}),me.push(()=>Re(y,"sort",x));let Ce=n[3];const Te=W=>W[21].id;for(let W=0;W<Ce.length;W+=1){let _e=Ku(n,Ce,W),He=Te(_e);E.set(He,O[W]=Xu(He,_e))}let K=null;Ce.length||(K=Ju(n)
Line truncated
|
||||
* Chart.js v3.9.1
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/function _i(){}const jv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function It(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function ht(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Kt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function jn(n,e){return Kt(n)?n:e}function yt(n,e){return typeof n>"u"?e:n}const qv=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,r_=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Et(n,e,t,i){let s,l,o;if(It(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(ht(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function So(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 Co(n){if(It(n))return n.map(Co);if(ht(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=Co(n[t[s]]);return e}return n}function a_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Vv(n,e,t,i){if(!a_(n))return;const s=e[n],l=t[n];ht(s)&&ht(l)?ml(s,l,i):e[n]=Co(l)}function ml(n,e,t){const i=It(e)?e:[e],s=i.length;if(!ht(n))return n;t=t||{};const l=t.merger||Vv;for(let o=0;o<s;++o){if(e=i[o],!ht(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 ll(n,e){return ml(n,e,{merger:zv})}function zv(n,e,t){if(!a_(n))return;const i=e[n],s=t[n];ht(i)&&ht(s)?ll(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Co(s))}const ef={"":n=>n,x:n=>n.x,y:n=>n.y};function ji(n,e){return(ef[e]||(ef[e]=Bv(e)))(n)}function Bv(n){const e=Uv(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Uv(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 Kn=n=>typeof n<"u",qi=n=>typeof n=="function",tf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Wv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,At=2*Ut,Yv=At+Ut,Mo=Number.POSITIVE_INFINITY,Kv=Ut/180,zt=Ut/2,Us=Ut/4,nf=Ut*2/3,Un=Math.log10,pi=Math.sign;function sf(n){const e=Math.round(n);n=ol(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Un(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Jv(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 Ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ol(n,e,t){return Math.abs(n-e)<t}function Zv(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function u_(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 ei(n){return n*(Ut/180)}function Pa(n){return n*(180/Ut)}function lf(n){if(!Kt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function f_(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*Ut&&(l+=At),{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 Gv(n,e){return(n-e+Yv)%At-Ut}function Pn(n){return(n%At+At)%At}function gl(n,e,t,i){const s=Pn(n),l=Pn(e),o=Pn(t),r=Pn(l-s),a=Pn(o-s),u=Pn(s-l),f=Pn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function cn(n,e,t){return Math.max(e,Math.min(t,n))}function Xv(n){return cn(n,-32768,32767)}function _l(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 ts=(n,e,t,i)=>La(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Qv=(n,e,t)=>La(n,t,i=>n[i][e]>=t);function xv(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 c_=["push","pop","shift","splice","unshift"];function ey(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),c_.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 of(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)&&(c_.forEach(l=>{delete n[l]}),delete n._chartjs)}function d_(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 p_=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 Ni=(n,e,t)=>Math.max(Math.min(n,t),e);function el(n){return Ni(Dl(n*2.55),0,255)}function Hi(n){return Ni(Dl(n*255),0,255)}function yi(n){return Ni(Dl(n/2.55)/100,0,1)}function ff(n){return Ni(Dl(n*100),0,100)}const Hn={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},ea=[..."0123456789ABCDEF"],iy=n=>ea[n&15],sy=n=>ea[(n&240)>>4]+ea[n&15],Jl=n=>(n&240)>>4===(n&15),ly=n=>Jl(n.r)&&Jl(n.g)&&Jl(n.b)&&Jl(n.a);function oy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Hn[n[1]]*17,g:255&Hn[n[2]]*17,b:255&Hn[n[3]]*17,a:e===5?Hn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Hn[n[1]]<<4|Hn[n[2]],g:Hn[n[3]]<<4|Hn[n[4]],b:Hn[n[5]]<<4|Hn[n[6]],a:e===9?Hn[n[7]]<<4|Hn[n[8]]:255})),t}const ry=(n,e)=>n<255?e(n):"";function ay(n){var e=ly(n)?iy:sy;return n?"#"+e(n.r)+e(n.g)+e(n.b)+ry(n.a,e):void 0}const uy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function __(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 fy(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 cy(n,e,t){const i=__(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 dy(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 Ia(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=dy(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(Hi)}function Fa(n,e,t){return Na(__,n,e,t)}function py(n,e,t){return Na(cy,n,e,t)}function hy(n,e,t){return Na(fy,n,e,t)}function b_(n){return(n%360+360)%360}function my(n){const e=uy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?el(+e[5]):Hi(+e[5]));const s=b_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=py(s,l,o):e[1]==="hsv"?i=hy(s,l,o):i=Fa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function gy(n,e){var t=Ia(n);t[0]=b_(t[0]+e),t=Fa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function _y(n){if(!n)return;const e=Ia(n),t=e[0],i=ff(e[1]),s=ff(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const cf={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"},df={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 by(){const n={},e=Object.keys(df),t=Object.keys(cf);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 yk{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=p_.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 bi=new yk;const Sf="transparent",kk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=hf(n||Sf),s=i.valid&&hf(e||Sf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class wk{constructor(e,t,i,s){const l=t[i];s=Xl([e.to,s,l,e.from]);const o=Xl([e.from,l,s]);this._active=!0,this._fn=e.fn||kk[e.type||typeof o],this._easing=rl[e.easing]||rl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Xl([e.to,t,s,e.from]),this._from=Xl([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 $k=["x","y","borderWidth","radius","tension"],Sk=["color","borderColor","backgroundColor"];kt.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 Ck=Object.keys(kt.animation);kt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});kt.set("animations",{colors:{type:"color",properties:Sk},numbers:{type:"number",properties:$k}});kt.describe("animations",{_fallback:"animation"});kt.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 L_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!ht(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!ht(s))return;const l={};for(const o of Ck)l[o]=s[o];(It(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Tk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Mk(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 wk(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 bi.add(this._chart,i),!0}}function Mk(n,e){const t=[]Line truncated
|
||||
`)>-1?n.split(`
|
||||
`):n}function Vw(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 tc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Jn(e.padding);let v=g.height,b=0,y=i.reduce((S,T)=>S+T.before.length+T.lines.length+T.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const S=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*S+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let $=0;const C=function(S){b=Math.max(b,t.measureText(S).width+$)};return t.save(),t.font=u.string,Et(n.title,C),t.font=a.string,Et(n.beforeBody.concat(n.afterBody),C),$=e.displayColors?o+2+e.boxPadding:0,Et(i,S=>{Et(S.before,C),Et(S.lines,C),Et(S.after,C)}),$=0,t.font=f.string,Et(n.footer,C),t.restore(),b+=g.width,{width:b,height:v}}function zw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Bw(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 Uw(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"),Bw(u,n,e,t)&&(u="center"),u}function nc(n,e,t){const i=t.yAlign||e.yAlign||zw(n,t);return{xAlign:t.xAlign||e.xAlign||Uw(n,e,t,i),yAlign:i}}function Ww(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Yw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function ic(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=$s(o);let g=Ww(e,r);const v=Yw(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:cn(g,0,i.width-e.width),y:cn(v,0,i.height-e.height)}}function so(n,e,t){const i=Jn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function sc(n){return fi([],vi(n))}function Kw(n,e,t){return zi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function lc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ua extends Mi{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 L_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Kw(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=fi(r,vi(s)),r=fi(r,vi(l)),r=fi(r,vi(o)),r}getBeforeBody(e,t){return sc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Et(e,l=>{const o={before:[],lines:[],after:[]},r=lc(i,l);fi(o.before,vi(r.beforeLabel.call(this,l))),fi(o.lines,r.label.call(this,l)),fi(o.after,vi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return sc(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=fi(r,vi(s)),r=fi(r,vi(l)),r=fi(r,vi(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(Vw(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))),Et(r,f=>{const c=lc(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.2.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 chartjs-adapter-luxon Contributors
|
||||
* Released under the MIT license
|
||||
*/const h$={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};H_._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return h$},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=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function pc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=st(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=st(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function m$(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=N(n[1]),t=D(),s=N(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function g$(n){let e;return{c(){e=N("Loading...")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function _$(n){let e,t,i,s,l,o=n[2]&&pc();function r(f,c){return f[2]?g$:m$}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=D(),i=_("canvas"),s=D(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),lu(i,"height","250px"),lu(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),te(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=pc(),o.c(),A(o,1),o.m(e,t)):o&&(Ae(),L(o,1,1,()=>{o=null}),Pe()),c&4&&te(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){L(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function b$(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),ye.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:B.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ye.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Fn(()=>(Io.register(Bi,er,Qo,Qa,Pl,qw,Jw),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:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){me[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class v$ extends Ee{constructor(e){super(),Oe(this,e,b$,_$,De,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var hc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sb={exports:{}};(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 $(C){return C instanceof a?new a(C.type,$(C.content),C.alias):Array.isArray(C)?C.map($):C.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(C,S){S=S||{};var T,M;switch(r.util.type(C)){case"Object":if(M=r.util.objId(C),S[M])return S[M];T={},S[M]=T;for(var O in C)C.hasOwnProperty(O)&&(T[O]=$(C[O],S));return T;case"Array":return M=r.util.objId(C),S[M]?S[M]:(T=[],S[M]=T,C.forEach(function(E,P){T[P]=$(E,S)}),T);default:return C}},getLanguage:function($){for(;$;){var C=s.exec($.className);if(C)return C[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,C){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(T){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if($){var C=document.getElementsByTagName("script");for(var S in C)if(C[S].src==$)return C[S]}return null}},isActive:function($,C,S){for(var T="no-"+C;$;){var M=$.classList;if(M.contains(C))return!0;if(M.contains(T))return!1;$=$.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,C){var S=r.util.clone(r.languages[$]);for(var T in C)S[T]=C[T];return S},insertBefore:function($,C,S,T){T=T||r.languages;var M=T[$],O={};for(var E in M)if(M.hasOwnProperty(E)){if(E==C)for(var P in S)S.hasOwnProperty(P)&&(O[P]=S[P]);S.hasOwnProperty(E)||(O[E]=M[E])}var I=T[$];return T[$]=O,r.languages.DFS(r.languages,function(F,z){z===I&&F!=$&&(this[F]=O)}),O},DFS:function $(C,S,T,M){M=M||{};var O=r.util.objId;for(var E in C)if(C.hasOwnProperty(E)){S.call(C,E,C[E],T||E);var P=C[E],I=r.util.type(P);I==="Object"&&!M[O(P)]?(M[O(P)]=!0,$(P,S,null,M)):I==="Array"&&!M[O(P)]&&(M[O(P)]=!0,$(P,S,E,M))}}},plugins:{},highlightAll:function($,C){r.highlightAllUnder(document,$,C)},highlightAllUnder:function($,C,S){var T={callback:S,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),r.hooks.run("before-all-elements-highlight",T);for(var M=0,O;O=T.elements[M++];)r.highlightElement(O,C===!0,T.callback)},highlightElement:function($,C,S){var T=r.util.getLanguage($),M=r.languages[T];r.util.setLanguage($,T);var O=$.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,T);var E=$.textContent,P={element:$,language:T,grammar:M,code:E};function I(z){P.highlightedCode=z,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),S&&S.call(P.element)}if(r.hooks.run("before-sanity-check",P),O=P.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),S&&S.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){I(r.util.encode(P.code));return}if(C&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(z){I(z.data)},F.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else I(r.highlight(P.code,P.grammar,P.language))},highlight:function($,C,S){var T={code:$,grammar:C,language:S};if(r.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=r.tokenize(T.code,T.grammar),r.hooks.run("after-tokenize",T),a.stringify(r.util.encode(T.tokens),T.language)},tokenize:function($,C){var S=C.rest;if(S){for(var T in S)C[T]=S[T];delete C.rest}var M=new c;return d(M,M.head,$),f($,M,C,M.head,0),g(M)},hooks:{all:{},add:function($,C){var S=r.hooks.all;S[$]=S[$]||[],S[$].push(C)},run:function($,C){var S=r.hooks.all[$];if(!(!S||!S.length))for(var T=0,M;M=S[T++];)M(C)}},Token:a};i.Prism=r;function a($,C,S,T){this.type=$,this.content=C,this.alias=S,this.length=(T||"").length|0}a.stringify=function $(C,S){if(typeof C=="string")return C;if(Array.isArray(C)){var T="";return C.forEach(function(I){T+=$(I,S)}),T}var M={type:C.type,content:$(C.content,S),tag:"span",classes:["token",C.type],attributes:{},language:S},O=C.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(M.classes,O):M.classes.push(O)),r.hooks.run("wrap",M);var E="";for(var P in M.attributes)E+=" "+P+'="'+(M.attributes[P]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+E+">"+M.content+"</"+M.tag+">"};function u($,C,S,T){$.lastIndex=C;var M=$.exec(S);if(M&&T&&M[1]){var O=M[1].length;M.index+=O,M[0]=M[0].slice(O)}return M}funLine truncated
|
||||
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}y.textContent=M,t.highlightElement(y)},function(M){b.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),$=0,C;C=y[$++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(sb);const Gs=sb.exports;var y$={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<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 h=s(f[d]);c+=h,c>r&&(f[d]=`
|
||||
`+f[d],c=h)}a[u]=f.join("")}return a.join(`
|
||||
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",g="",v=!1,b=0;b<d.length;++b){var y=d[b];y==o.element?v=!0:y.nodeName==="#text"&&(v?g+=y.nodeValue:h+=y.nodeValue,a.removeChild(y),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+g,o.code=r.normalize(o.code,o.settings);else{var $=h+o.element.innerHTML+g;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(y$);(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 k$(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(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-1ua9m3i")&&p(e,"class",i)},i:se,o:se,d(s){s&&k(e)}}}function w$(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=Gs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Gs.highlight(a,Gs.languages[l]||Gs.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 Gs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _n extends Ee{constructor(e){super(),Oe(this,e,w$,k$,De,{class:0,content:2,language:3})}}const $$=n=>({}),mc=n=>({}),S$=n=>({}),gc=n=>({});function _c(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C=n[4]&&!n[2]&&bc(n);const S=n[18].header,T=$n(S,n,n[17],gc);let M=n[4]&&n[2]&&vc(n);const O=n[18].default,E=$n(O,n,n[17],null),P=n[18].footer,I=$n(P,n,n[17],mc);return{c(){e=_("div"),t=_("div"),s=D(),l=_("div"),o=_("div"),C&&C.c(),r=D(),T&&T.c(),a=D(),M&&M.c(),u=D(),f=_("div"),E&&E.c(),c=D(),d=_("div"),I&&I.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),te(l,"popup",n[2]),p(e,"class","overlay-panel-container"),te(e,"padded",n[2]),te(e,"active",n[0])},m(F,z){w(F,e,z),m(e,t),m(e,s),m(e,l),m(l,o),C&&C.m(o,null),m(o,r),T&&T.m(o,null),m(o,a),M&&M.m(o,null),m(l,u),m(l,f),E&&E.m(f,null),n[20](f),m(l,c),m(l,d),I&&I.m(d,null),b=!0,y||($=[J(t,"click",Wt(n[19])),J(f,"scroll",n[21])],y=!0)},p(F,z){n=F,n[4]&&!n[2]?C?C.p(n,z):(C=bc(n),C.c(),C.m(o,r)):C&&(C.d(1),C=null),T&&T.p&&(!b||z&131072)&&Cn(T,S,n,n[17],b?Sn(S,n[17],z,S$):Mn(n[17]),gc),n[4]&&n[2]?M?M.p(n,z):(M=vc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),E&&E.p&&(!b||z&131072)&&Cn(E,O,n,n[17],b?Sn(O,n[17],z,null):Mn(n[17]),null),I&&I.p&&(!b||z&131072)&&Cn(I,P,n,n[17],b?Sn(P,n[17],z,$$)
Line truncated
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const $={};y&16&&($.id=b[4]),y&1&&($.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,je(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function AS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("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(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(gt.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(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const $={};y&16&&($.id=b[4]+".options.onlyDomains"),y&1&&($.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,je(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function PS(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[ES,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[AS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),H(i,t,null),m(e,s),m(e,l),H(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){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(i),j(o)}}}function LS(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 ab extends Ee{constructor(e){super(),Oe(this,e,LS,PS,De,{key:1,options:0})}}function IS(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 ab({props:r}),me.push(()=>Re(e,"key",l)),me.push(()=>Re(e,"options",o)),{c(){q(e.$$.fragment)},m(a,u){H(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],je(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],je(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function NS(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 FS extends Ee{constructor(e){super(),Oe(this,e,NS,IS,De,{key:0,options:1})}}var Dr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Ss={_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},yl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to togg
Line truncated
|
||||
<span class='flatpickr-weekday'>
|
||||
`+V.join("</span><span class='flatpickr-weekday'>")+`
|
||||
</span>
|
||||
`}}function de(){t.calendarContainer.classList.add("hasWeeks");var R=St("div","flatpickr-weekwrapper");R.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var V=St("div","flatpickr-weeks");return R.appendChild(V),{weekWrapper:R,weekNumbers:V}}function x(R,V){V===void 0&&(V=!0);var ie=V?R:R-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),Q()),z(),Ze("onMonthChange"),rt())}function oe(R,V){if(R===void 0&&(R=!0),V===void 0&&(V=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,V===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Pr(t.config),re=ie.hours,Le=ie.minutes,le=ie.seconds;h(re,Le,le)}t.redraw(),R&&Ze("onChange")}function Ce(){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 R=t._handlers.length;R--;)t._handlers[R].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 V=t.calendarContainer.parentNode;if(V.lastChild&&V.removeChild(V.lastChild),V.parentNode){for(;V.firstChild;)V.parentNode.insertBefore(V.firstChild,V);V.parentNode.removeChild(V)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function K(R){return t.calendarContainer.contains(R)}function we(R){if(t.isOpen&&!t.config.inline){var V=En(R),ie=K(V),re=V===t.input||V===t.altInput||t.element.contains(V)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Le=!re&&!ie&&!K(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(pe){return pe.contains(V)});Le&&le&&(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 ae(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var V=R,ie=t.currentYear!==V;t.currentYear=V||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),Ze("onYearChange"),Q())}}function W(R,V){var ie;V===void 0&&(V=!0);var re=t.parseDate(R,void 0,V);if(t.config.minDate&&re&&An(re,t.config.minDate,V!==void 0?V:!t.minDateHasTime)<0||t.config.maxDate&&re&&An(re,t.config.maxDate,V!==void 0?V:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(re===void 0)return!1;for(var Le=!!t.config.enable,le=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,pe=0,ve=void 0;pe<le.length;pe++){if(ve=le[pe],typeof ve=="function"&&ve(re))return Le;if(ve instanceof Date&&re!==void 0&&ve.getTime()===re.getTime())return Le;if(typeof ve=="string"){var fe=t.parseDate(ve,void 0,!0);return fe&&fe.getTime()===re.getTime()?Le:!Le}else if(typeof ve=="object"&&re!==void 0&&ve.from&&ve.to&&re.getTime()>=ve.from.getTime()&&re.getTime()<=ve.to.getTime())return Le}return!Le}function _e(R){return t.daysContainer!==void 0?R.className.indexOf("hidden")===-1&&R.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(R):!1}function He(R){var V=R.target===t._input,ie=t._input.value.trimEnd()!==Ht();V&&ie&&!(R.relatedTarget&&K(R.relatedTarget))&&t.setDate(t._input.value,!0,R.target===t.altInput?t.config.altFormat:t.config.dateFormat)}functi
Line truncated
|
||||
Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,P){(!C||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].mimeTypes,je(()=>a=!1)),r.$set(I);const F={};P&2049&&(F.$$scope={dirty:P,ctx:E}),$.$set(F)},i(E){C||(A(r.$$.fragment,E),A($.$$.fragment,E),C=!0)},o(E){L(r.$$.fragment,E),L($.$$.fragment,E),C=!1},d(E){E&&k(e),E&&k(o),j(r,E),E&&k(u),E&&k(f),j($),S=!1,T()}}}function u3(n){let e;return{c(){e=_("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){w(t,e,i)},p:se,d(t){t&&k(e)}}}function f3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;function M(E){n[9](E)}let O={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(O.value=n[0].thumbs),r=new hs({props:O}),me.push(()=>Re(r,"value",M)),$=new Ti({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[u3]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=D(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=D(),b=_("i"),y=D(),q($.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,P){w(E,e,P),m(e,t),m(e,i),m(e,s),w(E,o,P),H(r,E,P),w(E,u,P),w(E,f,P),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),H($,h,null),C=!0,S||(T=Ye(gt.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"})),S=!0)},p(E,P){(!C||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].thumbs,je(()=>a=!1)),r.$set(I);const F={};P&2048&&(F.$$scope={dirty:P,ctx:E}),$.$set(F)},i(E){C||(A(r.$$.fragment,E),A($.$$.fragment,E),C=!0)},o(E){L(r.$$.fragment,E),L($.$$.fragment,E),C=!1},d(E){E&&k(e),E&&k(o),j(r,E),E&&k(u),E&&k(f),j($),S=!1,T()}}}function c3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[l3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[o3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[a3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[f3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(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(g,v){w(g,e,v),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&2&&($.name="schema."+g[1]+".options.mimeTypes"),v&3073&&($.$$scope={dirty:v,ctx:g}),u.$set($);const C={};v&2&&(C.name="schema."+g[1]+".options.thumbs"),v&3073&&(C.$$scope={dirty:v,ctx:g}),d.$set(C)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(u.$$.fragment,g),L(d.$$.fragment,g),h=!1},d(g){g&&k(e),j(i),j(o),j(u),j(d)}}}function d3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Pt(this.value),t(0,s)}function o(){s.maxSelect=Pt(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{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)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d]}class p3 extends Ee{constructor(e){super(),Oe(this,e,d3,c3,De,{key:1,options:0})}}function h3(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new ps({props:u}),me.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=N("Collection"),s=D(),q(l.$$.fraLine truncated
|
||||
form-field
|
||||
required
|
||||
`+(n[5]?"":"invalid")+`
|
||||
`+(n[0].id&&n[0].system?"disabled":"")+`
|
||||
`,name:"schema."+n[1]+".name",$$slots:{default:[M3,({uniqueId:z})=>({38:z}),({uniqueId:z})=>[0,z?128:0]]},$$scope:{ctx:n}}});const O=[R3,F3,N3,I3,L3,P3,A3,E3,O3,D3,T3],E=[];function P(z,Q){return z[0].type==="text"?0:z[0].type==="number"?1:z[0].type==="bool"?2:z[0].type==="email"?3:z[0].type==="url"?4:z[0].type==="date"?5:z[0].type==="select"?6:z[0].type==="json"?7:z[0].type==="file"?8:z[0].type==="relation"?9:z[0].type==="user"?10:-1}~(f=P(n))&&(c=E[f]=O[f](n)),g=new Ne({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[H3,({uniqueId:z})=>({38:z}),({uniqueId:z})=>[0,z?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Yc(n),F=!n[0].toDelete&&Kc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),q(s.$$.fragment),l=D(),o=_("div"),q(r.$$.fragment),a=D(),u=_("div"),c&&c.c(),d=D(),h=_("div"),q(g.$$.fragment),v=D(),b=_("div"),I&&I.c(),y=D(),F&&F.c(),$=D(),C=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(C,"type","submit"),p(C,"class","hidden"),p(C,"tabindex","-1"),p(e,"class","field-form")},m(z,Q){w(z,e,Q),m(e,t),m(t,i),H(s,i,null),m(t,l),m(t,o),H(r,o,null),m(t,a),m(t,u),~f&&E[f].m(u,null),m(t,d),m(t,h),H(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),F&&F.m(t,null),m(e,$),m(e,C),S=!0,T||(M=J(e,"submit",Wt(n[31])),T=!0)},p(z,Q){const ne={};Q[0]&1&&(ne.class="form-field required "+(z[0].id?"disabled":"")),Q[0]&2&&(ne.name="schema."+z[1]+".type"),Q[0]&1|Q[1]&384&&(ne.$$scope={dirty:Q,ctx:z}),s.$set(ne);const G={};Q[0]&33&&(G.class=`
|
||||
form-field
|
||||
required
|
||||
`+(z[5]?"":"invalid")+`
|
||||
`+(z[0].id&&z[0].system?"disabled":"")+`
|
||||
`),Q[0]&2&&(G.name="schema."+z[1]+".name"),Q[0]&33|Q[1]&384&&(G.$$scope={dirty:Q,ctx:z}),r.$set(G);let ee=f;f=P(z),f===ee?~f&&E[f].p(z,Q):(c&&(Ae(),L(E[ee],1,1,()=>{E[ee]=null}),Pe()),~f?(c=E[f],c?c.p(z,Q):(c=E[f]=O[f](z),c.c()),A(c,1),c.m(u,null)):c=null);const U={};Q[0]&1|Q[1]&384&&(U.$$scope={dirty:Q,ctx:z}),g.$set(U),z[0].type!=="file"?I?(I.p(z,Q),Q[0]&1&&A(I,1)):(I=Yc(z),I.c(),A(I,1),I.m(b,null)):I&&(Ae(),L(I,1,1,()=>{I=null}),Pe()),z[0].toDelete?F&&(Ae(),L(F,1,1,()=>{F=null}),Pe()):F?(F.p(z,Q),Q[0]&1&&A(F,1)):(F=Kc(z),F.c(),A(F,1),F.m(t,null))},i(z){S||(A(s.$$.fragment,z),A(r.$$.fragment,z),A(c),A(g.$$.fragment,z),A(I),A(F),S=!0)},o(z){L(s.$$.fragment,z),L(r.$$.fragment,z),L(c),L(g.$$.fragment,z),L(I),L(F),S=!1},d(z){z&&k(e),j(s),j(r),~f&&E[f].d(),j(g),I&&I.d(),F&&F.d(),T=!1,M()}}}function Zc(n){let e,t,i,s,l=n[0].system&&Gc(),o=!n[0].id&&Xc(n),r=n[0].required&&Qc(),a=n[0].unique&&xc();return{c(){e=_("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Gc(),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=Xc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Qc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=xc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Gc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),te(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&te(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Qc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ed(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function td(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=J(e,"click",ni(n[15])),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function z3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&Zc(n),$=n[7]&&!n[0].system&&ed(),C=n[0].toDelete&&td(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=D(),o=_("strong"),a=N(r),f=D(),y&&y.c(),c=D(),d=_("div"),h=D(),$&&$.c(),g=D(),C&&C.c(),v=We(),p(i,"class",s=su(B.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),te(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w(S,f,T),y&&y.m(S,T),w(S,c,T),w(S,d,T),w(S,h,T),$&&$.m(S,T),w(S,g,T),C&&C.m(S,T),w(S,v,T),b=!0},p(S,T){(!b||T[0]&1&&s!==(s=su(B.getFieldTypeIcon(S[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||T[0]&1)&&r!==(r=(S[0].name||"-")+"")&&ue(a,r),(!b||T[0]&1&&u!==(u=S[0].name))&&p(o,"title",u),T[0]&1&&te(o,"txt-strikethrough",S[0].toDelete),S[0].toDelete?y&&(y.d(1),y=null):y?y.p(S,T):(y=Zc(S),y.c(),y.m(c.parentNode,c)),S[7]&&!S[0].system?$?T[0]&129&&A($,1):($=ed(),$.c(),A($,1),$.m(g.parentNode,g)):$&&(Ae(),L($,1,1,()=>{$=null}),Pe()),S[0].toDelete?C?C.p(S,T):(C=td(S),C.c(),C.m(v.parentNode,v)):C&&(C.d(1),C=null)},i(S){b||(A($),b=!0)},o(S){L($),b=!1},d(S){S&&k(e),S&&k(f),y&&y.d(S),S&&k(c),S&&k(d),S&&k(h),$&&$.d(S),S&&k(g),C&&C.d(S),S&&k(v)}}}function B3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[z3],default:[V3]},$$scope:{ctx:n}};return e=new ir({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&256&&(o.interactive=s[8]),l[0]&5&&(o.class=s[2]||s[0].toDelete||s[0].system?"field-accordion disabled":"field-accordion"),l[0]&483|l[1]&256&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[32](null),j(e,s)}}}function U3(n,e,t){let i,s,l,o,r;at(n,Vi,K=>t(14,r=K));const a=xt();let{key:u="0"}=e,{field:f=new Dn}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,h,g=f.type;function v(){h==null||h.expand()}function b(){h==null||h.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function $(K){if(K=(""+K).toLowerCase(),!K)return!1;for(const we of
Line truncated
|
||||
<code>@request.query.*</code>
|
||||
<code>@request.data.*</code>
|
||||
<code>@request.user.*</code>`,C=D(),S=_("hr"),T=D(),M=_("p"),M.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=D(),E=_("div"),E.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",P=D(),I=_("hr"),F=D(),z=_("p"),z.innerHTML=`Example rule:
|
||||
<br/>
|
||||
<code>@request.user.id!="" && created>"2022-01-01 00:00:00"</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p($,"class","inline-flex flex-gap-5"),p(S,"class","m-t-10 m-b-5"),p(M,"class","m-b-0"),p(E,"class","inline-flex flex-gap-5"),p(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(U,Y){w(U,e,Y),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let Z=0;Z<ee.length;Z+=1)ee[Z].m(o,null);m(i,h),m(i,g),m(i,v),m(i,b),m(i,y),m(i,$),m(i,C),m(i,S),m(i,T),m(i,M),m(i,O),m(i,E),m(i,P),m(i,I),m(i,F),m(i,z),ne=!0},p(U,Y){if(Y&1){G=U[0].schema;let Z;for(Z=0;Z<G.length;Z+=1){const de=ld(U,G,Z);ee[Z]?ee[Z].p(de,Y):(ee[Z]=rd(de),ee[Z].c(),ee[Z].m(o,null))}for(;Z<ee.length;Z+=1)ee[Z].d(1);ee.length=G.length}},i(U){ne||(U&&Tt(()=>{Q||(Q=st(e,on,{duration:150},!0)),Q.run(1)}),ne=!0)},o(U){U&&(Q||(Q=st(e,on,{duration:150},!1)),Q.run(0)),ne=!1},d(U){U&&k(e),Yt(ee,U),U&&Q&&Q.end()}}}function Z3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=N(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function G3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=N(t),s=N(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function rd(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?G3:Z3}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function X3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r<l.length;r+=1){let a=sd(n,l,r),u=o(a);t.set(u,e[r]=ad(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=We()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&131163&&(l=Object.entries(r[6]),Ae(),e=_t(e,a,o,1,r,l,t,i.parentNode,Gt,ad,i,sd),Pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)L(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function Q3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function x3(n){let e,t,i;function s(){return n[9](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(gt.call(null,e,"Lock and set to Admins only")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Je(i)}}}function eC(n){let e,t,i;function s(){return n[8](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(gt.call(null,e,"Unlock and set custom rule")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Je(i)}}}function tC(n){let e;return{c(){e=N("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function nC(n){let e;return{c(){e=N("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function iC(n){let e,t=n[14]+"",i,s,l=Ii(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function $(E){n[11](E,n[13])}var C=n[4];function S(E){let P={id:E[17],baseCollection:E[0],disabled:Ii(E[0][E[13]])};return E[0][E[13]]!==void 0&&(P.value=E[0][E[13]]),{props:P}}C&&(u=new C(S(n)),b(),me.push(()=>Re(u,"value",$)));function T(E,P){return P&1&&(g=null),g==null&&(g=!!Ii(E[0][E[13]])),g?nC:tC}let M=T(n,-1),O=M(n);return{c(){e=_("label"),i=N(t),s=N(" - "),o=N(l),a=D(),u&&q(u.$$.fragment),d=D(),h=_("div"),O.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(E,P){w(E,e,P),m(e,i),m(e,s),m(e,o),w(E,a,P),u&&H(u,E,P),w(E,d,P),w(E,h,P),O.m(h,null),v=!0},p(E,P){n=E,(!v||P&1)&&l!==(l=Ii(n[0][n[13]])?"Admins only":"Custom rule")&&ue(o,l),(!v||P&131072&&r!==(r=n[17]))&&p(e,"for",r),f!==n[13]&&(y(),f=n[13],b());const I={};if(P&131072&&(I.id=n[17]),P&1&&(I.baseCollection=n[0]),P&1&&(I.disabled=Ii(n[0][n[13]])),!c&&P&65&&(c=!0,I.value=n[0][n[13]],je(()=>c=!1)),C!==(C=n[4])){if(u){Ae();const F=u;L(F.$$.fragment,1,0,()=>{j(F,1)}),Pe()}C?(u=new C(S(n)),b(),me.push(()=>Re(u,"value",$)),q(u.$$.fragment),A(u.$$.fragment,1),H(u,d.parentNode,d)):u=null}else C&&u.$set(I);M!==(M=T(n,P))&&(O.d(1),O=M(n),O&&(O.c(),O.m(h,null)))},i(E){v||(u&&A(u.$$.fragment,E),v=!0)},o(E){u&&L(u.$$.fragment,E),v=!1},d(E){E&&k(e),E&&k(a),y(),u&&j(u,E),E&&k(d),E&&k(h),O.d()}}}function ad(n,e){let t,i,s,l,o,r,a,u;function f(h,g){return g&1&&(l=null),l==null&&(l=!!Ii(h[0][h[13]])),l?eC:x3}let c=f(e,-1),d=c(e);return r=new Ne({props:{class:"form-field rule-field m-0 "+(Ii(e[0][e[13]])?"disabled":""),name:e[13],$$slots:{default:[iC,({uniqueId:h})=>({17:h}),({Line truncated
|
||||
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
|
||||
</a>.`,s=D(),l=_("span"),r=N(o),a=D(),b&&b.c(),u=D(),c.c(),d=We(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w(S,u,T),$[f].m(S,T),w(S,d,T),h=!0,g||(v=J(l,"click",n[7]),g=!0)},p(S,[T]){(!h||T&4)&&o!==(o=S[2]?"Hide available fields":"Show available fields")&&ue(r,o),S[2]?b?(b.p(S,T),T&4&&A(b,1)):(b=od(S),b.c(),A(b,1),b.m(e,null)):b&&(Ae(),L(b,1,1,()=>{b=null}),Pe());let M=f;f=C(S),f===M?$[f].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),c=$[f],c?c.p(S,T):(c=$[f]=y[f](S),c.c()),A(c,1),c.m(d.parentNode,d))},i(S){h||(A(b),A(c),h=!0)},o(S){L(b),L(c),h=!1},d(S){S&&k(e),b&&b.d(),S&&k(u),$[f].d(S),S&&k(d),g=!1,v()}}}function Ii(n){return n===null}function lC(n,e,t){let{collection:i=new dn}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Pi(()=>import("./FilterAutocompleteInput.586413d1.js"),["FilterAutocompleteInput.586413d1.js","index.c4d07677.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Fn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await Zn(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){me[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class oC extends Ee{constructor(e){super(),Oe(this,e,lC,sC,De,{collection:0})}}function ud(n,e,t){const i=n.slice();return i[14]=e[t],i}function fd(n,e,t){const i=n.slice();return i[14]=e[t],i}function cd(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=N(`Renamed collection
|
||||
`),s=_("strong"),o=N(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=N(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(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&ue(o,l),g&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function pd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=N(`Renamed field
|
||||
`),s=_("strong"),o=N(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=N(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(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&ue(o,l),g&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function hd(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=N("Removed field "),i=_("span"),l=N(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ue(l,s)},d(r){r&&k(e)}}}function rC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&cd(),g=n[5]&&dd(n),v=n[4],b=[];for(let C=0;C<v.length;C+=1)b[C]=pd(fd(n,v,C));let y=n[3],$=[];for(let C=0;C<y.length;C+=1)$[C]=hd(ud(n,y,C));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
|
||||
update it manually!`,o=D(),h&&h.c(),r=D(),a=_("h6"),a.textContent="Changes:",u=D(),f=_("ul"),g&&g.c(),c=D();for(let C=0;C<b.length;C+=1)b[C].c();d=D();for(let C=0;C<$.length;C+=1)$[C].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(C,S){w(C,e,S),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),h&&h.m(s,null),w(C,r,S),w(C,a,S),w(C,u,S),w(C,f,S),g&&g.m(f,null),m(f,c);for(let T=0;T<b.length;T+=1)b[T].m(f,null);m(f,d);for(let T=0;T<$.length;T+=1)$[T].m(f,null)},p(C,S){if(C[3].length?h||(h=cd(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),C[5]?g?g.p(C,S):(g=dd(C),g.c(),g.m(f,c)):g&&(g.d(1),g=null),S&16){v=C[4];let T;for(T=0;T<v.length;T+=1){const M=fd(C,v,T);b[T]?b[T].p(M,S):(b[T]=pd(M),b[T].c(),b[T].m(f,d))}for(;T<b.length;T+=1)b[T].d(1);b.length=v.length}if(S&8){y=C[3];let T;for(T=0;T<y.length;T+=1){const M=ud(C,y,T);$[T]?$[T].p(M,S):($[T]=hd(M),$[T].c(),$[T].m(f,null))}for(;T<$.length;T+=1)$[T].d(1);$.length=y.length}},d(C){C&&k(e),h&&h.d(),C&&k(r),C&&k(a),C&&k(u),C&&k(f),g&&g.d(),Yt(b,C),Yt($,C)}}}function aC(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function uC(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[J(e,"click",n[8]),J(i,"click",n[9])],s=!0)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Je(l)}}}function fC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[uC],header:[aC],default:[rC]},$$scope:{ctx:n}};return e=new ui({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function cC(n,e,t){let i,s,l;const o=xt();let r,a;async function u(y){t(1,a=y),await Zn(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){me[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){tt.call(this,n,y)}function b(y){tt.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class dC extends Ee{constructor(e){super(),Oe(this,e,cC,fC,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function md(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new oC({props:o}),me.push(()=>Re(t,"collection",l)),{c(){e=_("div"),q(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],je(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),j(t)}}}function pC(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new J3({props:a}),me.push(()=>Re(i,"collection",r));let u=n[9]===kl&&md(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),l=D(),u&&u.c(),p(t,"class","tab-item"),te(t,"active",n[9]===rs),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),H(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],je(()=>s=!1)),i.$set(d),c[0]&512&&te(t,"active",f[9]===rs),f[9]===kl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=md(f),u.c(),A(u,1),u.m(e,null)):u&&(Ae(),L(u,1,1,()=>{u=null}),Pe())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){L(i.$$.fragment,f),L(u),o=!1},d(f){f&&k(e),j(i),u&&u.d()}}}function gd(n){let e,t,i,s,l,o,r;return o=new Ti({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[hC]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=D(),i=_("button"),s=_("i"),l=D(),q(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),j(o)}}}function hC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[20]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function _d(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function mC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&_d();return{c(){e=_("label"),t=N("Name"),s=D(),l=_("input"),u=D(),h&&h.c(),f=We(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=J(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=_d(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function bd(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ye(t=gt.call(null,e,n[12])),l=!0)},p(r,a){t&&Nn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=st(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=st(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function vd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function gC(n){var F,z,Q,ne,G,ee;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!B.isEmpty((F=n[4])==null?void 0:F.schema),b,y,$,C,S=!B.isEmpty((z=n[4])==null?void 0:z.listRule)||!B.isEmpty((Q=n[4])==null?void 0:Q.viewRule)||!B.isEmpty((ne=n[4])==null?void 0:ne.createRule)||!B.isEmpty((G=n[4])==null?void 0:G.updateRule)||!B.isEmpty((ee=n[4])==null?void 0:ee.deleteRule),T,M,O,E=!n[2].isNew&&!n[2].system&&gd(n);r=new Ne({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[mC,({uniqueId:U})=>({38:U}),({uniqueId:U})=>[0,U?128:0]]},$$scope:{ctx:n}}});let P=v&&bd(n),I=S&&vd();return{c(){e=_("h4"),i=N(t),s=D(),E&&E.c(),l=D(),o=_("form"),q(r.$$.fragment),a=D(),u=_("input"),f=D(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=D(),P&&P.c(),b=D(),y=_("button"),$=_("span"),$.textContent="API Rules",C=D(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),te(d,"active",n[9]===rs),p($,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),te(y,"active",n[9]===kl),p(c,"class","tabs-header stretched")},m(U,Y){w(U,e,Y),m(e,i),w(U,s,Y),E&&E.m(U,Y),w(U,l,Y),w(U,o,Y),H(r,o,null),m(o,a),m(o,u),w(U,f,Y),w(U,c,Y),m(c,d),m(d,h),m(d,g),P&&P.m(d,null),m(c,b),m(c,y),m(y,$),m(y,C),I&&I.m(y,null),T=!0,M||(O=[J(o,"submit",Wt(n[22])),J(d,"click",n[23]),J(y,"click",n[24])],M=!0)},p(U,Y){var de,x,oe,Ce,Te,K;(!T||Y[0]&4)&&t!==(t=U[2].isNew?"New collection":"Edit collection")&&ue(i,t),!U[2].isNew&&!U[2].system?E?(E.p(U,Y),Y[0]&4&&A(E,1)):(E=gd(U),E.c(),A(E,1),E.m(l.parentNode,l)):E&&(Ae(),L(E,1,1,()=>{E=null}),Pe());const Z={};Y[0]&2048&&(Z.class="form-field required m-b-0 "+(U[11]?"disabled":"")),Y[0]&2052|Y[1]&384&&(Z.$$scope={dirty:Y,ctx:U}),r.$set(Z),Y[0]&16&&(v=!B.isEmpty((de=U[4])==null?void 0:de.schema)),v?P?(P.p(U,Y),Y[0]&16&&A(P,1)):(P=bd(U),P.c(),A(P,1),P.m(d,null)):P&&(Ae(),L(P,1,1,()=>{P=null}),Pe()),Y[0]&512&&te(d,"active",U[9]===rs),Y[0]&16&&(S=!B.isEmpty((x=U[4])==null?void 0:x.listRule)||!B.isEmpty((oe=U[4])==null?void 0:oe.viewRule)||!B.isEmpty((Ce=U[4])==null?void 0:Ce.createRule)||!B.isEmpty((Te=U[4])==null?void 0:Te.updateRule)||!B.isEmpty((K=U[4])==null?void 0:K.deleteRule)),S?I?Y[0]&16&&A(I,1):(I=vd(),I.c(),A(I,1),I.m(y,null)):I&&(Ae(),L(I,1,1,()=>{I=null}),Pe()),Y[0]&512&&te(y,"active",U[9]===kl)},i(U){T||(A(E),A(r.$$.fragment,U),A(P),A(I),T=!0)},o(U){L(E),L(r.$$.fragment,U),L(P),L(I),T=!1},d(U){U&&k(e),U&&k(s),E&&E.d(U),U&&k(l),U&&k(o),j(r),U&&k(f),U&&k(c),P&&P.d(),I&&I.d(),M=!1,Je(O)}}}function _C(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),r=N(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],te(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=[J(e,"click",n[18]),J(s,"click",n[19]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){w(l,e,o),m(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:se,d(l){l&&k(e),i=!1,s()}}}function wC(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,v,b,y,$,C,S=n[3];const T=P=>P[14].id;for(let P=0;P<S.length;P+=1){let I=yd(n,S,P),F=T(I);h.set(F,d[P]=$d(F,I))}let M=null;S.length||(M=kd(n));let O=!n[6]&&Sd(n),E={};return b=new tu({props:E}),n[13](b),{c(){e=_("aside"),t=_("header"),i=_("div"),s=_("div"),l=_("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=_("input"),a=D(),u=_("hr"),f=D(),c=_("div");for(let P=0;P<d.length;P+=1)d[P].c();M&&M.c(),g=D(),O&&O.c(),v=D(),q(b.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),te(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"),te(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(e,"class","page-sidebar collection-sidebar")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Se(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let F=0;F<d.length;F+=1)d[F].m(c,null);M&&M.m(c,null),m(e,g),O&&O.m(e,null),w(P,v,I),H(b,P,I),y=!0,$||(C=[J(l,"click",n[9]),J(r,"input",n[10])],$=!0)},p(P,[I]){I&16&&te(l,"hidden",!P[4]),I&1&&r.value!==P[0]&&Se(r,P[0]),I&16&&te(i,"active",P[4]),I&170&&(S=P[3],d=_t(d,I,T,1,P,S,h,c,bn,$d,null,yd),!S.length&&M?M.p(P,I):S.length?M&&(M.d(1),M=null):(M=kd(P),M.c(),M.m(c,null))),P[6]?O&&(O.d(1),O=null):O?O.p(P,I):(O=Sd(P),O.c(),O.m(e,null));const F={};b.$set(F)},i(P){y||(A(b.$$.fragment,P),y=!0)},o(P){L(b.$$.fragment,P),y=!1},d(P){P&&k(e);for(let I=0;I<d.length;I+=1)d[I].d();M&&M.d(),O&&O.d(),P&&k(v),n[13](null),j(b,P),$=!1,Je(C)}}}function $C(n,e,t){let i,s,l,o,r,a;at(n,hi,y=>t(5,o=y)),at(n,As,y=>t(8,r=y)),at(n,us,y=>t(6,a=y));let u,f="";function c(y){nn(hi,o=y,o)}const d=()=>t(0,f="");function h(){f=this.value,t(0,f)}const g=y=>c(y),v=()=>u==null?void 0:u.show();function b(y){me[y?"unshift":"push"](()=>{u=y,t(2,u)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=f.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=f!==""),n.$$.dirty&259&&t(3,l=r.filter(y=>y.name!="profiles"&&(y.id==f||y.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[f,i,u,l,s,o,a,c,r,d,h,g,v,b]}class SC extends Ee{constructor(e){super(),Oe(this,e,$C,wC,De,{})}}function CC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,we,ae,W,_e,He,Ue,X,ge,ce,ke,Ge;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
|
||||
<code><span class="txt-success">OPERAND</span>
|
||||
<span class="txt-danger">OPERATOR</span>
|
||||
<span class="txt-success">OPERAND</span></code>, where:`,t=D(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
|
||||
quoted), number, null, true, false`,l=D(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=N(` - is one of:
|
||||
`),u=_("br"),f=D(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=D(),v=_("span"),v.textContent="Equal",b=D(),y=_("li"),$=_("code"),$.textContent="!=",C=D(),S=_("span"),S.textContent="NOT equal",T=D(),M=_("li"),O=_("code"),O.textContent=">",E=D(),P=_("span"),P.textContent="Greater than",I=D(),F=_("li"),z=_("code"),z.textContent=">=",Q=D(),ne=_("span"),ne.textContent="Greater than or equal",G=D(),ee=_("li"),U=_("code"),U.textContent="<",Y=D(),Z=_("span"),Z.textContent="Less than or equal",de=D(),x=_("li"),oe=_("code"),oe.textContent="<=",Ce=D(),Te=_("span"),Te.textContent="Less than or equal",K=D(),we=_("li"),ae=_("code"),ae.textContent="~",W=D(),_e=_("span"),_e.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||||
match)`,He=D(),Ue=_("li"),X=_("code"),X.textContent="!~",ge=D(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,ke=D(),Ge=_("p"),Ge.innerHTML=`To group and combine several expressions you could use brackets
|
||||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p($,"class","filter-op svelte-1w7s5nw"),p(S,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(P,"class","txt-hint"),p(z,"class","filter-op svelte-1w7s5nw"),p(ne,"class","txt-hint"),p(U,"class","filter-op svelte-1w7s5nw"),p(Z,"class","txt-hint"),p(oe,"class","filter-op svelte-1w7s5nw"),p(Te,"class","txt-hint"),p(ae,"class","filter-op svelte-1w7s5nw"),p(_e,"class","txt-hint"),p(X,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(et,Ke){w(et,e,Ke),w(et,t,Ke),w(et,i,Ke),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,h),m(d,g),m(d,v),m(c,b),m(c,y),m(y,$),m(y,C),m(y,S),m(c,T),m(c,M),m(M,O),m(M,E),m(M,P),m(c,I),m(c,F),m(F,z),m(F,Q),m(F,ne),m(c,G),m(c,ee),m(ee,U),m(ee,Y),m(ee,Z),m(c,de),m(c,x),m(x,oe),m(x,Ce),m(x,Te),m(c,K),m(c,we),m(we,ae),m(we,W),m(we,_e),m(c,He),m(c,Ue),m(Ue,X),m(Ue,ge),m(Ue,ce),w(et,ke,Ke),w(et,Ge,Ke)},p:se,i:se,o:se,d(et){et&&k(e),et&&k(t),et&&k(i),et&&k(ke),et&&k(Ge)}}}class MC extends Ee{constructor(e){super(),Oe(this,e,null,CC,De,{})}}function Cd(n,e,t){const i=n.slice();return i[5]=e[t],i}function Md(n,e,t){const i=n.slice();return i[5]=e[t],i}function Td(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=N(s),o=D(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),te(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=J(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&te(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function Dd(n,e){let t,i,s,l;return i=new _n({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item svelte-1maocj6"),te(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&te(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function TC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;g<f.length;g+=1){let v=Md(n,f,g),b=c(v);s.set(b,i[g]=Td(b,v))}let d=n[1];const h=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=Cd(n,d,g),b=h(v);a.set(b,r[g]=Dd(b,v))}return{c(){e=_("div"),t=_("div");for(let g=0;g<i.length;g+=1)i[g].c();l=D(),o=_("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact left"),p(o,"class","tabs-content"),p(e,"class","tabs sdk-tabs m-b-lg svelte-1maocj6")},m(g,v){w(g,e,v),m(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);m(e,l),m(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=_t(i,v,c,1,g,f,s,t,bn,Td,null,Md)),v&3&&(d=g[1],Ae(),r=_t(r,v,h,1,g,d,a,o,Gt,Dd,null,Cd),Pe())},i(g){if(!u){for(let v=0;v<d.length;v+=1)A(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)L(r[v]);u=!1},d(g){g&&k(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const Od="pb_sdk_preference";function DC(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(Od)||"javascript";const r=a=>t(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(Od,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class Hs extends Ee{constructor(e){super(),Oe(this,e,DC,TC,De,{js:2,dart:3})}}function Ed(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[6]=e[t],i}function Pd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ld(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("div"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&te(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Id(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&te(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function OC(n){var gi,Ll,ms,Il;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,we,ae,W,_e,He,Ue,X,ge,ce,ke,Ge,et,Ke,nt,Me,ze,Xe,it,ft,be,Fe,dt,Dt,pt,lt,Lt,bt,Ft,Ot,Ze,$e,Be,ot,rt,Ht,Ct,ct,en,R,V,ie,re=[],Le=new Map,le,pe,ve=[],fe=new MapLine truncated
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
const resultList = await client.records.getList('${(gi=n[0])==null?void 0:gi.name}', 1, 50, {
|
||||
filter: 'created >= "2022-01-01 00:00:00"',
|
||||
});
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
const records = await client.records.getFullList('${(Ll=n[0])==null?void 0:Ll.name}', 200 /* batch size */, {
|
||||
sort: '-created',
|
||||
});
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
final result = await client.records.getList(
|
||||
'${(ms=n[0])==null?void 0:ms.name}',
|
||||
page: 1,
|
||||
perPage: 50,
|
||||
filter: 'created >= "2022-01-01 00:00:00"',
|
||||
);
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
final records = await client.records.getFullList('${(Il=n[0])==null?void 0:Il.name}', batch: 200, sort: '-created');
|
||||
`}}),X=new _n({props:{content:`
|
||||
// DESC by created and ASC by id
|
||||
?sort=-created,id
|
||||
`}}),ze=new _n({props:{content:`
|
||||
?filter=(id='abc' && created>'2022-01-01')
|
||||
`}}),it=new MC({}),bt=new _n({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let mt=n[4];const un=qe=>qe[6].code;for(let qe=0;qe<mt.length;qe+=1){let xe=Ad(n,mt,qe),Xt=un(xe);Le.set(Xt,re[qe]=Ld(Xt,xe))}let jt=n[4];const Di=qe=>qe[6].code;for(let qe=0;qe<jt.length;qe+=1){let xe=Ed(n,jt,qe),Xt=Di(xe);fe.set(Xt,ve[qe]=Id(Xt,xe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=D(),Ie&&Ie.c(),d=D(),h=_("div"),g=_("p"),v=N("Fetch a paginated "),b=_("strong"),$=N(y),C=N(" records list."),S=D(),T=_("div"),T.textContent="Client SDKs example",M=D(),q(O.$$.fragment),E=D(),P=_("div"),P.textContent="Query parameters",I=D(),F=_("table"),z=_("thead"),z.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,Q=D(),ne=_("tbody"),G=_("tr"),G.innerHTML=`<td>page</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,ee=D(),U=_("tr"),U.innerHTML=`<td>perPage</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>Specify the max returned records per page (default to 30).</td>`,Y=D(),Z=_("tr"),de=_("td"),de.textContent="sort",x=D(),oe=_("td"),oe.innerHTML='<span class="label">String</span>',Ce=D(),Te=_("td"),K=N("Specify the records order attribute(s). "),we=_("br"),ae=N(`
|
||||
Add `),W=_("code"),W.textContent="-",_e=N(" / "),He=_("code"),He.textContent="+",Ue=N(` (default) in front of the attribute for DESC / ASC order.
|
||||
Ex.:
|
||||
`),q(X.$$.fragment),ge=D(),ce=_("tr"),ke=_("td"),ke.textContent="filter",Ge=D(),et=_("td"),et.innerHTML='<span class="label">String</span>',Ke=D(),nt=_("td"),Me=N(`Filter the returned records. Ex.:
|
||||
`),q(ze.$$.fragment),Xe=D(),q(it.$$.fragment),ft=D(),be=_("tr"),Fe=_("td"),Fe.textContent="expand",dt=D(),Dt=_("td"),Dt.innerHTML='<span class="label">String</span>',pt=D(),lt=_("td"),Lt=N(`Auto expand record relations. Ex.:
|
||||
`),q(bt.$$.fragment),Ft=N(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Ot=_("br"),Ze=N(`
|
||||
The expanded relations will be appended to each individual record under the
|
||||
`),$e=_("code"),$e.textContent="@expand",Be=N(" property (eg. "),ot=_("code"),ot.textContent='"@expand": {"rel1": {...}, ...}',rt=N(`). Only the
|
||||
relations that the user has permissions to `),Ht=_("strong"),Ht.textContent="view",Ct=N(" will be expanded."),ct=D(),en=_("div"),en.textContent="Responses",R=D(),V=_("div"),ie=_("div");for(let qe=0;qe<re.length;qe+=1)re[qe].c();le=D(),pe=_("div");for(let qe=0;qe<ve.length;qe+=1)ve[qe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","section-title"),p(F,"class","table-compact table-border m-b-lg"),p(en,"class","section-title"),p(ie,"class","tabs-header compact left"),p(pe,"class","tabs-content"),p(V,"class","tabs")},m(qe,xe){w(qe,e,xe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Ie&&Ie.m(e,null),w(qe,d,xe),w(qe,h,xe),m(h,g),m(g,v),m(g,b),m(b,$),m(g,C),w(qe,S,xe),w(qe,T,xe),w(qe,M,xe),H(O,qe,xe),w(qe,E,xe),w(qe,P,xe),w(qe,I,xe),w(qe,F,xe),m(F,z),m(F,Q),m(F,ne),m(ne,G),m(ne,ee),m(ne,U),m(ne,Y),m(ne,Z),m(Z,de),m(Z,x),m(Z,oe),m(Z,Ce),m(Z,Te),m(Te,K),m(Te,we),m(Te,ae),m(Te,W),m(Te,_e),m(Te,He),m(Te,Ue),H(X,Te,null),m(ne,ge),m(ne,ce),m(ce,ke),m(ce,Ge),m(ce,et),m(ce,Ke),m(ce,nt),m(nt,Me),H(ze,nt,null),m(nt,Xe),H(it,nt,null),m(ne,ft),m(ne,be),m(be,Fe),m(be,dt),m(be,Dt),m(be,pt),m(be,lt),m(lt,Lt),H(bt,lt,null),m(lt,Ft),m(lt,Ot),m(lt,Ze),m(lt,$e),m(lt,Be),m(lt,ot),m(lt,rt),m(lt,Ht),m(lt,Ct),w(qe,ct,xe),w(qe,en,xe),w(qe,R,xe),w(qe,V,xe),m(V,ie);for(let Xt=0;Xt<re.length;Xt+=1)re[Xt].m(ie,null);m(V,le),m(V,pe);for(let Xt=0;Xt<ve.length;Xt+=1)ve[Xt].m(pe,null);he=!0},p(qe,[xe]){var Nl,Fl,Rl,Hl;(!he||xe&1)&&a!==(a=qe[0].name+"")&&ue(u,a),qe[1]?Ie||(Ie=Pd(),Ie.c(),Ie.m(e,null)):Ie&&(Ie.d(1),Ie=null),(!he||xe&1)&&y!==(y=qe[0].name+"")&&ue($,y);const Xt={};xe&9&&(Xt.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${qe[3]}');
|
||||
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
const resultList = await client.records.getList('${(Nl=qe[0])==null?void 0:Nl.name}', 1, 50, {
|
||||
filter: 'created >= "2022-01-01 00:00:00"',
|
||||
});
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
const records = await client.records.getFullList('${(Fl=qe[0])==null?void 0:Fl.name}', 200 /* batch size */, {
|
||||
sort: '-created',
|
||||
});
|
||||
`),xe&9&&(Xt.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${qe[3]}');
|
||||
|
||||
...
|
||||
|
||||
// fetch a paginated records list
|
||||
final result = await client.records.getList(
|
||||
'${(Rl=qe[0])==null?void 0:Rl.name}',
|
||||
page: 1,
|
||||
perPage: 50,
|
||||
filter: 'created >= "2022-01-01 00:00:00"',
|
||||
);
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
final records = await client.records.getFullList('${(Hl=qe[0])==null?void 0:Hl.name}', batch: 200, sort: '-created');
|
||||
`),O.$set(Xt),xe&20&&(mt=qe[4],re=_t(re,xe,un,1,qe,mt,Le,ie,bn,Ld,null,Ad)),xe&20&&(jt=qe[4],Ae(),ve=_t(ve,xe,Di,1,qe,jt,fe,pe,Gt,Id,null,Ed),Pe())},i(qe){if(!he){A(O.$$.fragment,qe),A(X.$$.fragment,qe),A(ze.$$.fragment,qe),A(it.$$.fragment,qe),A(bt.$$.fragment,qe);for(let xe=0;xe<jt.length;xe+=1)A(ve[xe]);he=!0}},o(qe){L(O.$$.fragment,qe),L(X.$$.fragment,qe),L(ze.$$.fragment,qe),L(it.$$.fragment,qe),L(bt.$$.fragment,qe);for(let xe=0;xe<ve.length;xe+=1)L(ve[xe]);he=!1},d(qe){qe&&k(e),Ie&&Ie.d(),qe&&k(d),qe&&k(h),qe&&k(S),qe&&k(T),qe&&k(M),j(O,qe),qe&&k(E),qe&&k(P),qe&&k(I),qe&&k(F),j(X),j(ze),j(it),j(bt),qe&&k(ct),qe&&k(en),qe&&k(R),qe&&k(V);for(let xe=0;xe<re.length;xe+=1)re[xe].d();for(let xe=0;xe<ve.length;xe+=1)ve[xe].d()}}}function EC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[B.dummyCollectionRecord(l),B.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Something went wrong while processing your request. Invalid filter.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}))},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class AC extends Ee{constructor(e){super(),Oe(this,e,EC,OC,De,{collection:0})}}function Nd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Fd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Hd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&te(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function jd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&te(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function PC(n){var Ot,Ze;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,we,ae,W,_e,He,Ue,X,ge,ce,ke,Ge,et,Ke,nt,Me,ze,Xe=[],it=new Map,ft,be,Fe=[],dt=new Map,Dt,pt=n[1]&&Rd();E=new Hs({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
const record = await client.records.getOne('${(Ot=n[0])==null?void 0:Ot.name}', 'RECORD_ID', {
|
||||
expand: 'some_relation'
|
||||
});
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
final record = await client.records.getOne('${(Ze=n[0])==null?void 0:Ze.name}', 'RECORD_ID', query: {
|
||||
'expand': 'some_relation',
|
||||
});
|
||||
`}}),ae=new _n({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let lt=n[4];const Lt=$e=>$e[6].code;for(let $e=0;$e<lt.length;$e+=1){let Be=Fd(n,lt,$e),ot=Lt(Be);it.set(ot,Xe[$e]=Hd(ot,Be))}let bt=n[4];const Ft=$e=>$e[6].code;for(let $e=0;$e<bt.length;$e+=1){let Be=Nd(n,bt,$e),ot=Ft(Be);dt.set(ot,Fe[$e]=jd(ot,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),pt&&pt.c(),h=D(),g=_("div"),v=_("p"),b=N("Fetch a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("div"),M.textContent="Client SDKs example",O=D(),q(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path Parameters",F=D(),z=_("table"),z.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to view.</td></tr></tbody>`,Q=D(),ne=_("div"),ne.textContent="Query parameters",G=D(),ee=_("table"),U=_("thead"),U.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,Y=D(),Z=_("tbody"),de=_("tr"),x=_("td"),x.textContent="expand",oe=D(),Ce=_("td"),Ce.innerHTML='<span class="label">String</span>',Te=D(),K=_("td"),we=N(`Auto expand record relations. Ex.:
|
||||
`),q(ae.$$.fragment),W=N(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),_e=_("br"),He=N(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),Ue=_("code"),Ue.textContent="@expand",X=N(" property (eg. "),ge=_("code"),ge.textContent='"@expand": {"rel1": {...}, ...}',ce=N(`). Only the
|
||||
relations that the user has permissions to `),ke=_("strong"),ke.textContent="view",Ge=N(" will be expanded."),et=D(),Ke=_("div"),Ke.textContent="Responses",nt=D(),Me=_("div"),ze=_("div");for(let $e=0;$e<Xe.length;$e+=1)Xe[$e].c();ft=D(),be=_("div");for(let $e=0;$e<Fe.length;$e+=1)Fe[$e].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(M,"class","section-title"),p(I,"class","section-title"),p(z,"class","table-compact table-border m-b-lg"),p(ne,"class","section-title"),p(ee,"class","table-compact table-border m-b-lg"),p(Ke,"class","section-title"),p(ze,"class","tabs-header compact left"),p(be,"class","tabs-content"),p(Me,"class","tabs")},m($e,Be){w($e,e,Be),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),pt&&pt.m(e,null),w($e,h,Be),w($e,g,Be),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),w($e,T,Be),w($e,M,Be),w($e,O,Be),H(E,$e,Be),w($e,P,Be),w($e,I,Be),w($e,F,Be),w($e,z,Be),w($e,Q,Be),w($e,ne,Be),w($e,G,Be),w($e,ee,Be),m(ee,U),m(ee,Y),m(ee,Z),m(Z,de),m(de,x),m(de,oe),m(de,Ce),m(de,Te),m(de,K),m(K,we),H(ae,K,null),m(K,W),m(K,_e),m(K,He),m(K,Ue),m(K,X),m(K,ge),m(K,ce),m(K,ke),m(K,Ge),w($e,et,Be),w($e,Ke,Be),w($e,nt,Be),w($e,Me,Be),m(Me,ze);for(let ot=0;ot<Xe.length;ot+=1)Xe[ot].m(ze,null);m(Me,ft),m(Me,be);for(let ot=0;ot<Fe.length;ot+=1)Fe[ot].m(be,null);Dt=!0},p($e,[Be]){var rt,Ht;(!Dt||Be&1)&&a!==(a=$e[0].name+"")&&ue(u,a),$e[1]?pt||(pt=Rd(),pt.c(),pt.m(e,null)):pt&&(pt.d(1),pt=null),(!Dt||Be&1)&&$!==($=$e[0].name+"")&&ue(C,$);const ot={};Be&9&&(ot.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${$e[3]}');
|
||||
|
||||
...
|
||||
|
||||
const record = await client.records.getOne('${(rt=$e[0])==null?void 0:rt.name}', 'RECORD_ID', {
|
||||
expand: 'some_relation'
|
||||
});
|
||||
`),Be&9&&(ot.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${$e[3]}');
|
||||
|
||||
...
|
||||
|
||||
final record = await client.records.getOne('${(Ht=$e[0])==null?void 0:Ht.name}', 'RECORD_ID', query: {
|
||||
'expand': 'some_relation',
|
||||
});
|
||||
`),E.$set(ot),Be&20&&(lt=$e[4],Xe=_t(Xe,Be,Lt,1,$e,lt,it,ze,bn,Hd,null,Fd)),Be&20&&(bt=$e[4],Ae(),Fe=_t(Fe,Be,Ft,1,$e,bt,dt,be,Gt,jd,null,Nd),Pe())},i($e){if(!Dt){A(E.$$.fragment,$e),A(ae.$$.fragment,$e);for(let Be=0;Be<bt.length;Be+=1)A(Fe[Be]);Dt=!0}},o($e){L(E.$$.fragment,$e),L(ae.$$.fragment,$e);for(let Be=0;Be<Fe.length;Be+=1)L(Fe[Be]);Dt=!1},d($e){$e&&k(e),pt&&pt.d(),$e&&k(h),$e&&k(g),$e&&k(T),$e&&k(M),$e&&k(O),j(E,$e),$e&&k(P),$e&&k(I),$e&&k(F),$e&&k(z),$e&&k(Q),$e&&k(ne),$e&&k(G),$e&&k(ee),j(ae),$e&&k(et),$e&&k(Ke),$e&&k(nt),$e&&k(Me);for(let Be=0;Be<Xe.length;Be+=1)Xe[Be].d();for(let Be=0;Be<Fe.length;Be+=1)Fe[Be].d()}}}function LC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}))},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class IC extends Ee{constructor(e){super(),Oe(this,e,LC,PC,De,{collection:0})}}function qd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[6]=e[t],i}function zd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Bd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function NC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function FC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function RC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function HC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function jC(n){let e,t,i,s,l;return{c(){e=N("File object."),t=_("br"),i=N(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function qC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function VC(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function zC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function BC(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function UC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Ud(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=B.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?FC:NC}let $=y(e),C=$(e);function S(O,E){if(O[11].type==="text")return UC;if(O[11].type==="number")return BC;if(O[11].type==="json")return zC;if(O[11].type==="email")return VC;if(O[11].type==="url")return qC;if(O[11].type==="file")return jC;if(O[11].type==="relation")return HC;if(O[11].type==="user")return RC}let T=S(e),M=T&&T(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=D(),o=_("span"),a=N(r),u=D(),f=_("td"),c=_("span"),h=N(d),g=D(),v=_("td"),M&&M.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),M&&M.m(v,null),m(t,b)},p(O,E){e=O,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=B.getFieldValueType(e[11])+"")&&ue(h,d),T===(T=S(e))&&M?M.p(e,E):(M&&M.d(1),M=T&&T(e),M&&(M.c(),M.m(v,null)))},d(O){O&&k(t),C.d(),M&&M.d()}}}function Wd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&te(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Yd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&te(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function WC(n){var ie,re,Le;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x=[],oe=new Map,Ce,Te,K,we,ae,W,_e,He,Ue,X,ge,ce,ke,Ge,et,Ke,nt,Me,ze,Xe,it,ft,be,Fe,dt,Dt,pt,lt,Lt,bt=[],Ft=new Map,Ot,Ze,$e=[],Be=new Map,ot,rt=n[4]&&Bd();F=new Hs({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
const data = { ... };
|
||||
|
||||
const record = await client.records.create('${(ie=n[0])==null?void 0:ie.name}', data);
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
final body = <String, dynamic>{ ... };
|
||||
|
||||
final record = await client.records.create('${(re=n[0])==null?void 0:re.name}', body: body);
|
||||
`}});let Ht=(Le=n[0])==null?void 0:Le.schema;const Ct=le=>le[11].name;for(let le=0;le<Ht.length;le+=1){let pe=zd(n,Ht,le),ve=Ct(pe);oe.set(ve,x[le]=Ud(ve,pe))}et=new _n({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let ct=n[2];const en=le=>le[6].code;for(let le=0;le<ct.length;le+=1){let pe=Vd(n,ct,le),ve=en(pe);Ft.set(ve,bt[le]=Wd(ve,pe))}let R=n[2];const V=le=>le[6].code;for(let le=0;le<R.length;le+=1){let pe=qd(n,R,le),ve=V(pe);Be.set(ve,$e[le]=Yd(ve,pe))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=D(),rt&&rt.c(),d=D(),h=_("div"),g=_("p"),v=N("Create a new "),b=_("strong"),$=N(y),C=N(" record."),S=D(),T=_("p"),T.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,M=D(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=D(),P=_("div"),P.textContent="Client SDKs example",I=D(),q(F.$$.fragment),z=D(),Q=_("div"),Q.textContent="Body Parameters",ne=D(),G=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,U=D(),Y=_("tbody"),Z=_("tr"),Z.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
|
||||
<span>id</span></div></td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td><strong>15 characters string</strong> to store as record ID.
|
||||
<br/>
|
||||
If not set, it will be auto generated.</td>`,de=D();for(let le=0;le<x.length;le+=1)x[le].c();Ce=D(),Te=_("div"),Te.textContent="Query parameters",K=D(),we=_("table"),ae=_("thead"),ae.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,W=D(),_e=_("tbody"),He=_("tr"),Ue=_("td"),Ue.textContent="expand",X=D(),ge=_("td"),ge.innerHTML='<span class="label">String</span>',ce=D(),ke=_("td"),Ge=N(`Auto expand relations when returning the created record. Ex.:
|
||||
`),q(et.$$.fragment),Ke=N(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),nt=_("br"),Me=N(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),ze=_("code"),ze.textContent="@expand",Xe=N(" property (eg. "),it=_("code"),it.textContent='"@expand": {"rel1": {...}, ...}',ft=N(`). Only the
|
||||
relations that the user has permissions to `),be=_("strong"),be.textContent="view",Fe=N(" will be expanded."),dt=D(),Dt=_("div"),Dt.textContent="Responses",pt=D(),lt=_("div"),Lt=_("div");for(let le=0;le<bt.length;le+=1)bt[le].c();Ot=D(),Ze=_("div");for(let le=0;le<$e.length;le+=1)$e[le].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(P,"class","section-title"),p(Q,"class","section-title"),p(G,"class","table-compact table-border m-b-lg"),p(Te,"class","section-title"),p(we,"class","table-compact table-border m-b-lg"),p(Dt,"class","section-title"),p(Lt,"class","tabs-header compact left"),p(Ze,"class","tabs-content"),p(lt,"class","tabs")},m(le,pe){w(le,e,pe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),rt&&rt.m(e,null),w(le,d,pe),w(le,h,pe),m(h,g),m(g,v),m(g,b),m(b,$),m(g,C),m(h,S),m(h,T),m(h,M),m(h,O),w(le,E,pe),w(le,P,pe),w(le,I,pe),H(F,le,pe),w(le,z,pe),w(le,Q,pe),w(le,ne,pe),w(le,G,pe),m(G,ee),m(G,U),m(G,Y),m(Y,Z),m(Y,de);for(let ve=0;ve<x.length;ve+=1)x[ve].m(Y,null);w(le,Ce,pe),w(le,Te,pe),w(le,K,pe),w(le,we,pe),m(we,ae),m(we,W),m(we,_e),m(_e,He),m(He,Ue),m(He,X),m(He,ge),m(He,ce),m(He,ke),m(ke,Ge),H(et,ke,null),m(ke,Ke),m(ke,nt),m(ke,Me),m(ke,ze),m(ke,Xe),m(ke,it),m(ke,ft),m(ke,be),m(ke,Fe),w(le,dt,pe),w(le,Dt,pe),w(le,pt,pe),w(le,lt,pe),m(lt,Lt);for(let ve=0;ve<bt.length;ve+=1)bt[ve].m(Lt,null);m(lt,Ot),m(lt,Ze);for(let ve=0;ve<$e.length;ve+=1)$e[ve].m(Ze,null);ot=!0},p(le,[pe]){var fe,he,Ie;(!ot||pe&1)&&a!==(a=le[0].name+"")&&ue(u,a),le[4]?rt||(rt=Bd(),rt.c(),rt.m(e,null)):rt&&(rt.d(1),rt=null),(!ot||pe&1)&&y!==(y=le[0].name+"")&&ue($,y);const ve={};pe&9&&(ve.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${le[3]}');
|
||||
|
||||
...
|
||||
|
||||
const data = { ... };
|
||||
|
||||
const record = await client.records.create('${(fe=le[0])==null?void 0:fe.name}', data);
|
||||
`),pe&9&&(ve.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${le[3]}');
|
||||
|
||||
...
|
||||
|
||||
final body = <String, dynamic>{ ... };
|
||||
|
||||
final record = await client.records.create('${(he=le[0])==null?void 0:he.name}', body: body);
|
||||
`),F.$set(ve),pe&1&&(Ht=(Ie=le[0])==null?void 0:Ie.schema,x=_t(x,pe,Ct,1,le,Ht,oe,Y,bn,Ud,null,zd)),pe&6&&(ct=le[2],bt=_t(bt,pe,en,1,le,ct,Ft,Lt,bn,Wd,null,Vd)),pe&6&&(R=le[2],Ae(),$e=_t($e,pe,V,1,le,R,Be,Ze,Gt,Yd,null,qd),Pe())},i(le){if(!ot){A(F.$$.fragment,le),A(et.$$.fragment,le);for(let pe=0;pe<R.length;pe+=1)A($e[pe]);ot=!0}},o(le){L(F.$$.fragment,le),L(et.$$.fragment,le);for(let pe=0;pe<$e.length;pe+=1)L($e[pe]);ot=!1},d(le){le&&k(e),rt&&rt.d(),le&&k(d),le&&k(h),le&&k(E),le&&k(P),le&&k(I),j(F,le),le&&k(z),le&&k(Q),le&&k(ne),le&&k(G);for(let pe=0;pe<x.length;pe+=1)x[pe].d();le&&k(Ce),le&&k(Te),le&&k(K),le&&k(we),j(et),le&&k(dt),le&&k(Dt),le&&k(pt),le&&k(lt);for(let pe=0;pe<bt.length;pe+=1)bt[pe].d();for(let pe=0;pe<$e.length;pe+=1)$e[pe].d()}}}function YC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to create record.",
|
||||
"data": {
|
||||
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`}])},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,o,r,s,i,a]}class KC extends Ee{constructor(e){super(),Oe(this,e,YC,WC,De,{collection:0})}}function Kd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Jd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Zd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Gd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function JC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ZC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function GC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function XC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function QC(n){let e,t,i,s,l;return{c(){e=N("File object."),t=_("br"),i=N(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function xC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function e4(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function t4(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function n4(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function i4(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Xd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=B.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?ZC:JC}let $=y(e),C=$(e);function S(O,E){if(O[11].type==="text")return i4;if(O[11].type==="number")return n4;if(O[11].type==="json")return t4;if(O[11].type==="email")return e4;if(O[11].type==="url")return xC;if(O[11].type==="file")return QC;if(O[11].type==="relation")return XC;if(O[11].type==="user")return GC}let T=S(e),M=T&&T(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=D(),o=_("span"),a=N(r),u=D(),f=_("td"),c=_("span"),h=N(d),g=D(),v=_("td"),M&&M.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),M&&M.m(v,null),m(t,b)},p(O,E){e=O,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=B.getFieldValueType(e[11])+"")&&ue(h,d),T===(T=S(e))&&M?M.p(e,E):(M&&M.d(1),M=T&&T(e),M&&(M.c(),M.m(v,null)))},d(O){O&&k(t),C.d(),M&&M.d()}}}function Qd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&te(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function xd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&te(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function s4(n){var le,pe,ve;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te=[],K=new Map,we,ae,W,_e,He,Ue,X,ge,ce,ke,Ge,et,Ke,nt,Me,ze,Xe,it,ft,be,Fe,dt,Dt,pt,lt,Lt,bt,Ft,Ot,Ze=[],$e=new Map,Be,ot,rt=[],Ht=new Map,Ct,ct=n[4]&&Gd();z=new Hs({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
const data = { ... };
|
||||
|
||||
const record = await client.records.update('${(le=n[0])==null?void 0:le.name}', 'RECORD_ID', data);
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
final body = <String, dynamic>{ ... };
|
||||
|
||||
final record = await client.records.update('${(pe=n[0])==null?void 0:pe.name}', 'RECORD_ID', body: body);
|
||||
`}});let en=(ve=n[0])==null?void 0:ve.schema;const R=fe=>fe[11].name;for(let fe=0;fe<en.length;fe+=1){let he=Zd(n,en,fe),Ie=R(he);K.set(Ie,Te[fe]=Xd(Ie,he))}Me=new _n({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let V=n[2];const ie=fe=>fe[6].code;for(let fe=0;fe<V.length;fe+=1){let he=Jd(n,V,fe),Ie=ie(he);$e.set(Ie,Ze[fe]=Qd(Ie,he))}let re=n[2];const Le=fe=>fe[6].code;for(let fe=0;fe<re.length;fe+=1){let he=Kd(n,re,fe),Ie=Le(he);Ht.set(Ie,rt[fe]=xd(Ie,he))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),ct&&ct.c(),h=D(),g=_("div"),v=_("p"),b=N("Update a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,O=D(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",P=D(),I=_("div"),I.textContent="Client SDKs example",F=D(),q(z.$$.fragment),Q=D(),ne=_("div"),ne.textContent="Path parameters",G=D(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to update.</td></tr></tbody>`,U=D(),Y=_("div"),Y.textContent="Body Parameters",Z=D(),de=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,oe=D(),Ce=_("tbody");for(let fe=0;fe<Te.length;fe+=1)Te[fe].c();we=D(),ae=_("div"),ae.textContent="Query parameters",W=D(),_e=_("table"),He=_("thead"),He.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,Ue=D(),X=_("tbody"),ge=_("tr"),ce=_("td"),ce.textContent="expand",ke=D(),Ge=_("td"),Ge.innerHTML='<span class="label">String</span>',et=D(),Ke=_("td"),nt=N(`Auto expand relations when returning the updated record. Ex.:
|
||||
`),q(Me.$$.fragment),ze=N(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Xe=_("br"),it=N(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),ft=_("code"),ft.textContent="@expand",be=N(" property (eg. "),Fe=_("code"),Fe.textContent='"@expand": {"rel1": {...}, ...}',dt=N(`). Only the
|
||||
relations that the user has permissions to `),Dt=_("strong"),Dt.textContent="view",pt=N(" will be expanded."),lt=D(),Lt=_("div"),Lt.textContent="Responses",bt=D(),Ft=_("div"),Ot=_("div");for(let fe=0;fe<Ze.length;fe+=1)Ze[fe].c();Be=D(),ot=_("div");for(let fe=0;fe<rt.length;fe+=1)rt[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(I,"class","section-title"),p(ne,"class","section-title"),p(ee,"class","table-compact table-border m-b-lg"),p(Y,"class","section-title"),p(de,"class","table-compact table-border m-b-lg"),p(ae,"class","section-title"),p(_e,"class","table-compact table-border m-b-lg"),p(Lt,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(ot,"class","tabs-content"),p(Ft,"class","tabs")},m(fe,he){w(fe,e,he),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),ct&&ct.m(e,null),w(fe,h,he),w(fe,g,he),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),m(g,T),m(g,M),m(g,O),m(g,E),w(fe,P,he),w(fe,I,he),w(fe,F,he),H(z,fe,he),w(fe,Q,he),w(fe,ne,he),w(fe,G,he),w(fe,ee,he),w(fe,U,he),w(fe,Y,he),w(fe,Z,he),w(fe,de,he),m(de,x),m(de,oe),m(de,Ce);for(let Ie=0;Ie<Te.length;Ie+=1)Te[Ie].m(Ce,null);w(fe,we,he),w(fe,ae,he),w(fe,W,he),w(fe,_e,he),m(_e,He),m(_e,Ue),m(_e,X),m(X,ge),m(ge,ce),m(ge,ke),m(ge,Ge),m(ge,et),m(ge,Ke),m(Ke,nt),H(Me,Ke,null),m(Ke,ze),m(Ke,Xe),m(Ke,it),m(Ke,ft),m(Ke,be),m(Ke,Fe),m(Ke,dt),m(Ke,Dt),m(Ke,pt),w(fe,lt,he),w(fe,Lt,he),w(fe,bt,he),w(fe,Ft,he),m(Ft,Ot);for(let Ie=0;Ie<Ze.length;Ie+=1)Ze[Ie].m(Ot,null);m(Ft,Be),m(Ft,ot);for(let Ie=0;Ie<rt.length;Ie+=1)rt[Ie].m(ot,null);Ct=!0},p(fe,[he]){var mt,un,jt;(!Ct||he&1)&&a!==(a=fe[0].name+"")&&ue(u,a),fe[4]?ct||(ct=Gd(),ct.c(),ct.m(e,null)):ct&&(ct.d(1),ct=null),(!Ct||he&1)&&$!==($=fe[0].name+"")&&ue(C,$);const Ie={};he&9&&(Ie.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${fe[3]}');
|
||||
|
||||
...
|
||||
|
||||
const data = { ... };
|
||||
|
||||
const record = await client.records.update('${(mt=fe[0])==null?void 0:mt.name}', 'RECORD_ID', data);
|
||||
`),he&9&&(Ie.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${fe[3]}');
|
||||
|
||||
...
|
||||
|
||||
final body = <String, dynamic>{ ... };
|
||||
|
||||
final record = await client.records.update('${(un=fe[0])==null?void 0:un.name}', 'RECORD_ID', body: body);
|
||||
`),z.$set(Ie),he&1&&(en=(jt=fe[0])==null?void 0:jt.schema,Te=_t(Te,he,R,1,fe,en,K,Ce,bn,Xd,null,Zd)),he&6&&(V=fe[2],Ze=_t(Ze,he,ie,1,fe,V,$e,Ot,bn,Qd,null,Jd)),he&6&&(re=fe[2],Ae(),rt=_t(rt,he,Le,1,fe,re,Ht,ot,Gt,xd,null,Kd),Pe())},i(fe){if(!Ct){A(z.$$.fragment,fe),A(Me.$$.fragment,fe);for(let he=0;he<re.length;he+=1)A(rt[he]);Ct=!0}},o(fe){L(z.$$.fragment,fe),L(Me.$$.fragment,fe);for(let he=0;he<rt.length;he+=1)L(rt[he]);Ct=!1},d(fe){fe&&k(e),ct&&ct.d(),fe&&k(h),fe&&k(g),fe&&k(P),fe&&k(I),fe&&k(F),j(z,fe),fe&&k(Q),fe&&k(ne),fe&&k(G),fe&&k(ee),fe&&k(U),fe&&k(Y),fe&&k(Z),fe&&k(de);for(let he=0;he<Te.length;he+=1)Te[he].d();fe&&k(we),fe&&k(ae),fe&&k(W),fe&&k(_e),j(Me),fe&&k(lt),fe&&k(Lt),fe&&k(bt),fe&&k(Ft);for(let he=0;he<Ze.length;he+=1)Ze[he].d();for(let he=0;he<rt.length;he+=1)rt[he].d()}}}function l4(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to update record.",
|
||||
"data": {
|
||||
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`},{code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}])},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,o,r,s,i,a]}class o4 extends Ee{constructor(e){super(),Oe(this,e,l4,s4,De,{collection:0})}}function ep(n,e,t){const i=n.slice();return i[6]=e[t],i}function tp(n,e,t){const i=n.slice();return i[6]=e[t],i}function np(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ip(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&te(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function sp(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&te(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function r4(n){var He,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y=[],Z=new Map,de,x,oe=[],Ce=new Map,Te,K=n[1]&&np();E=new Hs({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
await client.records.delete('${(He=n[0])==null?void 0:He.name}', 'RECORD_ID');
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[3]}');
|
||||
|
||||
...
|
||||
|
||||
await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID');
|
||||
`}});let we=n[4];const ae=X=>X[6].code;for(let X=0;X<we.length;X+=1){let ge=tp(n,we,X),ce=ae(ge);Z.set(ce,Y[X]=ip(ce,ge))}let W=n[4];const _e=X=>X[6].code;for(let X=0;X<W.length;X+=1){let ge=ep(n,W,X),ce=_e(ge);Ce.set(ce,oe[X]=sp(ce,ge))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),K&&K.c(),h=D(),g=_("div"),v=_("p"),b=N("Delete a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("div"),M.textContent="Client SDKs example",O=D(),q(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path parameters",F=D(),z=_("table"),z.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to delete.</td></tr></tbody>`,Q=D(),ne=_("div"),ne.textContent="Responses",G=D(),ee=_("div"),U=_("div");for(let X=0;X<Y.length;X+=1)Y[X].c();de=D(),x=_("div");for(let X=0;X<oe.length;X+=1)oe[X].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(M,"class","section-title"),p(I,"class","section-title"),p(z,"class","table-compact table-border m-b-lg"),p(ne,"class","section-title"),p(U,"class","tabs-header compact left"),p(x,"class","tabs-content"),p(ee,"class","tabs")},m(X,ge){w(X,e,ge),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),K&&K.m(e,null),w(X,h,ge),w(X,g,ge),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),w(X,T,ge),w(X,M,ge),w(X,O,ge),H(E,X,ge),w(X,P,ge),w(X,I,ge),w(X,F,ge),w(X,z,ge),w(X,Q,ge),w(X,ne,ge),w(X,G,ge),w(X,ee,ge),m(ee,U);for(let ce=0;ce<Y.length;ce+=1)Y[ce].m(U,null);m(ee,de),m(ee,x);for(let ce=0;ce<oe.length;ce+=1)oe[ce].m(x,null);Te=!0},p(X,[ge]){var ke,Ge;(!Te||ge&1)&&a!==(a=X[0].name+"")&&ue(u,a),X[1]?K||(K=np(),K.c(),K.m(e,null)):K&&(K.d(1),K=null),(!Te||ge&1)&&$!==($=X[0].name+"")&&ue(C,$);const ce={};ge&9&&(ce.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${X[3]}');
|
||||
|
||||
...
|
||||
|
||||
await client.records.delete('${(ke=X[0])==null?void 0:ke.name}', 'RECORD_ID');
|
||||
`),ge&9&&(ce.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${X[3]}');
|
||||
|
||||
...
|
||||
|
||||
await client.records.delete('${(Ge=X[0])==null?void 0:Ge.name}', 'RECORD_ID');
|
||||
`),E.$set(ce),ge&20&&(we=X[4],Y=_t(Y,ge,ae,1,X,we,Z,U,bn,ip,null,tp)),ge&20&&(W=X[4],Ae(),oe=_t(oe,ge,_e,1,X,W,Ce,x,Gt,sp,null,ep),Pe())},i(X){if(!Te){A(E.$$.fragment,X);for(let ge=0;ge<W.length;ge+=1)A(oe[ge]);Te=!0}},o(X){L(E.$$.fragment,X);for(let ge=0;ge<oe.length;ge+=1)L(oe[ge]);Te=!1},d(X){X&&k(e),K&&K.d(),X&&k(h),X&&k(g),X&&k(T),X&&k(M),X&&k(O),j(E,X),X&&k(P),X&&k(I),X&&k(F),X&&k(z),X&&k(Q),X&&k(ne),X&&k(G),X&&k(ee);for(let ge=0;ge<Y.length;ge+=1)Y[ge].d();for(let ge=0;ge<oe.length;ge+=1)oe[ge].d()}}}function a4(n,e,t){let i,s,{collection:l=new dn}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:`
|
||||
null
|
||||
`}),r.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}))},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class u4 extends Ee{constructor(e){super(),Oe(this,e,a4,r4,De,{collection:0})}}function f4(n){var h,g,v,b,y,$,C,S;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Hs({props:{js:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${n[1]}');
|
||||
|
||||
...
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.users.authViaEmail('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.realtime.subscribe('${(g=n[0])==null?void 0:g.name}/RECORD_ID', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.realtime.unsubscribe() // remove all subscriptions
|
||||
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
|
||||
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
|
||||
`,dart:`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${n[1]}');
|
||||
|
||||
...
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.users.authViaEmail('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) {
|
||||
print(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.realtime.subscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID', (e) {
|
||||
print(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.realtime.unsubscribe() // remove all subscriptions
|
||||
client.realtime.unsubscribe('${(C=n[0])==null?void 0:C.name}') // remove only the collection subscription
|
||||
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}/RECORD_ID') // remove only the record subscription
|
||||
`}}),c=new _n({props:{content:JSON.stringify({action:"create",record:B.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||||
<div class="content"><p>/api/realtime</p></div>`,t=D(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||||
<p>Events are send for <strong>create</strong>, <strong>update</strong>
|
||||
and <strong>delete</strong> record operations (see "Event data format" section below).</p>
|
||||
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
|
||||
<p>When you subscribe to a <strong>single record</strong>, the collection's
|
||||
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p>
|
||||
<p>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||||
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p></div></div>`,s=D(),l=_("div"),l.textContent="Client SDKs example",o=D(),q(r.$$.fragment),a=D(),u=_("div"),u.textContent="Event data format",f=D(),q(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(T,M){w(T,e,M),w(T,t,M),w(T,i,M),w(T,s,M),w(T,l,M),w(T,o,M),H(r,T,M),w(T,a,M),w(T,u,M),w(T,f,M),H(c,T,M),d=!0},p(T,[M]){var P,I,F,z,Q,ne,G,ee;const O={};M&3&&(O.js=`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase('${T[1]}');
|
||||
|
||||
...
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.users.authViaEmail('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.realtime.subscribe('${(P=T[0])==null?void 0:P.name}', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.realtime.subscribe('${(I=T[0])==null?void 0:I.name}/RECORD_ID', function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.realtime.unsubscribe() // remove all subscriptions
|
||||
client.realtime.unsubscribe('${(F=T[0])==null?void 0:F.name}') // remove only the collection subscription
|
||||
client.realtime.unsubscribe('${(z=T[0])==null?void 0:z.name}/RECORD_ID') // remove only the record subscription
|
||||
`),M&3&&(O.dart=`
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
|
||||
final client = PocketBase('${T[1]}');
|
||||
|
||||
...
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.users.authViaEmail('test@example.com', '123456');
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.realtime.subscribe('${(Q=T[0])==null?void 0:Q.name}', (e) {
|
||||
print(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.realtime.subscribe('${(ne=T[0])==null?void 0:ne.name}/RECORD_ID', (e) {
|
||||
print(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.realtime.unsubscribe() // remove all subscriptions
|
||||
client.realtime.unsubscribe('${(G=T[0])==null?void 0:G.name}') // remove only the collection subscription
|
||||
client.realtime.unsubscribe('${(ee=T[0])==null?void 0:ee.name}/RECORD_ID') // remove only the record subscription
|
||||
`),r.$set(O);const E={};M&1&&(E.content=JSON.stringify({action:"create",record:B.dummyCollectionRecord(T[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(E)},i(T){d||(A(r.$$.fragment,T),A(c.$$.fragment,T),d=!0)},o(T){L(r.$$.fragment,T),L(c.$$.fragment,T),d=!1},d(T){T&&k(e),T&&k(t),T&&k(i),T&&k(s),T&&k(l),T&&k(o),j(r,T),T&&k(a),T&&k(u),T&&k(f),j(c,T)}}}function c4(n,e,t){let i,{collection:s=new dn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=B.getApiExampleUrl(ye.baseUrl)),[s,i]}class d4 extends Ee{constructor(e){super(),Oe(this,e,c4,f4,De,{collection:0})}}function lp(n,e,t){const i=n.slice();return i[14]=e[t],i}function op(n,e,t){const i=n.slice();return i[14]=e[t],i}function rp(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&q(t.$$.fragment),i=D(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&H(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Ae();const f=t;L(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(t=new l(o(r)),q(t.$$.fragment),A(t.$$.fragment,1),H(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&L(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&j(t)}}}function ap(n,e){let t,i,s,l=e[4]===e[14].id&&rp(e);return{key:n,first:null,c(){t=We(),l&&l.c(),i=We(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=rp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function p4(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=lp(n,l,r),u=o(a);i.set(u,t[r]=ap(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Ae(),t=_t(t,a,o,1,r,l,i,e,Gt,ap,null,lp),Pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)L(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function up(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=N(s),o=D(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),te(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[J(t,"click",u),J(t,"keydown",Bm(f))],r=!0)},p(c,d){e=c,d&48&&te(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,Je(a)}}}function h4(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=op(n,f,d),g=c(h);u.set(g,a[d]=up(g,h))}return{c(){e=_("h4"),t=_("strong"),s=N(i),l=N(" records API"),o=D(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(r,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,o,h),w(d,r,h);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ue(s,i),h&114&&(f=d[5],a=_t(a,h,c,1,d,f,u,r,bn,up,null,op))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function m4(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[8]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function g4(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[m4],header:[h4],default:[p4]},$$scope:{ctx:n}};return e=new ui({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function _4(n,e,t){const i=[{id:"list",label:"List",component:AC},{id:"view",label:"View",component:IC},{id:"create",label:"Create",component:KC},{id:"update",label:"Update",component:o4},{id:"delete",label:"Delete",component:u4},{id:"realtime",label:"Realtime",component:d4}];let s,l=new dn,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,$){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u($))}const c=()=>a(),d=y=>u(y.id),h=(y,$)=>f($,y.id);function g(y){me[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){tt.call(this,n,y)}function b(y){tt.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,h,g,v,b]}class b4 extends Ee{constructor(e){super(),Oe(this,e,_4,g4,De,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function v4(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=ut(l,s[o]);return{c(){e=_("textarea"),mi(e,l),te(e,"svelte-1x1pbts",!0)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[5](e),Se(e,n[0]),t||(i=[
Line truncated
|
||||
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[J(t,"change",n[17]),J(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Je(o)}}}function _M(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const y=M=>M[25];for(let M=0;M<b.length;M+=1){let O=dp(n,b,M),E=y(O);d.set(E,c[M]=pp(E,O))}let $=n[0],C=[];for(let M=0;M<$.length;M+=1)C[M]=hp(cp(n,$,M));const S=M=>L(C[M],1,1,()=>{C[M]=null});let T=!n[8]&&mp(n);return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),f=_("div");for(let M=0;M<c.length;M+=1)c[M].c();h=D();for(let M=0;M<C.length;M+=1)C[M].c();g=D(),T&&T.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(M,O){w(M,e,O),m(e,t),m(e,s),m(e,l),m(l,r),w(M,u,O),w(M,f,O);for(let E=0;E<c.length;E+=1)c[E].m(f,null);m(f,h);for(let E=0;E<C.length;E+=1)C[E].m(f,null);m(f,g),T&&T.m(f,null),n[19](f),v=!0},p(M,O){if((!v||O&8&&i!==(i=B.getFieldTypeIcon(M[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=M[3].name+"")&&ue(r,o),(!v||O&2097152&&a!==(a=M[21]))&&p(e,"for",a),O&1558&&(b=M[4],Ae(),c=_t(c,O,y,1,M,b,d,f,Gt,pp,h,dp),Pe()),O&2049){$=M[0];let E;for(E=0;E<$.length;E+=1){const P=cp(M,$,E);C[E]?(C[E].p(P,O),A(C[E],1)):(C[E]=hp(P),C[E].c(),A(C[E],1),C[E].m(f,g))}for(Ae(),E=$.length;E<C.length;E+=1)S(E);Pe()}M[8]?T&&(T.d(1),T=null):T?T.p(M,O):(T=mp(M),T.c(),T.m(f,null))},i(M){if(!v){for(let O=0;O<b.length;O+=1)A(c[O]);for(let O=0;O<$.length;O+=1)A(C[O]);v=!0}},o(M){for(let O=0;O<c.length;O+=1)L(c[O]);C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)L(C[O]);v=!1},d(M){M&&k(e),M&&k(u),M&&k(f);for(let O=0;O<c.length;O+=1)c[O].d();Yt(C,M),T&&T.d(),n[19](null)}}}function bM(n){let e,t;return e=new Ne({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[_M,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function vM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(E){B.removeByValue(u,E),t(1,u)}function g(E){B.pushUnique(u,E),t(1,u)}function v(E){B.isEmpty(a[E])||a.splice(E,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=E=>h(E),$=E=>g(E),C=E=>v(E);function S(E){me[E?"unshift":"push"](()=>{c=E,t(6,c)})}const T=()=>{for(let E of c.files)a.push(E);t(0,a),t(6,c.value=null,c)},M=()=>c==null?void 0:c.click();function O(E){me[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,P;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=B.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=B.toArray(u))),n.$$.dirty&8&&t(5,i=((E=f.options)==null?void 0:E.maxSelect)>1),n.$$.dirty&4128&&B.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=B.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((P=f.options)==null?void 0:P.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,y,$,C,S,T,M,O]}class yM extends Ee{constructor(e){super(),Oe(this,e,vM,bM,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function gp(n){let e,t;return{c(){e=_("small"),t=N(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function kM(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&gp(n);return{c(){e=_("i"),i=D(),s=_("div"),l=_("div"),r=N(o),a=D(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=Ye(t=gt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Nn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&o!==(o=d[0].id+"")&&ue(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,h):(c=gp(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:se,o:se,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function wM(n,e,t){let i;const s=["id","created","updated","@collectionId","@collectionName"];let{item:l={}}=e;function o(r){r=r||{};const a=["name","title","label","key","email","heading","content",...ObjectLine truncated
|
||||
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function BM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new VM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function UM(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new AM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function WM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new yM({props:u}),me.push(()=>Re(e,"value",o)),me.push(()=>Re(e,"uploadedFiles",r)),me.push(()=>Re(e,"deletedFileIndexes",a)),{c(){q(e.$$.fragment)},m(f,c){H(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],je(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],je(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],je(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function YM(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new x4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function KM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new Z4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function JM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new W4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ZM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new V4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function GM(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new R4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function XM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new L4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function QM(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new O4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function xM(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new C4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;
Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function nT(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&Mp(n);return{c(){e=_("h4"),i=N(t),s=D(),o=N(l),r=N(" record"),a=D(),c&&c.c(),u=We()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=Mp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function iT(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),r=N(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],te(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=J(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&te(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function sT(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[iT],header:[nT],default:[eT]},$$scope:{ctx:n}};return e=new ui({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[33](null),j(e,s)}}}function Tp(n){return JSON.stringify(n)}function lT(n,e,t){let i,s,l,o;const r=xt(),a="record_"+B.randomString(5);let{collection:u}=e,f,c=null,d=new _o,h=!1,g=!1,v={},b={},y="";function $(ae){return S(ae),t(8,g=!0),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function S(ae){ri({}),c=ae||{},t(2,d=ae!=null&&ae.clone?ae.clone():new _o),t(3,v={}),t(4,b={}),await Zn(),t(15,y=Tp(d))}function T(){if(h||!l)return;t(7,h=!0);const ae=O();let W;d.isNew?W=ye.records.create(u==null?void 0:u.id,ae):W=ye.records.update(u==null?void 0:u.id,d.id,ae),W.then(async _e=>{sn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),C(),r("save",_e)}).catch(_e=>{ye.errorResponseHandler(_e)}).finally(()=>{t(7,h=!1)})}function M(){!(c!=null&&c.id)||si("Do you really want to delete the selected record?",()=>ye.records.delete(c["@collectionId"],c.id).then(()=>{C(),sn("Successfully deleted record."),r("delete",c)}).catch(ae=>{ye.errorResponseHandler(ae)}))}function O(){const ae=(d==null?void 0:d.export())||{},W=new FormData,_e={};for(const He of(u==null?void 0:u.schema)||[])_e[He.name]=He;for(const He in ae)!_e[He]||(typeof ae[He]>"u"&&(ae[He]=null),B.addValueToFormData(W,He,ae[He]));for(const He in v){const Ue=B.toArray(v[He]);for(const X of Ue)W.append(He,X)}for(const He in b){const Ue=B.toArray(b[He]);for(const X of Ue)W.append(He+"."+X,"")}return W}const E=()=>C(),P=()=>M();function I(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function F(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function z(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function Q(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function ne(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function G(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function ee(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function U(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function Y(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function Z(ae,W){n.$$.not_equal(v[W.name],ae)&&(v[W.name]=ae,t(3,v))}function de(ae,W){n.$$.not_equal(b[W.name],ae)&&(b[W.name]=ae,t(4,b))}function x(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function oe(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}const Ce=()=>s&&g?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),C()}),!1):!0;function Te(ae){me[ae?"unshift":"push"](()=>{f=ae,t(6,f)})}function K(ae){tt.call(this,n,ae)}function we(ae){tt.call(this,n,ae)}return n.$$set=ae=>{"collection"in ae&&t(0,u=ae.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=B.hasNonEmptyProps(v)||B.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=Tp(d)),n.$$.dirty[0]&36&&t(9,l=d.isNew||s),n.$$.dirty[0]&1&&t(10,o=(u==null?void 0:u.name)!=="profiles")},[u,C,d,v,b,s,f,h,g,l,o,a,T,M,$,y,i,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,we]}class db extends Ee{constructor(e){super(),Oe(this,e,lT,sT,De,{collection:0,show:14,hide:1},null,[-1,-1])}get sLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function jp(n){let e,t,i;return{c(){e=_("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){w(s,e,l),t||(i=J(e,"click",n[28]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function qp(n,e){let t,i,s;return i=new pb({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=We(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function Vp(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,$,C,S,T,M,O,E,P,I,F,z;function Q(){return e[25](e[35])}h=new sr({props:{id:e[35].id}});let ne=e[11];const G=Y=>Y[38].name;for(let Y=0;Y<ne.length;Y+=1){let Z=Np(e,ne,Y),de=G(Z);b.set(de,v[Y]=qp(de,Z))}C=new Si({props:{date:e[35].created}}),M=new Si({props:{date:e[35].updated}});function ee(){return e[26](e[35])}function U(...Y){return e[27](e[35],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=D(),u=_("label"),c=D(),d=_("td"),q(h.$$.fragment),g=D();for(let Y=0;Y<v.length;Y+=1)v[Y].c();y=D(),$=_("td"),q(C.$$.fragment),S=D(),T=_("td"),q(M.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p($,"class","col-type-date col-field-created"),p(T,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,Z){w(Y,t,Z),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),H(h,d,null),m(t,g);for(let de=0;de<v.length;de+=1)v[de].m(t,null);m(t,y),m(t,$),H(C,$,null),m(t,S),m(t,T),H(M,T,null),m(t,O),m(t,E),m(t,P),I=!0,F||(z=[J(l,"change",Q),J(s,"click",ni(e[19])),J(t,"click",ee),J(t,"keydown",U)],F=!0)},p(Y,Z){e=Y,(!I||Z[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!I||Z[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!I||Z[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const de={};Z[0]&8&&(de.id=e[35].id),h.$set(de),Z[0]&2056&&(ne=e[11],Ae(),v=_t(v,Z,G,1,e,ne,b,t,Gt,qp,y,Np),Pe());const x={};Z[0]&8&&(x.date=e[35].created),C.$set(x);const oe={};Z[0]&8&&(oe.date=e[35].updated),M.$set(oe)},i(Y){if(!I){A(h.$$.fragment,Y);for(let Z=0;Z<ne.length;Z+=1)A(v[Z]);A(C.$$.fragment,Y),A(M.$$.fragment,Y),I=!0}},o(Y){L(h.$$.fragment,Y);for(let Z=0;Z<v.length;Z+=1)L(v[Z]);L(C.$$.fragment,Y),L(M.$$.fragment,Y),I=!1},d(Y){Y&&k(t),j(h);for(let Z=0;Z<v.length;Z+=1)v[Z].d();j(C),j(M),F=!1,Je(z)}}}function zp(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&ue(s,i),a[0]&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Bp(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),te(t,"btn-loading",n[8]),te(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c[0]&256&&te(t,"btn-loading",f[8]),c[0]&256&&te(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Up(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,v,b,y,$;return{c(){e=_("div"),t=_("div"),i=N("Selected "),s=_("strong"),l=N(n[6]),o=D(),a=N(r),u=D(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=D(),d=_("div"),h=D(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),te(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary btn-danger"),te(g,"btn-loading",n[9]),te(g,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(C,S){w(C,e,S),m(e,t),m(t,i),m(t,s),m(s,l),m(t,o),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,h),m(e,g),b=!0,y||($=[J(f,"click",n[30]),J(g,"click",n[31])],y=!0)},p(C,S){(!b||S[0]&64)&&ue(l,C[6]),(!b||S[0]&64)&&r!==(r=C[6]===1?"record":"records")&&ue(a,r),S[0]&512&&te(f,"btn-disabled",C[9]),S[0]&512&&te(g,"btn-loading",C[9]),S[0]&512&&te(g,"btn-disabled",C[9])},i(C){b||(C&&Tt(()=>{v||(v=st(e,Yn,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o(C){C&&(v||(v=st(e,Yn,{duration:150,y:5},!1)),v.run(0)),b=!1},d(C){C&&k(e),C&&v&&v.end(),y=!1,Je($)}}}function TT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,$,C,S,T,M,O,E,P,I,F=[],z=new Map,Q,ne,G,ee,U,Y,Z;function de(ce){n[21](ce)}let x={class:"col-type-text col-field-id",name:"id",$$slots
Line truncated
|
||||
<span class="txt">API Preview</span>`,v=D(),b=_("button"),b.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New record</span>`,y=D(),q($.$$.fragment),C=D(),q(S.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(b,"type","button"),p(b,"class","btn btn-expanded"),p(h,"class","btns-group"),p(e,"class","page-header")},m(ne,G){w(ne,e,G),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),I&&I.m(u,null),m(u,f),H(c,u,null),m(e,d),m(e,h),m(h,g),m(h,v),m(h,b),w(ne,y,G),H($,ne,G),w(ne,C,G),H(S,ne,G),O=!0,E||(P=[J(g,"click",n[15]),J(b,"click",n[16])],E=!0)},p(ne,G){(!O||G[0]&4)&&o!==(o=ne[2].name+"")&&ue(r,o),ne[9]?I&&(I.d(1),I=null):I?I.p(ne,G):(I=Wp(ne),I.c(),I.m(u,f));const ee={};G[0]&1&&(ee.value=ne[0]),G[0]&4&&(ee.autocompleteCollection=ne[2]),$.$set(ee);const U={};G[0]&4&&(U.collection=ne[2]),!T&&G[0]&1&&(T=!0,U.filter=ne[0],je(()=>T=!1)),!M&&G[0]&2&&(M=!0,U.sort=ne[1],je(()=>M=!1)),S.$set(U)},i(ne){O||(A(c.$$.fragment,ne),A($.$$.fragment,ne),A(S.$$.fragment,ne),O=!0)},o(ne){L(c.$$.fragment,ne),L($.$$.fragment,ne),L(S.$$.fragment,ne),O=!1},d(ne){ne&&k(e),I&&I.d(),j(c),ne&&k(y),j($,ne),ne&&k(C),n[18](null),j(S,ne),E=!1,Je(P)}}}function IT(n){let e,t,i,s,l;return{c(){e=_("h1"),e.textContent="Create your first collection to add records!",t=D(),i=_("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){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=J(i,"click",n[12]),s=!0)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function NT(n){let e;return{c(){e=_("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function FT(n){let e,t,i;function s(r,a){return r[9]?NT:IT}let l=s(n),o=l(n);return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),m(e,t),m(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function RT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function HT(n){let e,t,i,s,l,o,r,a,u;const f=[PT,AT,ET],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new tu({props:h}),n[22](s);let g={};o=new b4({props:g}),n[23](o);let v={collection:n[2]};return a=new db({props:v}),n[24](a),a.$on("save",n[25]),a.$on("delete",n[26]),{c(){t.c(),i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),H(s,b,y),w(b,l,y),H(o,b,y),w(b,r,y),H(a,b,y),u=!0},p(b,y){let $=e;e=d(b),e===$?c[e].p(b,y):(Ae(),L(c[$],1,1,()=>{c[$]=null}),Pe(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const S={};o.$set(S);const T={};y[0]&4&&(T.collection=b[2]),a.$set(T)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){L(t),L(s.$$.fragment,b),L(o.$$.fragment,b),L(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[22](null),j(s,b),b&&k(l),n[23](null),j(o,b),b&&k(r),n[24](null),j(a,b)}}}function jT(n,e,t){let i,s,l,o,r,a,u;at(n,hi,Y=>t(2,s=Y)),at(n,As,Y=>t(11,l=Y)),at(n,Vo,Y=>t(27,o=Y)),at(n,Nt,Y=>t(28,r=Y)),at(n,da,Y=>t(8,a=Y)),at(n,us,Y=>t(9,u=Y)),nn(Nt,r="Collections",r);const f=new URLSearchParams(o);let c,d,h,g,v=f.get("filter")||"",b=f.get("sort")||"-created",y=f.get("collectionId")||"";function $(){t(10,y=s.id),t(1,b="-created"),t(0,v="")}U$(y);const C=()=>c==null?void 0:c.show(),S=()=>c==null?void 0:c.show(s),T=()=>g==null?void 0:g.load(),M=()=>d==null?void 0:d.show(s),O=()=>h==null?void 0:h.show(),E=Y=>t(0,v=Y.detail);function P(Y){me[Y?"unshift":"push"](()=>{g=Y,t(6,g)})}function I(Y){v=Y,t(0,v)}function F(Y){b=Y,t(1,b)}const z=Y=>h==null?void 0:h.show(Y==null?void 0:Y.detail);function Q(Y){me[Y?"unshift":"push"](()=>{c=Y,t(3,c)})}function ne(Y){me[Y?"unshift":"push"](()=>{d=Y,t(4,d)})}function G(Y){me[Y?"unshift":"push"](()=>{h=Y,t(5,h)})}const ee=()=>g==null?void 0:g.load(),U=()=>g==null?void 0:g.load();return n.$$.update=()=>{if(n.$$.dirty[0]&2048&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty[0]&1028&&(s==null?void 0:s.id)&&y!=s.id&&$(),n.$$.dirty[0]&7&&(b||v||(s==null?void 0:s.id))){const Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:b}).toString();Ci("/collections?"+Y)}},[v,b,s,c,d,h,g,i,a,u,y,l,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U]}class qT extends Ee{constructor(e){super(),Oe(this,e,jT,HT,De,{},null,[-1,-1])}}const wl={googleAuth:{title:"Google",icon:"ri-google-fill"},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",selfHosted:!0},discordAuth:{title:"Discord",icon:"ri-discord-fill"}};function Yp(n,e,t){const i=n.slice();return i[9]=e[t],i}function VT(n){let e;return{c(){e=_("p"),e.textContent="No authorized OAuth2 providers.",p(e,"class","txt-hint txt-center")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function zT(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=Kp(Yp(n,t,s));return{c(){e=_("div");for(let s=0;s<i.length;s+=1)i[s].c();p(e,"class","list")},m(s,l){w(s,e,l);for(let o=0;o<i.length;o+=1)i[o].m(e,null)},p(s,l){if(l&58){t=s[1];let o;for(o=0;o<t.length;o+=1){const r=Yp(s,t,o);i[o]?i[o].p(r,l):(i[o]=Kp(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){s&&k(e),Yt(i,s)}}}function BT(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Kp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,h,g,v,b,y;function $(){return n[6](n[9])}return{c(){e=_("div"),t=_("i"),s=D(),l=_("span"),r=N(o),a=D(),u=_("div"),f=N("ID: "),d=N(c),h=D(),g=_("button"),g.innerHTML='<i class="ri-close-line"></i>',v=D(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-secondary link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(C,S){w(C,e,S),m(e,t),m(e,s),m(e,l),m(l,r),m(e,a),m(e,u),m(u,f),m(u,d),m(e,h),m(e,g),m(e,v),b||(y=J(g,"click",$),b=!0)},p(C,S){n=C,S&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),S&2&&o!==(o=n[3](n[9].provider)+"")&&ue(r,o),S&2&&c!==(c=n[9].providerId+"")&&ue(d,c)},d(C){C&&k(e),b=!1,y()}}}function UT(n){let e;function t(l,o){var r;return l[2]?BT:((r=l[0])==null?void 0:r.id)&&l[1].length?zT:VT}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:se,o:se,d(l){s.d(l),l&&k(e)}}}function WT(n,e,t){const i=xt();let{user:s}=e,l=[],o=!1;function r(d){var h;return((h=wl[d+"Auth"])==null?void 0:h.title)||B.sentenize(auth.provider,!1)}function a(d){var h;return((h=wl[d+"Auth"])==null?void 0:h.icon)||`ri-${d}-line`}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=awaiLine truncated
|
||||
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function eD(n){let e,t,i,s,l=!n[1].verified&&n[1].email&&nh(n);return{c(){l&&l.c(),e=D(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=J(t,"click",n[19]),i=!0)},p(o,r){!o[1].verified&&o[1].email?l?l.p(o,r):(l=nh(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function tD(n){let e,t=n[1].isNew?"New user":"Edit user",i,s,l,o,r=!n[1].isNew&&th(n);return{c(){e=_("h4"),i=N(t),s=D(),r&&r.c(),l=We()},m(a,u){w(a,e,u),m(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u[0]&2)&&t!==(t=a[1].isNew?"New user":"Edit user")&&ue(i,t),a[1].isNew?r&&(Ae(),L(r,1,1,()=>{r=null}),Pe()):r?(r.p(a,u),u[0]&2&&A(r,1)):(r=th(a),r.c(),A(r,1),r.m(l.parentNode,l))},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&k(e),a&&k(s),r&&r.d(a),a&&k(l)}}}function ih(n){let e,t,i=n[1].isNew?"Create":"Save changes",s,l;return{c(){e=_("button"),t=_("span"),s=N(i),p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[12]),p(e,"class","btn btn-expanded"),e.disabled=l=!n[11]||n[5],te(e,"btn-loading",n[5])},m(o,r){w(o,e,r),m(e,t),m(t,s)},p(o,r){r[0]&2&&i!==(i=o[1].isNew?"Create":"Save changes")&&ue(s,i),r[0]&2080&&l!==(l=!o[11]||o[5])&&(e.disabled=l),r[0]&32&&te(e,"btn-loading",o[5])},d(o){o&&k(e)}}}function nD(n){let e,t,i,s,l,o,r=n[10]===wi&&ih(n);return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),r&&r.c(),s=We(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[5]},m(a,u){w(a,e,u),m(e,t),w(a,i,u),r&&r.m(a,u),w(a,s,u),l||(o=J(e,"click",n[17]),l=!0)},p(a,u){u[0]&32&&(e.disabled=a[5]),a[10]===wi?r?r.p(a,u):(r=ih(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(a){a&&k(e),a&&k(i),r&&r.d(a),a&&k(s),l=!1,o()}}}function iD(n){let e,t,i={class:"user-panel",popup:n[1].isNew,beforeHide:n[27],$$slots:{footer:[nD],header:[tD],default:[xT]},$$scope:{ctx:n}};return e=new ui({props:i}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&2&&(o.popup=s[1].isNew),l[0]&2112&&(o.beforeHide=s[27]),l[0]&4014|l[1]&16&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[28](null),j(e,s)}}}const wi="account",Ps="providers";function sD(n,e,t){let i;const s=xt(),l="user_"+B.randomString(5);let o,r=new Ms,a=!1,u=!1,f="",c="",d="",h=!1,g=!0,v=wi;function b(x){return $(x),t(6,u=!0),t(10,v=r.isNew||r.email?wi:Ps),o==null?void 0:o.show()}function y(){return o==null?void 0:o.hide()}function $(x){ri({}),t(1,r=x!=null&&x.clone?x.clone():new Ms),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const x={email:f};(r.isNew||h)&&(x.password=c,x.passwordConfirm=d);let oe;r.isNew?oe=ye.users.create(x):oe=ye.users.update(r.id,x),oe.then(async Ce=>{t(1,r=Ce),g&&M(!1),t(6,u=!1),y(),sn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",Ce)}).catch(Ce=>{ye.errorResponseHandler(Ce)}).finally(()=>{t(5,a=!1)})}function T(){!(r!=null&&r.id)||si("Do you really want to delete the selected user?",()=>ye.users.delete(r.id).then(()=>{t(6,u=!1),y(),sn("Successfully deleted user."),s("delete",r)}).catch(x=>{ye.errorResponseHandler(x)}))}function M(x=!0){return ye.users.requestVerification(r.email||f).then(()=>{t(6,u=!1),y(),x&&sn(`Successfully sent verification email to ${r.email}.`)}).catch(oe=>{ye.errorResponseHandler(oe)})}const O=()=>y(),E=()=>M(),P=()=>T(),I=()=>t(10,v=wi),F=()=>t(10,v=Ps);function z(){f=this.value,t(2,f)}function Q(){h=this.checked,t(3,h)}function ne(){c=this.value,t(7,c)}function G(){d=this.value,t(8,d)}function ee(){g=this.checked,t(9,g)}const U=()=>i&&u?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),y()}),!1):!0;function Y(x){me[x?"unshift":"push"](()=>{o=x,t(4,o)})}function Z(x){tt.call(this,n,x)}function de(x){tt.call(this,n,x)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(11,i=r.isNew&&f!=""||h||f!==r.email)},[y,r,f,h,o,a,u,c,d,g,v,i,l,S,T,M,b,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de]}class lD extends Ee{constructor(e){super(),Oe(this,e,sD,iD,De,{show:16,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[0]}}function sh(n,e,t){const i=n.slice();return i[41]=e[t],i}function lh(n,e,t){const i=n.slice();return i[44]=e[t],i}function oh(n,e,t){const i=n.slice();return i[44]=e[t],i}function oD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P=[],I=new Map,F,z,Q,ne,G,ee,U,Y,Z,de,x=[],oe=new Map,Ce,Te,K,we,ae,W,_e=!n[15]&&rh(n);r=new Go({}),r.$on("refresh",n[18]),h=new Zo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),h.$on("submit",n[20]);function He(be){n[21](be)}let Ue={class:"col-type-text col-field-id",name:"id",$$slots:{default:[aD]},$$scope:{ctx:n}};n[4]!==void 0&&(Ue.sort=n[4]),C=new an({props:Ue}),me.push(()=>Re(C,"sort",He));function X(be){n[22](be)}let ge={class:"col-type-email col-field-email",name:"email"Line truncated
|
||||
<span class="txt">New user</span>`,d=D(),q(h.$$.fragment),g=D(),v=_("div"),b=_("table"),y=_("thead"),$=_("tr"),q(C.$$.fragment),T=D(),q(M.$$.fragment),E=D();for(let be=0;be<P.length;be+=1)P[be].c();F=D(),q(z.$$.fragment),ne=D(),q(G.$$.fragment),U=D(),Y=_("th"),Z=D(),de=_("tbody");for(let be=0;be<x.length;be+=1)x[be].c();Xe&&Xe.c(),Ce=D(),it&&it.c(),Te=D(),ft&&ft.c(),K=We(),p(i,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(e,"class","page-header"),p(Y,"class","col-type-action min-width"),p(b,"class","table"),te(b,"table-loading",n[10]),p(v,"class","table-wrapper")},m(be,Fe){w(be,e,Fe),m(e,t),m(t,i),m(i,s),m(e,l),_e&&_e.m(e,null),m(e,o),H(r,e,null),m(e,a),m(e,u),m(e,f),m(e,c),w(be,d,Fe),H(h,be,Fe),w(be,g,Fe),w(be,v,Fe),m(v,b),m(b,y),m(y,$),H(C,$,null),m($,T),H(M,$,null),m($,E);for(let dt=0;dt<P.length;dt+=1)P[dt].m($,null);m($,F),H(z,$,null),m($,ne),H(G,$,null),m($,U),m($,Y),m(b,Z),m(b,de);for(let dt=0;dt<x.length;dt+=1)x[dt].m(de,null);Xe&&Xe.m(de,null),w(be,Ce,Fe),it&&it.m(be,Fe),w(be,Te,Fe),ft&&ft.m(be,Fe),w(be,K,Fe),we=!0,ae||(W=J(c,"click",n[19]),ae=!0)},p(be,Fe){(!we||Fe[0]&16384)&&ue(s,be[14]),be[15]?_e&&(_e.d(1),_e=null):_e?_e.p(be,Fe):(_e=rh(be),_e.c(),_e.m(e,o));const dt={};Fe[0]&8&&(dt.value=be[3]),h.$set(dt);const Dt={};Fe[1]&262144&&(Dt.$$scope={dirty:Fe,ctx:be}),!S&&Fe[0]&16&&(S=!0,Dt.sort=be[4],je(()=>S=!1)),C.$set(Dt);const pt={};Fe[1]&262144&&(pt.$$scope={dirty:Fe,ctx:be}),!O&&Fe[0]&16&&(O=!0,pt.sort=be[4],je(()=>O=!1)),M.$set(pt),Fe[0]&4096&&(ce=be[12],P=_t(P,Fe,ke,1,be,ce,I,$,bn,ah,F,oh));const lt={};Fe[1]&262144&&(lt.$$scope={dirty:Fe,ctx:be}),!Q&&Fe[0]&16&&(Q=!0,lt.sort=be[4],je(()=>Q=!1)),z.$set(lt);const Lt={};Fe[1]&262144&&(Lt.$$scope={dirty:Fe,ctx:be}),!ee&&Fe[0]&16&&(ee=!0,Lt.sort=be[4],je(()=>ee=!1)),G.$set(Lt),Fe[0]&5450&&(Me=be[1],Ae(),x=_t(x,Fe,ze,1,be,Me,oe,de,Gt,ph,null,sh),Pe(),!Me.length&&Xe?Xe.p(be,Fe):Me.length?Xe&&(Xe.d(1),Xe=null):(Xe=uh(be),Xe.c(),Xe.m(de,null))),Fe[0]&1024&&te(b,"table-loading",be[10]),be[1].length?it?it.p(be,Fe):(it=hh(be),it.c(),it.m(Te.parentNode,Te)):it&&(it.d(1),it=null),be[1].length&&be[13]?ft?ft.p(be,Fe):(ft=mh(be),ft.c(),ft.m(K.parentNode,K)):ft&&(ft.d(1),ft=null)},i(be){if(!we){A(r.$$.fragment,be),A(h.$$.fragment,be),A(C.$$.fragment,be),A(M.$$.fragment,be),A(z.$$.fragment,be),A(G.$$.fragment,be);for(let Fe=0;Fe<Me.length;Fe+=1)A(x[Fe]);we=!0}},o(be){L(r.$$.fragment,be),L(h.$$.fragment,be),L(C.$$.fragment,be),L(M.$$.fragment,be),L(z.$$.fragment,be),L(G.$$.fragment,be);for(let Fe=0;Fe<x.length;Fe+=1)L(x[Fe]);we=!1},d(be){be&&k(e),_e&&_e.d(),j(r),be&&k(d),j(h,be),be&&k(g),be&&k(v),j(C),j(M);for(let Fe=0;Fe<P.length;Fe+=1)P[Fe].d();j(z),j(G);for(let Fe=0;Fe<x.length;Fe+=1)x[Fe].d();Xe&&Xe.d(),be&&k(Ce),it&&it.d(be),be&&k(Te),ft&&ft.d(be),be&&k(K),ae=!1,W()}}}function rD(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function rh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle")},m(s,l){w(s,e,l),t||(i=[Ye(gt.call(null,e,{text:"Edit profile collection",position:"right"})),J(e,"click",n[17])],t=!0)},p:se,d(s){s&&k(e),t=!1,Je(i)}}}function aD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function uD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function ah(n,e){let t,i,s,l,o,r,a,u=e[44].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=D(),r=_("span"),a=N("profile."),f=N(u),p(s,"class",l=B.getFieldTypeIcon(e[44].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[44].type+" col-field-"+e[44].name),p(t,"name",d=e[44].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=B.getFieldTypeIcon(e[44].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[44].name+"")&&ue(f,u),g[0]&4096&&c!==(c="col-type-"+e[44].type+" col-field-"+e[44].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[44].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function fD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function cD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function uh(n){let e;function t(l,o){return l[10]?pD:dD}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function dD(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&fh(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=fh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function pD(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function fh(n){let e,t,i;return{c(){e=_("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){w(s,e,l),t||(i=J(e,"click",n[27]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function hD(n){let e,t,i,s=n[41].verified&&ch();return{c(){e=_("div"),e.textContent="N/A",t=D(),s&&s.c(),i=We(),p(e,"class","txt-hint")},m(l,o){w(l,e,o),w(l,t,o),s&&s.m(l,o),w(l,i,o)},p(l,o){l[41].verified?s||(s=ch(),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(l){l&&k(e),l&&k(t),s&&s.d(l),l&&k(i)}}}function mD(n){let e,t=n[41].email+"",i,s,l,o,r=n[41].verified?"Verified":"Unverified",a;return{c(){e=_("span"),i=N(t),l=D(),o=_("span"),a=N(r),p(e,"class","txt"),p(e,"title",s=n[41].email),p(o,"class","label"),te(o,"label-success",n[41].verified),te(o,"label-warning",!n[41].verified)},m(u,f){w(u,e,f),m(e,i),w(u,l,f),w(u,o,f),m(o,a)},p(u,f){f[0]&2&&t!==(t=u[41].email+"")&&ue(i,t),f[0]&2&&s!==(s=u[41].email)&&p(e,"title",s),f[0]&2&&r!==(r=u[41].verified?"Verified":"Unverified")&&ue(a,r),f[0]&2&&te(o,"label-success",u[41].verified),f[0]&2&&te(o,"label-warning",!u[41].verified)},d(u){u&&k(e),u&&k(l),u&&k(o)}}}function ch(n){let e;return{c(){e=_("span"),e.textContent="OAuth2 verified",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dh(n,e){let t,i,s;return i=new pb({props:{field:e[44],record:e[41].profile||{}}}),{key:n,first:null,c(){t=We(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[44]),o[0]&2&&(r.record=e[41].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function ph(n,e){let t,i,s,l,o,r,a,u=[],f=new Map,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P;s=new sr({props:{id:e[41].id}});function I(U,Y){return U[41].email?mD:hD}let F=I(e),z=F(e),Q=e[12];const ne=U=>U[44].name;for(let U=0;U<Q.length;U+=1){let Y=lh(e,Q,U),Z=ne(Y);f.set(Z,u[U]=dh(Z,Y))}h=new Si({props:{date:e[41].created}}),b=new Si({props:{date:e[41].updated}});function G(){return e[25](e[41])}function ee(){return e[26](e[41])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),q(s.$$.fragment),l=D(),o=_("td"),r=_("div"),z.c(),a=D();for(let U=0;U<u.length;U+=1)u[U].c();c=D(),d=_("td"),q(h.$$.fragment),g=D(),v=_("td"),q(b.$$.fragment),y=D(),$=_("td"),C=_("button"),C.innerHTML=`<i class="ri-user-settings-line"></i>
|
||||
<span class="txt">Edit user</span>`,S=D(),T=_("button"),T.innerHTML=`<i class="ri-profile-line"></i>
|
||||
<span class="txt">Edit profile</span>`,M=D(),p(i,"class","col-type-text col-field-id"),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p(d,"class","col-type-date col-field-created"),p(v,"class","col-type-date col-field-updated"),p(C,"type","button"),p(C,"class","btn btn-sm btn-outline"),p(T,"type","button"),p(T,"class","btn btn-sm m-l-10"),p($,"class","col-type-action min-width"),this.first=t},m(U,Y){w(U,t,Y),m(t,i),H(s,i,null),m(t,l),m(t,o),m(o,r),z.m(r,null),m(t,a);for(let Z=0;Z<u.length;Z+=1)u[Z].m(t,null);m(t,c),m(t,d),H(h,d,null),m(t,g),m(t,v),H(b,v,null),m(t,y),m(t,$),m($,C),m($,S),m($,T),m(t,M),O=!0,E||(P=[J(C,"click",ni(G)),J(T,"click",ni(ee))],E=!0)},p(U,Y){e=U;const Z={};Y[0]&2&&(Z.id=e[41].id),s.$set(Z),F===(F=I(e))&&z?z.p(e,Y):(z.d(1),z=F(e),z&&(z.c(),z.m(r,null))),Y[0]&4098&&(Q=e[12],Ae(),u=_t(u,Y,ne,1,e,Q,f,t,Gt,dh,c,lh),Pe());const de={};Y[0]&2&&(de.date=e[41].created),h.$set(de);const x={};Y[0]&2&&(x.date=e[41].updated),b.$set(x)},i(U){if(!O){A(s.$$.fragment,U);for(let Y=0;Y<Q.length;Y+=1)A(u[Y]);A(h.$$.fragment,U),A(b.$$.fragment,U),O=!0}},o(U){L(s.$$.fragment,U);for(let Y=0;Y<u.length;Y+=1)L(u[Y]);L(h.$$.fragment,U),L(b.$$.fragment,U),O=!1},d(U){U&&k(t),j(s),z.d();for(let Y=0;Y<u.length;Y+=1)u[Y].d();j(h),j(b),E=!1,Je(P)}}}function hh(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&ue(s,i),a[0]&4&&ue(o,r[2])},d(r){r&&k(e)}}}function mh(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),te(t,"btn-loading",n[10]),te(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[28]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ue(o,l),c[0]&1024&&te(t,"btn-loading",f[10]),c[0]&1024&&te(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function gD(n){let e,t,i,s;const l=[rD,oD],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=We()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Ae(),L(o[f],1,1,()=>{o[f]=null}),Pe(),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){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function _D(n){let e,t,i,s,l,o,r,a;e=new On({props:{$$slots:{default:[gD]},$$scope:{ctx:n}}});let u={};i=new lD({props:u}),n[29](i),i.$on("save",n[30]),i.$on("delete",n[31]);let f={};l=new tu({props:f}),n[32](l),l.$on("save",n[33]);let c={collection:n[5]};return r=new db({props:c}),n[34](r),r.$on("save",n[35]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment),o=D(),q(r.$$.fragment)},m(d,h){H(e,d,h),w(d,t,h),H(i,d,h),w(d,s,h),H(l,d,h),w(d,o,h),H(r,d,h),a=!0},p(d,h){const g={};h[0]&65534|h[1]&262144&&(g.$$scope={dirty:h,ctx:d}),e.$set(g);const v={};i.$set(v);const b={};l.$set(b);const y={};h[0]&32&&(y.collection=d[5]),r.$set(y)},i(d){a||(A(e.$$.fragment,d),A(i.$$.fragment,d),A(l.$$.fragment,d),A(r.$$.fragment,d),a=!0)},o(d){L(e.$$.fragment,d),L(i.$$.fragment,d),L(l.$$.fragment,d),L(r.$$.fragment,d),a=!1},d(d){j(e,d),d&&k(t),n[29](null),j(i,d),d&&k(s),n[32](null),j(l,d),d&&k(o),n[34](null),j(r,d)}}}function bD(n,e,t){let i,s,l,o,r;at(n,Vo,W=>t(36,l=W)),at(n,Nt,W=>t(14,o=W)),at(n,us,W=>t(15,r=W)),nn(Nt,o="Users",o);const a=new URLSearchParams(l),u=["id","userId","created","updated"];let f,c,d,h=[],g=1,v=0,b=!1,y=a.get("filter")||"",$=a.get("sort")||"-created",C=new dn,S=!1;E();async function T(W=1){return t(10,b=!0),W<=1&&M(),ye.users.getList(W,50,{sort:$||"-created",filter:y}).then(_e=>{t(10,b=!1),t(1,h=h.concat(_e.items)),t(9,g=_e.page),t(2,v=_e.totalItems)}).catch(_e=>{_e!=null&&_e.isAbort||(t(10,b=!1),console.warn(_e),M(),ye.errorResponseHandler(_e,!1))})}function M(){t(1,h=[]),t(9,g=1),t(2,v=0)}function O(W){const _e=h.find(He=>He.id===(W==null?void 0:W.userId));_e&&(_e.profile=W),t(1,h)}async function E(){t(11,S=!0);try{t(5,C=await ye.collections.getOne("profiles"))}catch(W){ye.errorResponseHandler(W)}t(11,S=!1)}const P=()=>c==null?void 0:c.show(C),I=()=>T(),F=()=>f==null?void 0:f.show(),z=W=>t(3,y=W.detail);function Q(W){$=W,t(4,$)}function ne(W){$=W,t(4,$)}function G(W){$=W,t(4,$)}function ee(W){$=W,t(4,$)}const U=W=>f==null?void 0:f.show(W),Y=W=>d==null?void 0:d.show(W.profile),Z=()=>t(3,y=""),de=()=>T(g+1);function x(W){me[W?"unshift":"push"](()=>{f=W,t(6,f)})}const oe=()=>T(),Ce=()=>T();function Te(W){me[W?"unshift":"push"](()=>{c=W,t(7,c)})}const K=W=>t(5,C=W.detail);function we(W){me[W?"unshift":"push"](()=>{d=W,t(8,d)})}const ae=W=>O(W.detail);return n.$$.update=()=>{var W;if(n.$$.dirty[0]&24&&$!==-1&&y!==-1){const _e=new URLSearchParams({filter:y,sort:$}).toString();Ci("/users?"+_Line truncated
|
||||
<span class="txt">Application</span>`,o=D(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||||
<span class="txt">Mail settings</span>`,a=D(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||||
<span class="txt">Files storage</span>`,f=D(),c=_("div"),c.innerHTML=`<span class="txt">Sync</span>
|
||||
<small class="label label-danger label-sm">Experimental</small>`,d=D(),h=_("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
|
||||
<span class="txt">Export collections</span>`,g=D(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
|
||||
<span class="txt">Import collections</span>`,b=D(),y=_("div"),y.textContent="Authentication",$=D(),C=_("a"),C.innerHTML=`<i class="ri-lock-password-line"></i>
|
||||
<span class="txt">Auth providers</span>`,S=D(),T=_("a"),T.innerHTML=`<i class="ri-key-line"></i>
|
||||
<span class="txt">Token options</span>`,M=D(),O=_("a"),O.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(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(C,"href","/settings/auth-providers"),p(C,"class","sidebar-list-item"),p(T,"href","/settings/tokens"),p(T,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,v),m(t,b),m(t,y),m(t,$),m(t,C),m(t,S),m(t,T),m(t,M),m(t,O),E||(P=[Ye(Vn.call(null,l,{path:"/settings"})),Ye(mn.call(null,l)),Ye(Vn.call(null,r,{path:"/settings/mail/?.*"})),Ye(mn.call(null,r)),Ye(Vn.call(null,u,{path:"/settings/storage/?.*"})),Ye(mn.call(null,u)),Ye(Vn.call(null,h,{path:"/settings/export-collections/?.*"})),Ye(mn.call(null,h)),Ye(Vn.call(null,v,{path:"/settings/import-collections/?.*"})),Ye(mn.call(null,v)),Ye(Vn.call(null,C,{path:"/settings/auth-providers/?.*"})),Ye(mn.call(null,C)),Ye(Vn.call(null,T,{path:"/settings/tokens/?.*"})),Ye(mn.call(null,T)),Ye(Vn.call(null,O,{path:"/settings/admins/?.*"})),Ye(mn.call(null,O))],E=!0)},p:se,i:se,o:se,d(I){I&&k(e),E=!1,Je(P)}}}class Ui extends Ee{constructor(e){super(),Oe(this,e,null,yD,De,{})}}function gh(n,e,t){const i=n.slice();return i[31]=e[t],i}function _h(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[kD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function kD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="ID",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function bh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=D(),ti(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[J(e,"click",a),J(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Je(r)}}}function wD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Email",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Se(r,n[3]),u||(f=J(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Se(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function vh(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[$D,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function $D(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function yh(n){let e,t,i,s,l,o,r,a,u;return s=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[SD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[CD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),q(s.$$.fragment),l=D(),o=_("div"),q(r.$$.fragment),p(i,"class","col-sm-6"),p(o,Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function OD(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&kh(n);return{c(){h&&h.c(),e=D(),t=_("button"),i=_("span"),i.textContent="Cancel",s=D(),l=_("button"),o=_("span"),a=N(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),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],te(l,"btn-loading",n[6])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=J(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?h&&(Ae(),L(h,1,1,()=>{h=null}),Pe()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=kh(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&te(l,"btn-loading",g[6])},i(g){f||(A(h),f=!0)},o(g){L(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function ED(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[OD],header:[TD],default:[MD]},$$scope:{ctx:n}};return e=new ui({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),j(e,s)}}}function AD(n,e,t){let i;const s=xt(),l="admin_"+B.randomString(5);let o,r=new as,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function v(U){return y(U),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(U){ri({}),t(1,r=U!=null&&U.clone?U.clone():new as),$()}function $(){t(4,g=!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,h="")}function C(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||g)&&(U.password=d,U.passwordConfirm=h);let Y;r.isNew?Y=ye.admins.create(U):Y=ye.admins.update(r.id,U),Y.then(async Z=>{var de;t(7,u=!1),b(),sn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",Z),((de=ye.authStore.model)==null?void 0:de.id)===Z.id&&ye.authStore.save(ye.authStore.token,Z)}).catch(Z=>{ye.errorResponseHandler(Z)}).finally(()=>{t(6,a=!1)})}function S(){!(r!=null&&r.id)||si("Do you really want to delete the selected admin?",()=>ye.admins.delete(r.id).then(()=>{t(7,u=!1),b(),sn("Successfully deleted admin."),s("delete",r)}).catch(U=>{ye.errorResponseHandler(U)}))}const T=()=>S(),M=()=>b(),O=U=>t(2,f=U),E=(U,Y)=>{(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),t(2,f=U))};function P(){c=this.value,t(3,c)}function I(){g=this.checked,t(4,g)}function F(){d=this.value,t(8,d)}function z(){h=this.value,t(9,h)}const Q=()=>i&&u?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function ne(U){me[U?"unshift":"push"](()=>{o=U,t(5,o)})}function G(U){tt.call(this,n,U)}function ee(U){tt.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,h,i,l,C,S,v,T,M,O,E,P,I,F,z,Q,ne,G,ee]}class PD extends Ee{constructor(e){super(),Oe(this,e,AD,ED,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function wh(n,e,t){const i=n.slice();return i[24]=e[t],i}function LD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function ID(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function ND(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function FD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function $h(n){let e;function t(l,o){return l[5]?HD:RD}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function RD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Sh(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-centeLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Sh(n){let e,t,i;return{c(){e=_("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){w(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Ch(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mh(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g=e[24].email+"",v,b,y,$,C,S,T,M,O,E,P,I,F,z;u=new sr({props:{id:e[24].id}});let Q=e[24].id===e[7].id&&Ch();C=new Si({props:{date:e[24].created}}),M=new Si({props:{date:e[24].updated}});function ne(){return e[15](e[24])}function G(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=D(),a=_("td"),q(u.$$.fragment),f=D(),Q&&Q.c(),c=D(),d=_("td"),h=_("span"),v=N(g),y=D(),$=_("td"),q(C.$$.fragment),S=D(),T=_("td"),q(M.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),ti(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(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(T,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,U){w(ee,t,U),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),H(u,a,null),m(a,f),Q&&Q.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,y),m(t,$),H(C,$,null),m(t,S),m(t,T),H(M,T,null),m(t,O),m(t,E),m(t,P),I=!0,F||(z=[J(t,"click",ne),J(t,"keydown",G)],F=!0)},p(ee,U){e=ee,(!I||U&16&&!ti(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Y={};U&16&&(Y.id=e[24].id),u.$set(Y),e[24].id===e[7].id?Q||(Q=Ch(),Q.c(),Q.m(a,null)):Q&&(Q.d(1),Q=null),(!I||U&16)&&g!==(g=e[24].email+"")&&ue(v,g),(!I||U&16&&b!==(b=e[24].email))&&p(h,"title",b);const Z={};U&16&&(Z.date=e[24].created),C.$set(Z);const de={};U&16&&(de.date=e[24].updated),M.$set(de)},i(ee){I||(A(u.$$.fragment,ee),A(C.$$.fragment,ee),A(M.$$.fragment,ee),I=!0)},o(ee){L(u.$$.fragment,ee),L(C.$$.fragment,ee),L(M.$$.fragment,ee),I=!1},d(ee){ee&&k(t),j(u),Q&&Q.d(),j(C),j(M),F=!1,Je(z)}}}function Th(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),r=N(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&ue(s,i),u&16&&o!==(o=a[4].length+"")&&ue(r,o)},d(a){a&&k(e)}}}function jD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x=[],oe=new Map,Ce,Te,K,we,ae;a=new Go({}),a.$on("refresh",n[8]),g=new Zo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]);function W(Me){n[11](Me)}let _e={class:"col-type-text",name:"id",$$slots:{default:[LD]},$$scope:{ctx:n}};n[2]!==void 0&&(_e.sort=n[2]),M=new an({props:_e}),me.push(()=>Re(M,"sort",W));function He(Me){n[12](Me)}let Ue={class:"col-type-email col-field-email",name:"email",$$slots:{default:[ID]},$$scope:{ctx:n}};n[2]!==void 0&&(Ue.sort=n[2]),P=new an({props:Ue}),me.push(()=>Re(P,"sort",He));function X(Me){n[13](Me)}let ge={class:"col-type-date col-field-created",name:"created",$$slots:{default:[ND]},$$scope:{ctx:n}};n[2]!==void 0&&(ge.sort=n[2]),z=new an({props:ge}),me.push(()=>Re(z,"sort",X));function ce(Me){n[14](Me)}let ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[FD]},$$scope:{ctx:n}};n[2]!==void 0&&(ke.sort=n[2]),G=new an({props:ke}),me.push(()=>Re(G,"sort",ce));let Ge=n[4];const et=Me=>Me[24].id;for(let Me=0;Me<Ge.length;Me+=1){let ze=wh(n,Ge,Me),Xe=et(ze);oe.set(Xe,x[Me]=Mh(Xe,ze))}let Ke=null;Ge.length||(Ke=$h(n));let nt=n[4].length&&Th(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[6]),r=D(),q(a.$$.fragment),u=D(),f=_("div"),c=D(),d=_("button"),d.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New admin</span>`,h=D(),q(g.$$.fragment),v=D(),b=_("div"),y=_("table"),$=_("thead"),C=_("tr"),S=_("th"),T=D(),q(M.$$.fragment),E=D(),q(P.$$.fragment),F=D(),q(z.$$.fragment),ne=D(),q(G.$$.fragment),U=D(),Y=_("th"),Z=D(),de=_("tbody");for(let Me=0;Me<x.length;Me+=1)x[Me].c();Ke&&Ke.c(),Ce=D(),nt&&nt.c(),Te=We(),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(S,"class","min-width"),p(Y,"class","col-type-action min-width"),p(y,"class","table"),te(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Me,ze){w(Me,e,ze),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),H(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(Me,h,ze),H(g,Me,ze),w(Me,v,ze),w(Me,b,ze),m(b,y),m(y,$),m($,C),m(C,S),m(C,T),H(M,C,null),m(C,E),H(P,C,null),m(C,F),H(z,C,null),m(C,ne),H(G,C,null),m(C,U),m(C,Y),m(y,Z),m(y,de);for(let Xe=0;Xe<x.length;Xe+=1)x[Xe].m(de,null);Ke&&Ke.m(de,null),w(Me,Ce,ze),nt&&nt.m(Me,ze),w(Me,Te,ze),K=!0,we||(ae=J(d,"click",n[9]),we=!0)},p(Me,ze){(!K||ze&64)&&ue(o,Me[6]);const Xe={};ze&2&&(Xe.value=Me[1]),g.$set(Xe);const it={};ze&134217728&&(it.$$scope={dirty:ze,ctx:Me}),!O&&ze&4&&(O=!0,it.sort=Me[2],je(()=>O=!1)),M.$set(it);const ft={};ze&134217728&&(ft.$$scope={dirty:ze,ctx:Me}),!I&&ze&4&&(I=!0,ft.sort=Me[2],je(()=>I=!1)),P.$set(ft);const be={};ze&134217728&&(be.$$scope={dirty:ze,ctx:Me}),!Q&&ze&4&&(Q=!0,be.sort=Me[2],je(()=>Q=!1)),z.$set(be);const Fe={};ze&134217728&&(Fe.$$scope={dirty:ze,ctx:Me}),!ee&&ze&4&&(ee=!0,Fe.sort=Me[2],je(()=>ee=!1)),G.$set(Fe),ze&186&&(Ge=Me[4],Ae(),x=_t(x,ze,et,1,Me,Ge,oe,de,Gt,Mh,null,wh),Pe(),!Ge.length&&Ke?Ke.p(Me,ze):Ge.length?Ke&&(Ke.d(1),Ke=null):(Ke=$h(Me),Ke.c(),Ke.m(de,null))),ze&32&&te(y,"table-loading",Me[5]),Me[4].length?nt?nt.p(Me,ze):(nt=Th(Me),nt.c(),nt.m(Te.parentNode,Te)):nt&&(nt.d(1),nt=null)},i(Me){if(!K){A(a.$$.fragment,Me),A(g.$$.fragment,Me),A(M.$$.fragment,Me),A(P.$$.fragment,Me),A(z.$$.fragment,Me),A(G.$$.fragment,Me);for(let ze=0;ze<Ge.length;ze+=1)A(x[ze]);K=!0}},o(Me){L(a.$$.fragment,Me),L(g.$$.fragment,Me),L(M.$$.fragment,Me),L(P.$$.fragment,Me),L(z.$$.fragment,Me),L(G.$$.fragment,Me);for(let ze=0;ze<x.length;ze+=1)L(x[ze]);K=!1},d(Me){Me&&k(e),j(a),Me&&k(h),j(g,Me),Me&&k(v),Me&&k(b),j(M),j(P),j(z),j(G);for(let ze=0;ze<x.length;ze+=1)x[ze].d();Ke&&Ke.d(),Me&&k(Ce),nt&&nt.d(Me),Me&&k(Te),we=!1,ae()}}}function qD(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[jD]},$$scope:{ctx:n}}});let r={};return l=new PD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[18](null),j(l,a)}}}function VD(n,e,t){let i,s,l;at(n,Vo,F=>t(21,i=F)),at(n,Nt,F=>t(6,s=F)),at(n,Ea,F=>t(7,l=F)),nn(Nt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),ye.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),ye.errorResponseHandler(F,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}function C(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}const T=F=>r==null?void 0:r.show(F),M=(F,z)=>{(z.code==="Enter"||z.code==="Space")&&(z.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function E(F){me[F?"unshift":"push"](()=>{r=F,t(3,r)})}const P=()=>d(),I=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Ci("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,$,C,S,T,M,O,E,P,I]}class zD extends Ee{constructor(e){super(),Oe(this,e,VD,qD,De,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function BD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=D(),l=_("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0]),l.focus(),r||(a=J(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]&&Se(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function UD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=N("Password"),s=D(),l=_("input"),r=D(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Se(l,n[Line truncated
|
||||
<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"),te(a,"btn-disabled",n[2]),te(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),m(e,a),u=!0,f||(c=J(e,"submit",Wt(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),h&4&&te(a,"btn-disabled",d[2]),h&4&&te(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),j(s),j(o),f=!1,c()}}}function YD(n){let e,t;return e=new l_({props:{$$slots:{default:[WD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function KD(n,e,t){let i;at(n,Vo,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),ye.admins.authViaEmail(l,o).then(()=>{Ci("/")}).catch(()=>{hl("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 JD extends Ee{constructor(e){super(),Oe(this,e,KD,YD,De,{})}}function ZD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;i=new Ne({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[XD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[QD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[xD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new Ne({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[eO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Dh(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),c=D(),d=_("div"),h=_("div"),g=D(),M&&M.c(),v=D(),b=_("button"),y=_("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],te(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),H(a,e,null),m(e,u),H(f,e,null),m(e,c),m(e,d),m(d,h),m(d,g),M&&M.m(d,null),m(d,v),m(d,b),m(b,y),C=!0,S||(T=J(b,"click",n[13]),S=!0)},p(O,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&1572865&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),a.$set(F);const z={};E&1572865&&(z.$$scope={dirty:E,ctx:O}),f.$set(z),O[3]?M?M.p(O,E):(M=Dh(O),M.c(),M.m(d,v)):M&&(M.d(1),M=null),(!C||E&12&&$!==($=!O[3]||O[2]))&&(b.disabled=$),E&4&&te(b,"btn-loading",O[2])},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),C=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),L(f.$$.fragment,O),C=!1},d(O){O&&k(e),j(i),j(o),j(a),j(f),M&&M.d(),S=!1,T()}}}function GD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function XD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application name"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].meta.appName),r||(a=J(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&&Se(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function QD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application url"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].meta.appUrl),r||(a=J(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&&Se(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function xD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Logs max days retention"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].logs.maxDays),r||(a=J(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&&Se(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function eO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("input"),i=D(),s=_("label"),l=_("span"),l.textContent="Line truncated
|
||||
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=_("div"),s=_("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),m(i,s),c[l].m(s,null),r=!0,a||(u=J(s,"submit",Wt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Ae(),L(c[v],1,1,()=>{c[v]=null}),Pe(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){L(o),r=!1},d(h){h&&k(e),h&&k(t),h&&k(i),c[l].d(),a=!1,u()}}}function nO(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[tO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function iO(n,e,t){let i,s,l,o;at(n,us,M=>t(14,s=M)),at(n,wo,M=>t(15,l=M)),at(n,Nt,M=>t(16,o=M)),nn(Nt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const M=await ye.settings.getAll()||{};g(M)}catch(M){ye.errorResponseHandler(M)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const M=await ye.settings.update(B.filterRedactedProps(a));g(M),sn("Successfully saved application settings.")}catch(M){ye.errorResponseHandler(M)}t(2,f=!1)}}function g(M={}){var O,E;nn(wo,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),nn(us,s=!!((E=M==null?void 0:M.meta)!=null&&E.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function v(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=Pt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const S=()=>v(),T=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,v,r,c,b,y,$,C,S,T]}class sO extends Ee{constructor(e){super(),Oe(this,e,iO,nO,De,{})}}function lO(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=ut(l,s[o]);return{c(){e=_("input"),mi(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Se(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){mi(e,l=pn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Se(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function oO(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=ut(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),mi(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Ye(gt.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){mi(s,a=pn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Je(o)}}}function rO(n){let e;function t(l,o){return l[3]?oO:lO}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:se,o:se,d(l){s.d(l),l&&k(e)}}}function aO(n,e,t){const i=["value","mask"];let s=Bt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await Zn(),r==null||r.focus()}const f=()=>u();function c(h){me[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ut(ut({},e),li(h)),t(5,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class nu extends Ee{constructor(e){super(),Oe(this,e,aO,rO,De,{value:0,mask:1})}}function uO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;return{c(){e=_("label"),t=N("Subject"),s=D(),l=_("input"),r=D(),a=_("div"),u=N(`Available placeholder parameters:
|
||||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||||
`,c=N(`,
|
||||
`),d=_("span"),d.textContent=`{APP_URL}
|
||||
`,h=N("."),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,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){w(b,e,y),m(e,t),w(b,s,y),w(b,l,y),Se(l,n[0].subject),w(b,r,y),w(b,a,y),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),g||(v=[J(l,"input",n[13]),J(f,"click",n[14]),J(d,"click",n[15])],g=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&Se(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),g=!1,Je(v)}}}function fO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y;return{c(){e=_("label"),t=N("Action URL"),s=D(),l=_("input"),r=D(),a=_("div"),u=N(`Available placeholder parameters:
|
||||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||||
`,c=N(`,
|
||||
`),d=_("span"),d.textContent=`{APP_URL}
|
||||
`,h=N(`,
|
||||
`),g=_("span"),g.textContent="{TOKEN}",v=N("."),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,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m($,C){w($,e,C),m(e,t),w($,s,C),w($,l,C),Se(l,n[0].actionUrl),w($,r,C),w($,a,C),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),b||(y=[J(l,"input",n[16]),J(f,"click",n[17]),J(d,"click",n[18]),J(g,"click",n[19])],b=!0)},p($,C){C[1]&1&&i!==(i=$[31])&&p(e,"for",i),C[1]&1&&o!==(o=$[31])&&p(l,"id",o),C[0]&1&&l.value!==$[0].actionUrl&&Se(l,$[0].actionUrl)},d($){$&&k(e),$&&k(s),$&&k(l),$&&k(r),$&&k(a),b=!1,Je(y)}}}function cO(n){let e,t,i,s;return{c(){e=_("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),Se(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&Se(e,l[0].body)},i:se,o:se,d(l){l&&k(e),i=!1,s()}}}function dO(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=new o(r(n)),me.push(()=>Re(e,"value",l))),{c(){e&&q(e.$$.fragment),i=We()},m(a,u){e&&H(e,a,u),w(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,je(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;L(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),me.push(()=>Re(e,"value",l)),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&j(e,a)}}}function pO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S;const T=[dO,cO],M=[];function O(E,P){return E[4]&&!E[5]?0:1}return l=O(n),o=M[l]=T[l](n),{c(){e=_("label"),t=N("Body (HTML)"),s=D(),o.c(),r=D(),a=_("div"),u=N(`Available placeholder parameters:
|
||||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||||
`,c=N(`,
|
||||
`),d=_("span"),d.textContent=`{APP_URL}
|
||||
`,h=N(`,
|
||||
`),g=_("span"),g.textContent=`{TOKEN}
|
||||
`,v=N(`,
|
||||
`),b=_("span"),b.textContent=`{ACTION_URL}
|
||||
`,y=N("."),p(e,"for",i=n[31]),p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(E,P){w(E,e,P),m(e,t),w(E,s,P),M[l].m(E,P),w(E,r,P),w(E,a,P),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),m(a,b),m(a,y),$=!0,C||(S=[J(f,"click",n[22]),J(d,"click",n[23]),J(g,"click",n[24]),J(b,"click",n[25])],C=!0)},p(E,P){(!$||P[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let I=l;l=O(E),l===I?M[l].p(E,P):(Ae(),L(M[I],1,1,()=>{M[I]=null}),Pe(),o=M[l],o?o.p(E,P):(o=M[l]=T[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){$||(A(o),$=!0)},o(E){L(o),$=!1},d(E){E&&k(e),E&&k(s),M[l].d(E),E&&k(r),E&&k(a),C=!1,Je(S)}}}function hO(n){let e,t,i,s,l,o;return e=new Ne({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[uO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new Ne({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[fO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new Ne({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[pO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&k(t),j(i,r),r&&k(s),j(l,r)}}}function Oh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function mO(n){let e,t,i,s,l,o,r,a,u,f,c=n[6]&&Oh();return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),l=N(n[2]),o=D(),r=_("div"),a=D(),c&&c.c(),u=We(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),w(d,o,h),w(d,r,h),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&ue(l,d[2]),d[6]?c?h[0]&64&&A(c,1):(c=Oh(),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(a),c&&c.d(d),d&&k(u)}}}function gO(n){let e,t;const i=[n[8]];let s={$$slots:{header:[mO],default:[hO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ut(s,i[l]);return e=new ir({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,o){const r=o[0]&256?pn(i,[oi(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){L(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}function _O(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;at(n,Vi,Z=>t(12,o=Z));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function v(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await Pi(()=>import("./CodeEditor.4ed72f0a.js"),["CodeEditor.4ed72f0a.js","index.c4d07677.js"],import.meta.url)).default),t(5,d=!1))}function y(Z){B.copyToClipboard(Z),i_(`Copied ${Z} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),S=()=>y("{APP_URL}");function T(){u.actionUrl=this.value,t(0,u)}const M=()=>y("{APP_NAME}"),O=()=>y("{APP_URL}"),E=()=>y("{TOKEN}");function P(Z){n.$$.not_equal(u.body,Z)&&(u.body=Z,t(0,u))}function I(){u.body=this.value,t(0,u)}const F=()=>y("{APP_NAME}"),z=()=>y("{APP_URL}"),Q=()=>y("{TOKEN}"),ne=()=>y("{ACTION_URL}");function G(Z){me[Z?"unshift":"push"](()=>{f=Z,t(3,f)})}function ee(Z){tt.call(this,n,Z)}function U(Z){tt.call(this,n,Z)}function Y(Z){tt.call(this,n,Z)}return n.$$set=Z=>{e=ut(ut({},e),li(Z)),t(8,l=Bt(e,s)),"key"in Z&&t(1,r=Z.key),"title"in Z&&t(2,a=Z.title),"config"in Z&&t(0,u=Z.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!B.isEmpty(B.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Oa(r))},[u,r,a,f,c,d,i,y,l,h,g,v,o,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y]}class Ir extends Ee{constructor(e){super(),Oe(this,e,_O,gO,De,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get colla
Line truncated
|
||||
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[24]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function RO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary 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],te(s,"btn-loading",n[3])},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),m(s,l),r||(a=[J(e,"click",n[22]),J(s,"click",n[23])],r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f&8&&te(s,"btn-loading",u[3])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,Je(a)}}}function HO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[TO,MO],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[5]),r=D(),a=_("div"),u=_("form"),f=_("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Wt(n[25])),v=!0)},p(S,T){(!g||T&32)&&ue(o,S[5]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function jO(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[HO]},$$scope:{ctx:n}}});let r={};return l=new CO({props:r}),n[26](l),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&1073741887&&(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[26](null),j(l,a)}}}function qO(n,e,t){let i,s,l;at(n,Nt,ee=>t(5,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}];nn(Nt,l="Mail settings",l);let r,a={},u={},f=!1,c=!1;d();async function d(){t(2,f=!0);try{const ee=await ye.settings.getAll()||{};g(ee)}catch(ee){ye.errorResponseHandler(ee)}t(2,f=!1)}async function h(){if(!(c||!s)){t(3,c=!0);try{const ee=await ye.settings.update(B.filterRedactedProps(u));g(ee),ri({}),sn("Successfully saved mail settings.")}catch(ee){ye.errorResponseHandler(ee)}t(3,c=!1)}}function g(ee={}){t(0,u={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),t(9,a=JSON.parse(JSON.stringify(u)))}function v(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function b(){u.meta.senderName=this.value,t(0,u)}function y(){u.meta.senderAddress=this.value,t(0,u)}function $(ee){n.$$.not_equal(u.meta.verificationTemplate,ee)&&(u.meta.verificationTemplate=ee,t(0,u))}function C(ee){n.$$.not_equal(u.meta.resetPasswordTemplate,ee)&&(u.meta.resetPasswordTemplate=ee,t(0,u))}function S(ee){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,ee)&&(u.meta.confirmEmailChangeTemplate=ee,t(0,u))}function T(){u.smtp.enabled=this.checked,t(0,u)}function M(){u.smtp.host=this.value,t(0,u)}function O(){u.smtp.port=Pt(this.value),t(0,u)}function E(ee){n.$$.not_equal(u.smtp.tls,ee)&&(u.smtp.tls=ee,t(0,u))}function P(){u.smtp.username=this.value,t(0,u)}function I(ee){n.$$.not_equal(u.smtp.password,ee)&&(u.smtp.password=ee,t(0,u))}const F=()=>v(),z=()=>h(),Q=()=>r==null?void 0:r.show(),ne=()=>h();function G(ee){me[ee?"unshift":"push"](()=>{r=ee,t(1,r)})}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(4,s=i!=JSON.stringify(u))},[u,r,f,c,s,l,o,h,v,a,i,b,y,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G]}class VO extends Ee{constructor(e){super(),Oe(this,e,qO,jO,De,{})}}function zO(n){var S,T;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[UO,({uniqueId:M})=>({25:M}),({uniqueId:M})=>M?33554432:0]},$$scope:{ctx:n}}});let b=((S=n[0].s3)==null?void 0:S.enabled)!=n[1].s3.enabled&&Ih(n),y=n[1].s3.enabled&&Nh(n),$=((T=n[1].s3)==null?void 0:T.enabled)&&!n[6]&&!n[3]&&Fh(n),C=n[6]&&Rh(n);return{c(){q(e.$$.fragment),t=D(),b&&b.c(),i=D(),y&&y.c(),s=D(),l=_("div"),o=_("div"),r=D(),$&&$.c(),a=D(),C&&C.c(),u=D(),f=_("button"),c=_("span"),c.textContent="Save changes",p(o,"class","flex-fill"),p(c,"class","txt"),p(f,"type","submit"),p(f,"class","btn btn-expanded"),f.disabled=d=!n[6]||n[3],te(f,"btn-loading",n[3]),p(l,"class","flex")},m(M,O){H(e,M,O),w(M,t,O),b&&b.m(M,O),w(M,i,O),y&&y.m(M,O),w(M,s,O),w(M,l,O),m(l,o),m(l,r),Line truncated
|
||||
the
|
||||
`),r=_("strong"),u=N(a),f=N(`
|
||||
to the
|
||||
`),c=_("strong"),h=N(d),g=N(`.
|
||||
`),v=_("br"),b=N(`
|
||||
There are numerous command line tools that can help you, such as:
|
||||
`),y=_("a"),y.textContent=`rclone
|
||||
`,$=N(`,
|
||||
`),C=_("a"),C.textContent=`s5cmd
|
||||
`,S=N(", etc."),T=D(),M=_("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,h),m(l,g),m(l,v),m(l,b),m(l,y),m(l,$),m(l,C),m(l,S),m(e,T),m(e,M),E=!0},p(I,F){var z;(!E||F&1)&&a!==(a=(z=I[0].s3)!=null&&z.enabled?"S3 storage":"local file system")&&ue(u,a),(!E||F&2)&&d!==(d=I[1].s3.enabled?"S3 storage":"local file system")&&ue(h,d)},i(I){E||(I&&Tt(()=>{O||(O=st(e,on,{duration:150},!0)),O.run(1)}),E=!0)},o(I){I&&(O||(O=st(e,on,{duration:150},!1)),O.run(0)),E=!1},d(I){I&&k(e),I&&O&&O.end()}}}function Nh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M;return i=new Ne({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[WO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[YO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"s3.region",$$slots:{default:[KO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[JO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[ZO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),$=new Ne({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[GO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(d.$$.fragment),h=D(),g=_("div"),q(v.$$.fragment),b=D(),y=_("div"),q($.$$.fragment),C=D(),S=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(S,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),m(e,h),m(e,g),H(v,g,null),m(e,b),m(e,y),H($,y,null),m(e,C),m(e,S),M=!0},p(O,E){const P={};E&100663298&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&100663298&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),u.$set(F);const z={};E&100663298&&(z.$$scope={dirty:E,ctx:O}),d.$set(z);const Q={};E&100663298&&(Q.$$scope={dirty:E,ctx:O}),v.$set(Q);const ne={};E&100663298&&(ne.$$scope={dirty:E,ctx:O}),$.$set(ne)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(v.$$.fragment,O),A($.$$.fragment,O),O&&Tt(()=>{T||(T=st(e,on,{duration:150},!0)),T.run(1)}),M=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(u.$$.fragment,O),L(d.$$.fragment,O),L(v.$$.fragment,O),L($.$$.fragment,O),O&&(T||(T=st(e,on,{duration:150},!1)),T.run(0)),M=!1},d(O){O&&k(e),j(i),j(o),j(u),j(d),j(v),j($),O&&T&&T.end()}}}function WO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Endpoint"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1].s3.endpoint),r||(a=J(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&&Se(l,u[1].s3.endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function YO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Bucket"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1].s3.bucket),r||(a=J(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&&Se(l,u[1].s3.bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function KO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Region"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1].s3.region),r||(a=J(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&&Se(l,u[1].s3.region)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Access key"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1].s3.accessKey),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",
Line truncated
|
||||
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function QO(n){let e,t,i,s;return{c(){e=_("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;w(l,e,o),i||(s=Ye(t=gt.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Nn(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function xO(n){let e;return{c(){e=_("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Rh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),m(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function e5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[BO,zO],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[7]),r=D(),a=_("div"),u=_("form"),f=_("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(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Wt(n[20])),v=!0)},p(S,T){(!g||T&128)&&ue(o,S[7]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function t5(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[e5]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}const Fr="s3_test_request";function n5(n,e,t){let i,s,l;at(n,Nt,z=>t(7,l=z)),nn(Nt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;h();async function h(){t(2,a=!0);try{const z=await ye.settings.getAll()||{};b(z)}catch(z){ye.errorResponseHandler(z)}t(2,a=!1)}async function g(){if(t(5,c=null),!!r.s3.enabled){t(4,f=!0);try{await ye.settings.testS3({$cancelKey:Fr})}catch(z){t(5,c=z)}t(4,f=!1)}}async function v(){if(!(u||!s)){t(3,u=!0),clearTimeout(d),d=setTimeout(()=>{ye.cancelRequest(Fr),addErrorToast("S3 test connection timeout.")},3e4);try{ye.cancelRequest(Fr);const z=await ye.settings.update(B.filterRedactedProps(r));ri({}),await b(z),J0(),c?K0("Successfully saved but failed to establish S3 connection."):sn("Successfully saved files storage settings.")}catch(z){ye.errorResponseHandler(z)}clearTimeout(d),t(3,u=!1)}}async function b(z={}){t(1,r={s3:(z==null?void 0:z.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await g()}async function y(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await g()}function $(){r.s3.enabled=this.checked,t(1,r)}function C(){r.s3.endpoint=this.value,t(1,r)}function S(){r.s3.bucket=this.value,t(1,r)}function T(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function O(z){n.$$.not_equal(r.s3.secret,z)&&(r.s3.secret=z,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>y(),I=()=>v(),F=()=>v();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,v,y,i,$,C,S,T,M,O,E,P,I,F]}class i5 extends Ee{constructor(e){super(),Oe(this,e,n5,t5,De,{})}}function s5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Hh(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Ne({props:{class:"form-field required",name:"emailAuth.minPasswordLength",$$slots:{default:[l5,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field "+(B.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailAuth.exceptDomains",$$slots:{default:[o5,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field "+(B.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailAuth.onlyDomains",$$slots:{default:[r5,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const v={};h&1&&(v.class="form-field "+(B.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(B.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=st(e,on,{duration:150},!0)),f.run(1)}),c=!0)},o(d){L(i.$$.fragment,d),L(o.$$.fragment,d),L(u.$$.fragment,d),d&&(f||(f=st(e,on,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),j(i),j(o),j(u),d&&f&&f.end()}}}function l5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Minimum password length"),s=D(),l=_("input"),p(e,"for",i=n[16]),p(l,"type","number"),p(l,"id",o=n[16]),l.required=!0,p(l,"min","5"),p(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].minPassworLine truncated
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&p(e,"for",l);const $={};y&65536&&($.id=b[16]),y&1&&($.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,je(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function r5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(gt.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(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const $={};y&65536&&($.id=b[16]+".config.onlyDomains"),y&1&&($.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,je(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function a5(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-toggle m-b-0",name:"emailAuth.enabled",$$slots:{default:[s5,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Hh(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=We()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Hh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){j(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function u5(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function f5(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function jh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function c5(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?f5:u5}let u=a(n),f=u(n),c=n[2]&&jh();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||||
<span class="txt">Email/Password</span>`,t=D(),f.c(),i=D(),s=_("div"),l=D(),c&&c.c(),o=We(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&A(c,1):(c=jh(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){r||(A(c),r=!0)},o(d){L(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function d5(n){let e,t;const i=[n[3]];let s={$$slots:{header:[c5],default:[a5]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ut(s,i[l]);return e=new ir({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,[o]){const r=o&8?pn(i,[oi(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[12](null),j(e,l)}}}function p5(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;at(n,Vi,S=>t(7,o=S));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function h(){r.minPasswordLength=Pt(this.value),t(0,r)}function g(S){n.$$.not_equal(r.exceptDomains,S)&&(r.exceptDomains=S,t(0,r))}function v(S){n.$$.not_equal(r.onlyDomains,S)&&(r.onlyDomains=S,t(0,r))}function b(S){me[S?"unshift":"push"](()=>{a=S,t(1,a)})}function y(S){tt.call(this,n,S)}function $(S){tt.call(this,n,S)}function C(S){tt.call(this,n,S)}return n.$$set=S=>{e=ut(ut({},e),li(S)),t(3,l=Bt(e,s)),"config"in S&&t(0,r=S.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!B.isEmpty(o==null?void 0:o.emailAuth))},[r,a,i,l,u,f,c,o,d,h,g,v,b,y,$,C]}class h5 extends Ee{constructor(e){super(),Oe(this,e,p5,d5,De,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function m5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[12]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function qh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;l=new Ne({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[g5,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[_5,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),c=new Ne({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[b5,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}});let v=n[4]&&Vh(n);return{c(){e=_("div"),t=_("div"),i=D(),s=_("div"),q(l.$$.fragment),o=D(),r=_("div"),q(a.$$.fragment),u=D(),f=_("div"),q(c.$$.fragment),d=D(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),H(l,s,null),m(e,o),m(e,r),H(a,r,null),m(e,u),m(e,f),H(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const $={};y&2&&($.name=b[1]+".clientId"),y&25165825&&($.$$scope={dirty:y,ctx:b}),l.$set($);const C={};y&2&&(C.name=b[1]+".clientSecret"),y&25165825&&(C.$$scope={dirty:y,ctx:b}),a.$set(C);const S={};y&2&&(S.name=b[1]+".allowRegistrations"),y&25165825&&(S.$$scope={dirty:y,ctx:b}),c.$set(S),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=Vh(b),v.c(),A(v,1),v.m(e,null)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{h||(h=st(e,on,{duration:200},!0)),h.run(1)}),g=!0)},o(b){L(l.$$.fragment,b),L(a.$$.fragment,b),L(c.$$.fragment,b),L(v),b&&(h||(h=st(e,on,{duration:200},!1)),h.run(0)),g=!1},d(b){b&&k(e),j(l),j(a),j(c),v&&v.d(),b&&h&&h.end()}}}function g5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Client ID"),s=D(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].clientId),r||(a=J(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&&l.value!==u[0].clientId&&Se(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function _5(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[23],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new nu({props:u}),me.push(()=>Re(l,"value",a)),{c(){e=_("label"),t=N("Client Secret"),s=D(),q(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(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&1&&(Line truncated
|
||||
another PocketBase environment.</p>`,t=D(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),q(o.$$.fragment),r=D(),a=_("div"),u=_("div"),f=D(),c=_("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-secondary 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,b){w(v,e,b),w(v,t,b),w(v,i,b),m(i,s),m(i,l),H(o,i,null),n[8](i),w(v,r,b),w(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(A(o.$$.fragment,v),d=!0)},o(v){L(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),j(o),n[8](null),v&&k(r),v&&k(a),h=!1,Je(g)}}}function B5(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function U5(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[B5,z5],g=[];function v(b,y){return b[1]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[3]),r=D(),a=_("div"),u=_("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(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&ue(o,b[3]);let $=f;f=v(b),f===$?g[f].p(b,y):(Ae(),L(g[$],1,1,()=>{g[$]=null}),Pe(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function W5(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[U5]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function Y5(n,e,t){let i,s;at(n,Nt,b=>t(3,s=b)),nn(Nt,s="Export collections",s);const l="export_"+B.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ye.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){ye.errorResponseHandler(b)}t(1,a=!1)}function f(){B.downloadJson(r,"pb_schema")}function c(){B.copyToClipboard(i),i_("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){me[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),$=document.createRange();$.selectNodeContents(o),y.removeAllRanges(),y.addRange($)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,v]}class K5 extends Ee{constructor(e){super(),Oe(this,e,Y5,W5,De,{})}}function Gh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Qh(n,e,t){const i=n.slice();return i[14]=e[t],i}function xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function em(n,e,t){const i=n.slice();return i[14]=e[t],i}function tm(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function nm(n,e,t){const i=n.slice();return i[30]=e[t],i}function J5(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&im(),a=n[0].name!==n[1].name&&sm(n);return{c(){e=_("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=_("strong"),o=N(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),m(e,t),a&&a.m(e,null),m(e,i),m(e,s),m(s,o)},p(u,f){u[9]?r||(r=im(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=sm(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&ue(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function Z5(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=D(),i=_("strong"),l=N(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&ue(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function G5(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Added",t=D(),i=_("strong"),l=N(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&ue(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function im(n){let e;return{c(){e=_("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sm(n){let e,t=n[0].name+"",i,s,l;return{c(){e=_("strong"),i=N(t),s=D(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function lm(n){var b,y;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+""Line truncated
|
||||
<th width="10%" class="svelte-lmkr38">Old</th>
|
||||
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=_("tbody");for(let S=0;S<g.length;S+=1)g[S].c();r=D(),v&&v.c(),a=D();for(let S=0;S<y.length;S+=1)y[S].c();u=D();for(let S=0;S<C.length;S+=1)C[S].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(S,T){w(S,e,T),d.m(e,null),w(S,t,T),w(S,i,T),m(i,s),m(i,l),m(i,o);for(let M=0;M<g.length;M+=1)g[M].m(o,null);m(o,r),v&&v.m(o,null),m(o,a);for(let M=0;M<y.length;M+=1)y[M].m(o,null);m(o,u);for(let M=0;M<C.length;M+=1)C[M].m(o,null)},p(S,T){if(c===(c=f(S))&&d?d.p(S,T):(d.d(1),d=c(S),d&&(d.c(),d.m(e,null))),T[0]&7203){h=S[11];let M;for(M=0;M<h.length;M+=1){const O=nm(S,h,M);g[M]?g[M].p(O,T):(g[M]=lm(O),g[M].c(),g[M].m(o,r))}for(;M<g.length;M+=1)g[M].d(1);g.length=h.length}if(S[2]||S[5]?v?v.p(S,T):(v=om(S),v.c(),v.m(o,a)):v&&(v.d(1),v=null),T[0]&4248){b=S[7];let M;for(M=0;M<b.length;M+=1){const O=Qh(S,b,M);y[M]?y[M].p(O,T):(y[M]=cm(O),y[M].c(),y[M].m(o,u))}for(;M<y.length;M+=1)y[M].d(1);y.length=b.length}if(T[0]&4352){$=S[8];let M;for(M=0;M<$.length;M+=1){const O=Gh(S,$,M);C[M]?C[M].p(O,T):(C[M]=pm(O),C[M].c(),C[M].m(o,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=$.length}},i:se,o:se,d(S){S&&k(e),d.d(),S&&k(t),S&&k(i),Yt(g,S),v&&v.d(),Yt(y,S),Yt(C,S)}}}function zn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function yn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function Q5(n,e,t){let i,s,l,{collectionA:o=new dn}=e,{collectionB:r=new dn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const g=Object.keys(new dn().export()).filter(y=>!["schema","created","updated"].includes(y));function v(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find($=>y.id==$.id))))}function b(y){return typeof y>"u"?"":B.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&v(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find($=>y.id==$.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find($=>$.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find($=>$.id==y.id))),n.$$.dirty[0]&7&&t(9,l=B.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,b]}class x5 extends Ee{constructor(e){super(),Oe(this,e,Q5,X5,De,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function hm(n,e,t){const i=n.slice();return i[17]=e[t],i}function mm(n){let e,t;return e=new x5({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eE(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=mm(hm(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=We()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(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=hm(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=mm(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);Pe()}},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)L(s[r]);t=!1},d(o){Yt(s,o),o&&k(e)}}}function tE(n){let e;return{c(){e=_("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function nE(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=N("Close"),i=D(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=n[4],te(s,"btn-loading",n[4])},m(a,u){w(a,e,u),m(e,t),w(a,i,u),w(a,s,u),m(s,l),o||(r=[J(e,"click",n[0]),J(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&te(s,"btn-loading",a[4])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,Je(r)}}}function iE(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[nE],header:[tE],default:[eE]},$$scope:{ctx:n}};return e=new ui({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(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){L(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function sE(n,e,t){const i=xt();let s,Line truncated
|
||||
- ${S.join(`
|
||||
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await ye.collections.import(o,a),sn("Successfully imported collections configuration."),i("submit")}catch(S){ye.errorResponseHandler(S)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y(S){me[S?"unshift":"push"](()=>{s=S,t(1,s)})}function $(S){tt.call(this,n,S)}function C(S){tt.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,$,C]}class lE extends Ee{constructor(e){super(),Oe(this,e,sE,iE,De,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function gm(n,e,t){const i=n.slice();return i[32]=e[t],i}function _m(n,e,t){const i=n.slice();return i[35]=e[t],i}function bm(n,e,t){const i=n.slice();return i[32]=e[t],i}function oE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O;a=new Ne({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[aE,({uniqueId:Q})=>({40:Q}),({uniqueId:Q})=>[0,Q?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&ym(),I=n[6]&&n[1].length&&n[7]&&km(n),F=n[13].length&&Pm(n),z=!!n[0]&&Lm(n);return{c(){e=_("input"),t=D(),i=_("div"),s=_("p"),l=N(`Paste below the collections configuration you want to import or
|
||||
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),q(a.$$.fragment),u=D(),f=D(),P&&P.c(),c=D(),I&&I.c(),d=D(),F&&F.c(),h=D(),g=_("div"),z&&z.c(),v=D(),b=_("div"),y=D(),$=_("button"),C=_("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),te(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(C,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=S=!n[14],p(g,"class","flex m-t-base")},m(Q,ne){w(Q,e,ne),n[19](e),w(Q,t,ne),w(Q,i,ne),m(i,s),m(s,l),m(s,o),w(Q,r,ne),H(a,Q,ne),w(Q,u,ne),w(Q,f,ne),P&&P.m(Q,ne),w(Q,c,ne),I&&I.m(Q,ne),w(Q,d,ne),F&&F.m(Q,ne),w(Q,h,ne),w(Q,g,ne),z&&z.m(g,null),m(g,v),m(g,b),m(g,y),m(g,$),m($,C),T=!0,M||(O=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(Q,ne){ne[0]&4096&&te(o,"btn-loading",Q[12]);const G={};ne[0]&64&&(G.class="form-field "+(Q[6]?"":"field-error")),ne[0]&65|ne[1]&1536&&(G.$$scope={dirty:ne,ctx:Q}),a.$set(G),Q[6]&&Q[1].length&&!Q[7]?P||(P=ym(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),Q[6]&&Q[1].length&&Q[7]?I?I.p(Q,ne):(I=km(Q),I.c(),I.m(d.parentNode,d)):I&&(I.d(1),I=null),Q[13].length?F?F.p(Q,ne):(F=Pm(Q),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null),Q[0]?z?z.p(Q,ne):(z=Lm(Q),z.c(),z.m(g,v)):z&&(z.d(1),z=null),(!T||ne[0]&16384&&S!==(S=!Q[14]))&&($.disabled=S)},i(Q){T||(A(a.$$.fragment,Q),A(E),T=!0)},o(Q){L(a.$$.fragment,Q),L(E),T=!1},d(Q){Q&&k(e),n[19](null),Q&&k(t),Q&&k(i),Q&&k(r),j(a,Q),Q&&k(u),Q&&k(f),P&&P.d(Q),Q&&k(c),I&&I.d(Q),Q&&k(d),F&&F.d(Q),Q&&k(h),Q&&k(g),z&&z.d(),M=!1,Je(O)}}}function rE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function vm(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function aE(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&vm();return{c(){e=_("label"),t=N("Collections"),s=D(),l=_("textarea"),r=D(),c&&c.c(),a=We(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Se(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=J(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Se(l,d[0]),!!d[0]&&!d[6]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function ym(n){let e;return{c(){e=_("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){w(t,e,i)},d(t){t&&k(e)}}}function km(n){let e,t,i,s,l,o=n[9].length&&wm(n),r=n[4].length&&Cm(n),a=n[8].length&&Om(n);return{c(){e=_("h5"),e.textContent="Detected changes",t=D(),i=_("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),m(i,s),r&&r.m(i,null),m(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=wm(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Cm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Om(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function wm(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=bm(n,s,o),a=l(r);t.set(a,e[o]=Sm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=We()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=_t(e,r,l,1,o,s,t,i.parentNode,bn,Sm,i,bm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function $m(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Sm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&$m(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=D(),l=_("strong"),r=N(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=$m(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Cm(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=_m(n,s,o),a=l(r);t.set(a,e[o]=Dm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=We()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=_t(e,r,l,1,o,s,t,i.parentNode,bn,Dm,i,_m))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Mm(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=_("strong"),i=N(t),s=D(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function Tm(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Dm(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&&Mm(e),h=e[35].new.id&&Tm(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Changed",s=D(),l=_("div"),d&&d.c(),o=D(),r=_("strong"),u=N(a),f=D(),h&&h.c(),c=D(),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(g,v){w(g,t,v),m(t,i),m(t,s),m(t,l),d&&d.m(l,null),m(l,o),m(l,r),m(r,u),m(l,f),h&&h.m(l,null),m(t,c)},p(g,v){e=g,e[35].old.name!==e[35].new.name?d?d.p(e,v):(d=Mm(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),v[0]&16&&a!==(a=e[35].new.name+"")&&ue(u,a),e[35].new.id?h?h.p(e,v):(h=Tm(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&k(t),d&&d.d(),h&&h.d()}}}function Om(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=gm(n,s,o),a=l(r);t.set(a,e[o]=Am(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=We()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=_t(e,r,l,1,o,s,t,i.parentNode,bn,Am,i,gm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Em(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Am(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Em(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Added",s=D(),l=_("strong"),r=N(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=Em(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Pm(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=_("div"),s.innerHTML=`<string>Some of the imported collections shares 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=_("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){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:se,d(u){u&&k(e),r=!1,a()}}}function Lm(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-secondary link-hint")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function uE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[rE,oE],g=[];function v(b,y){return b[5]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[15]),r=D(),a=_("div"),u=_("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(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&ue(o,b[15]);let $=f;f=v(b),f===$?g[f].p(b,y):(Ae(),L(g[$],1,1,()=>{g[$]=null}),Pe(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function fE(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[uE]},$$scope:{ctx:n}}});let r={};return l=new lE({props:r}),n[27](l),l.$on("submit",n[28]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[27](null),j(l,a)}}}function cE(n,e,t){let i,s,l,o,r,a,u;at(n,Nt,Z=>t(15,u=Z)),nn(Nt,u="Import collections",u);let f,c,d="",h=!1,g=[],v=[],b=!0,y=[],$=!1;C();async function C(){t(5,$=!0);try{t(2,v=await ye.collections.getFullList(200));for(let Z of v)delete Z.created,delete Z.updated}catch(Z){ye.errorResponseHandler(Z)}t(5,$=!1)}function S(){if(t(4,y=[]),!!i)for(let Z of g){const de=B.findByKey(v,"id",Z.id);!(de!=null&&de.id)||!B.hasCollectionChanges(de,Z,b)||y.push({new:Z,old:de})}}function T(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=B.filterDuplicatesByKey(g)):t(1,g=[]);for(let Z of g)delete Z.created,delete Z.updated,Z.schema=B.filterDuplicatesByKey(Z.schema)}function M(){var Z,de;for(let x of g){const oe=B.findByKey(v,"name",x.name)||B.findByKey(v,"id",x.id);if(!oe)continue;const Ce=x.id,Te=oe.id;x.id=Te;const K=Array.isArray(oe.schema)?oe.schema:[],we=Array.isArray(x.schema)?x.schema:[];for(const ae of we){const W=B.findByKey(K,"name",ae.name);W&&W.id&&(ae.id=W.id)}for(let ae of g)if(!!Array.isArray(ae.schema))for(let W of ae.schema)((Z=W.options)==null?void 0:Z.collectionId)&&((de=W.options)==null?void 0:de.collectionId)===Ce&&(W.options.collectionId=Te)}t(0,d=JSON.stringify(g,null,4))}function O(Z){t(12,h=!0);const de=new FileReader;de.onload=async x=>{t(12,h=!1),t(10,f.value="",f),t(0,d=x.target.result),await Zn(),g.length||(hl("Invalid collections configuration."),E())},de.onerror=x=>{console.warn(x),hl("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},de.readAsText(Z)}function E(){t(0,d=""),t(10,f.value="",f),ri({})}function P(Z){me[Z?"unshift":"push"](()=>{f=Z,t(10,f)})}const I=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function z(){d=this.value,t(0,d)}function Q(){b=this.checked,t(3,b)}const ne=()=>M(),G=()=>E(),ee=()=>c==null?void 0:c.show(v,g,b);function U(Z){me[Z?"unshift":"push"](()=>{c=Z,t(11,c)})}const Y=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&T(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(Z=>!!Z.id&&!!Z.name).length),n.$$.dirty[0]&78&&t(9,s=v.filter(Z=>i&&b&&!B.findByKey(g,"id",Z.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(Z=>i&&!B.findByKey(v,"id",Z.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof b<"u")&&S(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!$&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(Z=>{let de=B.findByKey(v,"name",Z.name)||B.findByKey(v,"id",Z.id);if(!de)return!1;if(de.id!=Z.id)return!0;const x=Array.isArray(de.schema)?de.schema:[],oe=Array.isArray(Z.schema)?Z.schema:[];for(const Ce of oe){if(B.findByKey(x,"id",Ce.id))continue;const K=B.findByKey(x,"name",Ce.name);if(K&&Ce.id!=K.id)return!0}return!1}))},[d,g,v,b,y,$,i,o,l,s,f,c,h,a,r,u,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y]}class dE extends Ee{constructor(e){super(),Oe(this,e,cE,fE,De,{},null,[-1,-1])}}const rn=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ci("/"):!0}],pE={"/login":tn({component:JD,conditions:rn.conLine truncated
|
||||
<span class="txt">Manage admins</span>`,t=D(),i=_("hr"),s=D(),l=_("div"),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,"tabindex","0"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Ye(mn.call(null,e)),J(l,"click",n[6])],o=!0)},p:se,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Je(r)}}}function DE(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=B.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&Fm(n);return o=new Ib({props:{routes:pE}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new kE({}),f=new ME({}),{c(){t=D(),i=_("div"),d&&d.c(),s=D(),l=_("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),H(o,l,null),m(l,r),H(a,l,null),w(g,u,v),H(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=B.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=Fm(g),d.c(),A(d,1),d.m(i,s)):d&&(Ae(),L(d,1,1,()=>{d=null}),Pe())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){L(d),L(o.$$.fragment,g),L(a.$$.fragment,g),L(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),j(o),j(a),g&&k(u),j(f,g)}}}function OE(n,e,t){let i,s,l,o;at(n,us,h=>t(8,i=h)),at(n,wo,h=>t(2,s=h)),at(n,Ea,h=>t(0,l=h)),at(n,Nt,h=>t(3,o=h));let r,a=!1;function u(h){var g,v,b,y;((g=h==null?void 0:h.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((b=(v=h==null?void 0:h.detail)==null?void 0:v.userData)!=null&&b.showAppSidebar)),r=(y=h==null?void 0:h.detail)==null?void 0:y.location,nn(Nt,o="",o),ri({}),ob())}function f(){Ci("/")}async function c(){var h,g;if(!!(l!=null&&l.id))try{const v=await ye.settings.getAll({$cancelKey:"initialAppSettings"});nn(wo,s=((h=v==null?void 0:v.meta)==null?void 0:h.appName)||"",s),nn(us,i=!!((g=v==null?void 0:v.meta)!=null&&g.hideControls),i)}catch(v){console.warn("Failed to load app settings.",v)}}function d(){ye.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class EE extends Ee{constructor(e){super(),Oe(this,e,OE,DE,De,{})}}new EE({target:document.getElementById("app")});export{Je as A,sn as B,B as C,Ci as D,We as E,l_ as F,va as G,at as H,As as I,xt as J,dn as K,Fn as L,me as M,lu as N,Ee as S,L as a,D as b,q as c,j as d,_ as e,p as f,w as g,m as h,Oe as i,Ye as j,Ae as k,mn as l,H as m,Pe as n,k as o,ye as p,Ne as q,te as r,De as s,A as t,J as u,Wt as v,N as w,ue as x,se as y,Se as z};
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
class N{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),He.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),He.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ti(this),r=new ti(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ti(this,e)}iterRange(e,t=this.length){return new Yo(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new _o(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?N.empty:e.length<=32?new J(e):He.from(J.split(e,[]))}}class J extends N{constructor(e,t=Ra(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Ea(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new J(yr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Fi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new J(l,o.length+r.length));else{let h=l.length>>1;i.push(new J(l.slice(0,h)),new J(l.slice(h)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof J))return super.replace(e,t,i);let s=Fi(this.text,Fi(i.text,yr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new J(s,r):He.from(J.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
||||
`){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],h=r+l.length;r>e&&o&&(s+=i),e<h&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=h+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new J(i,s)),i=[],s=-1);return s>-1&&t.push(new J(i,s)),t}}class He extends N{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,h=i+o.lines-1;if((t?h:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=h+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],h=o+l.length;if(e<=h&&t>=o){let a=s&((o<=e?1:0)|(h>=t?2:0));o>=e&&h<=t&&!a?i.push(l):l.decompose(e-o,t-o,i,a)}o=h+1}}replace(e,t,i){if(i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let h=o.replace(e-r,t-r,i),a=this.lines-o.lines+h.lines;if(h.lines<a>>5-1&&h.lines>a>>5+1){let c=this.children.slice();return c[s]=h,new He(c,this.length-(t-e)+i.length)}return super.replace(r,l,h)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
||||
`){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],h=o+l.length;o>e&&r&&(s+=i),e<h&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=h+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof He))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let h=this.children[s],a=e.children[r];if(h!=a)return i+h.scanIdentical(a,t);i+=h.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new J(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],h=0,a=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof He)for(let g of d.children)f(g);else d.lines>o&&(h>o||!h)?(u(),l.push(d)):d instanceof J&&h&&(p=c[c.length-1])instanceof J&&d.lines+p.lines<=32?(h+=d.lines,a+=d.length+1,c[c.length-1]=new J(p.text.concat(d.text),p.length+1+d.length)):(h+d.lines>s&&u(),h+=d.lines,a+=d.length+1,c.push(d))}function u(){h!=0&&(l.push(c.length==1?c[0]:He.from(c,a)),a=-1,h=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new He(l,t)}}N.empty=new J([""],0);function Ra(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Fi(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],h=s+l.length;h>=t&&(h>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=h+1}return e}function yr(n,e,t){return Fi(n,[""],e,t)}class ti{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof J?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof J?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
||||
`,this;e--}else if(s instanceof J){let h=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=s.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof J?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Yo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ti(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class _o{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(N.prototype[Symbol.iterator]=function(){return this.iter()},ti.prototype[Symbol.iterator]=Yo.prototype[Symbol.iterator]=_o.prototype[Symbol.iterator]=function(){return this});class Ea{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Bt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;n<Bt.length;n++)Bt[n]+=Bt[n-1];function Ia(n){for(let e=1;e<Bt.length;e+=2)if(Bt[e]>n)return Bt[e-1]<=n;return!1}function br(n){return n>=127462&&n<=127487}const wr=8205;function fe(n,e,t=!0,i=!0){return(t?Qo:Na)(n,e,i)}function Qo(n,e,t){if(e==n.length)return e;e&&Zo(n.charCodeAt(e))&&el(n.charCodeAt(e-1))&&e--;let i=ie(n,e);for(e+=ve(i);e<n.length;){let s=ie(n,e);if(i==wr||s==wr||t&&Ia(s))e+=ve(s),i=s;else if(br(s)){let r=0,o=e-2;for(;o>=0&&br(ie(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Na(n,e,t){for(;e>0;){let i=Qo(n,e-2,t);if(i<e)return i;e--}return 0}function Zo(n){return n>=56320&&n<57344}function el(n){return n>=55296&&n<56320}function ie(n,e){let t=n.charCodeAt(e);if(!el(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Zo(i)?(t-55296<<10)+(i-56320)+65536:t}function Ws(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ve(n){return n<65536?1:2}const Yn=/\r\n?|\n/;var le=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(le||(le={}));class je{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){_n(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s
Line truncated
|
||||
`}get readOnly(){return this.facet(cl)}phrase(e,...t){for(let i of this.facet(I.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(sl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Ga(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let h=fe(t,o,!1);if(r(t.slice(h,o))!=j.Word)break;o=h}for(;l<s;){let h=fe(t,l);if(r(t.slice(l,h))!=j.Word)break;l=h}return o==l?null:m.range(o+i,l+i)}}I.allowMultipleSelections=rl;I.tabSize=D.define({combine:n=>n.length?n[0]:4});I.lineSeparator=ol;I.readOnly=cl;I.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});I.languageData=sl;I.changeFilter=ll;I.transactionFilter=hl;I.transactionExtender=al;gn.reconfigure=R.define();function Ct(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class yt{eq(e){return this==e}range(e,t=e){return li.create(e,t,this)}}yt.prototype.startSide=yt.prototype.endSide=0;yt.prototype.point=!1;yt.prototype.mapMode=le.TrackDel;class li{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new li(e,t,i)}}function ns(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class qs{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let h=o+l>>1,a=r[h]-e||(i?this.value[h].endSide:this.value[h].startSide)-t;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let h=0;h<this.value.length;h++){let a=this.value[h],c=this.from[h]+e,f=this.to[h]+e,u,d;if(c==f){let p=t.mapPos(c,a.startSide,a.mapMode);if(p==null||(u=d=p,a.startSide!=a.endSide&&(d=t.mapPos(c,a.endSide),d<u)))continue}else if(u=t.mapPos(c,a.startSide),d=t.mapPos(f,a.endSide),u>d||u==d&&a.startSide>0&&a.endSide<=0)continue;(d-u||a.endSide-a.startSide)<0||(o<0&&(o=u),a.point&&(l=Math.max(l,d-u)),i.push(a),s.push(u-o),r.push(d-o))}return{mapped:i.length?new qs(s,r,i,l):null,pos:o}}}class ${constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new $(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ns)),this.isEmpty)return t.length?$.of(t):this;let l=new dl(this,null,-1).goto(0),h=0,a=[],c=new bt;for(;l.value||h<t.length;)if(h<t.length&&(l.from-t[h].from||l.startSide-t[h].value.startSide)>=0){let f=t[h++];c.addInner(f.from,f.to,f.value)||a.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(l.chunkIndex)<t[h].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||a.push(li.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!a.length?$.empty:this.nextLayer.update({add:a,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],h=this.chunk[o],a=e.touchesRange(l,l+h.length);if(a===!1)s=Math.max(s,h.maxPoint),t.push(h),i.push(e.mapPos(l));else if(a===!0){let{mapped:c,pos:f}=h.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new $(i,t,r||$.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return hi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return hi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),h=Sr(o,l,i),a=new Ut(o,h,r),c=new Ut(l,h
Line truncated
|
||||
`)}static newName(){let e=Mr[Ar]||1;return Mr[Ar]=e+1,os+e.toString(36)}static mount(e,t){(e[ls]||new Xa(e)).mount(Array.isArray(t)?t:[t])}}let Ci=null;class Xa{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Ci)return e.adoptedStyleSheets=[Ci.sheet].concat(e.adoptedStyleSheets),e[ls]=Ci;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),Ci=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[ls]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let h=0;h<o.rules.length;h++)t.insertRule(o.rules[h],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
|
||||
`;this.styleTag.textContent=r}}}var lt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ai={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Dr=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent);var Ya=typeof navigator<"u"&&/Mac/.test(navigator.platform),_a=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Qa=Ya||Dr&&+Dr[1]<57;for(var ne=0;ne<10;ne++)lt[48+ne]=lt[96+ne]=String(ne);for(var ne=1;ne<=24;ne++)lt[ne+111]="F"+ne;for(var ne=65;ne<=90;ne++)lt[ne]=String.fromCharCode(ne+32),ai[ne]=String.fromCharCode(ne);for(var Pn in lt)ai.hasOwnProperty(Pn)||(ai[Pn]=lt[Pn]);function Za(n){var e=Qa&&(n.ctrlKey||n.altKey||n.metaKey)||_a&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ai:lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Ui(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Et(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function ec(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Hi(n,e){if(!e.anchorNode)return!1;try{return Et(n,e.anchorNode)}catch{return!1}}function ci(n){return n.nodeType==3?It(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Gi(n,e,t,i){return t?Or(n,e,t,i,-1)||Or(n,e,t,i,1):!1}function Ji(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Or(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:fi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Ji(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?fi(n):0}else return!1}}function fi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const pl={left:0,right:0,top:0,bottom:0};function mn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function tc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function ic(n,e,t,i,s,r,o,l){let h=n.ownerDocument,a=h.defaultView;for(let c=n;c;)if(c.nodeType==1){let f,u=c==h.body;if(u)f=tc(a);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top<f.top?(p=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p<f.top&&(p=-(f.top+p-e.top+o)));else{let g=e.bottom-e.top,y=f.bottom-f.top;p=(s=="center"&&g<=y?e.top+g/2-y/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-y+o)-f.top}if(i=="nearest"?e.left<f.left?(d=-(f.left-e.left+r),t>0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.left<f.left+d&&(d=-(f.left+d-e.left+r))):d=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==l?e.left-r:e.right-(f.right-f.left)+r)-f.left,d||p)if(u)a.scrollBy(d,p);else{if(p){let g=c.scrollTop;c.scrollTop+=p,p=c.scrollTop-g}if(d){let g=c.scrollLeft;c.scrollLeft+=d,d=c.scrollLeft-g}e={left:e.left-d,top:e.top-p,right:e.right-d,bottom:e.bottom-p}}if(u)break;c=c.assignedSlot||c.parentNode,i=s="nearest"}else if(c.nodeType==11)c=c.host;else break}class nc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Dt=null;function gl(n){if(n.setActive)return n.setActive();if(Dt)return n.focus(Dt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Dt==null?{get preventScroll(){return Dt={preventScroll:!0},!0}}:void 0),!Dt){Dt=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let Tr;function It(n,e,t=e){leLine truncated
|
||||
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),a=m.cursor(t?s.from:s.to)}if(h){if(!h(c))return l}else{if(!i)return a;h=i(c)}l=a}}function Bc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==j.Space&&(s=o),s==o}}function Pc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return m.cursor(s,e.assoc);let o=e.goalColumn,l,h=n.contentDOM.getBoundingClientRect(),a=n.coordsAtPos(s),c=n.documentTop;if(a)o==null&&(o=a.left-h.left),l=r<0?a.top:a.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(h.right-h.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=h.left+o,u=i!=null?i:n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=jl(n,{x:f,y:p},!1,r);if(p<h.top||p>h.bottom||(r<0?g<s:g>s))return m.cursor(g,e.assoc,void 0,o)}}function In(n,e,t){let i=n.state.facet(Nl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,h)=>{t.from>o&&t.from<l&&(t=e.from>t.from?m.cursor(o,1):m.cursor(l,-1),s=!0)});if(!s)return t}}class Lc{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in Z){let i=Z[t];e.contentDOM.addEventListener(t,s=>{!Kr(e,s)||this.ignoreDuringComposition(s)||t=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,s)?s.preventDefault():i(e,s))},xs[t]),this.registeredEvents.push(t)}A.chrome&&A.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,A.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{!Kr(e,l)||this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Re(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Re(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(A.android&&A.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return e.observer.delayAndroidKey(t.key,t.keyCode),!0;let i;return A.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((i=Kl.find(s=>s.keyCode==t.keyCode))&&!t.ctrlKey||Rc.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,ni(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:A.safari&&!A.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229||e.type=="compositionend"&&!A.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const Kl=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Rc="dthko",Ul=[16,17,18,20,91,92,224,225];class Ec{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(I.allowMultipleSelections)&&Ic(e,t),this.dragMove=Nc(e,t),this.dragging=Vc(e,t)&&Us(t)==1?null:!1,this.dragging===!1&&(t.preventDefault(),this.select(t))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this
Line truncated
|
||||
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,As),Df={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Fn=null;function Of(){var n;if(Fn==null&&typeof document<"u"&&document.body){let e=document.body.style;Fn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Fn||!1}const qi=D.define({combine(n){let e=Ct(n,{render:null,specialChars:Mf,addSpecialChars:null});return(e.replaceTabs=!Of())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,As)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,As)),e}});function cg(n={}){return[qi.of(n),Tf()]}let uo=null;function Tf(){return uo||(uo=de.fromClass(class{constructor(n){this.view=n,this.decorations=T.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(qi)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Af({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ie(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,h=yi(o.text,l,i-o.from);return T.replace({widget:new Rf((l-h%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=T.replace({widget:new Lf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(qi);n.startState.facet(qi)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Bf="\u2022";function Pf(n){return n>=32?Bf:n==10?"\u2424":String.fromCharCode(9216+n)}class Lf extends at{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Pf(this.code),i=e.state.phrase("Control character")+" "+(Df[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Rf extends at{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Ef extends at{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function fg(n){return de.fromClass(class{constructor(e){this.view=e,this.placeholder=T.set([T.widget({widget:new Ef(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?T.none:this.placeholder}},{decorations:e=>e.decorations})}const Ms=2e3;function If(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Ms||t.off>Ms||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let h=i;h<=s;h++){let a=n.doc.line(h);a.length<=l&&r.push(m.range(a.from+o,a.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let h=i;h<=s;h++){let a=n.doc.line(h),c=rs(a.text,o,n.tabSize,!0);if(c>-1){let f=rs(a.text,l,n.tabSize);r.push(m.range(a.from+c,a.from+f))}}}return r}function Nf(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function po(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Ms?-1:s==i.length?Nf(n,e.clientX):yi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Vf(n,e){let t=po(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=po(n,s);if(!l)return i;let h=If(n.state,t,l);return h.length?o?m.create(h.concat(i.ranges)):m.create(h):i}}:null}function ug(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?Vf(t,i):null)}const Wn="-10000px";class Ff{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filt
Line truncated
|
||||
`&&(t="");else{let i=t.indexOf(`
|
||||
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Oh(t,e?e.state.tabSize:4,e?kt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Ph(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=F.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Nu,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new F(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new F(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Ph(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const tr=Object.create(null),pi=[pe.none],Nu=new Xs(pi),To=[],Lh=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Lh[n]=Eh(tr,e);class Rh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Lh)}resolve(e){return e?this.table[e]||(this.table[e]=Eh(this.extra,e)):0}}const Vu=new Rh(tr);function Kn(n,e){To.indexOf(n)>-1||(To.push(n),console.warn(e))}function Eh(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||x[r];o?typeof o=="function"?t?t=o(t):Kn(r,`Modifier ${r} used at start of tag`):t?Kn(r,`Tag ${r} used as modifier`):t=o:Kn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=pe.define({id:pi.length,name:i,props:[hu({[i]:t})]});return pi.push(s),s.id}function Fu(n){let e=pe.define({id:pi.length,name:"Document",props:[Ft.add(()=>n)]});return pi.push(e),e}const Wu=n=>{let e=nr(n.state);return e.line?Hu(n):e.block?qu(n):!1};function ir(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const Hu=ir(Ku,0),zu=ir(Ih,0),qu=ir((n,e)=>Ih(n,e,ju(e)),0);function nr(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Xt=50;function $u(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Xt,i),o=n.sliceDoc(s,s+Xt),l=/\s*$/.exec(r)[0].length,h=/^\s*/.exec(o)[0].length,a=r.length-l;if(r.slice(a-e.length,a)==e&&o.slice(h,h+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+h,margin:h&&1}};let c,f;s-i<=2*Xt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Xt),f=n.sliceDoc(s-Xt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function ju(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function Ih(n,e,t=e.selection.ranges){let i=t.map(r=>nr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>$u(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let h=i[o],{open:a,close:c}=l;r.push({from:a.pos-h.open.length,to:a.pos+a.margin},{from:c.pos-c.margin,to:c.pos+h.close.length})}return{changes:r}}return null}function Ku(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,h=1e9;for(let a=r;a<=o;){let c=e.doc.lineAt(a);if(c.from>s&&(r==o||o>c.from)){s=c.from;let f=nr(e,a).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c
Line truncated
|
||||
`:i=="r"?"\r":i=="t"?" ":"\\"),this.wholeWord=!!e.wholeWord}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new hp(this):new op(this)}getCursor(e,t=0,i){let s=e.doc?e:I.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Tt(this,s,t,i):Ot(this,s,t,i)}}class ba{constructor(e){this.spec=e}}function Ot(n,e,t,i){return new qt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?rp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function rp(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),e(an(s,t-r))!=j.Word||e(hn(s,i-r))!=j.Word||e(hn(s,t-r))!=j.Word&&e(an(s,i-r))!=j.Word)}class op extends ba{constructor(e){super(e)}nextMatch(e,t,i){let s=Ot(this.spec,e,i,e.doc.length).nextOverlapping();return s.done&&(s=Ot(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Ot(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=Ot(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Ot(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Tt(n,e,t,i){return new pa(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?lp(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function hn(n,e){return n.slice(fe(n,e,!1),e)}function an(n,e){return n.slice(e,fe(n,e))}function lp(n){return(e,t,i)=>!i[0].length||n(an(i.input,i.index))!=j.Word||n(hn(i.input,i.index+i[0].length))!=j.Word||n(hn(i.input,i.index))!=j.Word&&n(an(i.input,i.index+i[0].length))!=j.Word}class hp extends ba{nextMatch(e,t,i){let s=Tt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Tt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Tt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=Tt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Tt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const gi=R.define(),lr=R.define(),st=me.define({create(n){return new Jn(Vs(n).create(),null)},update(n,e){for(let t of e.effects)t.is(gi)?n=new Jn(t.value.create(),n.panel):t.is(lr)&&(n=new Jn(n.query,t.value?hr:null));return n},provide:n=>Zi.from(n,e=>e.panel)});class Jn{constructor(e,t){this.query=e,this.panel=t}}const ap=T.mark({class:"cm-searchMatch"}),cp=T.mark({class:"cm-searchMatch cm-searchMatch-selected"}),fp=de.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(st))}update(n){let e=n.state.field(st);(e!=n.startState.field(st)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return T.none;let{view:t}=this,i=new bt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:h}=r[s];for(;s<o-1&&h>r[s+1].from-2*250;)h=r[++s].to;n.highlight(t.state,l,h,(a,c)=>{let f=t.state.selection.ranges.some(u=>u.from==a&&u.to==c);i.add(a,c,f?cp:ap)})}return i.finish()}},{decorations:n=>n.decorations});function wi(n){return e=>{let t=e.state.field(st,!1);return t&&t.query.spec.valid?n(e,t):wa(e)}}const cn=wi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:ar(n,i),userEvent:"select.search"}),!0):!1}),fn=wi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:ar(n,s),userEvent:"select.search"}),!0):!1}),up=wi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:m.create(t.map(i=>m.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),dp=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new qt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(m.range(l.value.from,l.value.to))}return e(n.update({selection:m.create(r,o),userEvent:"select
Line truncated
|
||||
Vendored
+2
-2
@@ -24,8 +24,8 @@
|
||||
window.Prism = window.Prism || {};
|
||||
window.Prism.manual = true;
|
||||
</script>
|
||||
<script type="module" crossorigin src="./assets/index.bdac21fd.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index.9a52adce.css">
|
||||
<script type="module" crossorigin src="./assets/index.21c960f7.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index.26987507.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Generated
+314
-287
File diff suppressed because it is too large.
Load diff
@@ -189,7 +189,7 @@
|
||||
submitShortcut,
|
||||
...closeBracketsKeymap,
|
||||
...defaultKeymap,
|
||||
...searchKeymap,
|
||||
searchKeymap.find((item) => item.key === "Mod-d"),
|
||||
...historyKeymap,
|
||||
...completionKeymap,
|
||||
]),
|
||||
|
||||
@@ -270,7 +270,6 @@
|
||||
}
|
||||
|
||||
const skipFields = [
|
||||
"@request.user.profile.id",
|
||||
"@request.user.profile.userId",
|
||||
"@request.user.profile.created",
|
||||
"@request.user.profile.updated",
|
||||
@@ -379,7 +378,7 @@
|
||||
submitShortcut,
|
||||
...closeBracketsKeymap,
|
||||
...defaultKeymap,
|
||||
...searchKeymap,
|
||||
searchKeymap.find((item) => item.key === "Mod-d"),
|
||||
...historyKeymap,
|
||||
...completionKeymap,
|
||||
]),
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<script>
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
|
||||
export let date = "";
|
||||
|
||||
// note: manual trim the ms without converting to DateTime
|
||||
// to help improving the rendering performance in large data sets
|
||||
$: shortDate = date.length > 19 ? date.substring(0, 19) : date;
|
||||
</script>
|
||||
|
||||
{#if date}
|
||||
<span class="txt" use:tooltip={CommonHelper.formatToLocalDate(date) + " Local"}>
|
||||
{CommonHelper.formatToUTCDate(date)} UTC
|
||||
</span>
|
||||
<span class="txt">{shortDate} UTC</span>
|
||||
{:else}
|
||||
<span class="txt txt-hint">N/A</span>
|
||||
{/if}
|
||||
@@ -25,8 +25,9 @@
|
||||
|
||||
let newSelected = [];
|
||||
|
||||
for (let item of items) {
|
||||
if (CommonHelper.inArray(newKeyOfSelected, item[selectionKey])) {
|
||||
for (let v of newKeyOfSelected) {
|
||||
const item = CommonHelper.findByKey(items, selectionKey, v);
|
||||
if (item) {
|
||||
newSelected.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
$: filteredItems = filterItems(items, searchTerm);
|
||||
|
||||
$: isSelected = function (item) {
|
||||
let normalized = CommonHelper.toArray(selected);
|
||||
const normalized = CommonHelper.toArray(selected);
|
||||
|
||||
return CommonHelper.inArray(normalized, item);
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="content m-b-base">
|
||||
<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||||
<p>
|
||||
Events are send for <strong>create</strong>, <strong>update</strong>
|
||||
Events are sent for <strong>create</strong>, <strong>update</strong>
|
||||
and <strong>delete</strong> record operations (see "Event data format" section below).
|
||||
</p>
|
||||
<div class="alert alert-info m-t-10">
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
};
|
||||
}
|
||||
|
||||
// leave the validation to the api
|
||||
// note: leave the validation to the api
|
||||
// $: if (!CommonHelper.isEmpty(options.values) && options.maxSelect > options.values.length) {
|
||||
// options.maxSelect = options.values.length;
|
||||
// }
|
||||
|
||||
@@ -148,6 +148,6 @@
|
||||
<RecordUpsertPanel
|
||||
bind:this={recordPanel}
|
||||
collection={$activeCollection}
|
||||
on:save={() => recordsList?.load()}
|
||||
on:delete={() => recordsList?.load()}
|
||||
on:save={() => recordsList?.reloadLoadedPages()}
|
||||
on:delete={() => recordsList?.reloadLoadedPages()}
|
||||
/>
|
||||
@@ -7,6 +7,12 @@
|
||||
|
||||
export let record;
|
||||
export let field;
|
||||
|
||||
// rough text cut to avoid rendering large chunk of texts
|
||||
function cutText(text) {
|
||||
text = text || "";
|
||||
return text.length > 200 ? text.substring(0, 200) : text;
|
||||
}
|
||||
</script>
|
||||
|
||||
<td class="col-type-{field.type} col-field-{field.name}">
|
||||
@@ -28,30 +34,32 @@
|
||||
{:else if field.type === "date"}
|
||||
<FormattedDate date={record[field.name]} />
|
||||
{:else if field.type === "json"}
|
||||
<span class="txt txt-ellipsis">{JSON.stringify(record[field.name])}</span>
|
||||
<span class="txt txt-ellipsis">
|
||||
{cutText(JSON.stringify(record[field.name]))}
|
||||
</span>
|
||||
{:else if field.type === "select"}
|
||||
<div class="inline-flex">
|
||||
{#each CommonHelper.toArray(record[field.name]) as item}
|
||||
{#each CommonHelper.toArray(record[field.name]) as item, i (i + item)}
|
||||
<span class="label">{item}</span>
|
||||
{/each}
|
||||
</div>
|
||||
{:else if field.type === "relation" || field.type === "user"}
|
||||
<div class="inline-flex">
|
||||
{#each CommonHelper.toArray(record[field.name]) as item}
|
||||
{#each CommonHelper.toArray(record[field.name]) as item, i (i + item)}
|
||||
<IdLabel id={item} />
|
||||
{/each}
|
||||
</div>
|
||||
{:else if field.type === "file"}
|
||||
<div class="inline-flex">
|
||||
{#each CommonHelper.toArray(record[field.name]) as filename}
|
||||
{#each CommonHelper.toArray(record[field.name]) as filename, i (i + filename)}
|
||||
<figure class="thumb thumb-sm">
|
||||
<RecordFilePreview {record} {filename} />
|
||||
</figure>
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<span class="txt txt-ellipsis" title={record[field.name]}>
|
||||
{record[field.name]}
|
||||
<span class="txt txt-ellipsis" title={cutText(record[field.name])}>
|
||||
{cutText(record[field.name])}
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
// original select props
|
||||
export let multiple = false;
|
||||
export let selected = multiple ? [] : undefined;
|
||||
export let selected = [];
|
||||
export let keyOfSelected = multiple ? [] : undefined;
|
||||
export let selectPlaceholder = "- Select -";
|
||||
export let optionComponent = RecordSelectOption; // custom component to use for each dropdown option item
|
||||
@@ -23,15 +23,15 @@
|
||||
let isLoadingSelected = false;
|
||||
|
||||
$: if (collectionId) {
|
||||
loadList(true);
|
||||
loadSelected().then(() => {
|
||||
loadList(true);
|
||||
});
|
||||
}
|
||||
|
||||
$: isLoading = isLoadingList || isLoadingSelected;
|
||||
|
||||
$: canLoadMore = totalItems > list.length;
|
||||
|
||||
loadSelected();
|
||||
|
||||
async function loadSelected() {
|
||||
const selectedIds = CommonHelper.toArray(keyOfSelected);
|
||||
|
||||
@@ -47,14 +47,22 @@
|
||||
filters.push(`id="${id}"`);
|
||||
}
|
||||
|
||||
selected = await ApiClient.records.getFullList(collectionId, 200, {
|
||||
sort: "-created",
|
||||
const result = await ApiClient.records.getFullList(collectionId, 200, {
|
||||
filter: filters.join("||"),
|
||||
$cancelKey: uniqueId + "loadSelected",
|
||||
});
|
||||
|
||||
// preserve selected order
|
||||
selected = [];
|
||||
for (const id of selectedIds) {
|
||||
const item = CommonHelper.findByKey(result, "id", id);
|
||||
if (item) {
|
||||
selected.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
// add the selected models to the list (if not already)
|
||||
list = CommonHelper.filterDuplicatesByKey(list.concat(selected));
|
||||
list = CommonHelper.filterDuplicatesByKey(selected.concat(list));
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
@@ -78,10 +86,12 @@
|
||||
});
|
||||
|
||||
if (reset) {
|
||||
list = [];
|
||||
list = CommonHelper.toArray(selected).slice();
|
||||
}
|
||||
|
||||
list = CommonHelper.filterDuplicatesByKey(list.concat(result.items));
|
||||
list = CommonHelper.filterDuplicatesByKey(
|
||||
list.concat(result.items, CommonHelper.toArray(selected))
|
||||
);
|
||||
currentPage = result.page;
|
||||
totalItems = result.totalItems;
|
||||
} catch (err) {
|
||||
|
||||
@@ -23,8 +23,11 @@
|
||||
let isLoading = true;
|
||||
let isDeleting = false;
|
||||
|
||||
$: if (collection && collection.id && sort !== -1 && filter !== -1) {
|
||||
$: if (collection?.id) {
|
||||
clearList();
|
||||
}
|
||||
|
||||
$: if (collection?.id && sort !== -1 && filter !== -1) {
|
||||
load(1);
|
||||
}
|
||||
|
||||
@@ -36,6 +39,16 @@
|
||||
|
||||
$: areAllRecordsSelected = records.length && totalBulkSelected === records.length;
|
||||
|
||||
export async function reloadLoadedPages() {
|
||||
const loadedPages = currentPage;
|
||||
|
||||
for (let i = 1; i <= loadedPages; i++) {
|
||||
if (i === 1 || canLoadMore) {
|
||||
await load(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function load(page = 1) {
|
||||
if (!collection?.id) {
|
||||
return;
|
||||
@@ -43,16 +56,16 @@
|
||||
|
||||
isLoading = true;
|
||||
|
||||
if (page <= 1) {
|
||||
clearList();
|
||||
}
|
||||
|
||||
return ApiClient.records
|
||||
.getList(collection.id, page, 50, {
|
||||
sort: sort,
|
||||
filter: filter,
|
||||
})
|
||||
.then((result) => {
|
||||
if (page <= 1) {
|
||||
clearList();
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
records = records.concat(result.items);
|
||||
currentPage = result.page;
|
||||
@@ -140,7 +153,7 @@
|
||||
isDeleting = false;
|
||||
|
||||
// always reload because some of the records may not be deletable
|
||||
return load();
|
||||
return reloadLoadedPages();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -150,16 +163,20 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="bulk-select-col min-width">
|
||||
<div class="form-field">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="checkbox_0"
|
||||
disabled={!records.length}
|
||||
checked={areAllRecordsSelected}
|
||||
on:change={() => toggleSelectAllRecords()}
|
||||
/>
|
||||
<label for="checkbox_0" />
|
||||
</div>
|
||||
{#if isLoading}
|
||||
<span class="loader loader-sm" />
|
||||
{:else}
|
||||
<div class="form-field">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="checkbox_0"
|
||||
disabled={!records.length}
|
||||
checked={areAllRecordsSelected}
|
||||
on:change={() => toggleSelectAllRecords()}
|
||||
/>
|
||||
<label for="checkbox_0" />
|
||||
</div>
|
||||
{/if}
|
||||
</th>
|
||||
<SortHeader class="col-type-text col-field-id" name="id" bind:sort>
|
||||
<div class="col-header-content">
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
$: canLoadMore = totalItems > list.length;
|
||||
|
||||
loadList(true);
|
||||
|
||||
loadSelected();
|
||||
loadList(true).then(() => {
|
||||
loadSelected();
|
||||
});
|
||||
|
||||
async function loadSelected() {
|
||||
const selectedIds = CommonHelper.toArray(keyOfSelected);
|
||||
@@ -41,14 +41,22 @@
|
||||
filters.push(`id="${id}"`);
|
||||
}
|
||||
|
||||
selected = await ApiClient.users.getFullList(100, {
|
||||
sort: "-created",
|
||||
const result = await ApiClient.users.getFullList(100, {
|
||||
filter: filters.join("||"),
|
||||
$cancelKey: uniqueId + "loadSelected",
|
||||
});
|
||||
|
||||
// preserve selected order
|
||||
selected = [];
|
||||
for (const id of selectedIds) {
|
||||
const item = CommonHelper.findByKey(result, "id", id);
|
||||
if (item) {
|
||||
selected.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
// add the selected models to the list (if not already)
|
||||
list = CommonHelper.filterDuplicatesByKey(list.concat(selected));
|
||||
list = CommonHelper.filterDuplicatesByKey(selected.concat(list));
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
@@ -68,10 +76,12 @@
|
||||
});
|
||||
|
||||
if (reset) {
|
||||
list = [];
|
||||
list = CommonHelper.toArray(selected).slice();
|
||||
}
|
||||
|
||||
list = CommonHelper.filterDuplicatesByKey(list.concat(result.items));
|
||||
list = CommonHelper.filterDuplicatesByKey(
|
||||
list.concat(result.items, CommonHelper.toArray(selected))
|
||||
);
|
||||
currentPage = result.page;
|
||||
totalItems = result.totalItems;
|
||||
} catch (err) {
|
||||
|
||||
@@ -374,6 +374,10 @@ select,
|
||||
textarea {
|
||||
@extend %input;
|
||||
}
|
||||
input {
|
||||
// Safari and GNOME Web has a default height and ignores the min-height
|
||||
height: var(--inputHeight);
|
||||
}
|
||||
input:-webkit-autofill {
|
||||
-webkit-text-fill-color: var(--txtPrimaryColor);
|
||||
-webkit-box-shadow: inset 0 0 0 50px var(--baseAlt1Color);
|
||||
|
||||
@@ -207,6 +207,7 @@ table {
|
||||
// states
|
||||
&.table-loading {
|
||||
pointer-events: none;
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,6 +219,7 @@ table {
|
||||
margin-left: calc(var(--baseSpacing) * -1);
|
||||
margin-right: calc(var(--baseSpacing) * -1);
|
||||
.bulk-select-col {
|
||||
min-width: 70px;
|
||||
input[type="checkbox"] ~ label {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user