diff --git a/.gitignore b/.gitignore index 3980640a..c6cf6d0d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ __debug_bin /data /custom /.custom +/run.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a1cf63c..41aa00ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,198 @@ # Changelog All notable changes to paopao-ce are documented in this file. -## 0.5.0+dev ([`dev`](https://github.com/rocboss/paopao-ce/tree/dev)) +## 0.6.0+dev ([`dev`](https://github.com/rocboss/paopao-ce/tree/dev)) +TODO; + +## 0.5.0 +### Added +- add `LoggerOpenObserve` feature use OpenObserve to collect log.[#370](https://github.com/rocboss/paopao-ce/pull/370) + add `LoggerOpenObserve` to `conf.yaml` 's `Features` section to enable this feature like below: + ```yaml + # file config.yaml + ... + Features: + Default: ["Base", "Postgres", "Meili", "LocalOSS", "LoggerOpenObserve", "BigCacheIndex", "web"] + LoggerOpenObserve: # 使用OpenObserve写日志 + Host: 127.0.0.1:5080 + Organization: paopao-ce + Stream: default + User: root@paopao.info + Password: tiFEI8UeJWuYA7kN + Secure: False + MinWorker: 5 # 最小后台工作者, 设置范围[5, 100], 默认5 + MaxLogBuffer: 100 # 最大log缓存条数, 设置范围[10, 10000], 默认100 + ... + ``` +- Added friend tweets bar feature support in home page. [#377](https://github.com/rocboss/paopao-ce/pull/377) +- web: add custom `Friendship` feature support. To custom setup `Friendship` use below configure in `web/.env` or `web/.env.local` + ``` + # 功能特性开启 + VITE_USE_FRIENDSHIP=true + + # 模块开启 + VITE_ENABLE_FRIENDS_BAR=true + ``` +- add Newest/Hots/Following tweets support in friend bar feature. + mirgration database first(sql ddl file in `scripts/migration/**/*_home_timeline.up.sql`): + ```sql + CREATE TABLE `p_post_metric` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `post_id` bigint unsigned NOT NULL, + `rank_score` bigint unsigned NOT NULL DEFAULT 0, + `incentive_score` int unsigned NOT NULL DEFAULT 0, + `decay_factor` int unsigned NOT NULL DEFAULT 0, + `motivation_factor` int unsigned NOT NULL DEFAULT 0, + `is_del` tinyint NOT NULL DEFAULT 0, -- 是否删除, 0否, 1是 + `created_on` bigint unsigned NOT NULL DEFAULT '0', + `modified_on` bigint unsigned NOT NULL DEFAULT '0', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_post_metric_post_id_rank_score` (`post_id`,`rank_score`) USING BTREE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + + INSERT INTO p_post_metric (post_id, rank_score, created_on) + SELECT id AS post_id, + comment_count + upvote_count*2 + collection_count*4 AS rank_score, + created_on + FROM p_post + WHERE is_del=0; + + -- 原来的可见性: 0公开 1私密 2好友可见 3关注可见 + -- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 + UPDATE p_post a, p_post b + SET a.visibility = ( + CASE b.visibility + WHEN 0 THEN 90 + WHEN 1 THEN 0 + WHEN 2 THEN 50 + WHEN 3 THEN 60 + ELSE 0 + END + ) + WHERE a.ID = b.ID; + ``` +- add cache support for index/home etc. page. +- add hots comments support for post detail page. +- add highlight comments support for post detail page. + mirgration database first(sql ddl file in `scripts/migration/**/*_comment_esence.up.sql`): + ```sql + ALTER TABLE `p_comment` ADD COLUMN `is_essence` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否精选'; + ``` +- add follow/unfollow user support in index/home/collecion/message/post page. +- add simple prometheus metrics support. + add `Metrics` to `conf.yaml` 's `Features` section to enable this feature like below: + ```yaml + # file config.yaml + ... + Features: + Default: ["Base", "Postgres", "Meili", "LocalOSS", "Metrics", "web"] + JobManager: # Cron Job理器的配置参数 + MaxOnlineInterval: "@every 5m" # 更新最大在线人数,默认每5分钟更新一次 + UpdateMetricsInterval: "@every 5m" # 更新Prometheus指标,默认每5分钟更新一次 + MetricsServer: # Prometheus Metrics服务 + RunMode: debug + HttpIp: 0.0.0.0 + HttpPort: 6080 + ReadTimeout: 60 + WriteTimeout: 60 + ... + ``` +- add full support for tweet hots comment logic and add cache support for tweet comments. + mirgration database first(sql ddl file in `scripts/migration/**/*_rank_metrics.up.sql`): + ```sql + ALTER TABLE `p_comment` ADD COLUMN `reply_count` int unsigned NOT NULL DEFAULT 0 COMMENT '回复数'; + + UPDATE p_comment comment + SET reply_count = ( + SELECT count(*) FROM p_comment_reply reply WHERE reply.comment_id=comment.id AND reply.is_del=0 + ) + WHERE is_del=0; + + CREATE TABLE `p_comment_metric` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `comment_id` bigint unsigned NOT NULL, + `rank_score` bigint unsigned NOT NULL DEFAULT 0, + `incentive_score` int unsigned NOT NULL DEFAULT 0, + `decay_factor` int unsigned NOT NULL DEFAULT 0, + `motivation_factor` int unsigned NOT NULL DEFAULT 0, + `is_del` tinyint NOT NULL DEFAULT 0, + `created_on` bigint unsigned NOT NULL DEFAULT 0, + `modified_on` bigint unsigned NOT NULL DEFAULT 0, + `deleted_on` bigint unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_comment_metric_comment_id_rank_score` (`comment_id`, `rank_score`) USING BTREE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + + INSERT INTO p_comment_metric (comment_id, rank_score, created_on) + SELECT id AS comment_id, + reply_count*2 + thumbs_up_count*4 - thumbs_down_count AS rank_score, + created_on + FROM p_comment + WHERE is_del=0; + + CREATE TABLE `p_user_metric` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `user_id` bigint unsigned NOT NULL, + `tweets_count` int unsigned NOT NULL DEFAULT 0, + `latest_trends_on` bigint unsigned NOT NULL DEFAULT 0 COMMENT '最新动态时间', + `is_del` tinyint NOT NULL DEFAULT 0, + `created_on` bigint unsigned NOT NULL DEFAULT 0, + `modified_on` bigint unsigned NOT NULL DEFAULT 0, + `deleted_on` bigint unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_user_metric_user_id_tweets_count_trends` (`user_id`, `tweets_count`, `latest_trends_on`) USING BTREE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + + INSERT INTO p_user_metric (user_id, tweets_count) + SELECT user_id, count(*) AS tweets_count + FROM p_post + WHERE is_del=0 + GROUP BY user_id; + ``` +- add message filter support for message page. +- add read all unread message and display unread message count support for message page. +- add support follow user embed to index trends enable navigation user tweets by slide bar. + mirgration database first(sql ddl file in `scripts/migration/**/*_user_relation.up.sql`): + ```sql + CREATE VIEW p_user_relation AS + SELECT user_id, friend_id he_uid, 5 AS style + FROM p_contact WHERE status=2 AND is_del=0 + UNION + SELECT user_id, follow_id he_uid, 10 AS style + FROM p_following WHERE is_del=0; + ``` +- add tweets count info in Home/Profile page. +- add custom web frontend features base by a profile that fetch from backend support. + can add custom config to conf.yaml to custom web frontend features: + ```yaml + ... + WebProfile: + UseFriendship: true # 前端是否使用好友体系 + EnableTrendsBar: true # 广场页面是否开启动态条栏功能 + EnableWallet: false # 是否开启钱包功能 + AllowTweetAttachment: true # 是否允许推文附件 + AllowTweetAttachmentPrice: true # 是否允许推文付费附件 + AllowTweetVideo: true # 是否允许视频推文 + AllowUserRegister: true # 是否允许用户注册 + AllowPhoneBind: true # 是否允许手机绑定 + DefaultTweetMaxLength: 2000 # 推文允许输入的最大长度, 默认2000字,值的范围需要查询后端支持的最大字数 + TweetWebEllipsisSize: 400 # Web端推文作为feed显示的最长字数,默认400字 + TweetMobileEllipsisSize: 300 # 移动端推文作为feed显示的最长字数,默认300字 + DefaultTweetVisibility: friend # 推文可见性,默认好友可见 值: public/following/friend/private + DefaultMsgLoopInterval: 5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms + CopyrightTop: "2023 paopao.info" + CopyrightLeft: "Roc's Me" + CopyrightLeftLink: "" + CopyrightRight: "泡泡(PaoPao)开源社区" + CopyrightRightLink: "https://www.paopao.info" + ... + ``` +- add read more contents support for post card in tweets list. + +### Changed +- optimize jwt token generate logic. + ## 0.4.2 ### Fixed - fixed remove multi-objects no effects and occurs resource leak error when use Minio as OSS(Object Storage System).[#371](https://github.com/rocboss/paopao-ce/pull/371) [#372](https://github.com/rocboss/paopao-ce/pull/372) @@ -23,7 +214,7 @@ All notable changes to paopao-ce are documented in this file. ``` - add user highlight tweet support include custom tweet set to highlight and list in user/profile page. - add cli subcommand to start paopao-ce serve or other task. [#354](https://github.com/rocboss/paopao-ce/pull/354) -- add `Friendship` feature . [#355](https://github.com/rocboss/paopao-ce/pull/355) +- add `Followship` feature . [#355](https://github.com/rocboss/paopao-ce/pull/355) migration database first(sql ddl file in `scripts/migration/**/*_user_following.up.sql`): ```sql DROP TABLE IF EXISTS p_following; diff --git a/Makefile b/Makefile index 5a24d90c..1aa96136 100644 --- a/Makefile +++ b/Makefile @@ -18,15 +18,16 @@ RELEASE_DARWIN_AMD64 = $(RELEASE_ROOT)/darwin-amd64/$(PROJECT) RELEASE_DARWIN_ARM64 = $(RELEASE_ROOT)/darwin-arm64/$(PROJECT) RELEASE_WINDOWS_AMD64 = $(RELEASE_ROOT)/windows-amd64/$(PROJECT) -BUILD_VERSION := $(shell git describe --tags --always | cut -f 1 -f 2 -d "-") -BUILD_DATE := $(shell date +'%Y-%m-%d %H:%M:%S') +BUILD_VERSION := $(shell git describe --tags --always) +BUILD_DATE := $(shell date +'%Y-%m-%d %H:%M:%S %Z') SHA_SHORT := $(shell git rev-parse --short HEAD) -TAGS = "" MOD_NAME = github.com/rocboss/paopao-ce LDFLAGS = -X "${MOD_NAME}/pkg/version.version=${BUILD_VERSION}" \ -X "${MOD_NAME}/pkg/version.buildDate=${BUILD_DATE}" \ - -X "${MOD_NAME}/pkg/version.commitID=${SHA_SHORT}" -w -s + -X "${MOD_NAME}/pkg/version.commitID=${SHA_SHORT}" \ + -X "${MOD_NAME}/pkg/version.buildTags=${TAGS}" \ + -w -s all: fmt build diff --git a/README.md b/README.md index 7241c9fd..69a5c860 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Web端: 更多演示请前往[官网](https://www.paopao.info)体验(谢绝灌水) 桌面端: -![](docs/proposal/.assets/000-00.png) +![](docs/proposal/.assets/000-00.jpg)

(back to top)

@@ -288,7 +288,7 @@ make run TAGS='docs' ```sh cp config.yaml.sample config.yaml vim config.yaml # 修改参数 -paopao-ce +paopao serve ``` 配置文件中的 `Features` 小节是声明paopao-ce运行时开启哪些功能项: @@ -364,8 +364,8 @@ release/paopao serve --no-default-features --features sqlite3,localoss,loggerfil |`OSS:TempDir` | 对象存储 | 内测 |基于对象存储系统的对象拷贝/移动特性实现 先创建临时对象再持久化的功能| |`Redis` | 缓存 | 稳定 | Redis缓存功能 | |`SimpleCacheIndex` | 缓存 | Deprecated | 提供简单的 广场推文列表 的缓存功能 | -|`BigCacheIndex` | 缓存 | 稳定(推荐) | 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 | -|`RedisCacheIndex` | 缓存 | 内测(推荐) | 使用Redis缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 | +|`BigCacheIndex` | 缓存 | Deprecated | 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 | +|`RedisCacheIndex` | 缓存 | Deprecated | 使用Redis缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 | |`Zinc` | 搜索 | 稳定(推荐) | 基于[Zinc](https://github.com/zinclabs/zinc)搜索引擎提供推文搜索服务 | |`Meili` | 搜索 | 稳定(推荐) | 基于[Meilisearch](https://github.com/meilisearch/meilisearch)搜索引擎提供推文搜索服务 | |`Bleve` | 搜索 | WIP | 基于[Bleve](https://github.com/blevesearch/bleve)搜索引擎提供推文搜索服务 | @@ -373,6 +373,7 @@ release/paopao serve --no-default-features --features sqlite3,localoss,loggerfil |`LoggerFile` | 日志 | 稳定 | 使用文件写日志 | |`LoggerZinc` | 日志 | 稳定(推荐) | 使用[Zinc](https://github.com/zinclabs/zinc)写日志 | |`LoggerMeili` | 日志 | 内测 | 使用[Meilisearch](https://github.com/meilisearch/meilisearch)写日志 | +|`LoggerOpenObserve` | 日志 | 内测 | 使用[OpenObserve](https://github.com/openobserve/openobserve)写日志 | |[`Friendship`](docs/proposal/22110410-关于Friendship功能项的设计.md) | 关系模式 | 内置 Builtin | 弱关系好友模式,类似微信朋友圈 | |[`Followship`](docs/proposal/22110409-关于Followship功能项的设计.md) | 关系模式 | 内置 Builtin | 关注者模式,类似Twitter的Follow模式 | |[`Lightship`](docs/proposal/22121409-关于Lightship功能项的设计.md) | 关系模式 | 弃用 Deprecated | 开放模式,所有推文都公开可见 | @@ -382,6 +383,8 @@ release/paopao serve --no-default-features --features sqlite3,localoss,loggerfil |[`Pyroscope`](docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md)| 性能优化 | 内测 | 开启Pyroscope功能用于性能调试 | |[`Pprof`](docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md)| 性能优化 | 内测 | 开启Pprof功能收集Profile信息 | |`PhoneBind` | 其他 | 稳定 | 手机绑定功能 | +|`UseAuditHook` | 其他 | 内测 | 使用审核hook功能 | +|`DisableJobManager` | 其他 | 内测 | 禁止使用JobManager功能 | |`Web:DisallowUserRegister` | 功能特性 | 稳定 | 不允许用户注册 | > 功能项状态详情参考 [features-status](features-status.md). @@ -495,6 +498,35 @@ MinIO: # MinIO 存储配置 ... ``` +#### [OpenObserve](https://github.com/openobserve/openobserve) 日志收集、指标度量、轨迹跟踪 +* OpenObserve运行 +```sh +# 使用Docker运行 +mkdir data && docker run -v $PWD/data:/data -e ZO_DATA_DIR="/data" -p 5080:5080 \ + -e ZO_ROOT_USER_EMAIL="root@paopao.info" -e ZO_ROOT_USER_PASSWORD="paopao-ce" \ + public.ecr.aws/zinclabs/openobserve:latest + +# 使用docker compose运行, 需要删除docker-compose.yaml中关于openobserve的注释 +docker compose up -d openobserve +# visit http://loclahost:5080 +``` + +* 修改LoggerOpenObserve配置 +```yaml +# features中加上 LoggerOpenObserve +Features: + Default: ["Meili", "LoggerOpenObserve", "Base", "Sqlite3", "BigCacheIndex"] +... +LoggerOpenObserve: # 使用OpenObserve写日志 + Host: 127.0.0.1:5080 + Organization: paopao-ce + Stream: default + User: root@paopao.info + Password: tiFEI8UeJWuYA7kN + Secure: False +... +``` + #### [Pyroscope](https://github.com/pyroscope-io/pyroscope) 性能剖析 * Pyroscope运行 ```sh @@ -509,7 +541,7 @@ docker compose up -d pyroscope * 修改Pyroscope配置 ```yaml -# features中加上 MinIO +# features中加上 Pyroscope Features: Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "Pyroscope"] ... diff --git a/ROADMAP.md b/ROADMAP.md index 564278ed..b45e21df 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -56,7 +56,7 @@ ## paopao-ce-plus roadmap #### paopao-ce-plus/v0.5.0 -* [ ] adapt for paopao-ce v0.4.0 +* [x] adapt for paopao-ce v0.5.0 #### paopao-ce-plus/v0.4.0 * [x] adapt for paopao-ce v0.4.0 diff --git a/auto/api/v1/admin.go b/auto/api/v1/admin.go index ad4ac308..2ea0ed96 100644 --- a/auto/api/v1/admin.go +++ b/auto/api/v1/admin.go @@ -31,6 +31,7 @@ type Admin interface { // Chain provide handlers chain for gin Chain() gin.HandlersChain + SiteInfo(*web.SiteInfoReq) (*web.SiteInfoResp, mir.Error) ChangeUserStatus(*web.ChangeUserStatusReq) mir.Error mustEmbedUnimplementedAdminServant() @@ -44,6 +45,20 @@ func RegisterAdminServant(e *gin.Engine, s Admin) { router.Use(middlewares...) // register routes info to router + router.Handle("GET", "/admin/site/status", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.SiteInfoReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.SiteInfo(req) + s.Render(c, resp, err) + }) router.Handle("POST", "/admin/user/status", func(c *gin.Context) { select { case <-c.Request.Context().Done(): @@ -66,6 +81,10 @@ func (UnimplementedAdminServant) Chain() gin.HandlersChain { return nil } +func (UnimplementedAdminServant) SiteInfo(req *web.SiteInfoReq) (*web.SiteInfoResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + func (UnimplementedAdminServant) ChangeUserStatus(req *web.ChangeUserStatusReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } diff --git a/auto/api/v1/core.go b/auto/api/v1/core.go index 159e938f..1eee2f63 100644 --- a/auto/api/v1/core.go +++ b/auto/api/v1/core.go @@ -29,9 +29,9 @@ type Core interface { GetStars(*web.GetStarsReq) (*web.GetStarsResp, mir.Error) GetCollections(*web.GetCollectionsReq) (*web.GetCollectionsResp, mir.Error) SendUserWhisper(*web.SendWhisperReq) mir.Error + ReadAllMessage(*web.ReadAllMessageReq) mir.Error ReadMessage(*web.ReadMessageReq) mir.Error GetMessages(*web.GetMessagesReq) (*web.GetMessagesResp, mir.Error) - GetUnreadMsgCount(*web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error) GetUserInfo(*web.UserInfoReq) (*web.UserInfoResp, mir.Error) SyncSearchIndex(*web.SyncSearchIndexReq) mir.Error @@ -201,47 +201,50 @@ func RegisterCoreServant(e *gin.Engine, s Core) { } s.Render(c, nil, s.SendUserWhisper(req)) }) - router.Handle("POST", "/user/message/read", func(c *gin.Context) { + router.Handle("POST", "/user/message/readall", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - req := new(web.ReadMessageReq) + req := new(web.ReadAllMessageReq) if err := s.Bind(c, req); err != nil { s.Render(c, nil, err) return } - s.Render(c, nil, s.ReadMessage(req)) + s.Render(c, nil, s.ReadAllMessage(req)) }) - router.Handle("GET", "/user/messages", func(c *gin.Context) { + router.Handle("POST", "/user/message/read", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - req := new(web.GetMessagesReq) - var bv _binding_ = req - if err := bv.Bind(c); err != nil { + req := new(web.ReadMessageReq) + if err := s.Bind(c, req); err != nil { s.Render(c, nil, err) return } - resp, err := s.GetMessages(req) - s.Render(c, resp, err) + s.Render(c, nil, s.ReadMessage(req)) }) - router.Handle("GET", "/user/msgcount/unread", func(c *gin.Context) { + router.Handle("GET", "/user/messages", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - req := new(web.GetUnreadMsgCountReq) + req := new(web.GetMessagesReq) if err := s.Bind(c, req); err != nil { s.Render(c, nil, err) return } - resp, err := s.GetUnreadMsgCount(req) - s.Render(c, resp, err) + resp, err := s.GetMessages(req) + if err != nil { + s.Render(c, nil, err) + return + } + var rv _render_ = resp + rv.Render(c) }) router.Handle("GET", "/user/info", func(c *gin.Context) { select { @@ -324,15 +327,15 @@ func (UnimplementedCoreServant) SendUserWhisper(req *web.SendWhisperReq) mir.Err return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } -func (UnimplementedCoreServant) ReadMessage(req *web.ReadMessageReq) mir.Error { +func (UnimplementedCoreServant) ReadAllMessage(req *web.ReadAllMessageReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } -func (UnimplementedCoreServant) GetMessages(req *web.GetMessagesReq) (*web.GetMessagesResp, mir.Error) { - return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +func (UnimplementedCoreServant) ReadMessage(req *web.ReadMessageReq) mir.Error { + return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } -func (UnimplementedCoreServant) GetUnreadMsgCount(req *web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error) { +func (UnimplementedCoreServant) GetMessages(req *web.GetMessagesReq) (*web.GetMessagesResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } diff --git a/auto/api/v1/loose.go b/auto/api/v1/loose.go index 4c9f9c6f..536c3d1d 100644 --- a/auto/api/v1/loose.go +++ b/auto/api/v1/loose.go @@ -18,6 +18,7 @@ type Loose interface { // Chain provide handlers chain for gin Chain() gin.HandlersChain + TweetDetail(*web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) TweetComments(*web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) TopicList(*web.TopicListReq) (*web.TopicListResp, mir.Error) GetUserProfile(*web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) @@ -35,6 +36,20 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { router.Use(middlewares...) // register routes info to router + router.Handle("GET", "/post", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.TweetDetailReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.TweetDetail(req) + s.Render(c, resp, err) + }) router.Handle("GET", "/post/comments", func(c *gin.Context) { select { case <-c.Request.Context().Done(): @@ -47,7 +62,12 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { return } resp, err := s.TweetComments(req) - s.Render(c, resp, err) + if err != nil { + s.Render(c, nil, err) + return + } + var rv _render_ = resp + rv.Render(c) }) router.Handle("GET", "/tags", func(c *gin.Context) { select { @@ -89,7 +109,12 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { return } resp, err := s.GetUserTweets(req) - s.Render(c, resp, err) + if err != nil { + s.Render(c, nil, err) + return + } + var rv _render_ = resp + rv.Render(c) }) router.Handle("GET", "/posts", func(c *gin.Context) { select { @@ -104,7 +129,12 @@ func RegisterLooseServant(e *gin.Engine, s Loose) { return } resp, err := s.Timeline(req) - s.Render(c, resp, err) + if err != nil { + s.Render(c, nil, err) + return + } + var rv _render_ = resp + rv.Render(c) }) } @@ -115,6 +145,10 @@ func (UnimplementedLooseServant) Chain() gin.HandlersChain { return nil } +func (UnimplementedLooseServant) TweetDetail(req *web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + func (UnimplementedLooseServant) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } diff --git a/auto/api/v1/priv.go b/auto/api/v1/priv.go index f4adccfc..063f00af 100644 --- a/auto/api/v1/priv.go +++ b/auto/api/v1/priv.go @@ -27,6 +27,7 @@ type Priv interface { ThumbsUpTweetComment(*web.TweetCommentThumbsReq) mir.Error DeleteCommentReply(*web.DeleteCommentReplyReq) mir.Error CreateCommentReply(*web.CreateCommentReplyReq) (*web.CreateCommentReplyResp, mir.Error) + HighlightComment(*web.HighlightCommentReq) (*web.HighlightCommentResp, mir.Error) DeleteComment(*web.DeleteCommentReq) mir.Error CreateComment(*web.CreateCommentReq) (*web.CreateCommentResp, mir.Error) VisibleTweet(*web.VisibleTweetReq) (*web.VisibleTweetResp, mir.Error) @@ -44,8 +45,20 @@ type Priv interface { mustEmbedUnimplementedPrivServant() } +type PrivChain interface { + ChainCreateTweet() gin.HandlersChain + + mustEmbedUnimplementedPrivChain() +} + // RegisterPrivServant register Priv servant to gin -func RegisterPrivServant(e *gin.Engine, s Priv) { +func RegisterPrivServant(e *gin.Engine, s Priv, m ...PrivChain) { + var cc PrivChain + if len(m) > 0 { + cc = m[0] + } else { + cc = &UnimplementedPrivChain{} + } router := e.Group("v1") // use chain for router middlewares := s.Chain() @@ -172,6 +185,20 @@ func RegisterPrivServant(e *gin.Engine, s Priv) { resp, err := s.CreateCommentReply(req) s.Render(c, resp, err) }) + router.Handle("POST", "/post/comment/highlight", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.HighlightCommentReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.HighlightComment(req) + s.Render(c, resp, err) + }) router.Handle("DELETE", "/post/comment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): @@ -297,7 +324,7 @@ func RegisterPrivServant(e *gin.Engine, s Priv) { } s.Render(c, nil, s.DeleteTweet(req)) }) - router.Handle("POST", "/post", func(c *gin.Context) { + router.Handle("POST", "/post", append(cc.ChainCreateTweet(), func(c *gin.Context) { select { case <-c.Request.Context().Done(): return @@ -310,8 +337,13 @@ func RegisterPrivServant(e *gin.Engine, s Priv) { return } resp, err := s.CreateTweet(req) - s.Render(c, resp, err) - }) + if err != nil { + s.Render(c, nil, err) + return + } + var rv _render_ = resp + rv.Render(c) + })...) router.Handle("GET", "/attachment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): @@ -402,6 +434,10 @@ func (UnimplementedPrivServant) CreateCommentReply(req *web.CreateCommentReplyRe return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } +func (UnimplementedPrivServant) HighlightComment(req *web.HighlightCommentReq) (*web.HighlightCommentResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + func (UnimplementedPrivServant) DeleteComment(req *web.DeleteCommentReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } @@ -455,3 +491,12 @@ func (UnimplementedPrivServant) UploadAttachment(req *web.UploadAttachmentReq) ( } func (UnimplementedPrivServant) mustEmbedUnimplementedPrivServant() {} + +// UnimplementedPrivChain can be embedded to have forward compatible implementations. +type UnimplementedPrivChain struct{} + +func (b *UnimplementedPrivChain) ChainCreateTweet() gin.HandlersChain { + return nil +} + +func (b *UnimplementedPrivChain) mustEmbedUnimplementedPrivChain() {} diff --git a/auto/api/v1/pub.go b/auto/api/v1/pub.go index 850a7906..2a68a600 100644 --- a/auto/api/v1/pub.go +++ b/auto/api/v1/pub.go @@ -15,7 +15,6 @@ import ( type Pub interface { _default_ - TweetDetail(*web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) SendCaptcha(*web.SendCaptchaReq) mir.Error GetCaptcha() (*web.GetCaptchaResp, mir.Error) Register(*web.RegisterReq) (*web.RegisterResp, mir.Error) @@ -30,20 +29,6 @@ func RegisterPubServant(e *gin.Engine, s Pub) { router := e.Group("v1") // register routes info to router - router.Handle("GET", "/post", func(c *gin.Context) { - select { - case <-c.Request.Context().Done(): - return - default: - } - req := new(web.TweetDetailReq) - if err := s.Bind(c, req); err != nil { - s.Render(c, nil, err) - return - } - resp, err := s.TweetDetail(req) - s.Render(c, resp, err) - }) router.Handle("POST", "/captcha", func(c *gin.Context) { select { case <-c.Request.Context().Done(): @@ -110,10 +95,6 @@ func RegisterPubServant(e *gin.Engine, s Pub) { // UnimplementedPubServant can be embedded to have forward compatible implementations. type UnimplementedPubServant struct{} -func (UnimplementedPubServant) TweetDetail(req *web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) { - return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) -} - func (UnimplementedPubServant) SendCaptcha(req *web.SendCaptchaReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } diff --git a/auto/api/v1/relax.go b/auto/api/v1/relax.go new file mode 100644 index 00000000..2cd41803 --- /dev/null +++ b/auto/api/v1/relax.go @@ -0,0 +1,87 @@ +// Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 + +package v1 + +import ( + "net/http" + + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +type Relax interface { + _default_ + + // Chain provide handlers chain for gin + Chain() gin.HandlersChain + + GetUnreadMsgCount(*web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error) + + mustEmbedUnimplementedRelaxServant() +} + +type RelaxChain interface { + ChainGetUnreadMsgCount() gin.HandlersChain + + mustEmbedUnimplementedRelaxChain() +} + +// RegisterRelaxServant register Relax servant to gin +func RegisterRelaxServant(e *gin.Engine, s Relax, m ...RelaxChain) { + var cc RelaxChain + if len(m) > 0 { + cc = m[0] + } else { + cc = &UnimplementedRelaxChain{} + } + router := e.Group("v1") + // use chain for router + middlewares := s.Chain() + router.Use(middlewares...) + + // register routes info to router + router.Handle("GET", "/user/msgcount/unread", append(cc.ChainGetUnreadMsgCount(), func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.GetUnreadMsgCountReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.GetUnreadMsgCount(req) + if err != nil { + s.Render(c, nil, err) + return + } + var rv _render_ = resp + rv.Render(c) + })...) +} + +// UnimplementedRelaxServant can be embedded to have forward compatible implementations. +type UnimplementedRelaxServant struct{} + +func (UnimplementedRelaxServant) Chain() gin.HandlersChain { + return nil +} + +func (UnimplementedRelaxServant) GetUnreadMsgCount(req *web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedRelaxServant) mustEmbedUnimplementedRelaxServant() {} + +// UnimplementedRelaxChain can be embedded to have forward compatible implementations. +type UnimplementedRelaxChain struct{} + +func (b *UnimplementedRelaxChain) ChainGetUnreadMsgCount() gin.HandlersChain { + return nil +} + +func (b *UnimplementedRelaxChain) mustEmbedUnimplementedRelaxChain() {} diff --git a/auto/api/v1/site.go b/auto/api/v1/site.go new file mode 100644 index 00000000..7f4f16cf --- /dev/null +++ b/auto/api/v1/site.go @@ -0,0 +1,63 @@ +// Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 + +package v1 + +import ( + "net/http" + + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +type Site interface { + _default_ + + Profile() (*conf.WebProfileConf, mir.Error) + Version() (*web.VersionResp, mir.Error) + + mustEmbedUnimplementedSiteServant() +} + +// RegisterSiteServant register Site servant to gin +func RegisterSiteServant(e *gin.Engine, s Site) { + router := e.Group("v1") + + // register routes info to router + router.Handle("GET", "/site/profile", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + + resp, err := s.Profile() + s.Render(c, resp, err) + }) + router.Handle("GET", "/site/version", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + + resp, err := s.Version() + s.Render(c, resp, err) + }) +} + +// UnimplementedSiteServant can be embedded to have forward compatible implementations. +type UnimplementedSiteServant struct{} + +func (UnimplementedSiteServant) Profile() (*conf.WebProfileConf, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedSiteServant) Version() (*web.VersionResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedSiteServant) mustEmbedUnimplementedSiteServant() {} diff --git a/auto/api/v1/trends.go b/auto/api/v1/trends.go new file mode 100644 index 00000000..9576ca84 --- /dev/null +++ b/auto/api/v1/trends.go @@ -0,0 +1,66 @@ +// Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 + +package v1 + +import ( + "net/http" + + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +type Trends interface { + _default_ + + // Chain provide handlers chain for gin + Chain() gin.HandlersChain + + GetIndexTrends(*web.GetIndexTrendsReq) (*web.GetIndexTrendsResp, mir.Error) + + mustEmbedUnimplementedTrendsServant() +} + +// RegisterTrendsServant register Trends servant to gin +func RegisterTrendsServant(e *gin.Engine, s Trends) { + router := e.Group("v1") + // use chain for router + middlewares := s.Chain() + router.Use(middlewares...) + + // register routes info to router + router.Handle("GET", "/trends/index", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.GetIndexTrendsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.GetIndexTrends(req) + if err != nil { + s.Render(c, nil, err) + return + } + var rv _render_ = resp + rv.Render(c) + }) +} + +// UnimplementedTrendsServant can be embedded to have forward compatible implementations. +type UnimplementedTrendsServant struct{} + +func (UnimplementedTrendsServant) Chain() gin.HandlersChain { + return nil +} + +func (UnimplementedTrendsServant) GetIndexTrends(req *web.GetIndexTrendsReq) (*web.GetIndexTrendsResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedTrendsServant) mustEmbedUnimplementedTrendsServant() {} diff --git a/build-image.sh b/build-image.sh index dba722d3..f30affde 100755 --- a/build-image.sh +++ b/build-image.sh @@ -2,7 +2,7 @@ # eg.1 : sh build-image.sh # eg.2, set image: sh build-image.sh bitbus/paopao-ce -VERSION=`git describe --tags --always | cut -f1 -f2 -d "-"` # eg.: 0.2.5 +VERSION=`git describe --tags --always | cut -f1,2 -d "-"` # eg.: 0.2.5 IMAGE="bitbus/paopao-ce" if [ -n "$1" ]; then diff --git a/cmd/serve/serve.go b/cmd/serve/serve.go index 5ffd7070..b7dcbff1 100644 --- a/cmd/serve/serve.go +++ b/cmd/serve/serve.go @@ -12,7 +12,7 @@ import ( "syscall" "time" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/fatih/color" "github.com/getsentry/sentry-go" "github.com/rocboss/paopao-ce/cmd" diff --git a/config.yaml.sample b/config.yaml.sample index 33f9b73d..635a9811 100644 --- a/config.yaml.sample +++ b/config.yaml.sample @@ -183,4 +183,23 @@ Sqlite3: # Sqlite3数据库 Redis: InitAddress: - redis:6379 +WebProfile: + UseFriendship: true # 前端是否使用好友体系 + EnableTrendsBar: true # 广场页面是否开启动态条栏功能 + EnableWallet: false # 是否开启钱包功能 + AllowTweetAttachment: true # 是否允许推文附件 + AllowTweetAttachmentPrice: true # 是否允许推文付费附件 + AllowTweetVideo: true # 是否允许视频推文 + AllowUserRegister: true # 是否允许用户注册 + AllowPhoneBind: true # 是否允许手机绑定 + DefaultTweetMaxLength: 2000 # 推文允许输入的最大长度, 默认2000字,值的范围需要查询后端支持的最大字数 + TweetWebEllipsisSize: 400 # Web端推文作为feed显示的最长字数,默认400字 + TweetMobileEllipsisSize: 300 # 移动端推文作为feed显示的最长字数,默认300字 + DefaultTweetVisibility: friend # 推文可见性,默认好友可见 值: public/following/friend/private + DefaultMsgLoopInterval: 5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms + CopyrightTop: "2023 paopao.info" + CopyrightLeft: "Roc's Me" + CopyrightLeftLink: "" + CopyrightRight: "泡泡(PaoPao)开源社区" + CopyrightRightLink: "https://www.paopao.info" \ No newline at end of file diff --git a/default.pgo b/default.pgo index 38d83f51..ff77ea14 100644 Binary files a/default.pgo and b/default.pgo differ diff --git a/docker-compose.yaml b/docker-compose.yaml index f562109d..3536580f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -78,6 +78,28 @@ services: networks: - paopao-network + # meilisearch-ui: + # image: riccoxie/meilisearch-ui:latest + # restart: always + # ports: + # - 24900:24900 + # networks: + # - paopao-network + + # openobserve: + # image: public.ecr.aws/zinclabs/openobserve:latest + # restart: always + # ports: + # - 5080:5080 + # volumes: + # - ./custom/data/openobserve/data:/data + # environment: + # ZO_DATA_DIR: /data + # ZO_ROOT_USER_EMAIL: root@paopao.info + # ZO_ROOT_USER_PASSWORD: paopao-ce + # networks: + # - paopao-network + # pyroscope: # image: pyroscope/pyroscope:latest # restart: always @@ -88,21 +110,21 @@ services: # networks: # - paopao-network - phpmyadmin: - image: phpmyadmin:5.2 - depends_on: - - db - ports: - - 8080:80 - environment: - - PMA_HOST=db - - PMA_USER=paopao - - PMA_PASSWORD=paopao - networks: - - paopao-network + # phpmyadmin: + # image: phpmyadmin:5.2 + # depends_on: + # - db + # ports: + # - 8080:80 + # environment: + # - PMA_HOST=db + # - PMA_USER=paopao + # - PMA_PASSWORD=paopao + # networks: + # - paopao-network backend: - image: bitbus/paopao-ce:0.4 + image: bitbus/paopao-ce:0.5 restart: always depends_on: - db diff --git a/docs/proposal/.assets/000-00.jpg b/docs/proposal/.assets/000-00.jpg new file mode 100644 index 00000000..21ab3b16 Binary files /dev/null and b/docs/proposal/.assets/000-00.jpg differ diff --git a/features-status.md b/features-status.md index e630c77d..b2781944 100644 --- a/features-status.md +++ b/features-status.md @@ -101,11 +101,11 @@ * [ ] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现 -* `BigCacheIndex` 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面(推荐使用); +* `BigCacheIndex` 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面(目前状态: Deprecated); * [ ] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现 -* `RedisCacheIndex` 使用Redis缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面(目前状态: 推荐使用); +* `RedisCacheIndex` 使用Redis缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面(目前状态: Deprecated); * [ ] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现 @@ -137,6 +137,10 @@ * [ ] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现 +* `LoggerOpenObserve` 使用[OpenObserve](https://github.com/openobserve/openobserve)写日志(目前状态: 内测阶段); + * [ ] 提按文档 + * [x] 接口定义 + * [x] 业务逻辑实现 #### 监控: * `Sentry` 使用Sentry进行错误跟踪与性能监控(目前状态: 内测); @@ -192,7 +196,17 @@ * `PhoneBind` 手机绑定功能; * [ ] 提按文档 * [x] 接口定义 - * [x] 业务逻辑实现 + * [x] 业务逻辑实现 + +* `UseAuditHook` 使用审核hook功能 (目前状态: 内测 待完善后将转为Builtin) + * [ ] 提按文档 + * [x] 接口定义 + * [x] 业务逻辑实现 + +* `DisableJobManager` 禁止使用JobManager功能 (目前状态: 内测 待完善后将转为Builtin) + * [ ] 提按文档 + * [x] 接口定义 + * [x] 业务逻辑实现 ### 功能特性: * `Web:DisallowUserRegister` 不允许用户注册; diff --git a/go.mod b/go.mod index 8b9f0783..694c4964 100644 --- a/go.mod +++ b/go.mod @@ -4,41 +4,44 @@ go 1.20 require ( github.com/Masterminds/semver/v3 v3.2.1 + github.com/RoaringBitmap/roaring v1.5.0 github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 - github.com/alimy/cfg v0.4.0 github.com/alimy/mir/v4 v4.0.0 - github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible + github.com/alimy/tryst v0.8.3 + github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible github.com/allegro/bigcache/v3 v3.1.0 github.com/bufbuild/connect-go v1.10.0 - github.com/bytedance/sonic v1.10.0 - github.com/cockroachdb/errors v1.10.0 + github.com/bytedance/sonic v1.10.1 + github.com/cockroachdb/errors v1.11.1 github.com/disintegration/imaging v1.6.2 github.com/fatih/color v1.15.0 - github.com/getsentry/sentry-go v0.23.0 + github.com/getsentry/sentry-go v0.24.1 github.com/gin-contrib/cors v1.4.0 github.com/gin-gonic/gin v1.9.1 - github.com/go-resty/resty/v2 v2.7.0 + github.com/go-resty/resty/v2 v2.9.1 github.com/goccy/go-json v0.10.2 github.com/gofrs/uuid/v5 v5.0.0 - github.com/golang-jwt/jwt/v4 v4.5.0 + github.com/golang-jwt/jwt/v5 v5.0.0 github.com/golang-migrate/migrate/v4 v4.15.2 - github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible + github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.9+incompatible github.com/json-iterator/go v1.1.12 - github.com/meilisearch/meilisearch-go v0.25.0 - github.com/minio/minio-go/v7 v7.0.62 - github.com/onsi/ginkgo/v2 v2.11.0 - github.com/onsi/gomega v1.27.10 + github.com/meilisearch/meilisearch-go v0.25.1 + github.com/minio/minio-go/v7 v7.0.63 + github.com/onsi/ginkgo/v2 v2.12.1 + github.com/onsi/gomega v1.28.0 + github.com/prometheus/client_golang v1.16.0 github.com/pyroscope-io/client v0.7.2 - github.com/redis/rueidis v1.0.15 + github.com/redis/rueidis v1.0.19 + github.com/robfig/cron/v3 v3.0.1 github.com/sirupsen/logrus v1.9.3 - github.com/smartwalle/alipay/v3 v3.2.15 + github.com/smartwalle/alipay/v3 v3.2.16 github.com/sourcegraph/conc v0.3.0 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 - github.com/tencentyun/cos-go-sdk-v5 v0.7.42 + github.com/tencentyun/cos-go-sdk-v5 v0.7.43 github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc go.uber.org/automaxprocs v1.5.3 - google.golang.org/grpc v1.57.0 + google.golang.org/grpc v1.58.2 google.golang.org/protobuf v1.31.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/resty.v1 v1.12.0 @@ -48,11 +51,14 @@ require ( gorm.io/gorm v1.25.4 gorm.io/plugin/dbresolver v1.4.7 gorm.io/plugin/soft_delete v1.2.1 - modernc.org/sqlite v1.25.0 + modernc.org/sqlite v1.26.0 ) require ( github.com/andybalholm/brotli v1.0.5 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bits-and-blooms/bitset v1.2.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect github.com/chenzhuoyu/iasm v0.9.0 // indirect github.com/clbanning/mxj v1.8.4 // indirect @@ -69,6 +75,7 @@ require ( github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -77,6 +84,7 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.6 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect @@ -97,20 +105,25 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-sqlite3 v1.14.17 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mozillazg/go-httpheader v0.2.1 // indirect + github.com/mschoch/smat v0.2.0 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect github.com/pyroscope-io/godeltaprof v0.1.2 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/rs/xid v1.5.0 // indirect - github.com/smartwalle/ncrypto v1.0.2 // indirect - github.com/smartwalle/ngx v1.0.6 // indirect + github.com/smartwalle/ncrypto v1.0.3 // indirect + github.com/smartwalle/ngx v1.0.7 // indirect github.com/smartwalle/nsign v1.0.8 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.5.1 // indirect @@ -123,15 +136,15 @@ require ( github.com/valyala/fasthttp v1.40.0 // indirect go.uber.org/atomic v1.9.0 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.12.0 // indirect + golang.org/x/crypto v0.13.0 // indirect golang.org/x/image v0.0.0-20210216034530-4410531fe030 // indirect - golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.14.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.9.3 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect + golang.org/x/tools v0.12.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/uint128 v1.2.0 // indirect diff --git a/go.sum b/go.sum index 8252693e..0fc6b105 100644 --- a/go.sum +++ b/go.sum @@ -112,6 +112,8 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/RoaringBitmap/roaring v1.5.0 h1:V0VCSiHjroItEYCM3guC8T83ehi5QMt3oM9EefTTOms= +github.com/RoaringBitmap/roaring v1.5.0/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 h1:uFrPOl1VBt/Abfl2z+A/DFc+AwmFLxEHR1+Yq6cXvww= github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868/go.mod h1:srphKZ1i+yGXxl/LpBS7ZIECTjCTPzZzAMtJWoG3sLo= @@ -123,12 +125,12 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= -github.com/alimy/cfg v0.4.0 h1:SslKPndmxRViT1ePWLmNsEq7okYP0GVeuowQlRWZPkw= -github.com/alimy/cfg v0.4.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c= github.com/alimy/mir/v4 v4.0.0 h1:MzGfmoLjjvR69jbZEmpKJO3tUuqB0RGRv1UWPbtukBg= github.com/alimy/mir/v4 v4.0.0/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc= -github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible h1:6JF1bjhT0WN2srEmijfOFtVWwV91KZ6dJY1/JbdtGrI= -github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= +github.com/alimy/tryst v0.8.3 h1:k54a9YesCGUTqfyDp9NL55TI8CxIj8HNJZyzbIoNab8= +github.com/alimy/tryst v0.8.3/go.mod h1:ua2eJbFrisHPh7z93Bgc0jNBE8Khu1SCx2p/6t3OzZI= +github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible h1:Sg/2xHwDrioHpxTN6WMiwbXTpUEinBpHsN7mG21Rc2k= +github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk= github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= @@ -174,10 +176,12 @@ github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiU github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= @@ -195,8 +199,8 @@ github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0Bsq github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.10.0 h1:qtNZduETEIWJVIyDl01BeNxur2rW9OwTQ/yBqFRkKEk= -github.com/bytedance/sonic v1.10.0/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc= +github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -206,6 +210,8 @@ github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6 github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= @@ -243,8 +249,8 @@ github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3K github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= -github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= @@ -456,8 +462,8 @@ github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.24.1 h1:W6/0GyTy8J6ge6lVCc94WB6Gx2ZuLrgopnn9w8Hiwuk= +github.com/getsentry/sentry-go v0.24.1/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g= @@ -518,8 +524,8 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/go-resty/resty/v2 v2.9.1 h1:PIgGx4VrHvag0juCJ4dDv3MiFRlDmP0vicBucwf+gLM= +github.com/go-resty/resty/v2 v2.9.1/go.mod h1:4/GYJVjh9nhkhGR6AUNW3XhpDYNUr+Uvy9gV/VGZIy4= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -581,6 +587,8 @@ github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-migrate/migrate/v4 v4.15.2 h1:vU+M05vs6jWHKDdmE1Ecwj0BznygFc4QsdRe2E/L7kc= github.com/golang-migrate/migrate/v4 v4.15.2/go.mod h1:f2toGLkYqD3JH+Todi4aZ2ZdbeUNx4sIwiOK96rE9Lw= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= @@ -727,6 +735,8 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru/v2 v2.0.6 h1:3xi/Cafd1NaoEnS/yDssIiuVeDVywU0QdFGl3aQaQHM= +github.com/hashicorp/golang-lru/v2 v2.0.6/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -734,8 +744,8 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible h1:XRAk4HBDLCYEdPLWtKf5iZhOi7lfx17aY0oSO9+mcg8= -github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= +github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.9+incompatible h1:zUhCrGMMpJxZGAB30GbQzluDhQuPENxRQfxss7KlpKU= +github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.9+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -932,15 +942,17 @@ github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6 github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/meilisearch/meilisearch-go v0.25.0 h1:xIp+8YWterHuDvpdYlwQ4Qp7im3JlRHmSKiP0NvjyXs= -github.com/meilisearch/meilisearch-go v0.25.0/go.mod h1:SxuSqDcPBIykjWz1PX+KzsYzArNLSCadQodWs8extS0= +github.com/meilisearch/meilisearch-go v0.25.1 h1:D5wY22sn5kkpRH3uYMGlwltdUEq5regIFmO7awHz3Vo= +github.com/meilisearch/meilisearch-go v0.25.1/go.mod h1:SxuSqDcPBIykjWz1PX+KzsYzArNLSCadQodWs8extS0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.62 h1:qNYsFZHEzl+NfH8UxW4jpmlKav1qUAgfY30YNRneVhc= -github.com/minio/minio-go/v7 v7.0.62/go.mod h1:Q6X7Qjb7WMhvG65qKf4gUgA5XaiSox74kR1uAEjxRS4= +github.com/minio/minio-go/v7 v7.0.63 h1:GbZ2oCvaUdgT5640WJOpyDhhDxvknAJU2/T3yurwcbQ= +github.com/minio/minio-go/v7 v7.0.63/go.mod h1:Q6X7Qjb7WMhvG65qKf4gUgA5XaiSox74kR1uAEjxRS4= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= @@ -982,6 +994,8 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= +github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= +github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mutecomm/go-sqlcipher/v4 v4.4.0/go.mod h1:PyN04SaWalavxRGH9E8ZftG6Ju7rsPrGmQRjrEaVpiY= @@ -1008,8 +1022,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= +github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA= +github.com/onsi/ginkgo/v2 v2.12.1/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1019,8 +1033,8 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= +github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1087,11 +1101,15 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1100,6 +1118,8 @@ github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1112,17 +1132,21 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pyroscope-io/client v0.7.2 h1:OX2qdUQsS8RSkn/3C8isD7f/P0YiZQlRbAlecAaj/R8= github.com/pyroscope-io/client v0.7.2/go.mod h1:FEocnjn+Ngzxy6EtU9ZxXWRvQ0+pffkrBxHLnPpxwi8= github.com/pyroscope-io/godeltaprof v0.1.2 h1:MdlEmYELd5w+lvIzmZvXGNMVzW2Qc9jDMuJaPOR75g4= github.com/pyroscope-io/godeltaprof v0.1.2/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE= -github.com/redis/rueidis v1.0.15 h1:KjTaoP4ab6lpxyCwgIEZ3/rqvKfKnbICe83tVaaItxQ= -github.com/redis/rueidis v1.0.15/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo= +github.com/redis/rueidis v1.0.19 h1:s65oWtotzlIFN8eMPhyYwxlwLR1lUdhza2KtWprKYSo= +github.com/redis/rueidis v1.0.19/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1164,12 +1188,12 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartwalle/alipay/v3 v3.2.15 h1:3fvFJnINKKAOXHR/Iv20k1Z7KJ+nOh3oK214lELPqG8= -github.com/smartwalle/alipay/v3 v3.2.15/go.mod h1:niTNB609KyUYuAx9Bex/MawEjv2yPx4XOjxSAkqmGjE= -github.com/smartwalle/ncrypto v1.0.2 h1:pTAhCqtPCMhpOwFXX+EcMdR6PNzruBNoGQrN2S1GbGI= -github.com/smartwalle/ncrypto v1.0.2/go.mod h1:Dwlp6sfeNaPMnOxMNayMTacvC5JGEVln3CVdiVDgbBk= -github.com/smartwalle/ngx v1.0.6 h1:JPNqNOIj+2nxxFtrSkJO+vKJfeNUSEQueck/Wworjps= -github.com/smartwalle/ngx v1.0.6/go.mod h1:mx/nz2Pk5j+RBs7t6u6k22MPiBG/8CtOMpCnALIG8Y0= +github.com/smartwalle/alipay/v3 v3.2.16 h1:oSzcQgV+kUHH7ko7FjYowU4RIm6chuQjgXeuChUbj0M= +github.com/smartwalle/alipay/v3 v3.2.16/go.mod h1:5EC6QZNr51TjmDAJFHSEJMLLSoTtge7583W2vuNmOYc= +github.com/smartwalle/ncrypto v1.0.3 h1:fnzjoriZt2LZeD8ljEtRe2eU33Au7i8vIF4Gafz5RuI= +github.com/smartwalle/ncrypto v1.0.3/go.mod h1:Dwlp6sfeNaPMnOxMNayMTacvC5JGEVln3CVdiVDgbBk= +github.com/smartwalle/ngx v1.0.7 h1:BIQo6wmAnERehogNKUnthoxwBavTWxbR9oLFcGjWXKQ= +github.com/smartwalle/ngx v1.0.7/go.mod h1:mx/nz2Pk5j+RBs7t6u6k22MPiBG/8CtOMpCnALIG8Y0= github.com/smartwalle/nsign v1.0.8 h1:78KWtwKPrdt4Xsn+tNEBVxaTLIJBX9YRX0ZSrMUeuHo= github.com/smartwalle/nsign v1.0.8/go.mod h1:eY6I4CJlyNdVMP+t6z1H6Jpd4m5/V+8xi44ufSTxXgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1239,8 +1263,8 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0= -github.com/tencentyun/cos-go-sdk-v5 v0.7.42 h1:Up1704BJjI5orycXKjpVpvuOInt9GC5pqY4knyE9Uds= -github.com/tencentyun/cos-go-sdk-v5 v0.7.42/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao= +github.com/tencentyun/cos-go-sdk-v5 v0.7.43 h1:aPCPWy85T3C3Ga3hn7va2DC4c0hAf8Dx0kpKj/uB/vw= +github.com/tencentyun/cos-go-sdk-v5 v0.7.43/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1290,6 +1314,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -1385,8 +1410,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1436,8 +1461,10 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1500,14 +1527,16 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1538,7 +1567,9 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1661,18 +1692,24 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/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-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/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-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= 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= @@ -1682,8 +1719,10 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1692,6 +1731,7 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1774,8 +1814,10 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1902,8 +1944,8 @@ google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1937,8 +1979,8 @@ google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2110,8 +2152,8 @@ modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY= modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k= modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs= -modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA= -modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= +modernc.org/sqlite v1.26.0 h1:SocQdLRSYlA8W99V8YH0NES75thx19d9sB/aFc4R8Lw= +modernc.org/sqlite v1.26.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= diff --git a/internal/conf/alipay.go b/internal/conf/alipay.go index 4f118d64..8d1b8d0f 100644 --- a/internal/conf/alipay.go +++ b/internal/conf/alipay.go @@ -21,16 +21,16 @@ func MustAlipayClient() *alipay.Client { logrus.Fatalf("alipay.New err: %s", err) } // 加载应用公钥证书 - if err = client.LoadAppPublicCertFromFile(s.AppPublicCertFile); err != nil { - logrus.Fatalf("client.LoadAppPublicCertFromFile err: %s\n", err) + if err = client.LoadAppCertPublicKeyFromFile(s.AppPublicCertFile); err != nil { + logrus.Fatalf("client.LoadAppCertPublicKeyFromFile err: %s\n", err) } // 加载支付宝根证书 if err = client.LoadAliPayRootCertFromFile(s.RootCertFile); err != nil { logrus.Fatalf("client.LoadAliPayRootCertFromFile err: %s\n", err) } // 加载支付宝公钥证书 - if err = client.LoadAliPayPublicCertFromFile(s.PublicCertFile); err != nil { - logrus.Fatalf("client.LoadAliPayPublicCertFromFile err: %s\n", err) + if err = client.LoadAlipayCertPublicKeyFromFile(s.PublicCertFile); err != nil { + logrus.Fatalf("client.LoadAlipayCertPublicKeyFromFile err: %s\n", err) } _alipayClient = client }) diff --git a/internal/conf/cache.go b/internal/conf/cache.go new file mode 100644 index 00000000..27652c5f --- /dev/null +++ b/internal/conf/cache.go @@ -0,0 +1,91 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package conf + +import ( + "fmt" + + "github.com/alimy/tryst/cache" + "github.com/rocboss/paopao-ce/pkg/types" +) + +const ( + _defaultKeyPoolSize = 128 +) + +// 以下包含一些在cache中会用到的key的前缀 +const ( + InfixCommentDefault = "default" + InfixCommentHots = "hots" + InfixCommentNewest = "newest" + PrefixNewestTweets = "paopao:newesttweets:" + PrefixHotsTweets = "paopao:hotstweets:" + PrefixFollowingTweets = "paopao:followingtweets:" + PrefixUserTweets = "paopao:usertweets:" + PrefixUnreadmsg = "paopao:unreadmsg:" + PrefixOnlineUser = "paopao:onlineuser:" + PrefixIdxTweetsNewest = "paopao:index:tweets:newest:" + PrefixIdxTweetsHots = "paopao:index:tweets:hots:" + PrefixIdxTweetsFollowing = "paopao:index:tweets:following:" + PrefixIdxTrends = "paopao:index:trends:" + PrefixMessages = "paopao:messages:" + PrefixUserInfo = "paopao:user:info:" + PrefixUserProfile = "paopao:user:profile:" + PrefixUserInfoById = "paopao:user:info:id:" + PrefixUserInfoByName = "paopao:user:info:name:" + prefixUserProfileByName = "paopao:user:profile:name:" + PrefixMyFriendIds = "paopao:myfriendids:" + PrefixMyFollowIds = "paopao:myfollowids:" + PrefixTweetComment = "paopao:comment:" + KeySiteStatus = "paopao:sitestatus" + KeyHistoryMaxOnline = "history.max.online" +) + +// 以下包含一些在cache中会用到的池化后的key +var ( + KeyNewestTweets cache.KeyPool[int] + KeyHotsTweets cache.KeyPool[int] + KeyFollowingTweets cache.KeyPool[string] + KeyUnreadMsg cache.KeyPool[int64] + KeyOnlineUser cache.KeyPool[int64] + KeyUserInfoById cache.KeyPool[int64] + KeyUserInfoByName cache.KeyPool[string] + KeyUserProfileByName cache.KeyPool[string] + KeyMyFriendIds cache.KeyPool[int64] + KeyMyFollowIds cache.KeyPool[int64] +) + +func initCacheKeyPool() { + poolSize := _defaultKeyPoolSize + if poolSize < CacheSetting.KeyPoolSize { + poolSize = CacheSetting.KeyPoolSize + } + KeyNewestTweets = intKeyPool[int](poolSize, PrefixNewestTweets) + KeyHotsTweets = intKeyPool[int](poolSize, PrefixHotsTweets) + KeyFollowingTweets = strKeyPool(poolSize, PrefixFollowingTweets) + KeyUnreadMsg = intKeyPool[int64](poolSize, PrefixUnreadmsg) + KeyOnlineUser = intKeyPool[int64](poolSize, PrefixOnlineUser) + KeyUserInfoById = intKeyPool[int64](poolSize, PrefixUserInfoById) + KeyUserInfoByName = strKeyPool(poolSize, PrefixUserInfoByName) + KeyUserProfileByName = strKeyPool(poolSize, prefixUserProfileByName) + KeyMyFriendIds = intKeyPool[int64](poolSize, PrefixMyFriendIds) + KeyMyFollowIds = intKeyPool[int64](poolSize, PrefixMyFollowIds) +} + +func strKeyPool(size int, prefix string) cache.KeyPool[string] { + return cache.MustKeyPool(size, func(key string) string { + return fmt.Sprintf("%s%s", prefix, key) + }) +} + +func intKeyPool[T types.Integer](size int, prefix string) cache.KeyPool[T] { + return cache.MustKeyPool[T](size, intKey[T](prefix)) +} + +func intKey[T types.Integer](prefix string) func(T) string { + return func(key T) string { + return fmt.Sprintf("%s%d", prefix, key) + } +} diff --git a/internal/conf/redis.go b/internal/conf/cache_redis.go similarity index 92% rename from internal/conf/redis.go rename to internal/conf/cache_redis.go index 93799b82..00564a31 100644 --- a/internal/conf/redis.go +++ b/internal/conf/cache_redis.go @@ -29,6 +29,8 @@ func MustRedisClient() rueidis.Client { log.Fatalf("create a redis client failed: %s", err) } _redisClient = client + // 顺便初始化一下CacheKeyPool + initCacheKeyPool() }) return _redisClient } diff --git a/internal/conf/conf.go b/internal/conf/conf.go index a0dc88df..075c2b06 100644 --- a/internal/conf/conf.go +++ b/internal/conf/conf.go @@ -8,16 +8,17 @@ import ( "log" "time" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" ) var ( - loggerSetting *loggerConf - loggerFileSetting *loggerFileConf - loggerZincSetting *loggerZincConf - loggerMeiliSetting *loggerMeiliConf - sentrySetting *sentryConf - redisSetting *redisConf + loggerSetting *loggerConf + loggerFileSetting *loggerFileConf + loggerZincSetting *loggerZincConf + loggerMeiliSetting *loggerMeiliConf + loggerOpenObserveSetting *loggerOpenObserveConf + sentrySetting *sentryConf + redisSetting *redisConf PyroscopeSetting *pyroscopeConf DatabaseSetting *databaseConf @@ -25,6 +26,7 @@ var ( PostgresSetting *postgresConf Sqlite3Setting *sqlite3Conf PprofServerSetting *httpServerConf + MetricsServerSetting *httpServerConf WebServerSetting *httpServerConf AdminServerSetting *httpServerConf SpaceXServerSetting *httpServerConf @@ -34,6 +36,10 @@ var ( DocsServerSetting *httpServerConf MobileServerSetting *grpcServerConf AppSetting *appConf + CacheSetting *cacheConf + EventManagerSetting *eventManagerConf + MetricManagerSetting *metricManagerConf + JobManagerSetting *jobManagerConf CacheIndexSetting *cacheIndexConf SimpleCacheIndexSetting *simpleCacheIndexConf BigCacheIndexSetting *bigCacheIndexConf @@ -51,6 +57,7 @@ var ( S3Setting *s3Conf LocalOSSSetting *localossConf JWTSetting *jwtConf + WebProfileSetting *WebProfileConf ) func setupSetting(suite []string, noDefault bool) error { @@ -68,7 +75,12 @@ func setupSetting(suite []string, noDefault bool) error { objects := map[string]any{ "App": &AppSetting, + "Cache": &CacheSetting, + "EventManager": &EventManagerSetting, + "MetricManager": &MetricManagerSetting, + "JobManager": &JobManagerSetting, "PprofServer": &PprofServerSetting, + "MetricsServer": &MetricsServerSetting, "WebServer": &WebServerSetting, "AdminServer": &AdminServerSetting, "SpaceXServer": &SpaceXServerSetting, @@ -89,6 +101,7 @@ func setupSetting(suite []string, noDefault bool) error { "LoggerFile": &loggerFileSetting, "LoggerZinc": &loggerZincSetting, "LoggerMeili": &loggerMeiliSetting, + "LoggerOpenObserve": &loggerOpenObserveSetting, "Database": &DatabaseSetting, "MySQL": &MysqlSetting, "Postgres": &PostgresSetting, @@ -105,6 +118,7 @@ func setupSetting(suite []string, noDefault bool) error { "MinIO": &MinIOSetting, "LocalOSS": &LocalOSSSetting, "S3": &S3Setting, + "WebProfile": &WebProfileSetting, } for k, v := range objects { err := vp.UnmarshalKey(k, v) @@ -113,6 +127,9 @@ func setupSetting(suite []string, noDefault bool) error { } } + CacheSetting.CientSideCacheExpire *= time.Second + EventManagerSetting.TickWaitTime *= time.Second + MetricManagerSetting.TickWaitTime *= time.Second JWTSetting.Expire *= time.Second SimpleCacheIndexSetting.CheckTickDuration *= time.Second SimpleCacheIndexSetting.ExpireTickDuration *= time.Second diff --git a/internal/conf/config.yaml b/internal/conf/config.yaml index fc86dfd4..42231d87 100644 --- a/internal/conf/config.yaml +++ b/internal/conf/config.yaml @@ -2,9 +2,39 @@ App: # APP基础设置项 RunMode: debug AttachmentIncomeRate: 0.8 MaxCommentCount: 1000 + MaxWhisperDaily: 1000 # 一天可以发送的最大私信总数,临时措施,后续将去掉这个限制 + MaxCaptchaTimes: 2 # 最大获取captcha的次数 DefaultContextTimeout: 60 DefaultPageSize: 10 MaxPageSize: 100 +Cache: + KeyPoolSize: 256 # 键的池大小, 设置范围[128, ++], 默认256 + CientSideCacheExpire: 60 # 客户端缓存过期时间 默认60s + UnreadMsgExpire: 60 # 未读消息过期时间,单位秒, 默认60s + UserTweetsExpire: 60 # 获取用户推文列表过期时间,单位秒, 默认60s + IndexTweetsExpire: 120 # 获取广场推文列表过期时间,单位秒, 默认120s + TweetCommentsExpire: 120 # 获取推文评论过期时间,单位秒, 默认120s + IndexTrendsExpire: 120 # 获取广场动态信息过期时间,单位秒, 默认120s + OnlineUserExpire: 300 # 标记在线用户 过期时间,单位秒, 默认300s + UserInfoExpire: 120 # 获取用户信息过期时间,单位秒, 默认120s + UserProfileExpire: 120 # 获取用户概要过期时间,单位秒, 默认120s + UserRelationExpire: 120 # 用户关系信息过期时间,单位秒, 默认120s + MessagesExpire: 60 # 消息列表过期时间,单位秒, 默认60s +EventManager: # 事件管理器的配置参数 + MinWorker: 64 # 最小后台工作者, 设置范围[5, ++], 默认64 + MaxEventBuf: 128 # 最大log缓存条数, 设置范围[10, ++], 默认128 + MaxTempEventBuf: 256 # 最大log缓存条数, 设置范围[10, ++], 默认256 + MaxTickCount: 60 # 最大的循环周期, 设置范围[60, ++], 默认60 + TickWaitTime: 1 # 一个周期的等待时间,单位:秒 默认1s +MetricManager: # 指标监控管理器的配置参数 + MinWorker: 32 # 最小后台工作者, 设置范围[5, ++], 默认32 + MaxEventBuf: 128 # 最大log缓存条数, 设置范围[10, ++], 默认128 + MaxTempEventBuf: 256 # 最大log缓存条数, 设置范围[10, ++], 默认256 + MaxTickCount: 60 # 最大的循环周期, 设置范围[60, ++], 默认60 + TickWaitTime: 1 # 一个周期的等待时间,单位:秒 默认1s +JobManager: # Cron Job理器的配置参数 + MaxOnlineInterval: "@every 5m" # 更新最大在线人数,默认每5分钟更新一次 + UpdateMetricsInterval: "@every 5m" # 更新Prometheus指标,默认每5分钟更新一次 Features: Default: [] WebServer: # Web服务 @@ -43,6 +73,12 @@ PprofServer: # Pprof服务 HttpPort: 6060 ReadTimeout: 60 WriteTimeout: 60 +MetricsServer: # Prometheus Metrics服务 + RunMode: debug + HttpIp: 0.0.0.0 + HttpPort: 6080 + ReadTimeout: 60 + WriteTimeout: 60 FrontendWebServer: # Web前端静态资源服务 RunMode: debug HttpIp: 0.0.0.0 @@ -64,8 +100,9 @@ SmsJuhe: TplID: TplVal: "#code#=%s&#m#=%d" Alipay: - AppID: + AppID: "paopao-ce-app-id" InProduction: True + PrivateKey: "MIICXAIBAAKBgQCzXV/spaX9+eOjM5f12W6eDTtszU9f9rgpXG4EQwzZI3WM5+Fe+9Bn6NQQILfF1o3Z+3BEzHMMcYwxrQw/toq2o6JPchbUK7eArKc6pl/GV3uIefZdKncz5bZvCFMgiJrpy75lYKhJgotQFEfQd+ks2t0gtC007uOjmY9QDB2EVQIDAQABAoGAMruhi0UbW2gYHCxWuiJDKI9jlJXJ8sHNO126fJgehTiDYlSgKYaeXxW7DcjDUkEqpFJ7YepWTFm9prtksIzIVQFNNjstI6cvowVF2t+lWf7mIB4w0ugarVd+SXssQK830Og3kjtZ84a3BbC6uf3a/qcgoIO8Sj1VnzOJ8fEYl+0CQQDeG6JhauGDOC8oCTwbFs9QPpjwGnp7UkYAJNg7jn4uBSVeg4lwb5uj9TshLSp49geNkPcWeCythuiz1jvoTqEjAkEAzrwIBxUPT1WmcDUXAkVPaQNADDbhMZLdw5nHZEUVwmO3o1FkJky4MLjLjT977400mhsnsQCy4sAWUZs6aEyoJwJARK3U2zy6eOHhqwaYAGRgPJbuoaf+Ya3CGX9LIbdhCwfqUzxnPk40mVFWNF8L+BVTppHB5b/JSOsjf6BqK95McwJBAL+kvUhbdHrV6lmgTXkUaV3u3mO0SCPdgui9WIKSLG6sY+LpI48BlcnMtR12WVyjKL0nKS9Dd5EOAmKaJJXlYgcCQGWbWCn9KUDUqpm4o3wr5nwXzlS74XYZo65UAM7TSzHRpcovfv5uiQ0VRLImWeiSXKK2aTOBGn5eKbevRTxN07k=" RootCertFile: "custom/alipay/RootCert.crt" PublicCertFile: "custom/alipay/CertPublicKey_RSA2.crt" AppPublicCertFile: "custom/alipay/AppCertPublicKey.crt" @@ -114,6 +151,15 @@ LoggerMeili: # 使用Meili写日志 Secure: False MinWorker: 5 # 最小后台工作者, 设置范围[5, 100], 默认5 MaxLogBuffer: 100 # 最大log缓存条数, 设置范围[10, 10000], 默认100 +LoggerOpenObserve: # 使用OpenObserve写日志 + Host: 127.0.0.1:5080 + Organization: paopao-ce + Stream: default + User: root@paopao.info + Password: tiFEI8UeJWuYA7kN + Secure: False + MinWorker: 5 # 最小后台工作者, 设置范围[5, 100], 默认5 + MaxLogBuffer: 100 # 最大log缓存条数, 设置范围[10, 10000], 默认100 JWT: # 鉴权加密 Secret: 18a6413dc4fe394c66345ebe501b2f26 Issuer: paopao-api @@ -202,4 +248,22 @@ Redis: Password: SelectDB: ConnWriteTimeout: 60 # 连接写超时时间 多少秒 默认 60秒 - \ No newline at end of file +WebProfile: + UseFriendship: true # 前端是否使用好友体系 + EnableTrendsBar: true # 广场页面是否开启动态条栏功能 + EnableWallet: false # 是否开启钱包功能 + AllowTweetAttachment: true # 是否允许推文附件 + AllowTweetAttachmentPrice: true # 是否允许推文付费附件 + AllowTweetVideo: true # 是否允许视频推文 + AllowUserRegister: true # 是否允许用户注册 + AllowPhoneBind: true # 是否允许手机绑定 + DefaultTweetMaxLength: 2000 # 推文允许输入的最大长度, 默认2000字,值的范围需要查询后端支持的最大字数 + TweetWebEllipsisSize: 400 # Web端推文作为feed显示的最长字数,默认400字 + TweetMobileEllipsisSize: 300 # 移动端推文作为feed显示的最长字数,默认300字 + DefaultTweetVisibility: friend # 推文默认可见性,默认好友可见 值: public/following/friend/private + DefaultMsgLoopInterval: 5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms + CopyrightTop: "2023 paopao.info" + CopyrightLeft: "Roc's Me" + CopyrightLeftLink: "" + CopyrightRight: "泡泡(PaoPao)开源社区" + CopyrightRightLink: "https://www.paopao.info" diff --git a/internal/conf/db.go b/internal/conf/db.go index 32867a9c..db0a1e43 100644 --- a/internal/conf/db.go +++ b/internal/conf/db.go @@ -8,7 +8,7 @@ import ( "database/sql" "sync" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/sirupsen/logrus" ) @@ -23,6 +23,7 @@ const ( TableAttachment = "attachment" TableCaptcha = "captcha" TableComment = "comment" + TableCommentMetric = "comment_metric" TableCommentContent = "comment_content" TableCommentReply = "comment_reply" TableFollowing = "following" @@ -30,6 +31,7 @@ const ( TableContactGroup = "contact_group" TableMessage = "message" TablePost = "post" + TablePostMetric = "post_metric" TablePostByComment = "post_by_comment" TablePostByMedia = "post_by_media" TablePostAttachmentBill = "post_attachment_bill" @@ -38,6 +40,8 @@ const ( TablePostStar = "post_star" TableTag = "tag" TableUser = "user" + TableUserRelation = "user_relation" + TableUserMetric = "user_metric" TableWalletRecharge = "wallet_recharge" TableWalletStatement = "wallet_statement" ) diff --git a/internal/conf/db_gorm.go b/internal/conf/db_gorm.go index f667ff61..eeff6236 100644 --- a/internal/conf/db_gorm.go +++ b/internal/conf/db_gorm.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/sirupsen/logrus" "gorm.io/driver/mysql" "gorm.io/driver/postgres" diff --git a/internal/conf/logger.go b/internal/conf/logger.go index f6d08723..3e999bf3 100644 --- a/internal/conf/logger.go +++ b/internal/conf/logger.go @@ -8,7 +8,7 @@ import ( "io" "time" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/getsentry/sentry-go" sentrylogrus "github.com/getsentry/sentry-go/logrus" "github.com/sirupsen/logrus" @@ -28,7 +28,7 @@ func setupLogger() { logrus.SetFormatter(&logrus.JSONFormatter{}) logrus.SetLevel(loggerSetting.logLevel()) - cfg.In(cfg.Actions{ + cfg.On(cfg.Actions{ "LoggerFile": func() { out := newFileLogger() logrus.SetOutput(out) @@ -43,6 +43,11 @@ func setupLogger() { logrus.SetOutput(io.Discard) logrus.AddHook(hook) }, + "LoggerOpenObserve": func() { + hook := newObserveLogHook() + logrus.SetOutput(io.Discard) + logrus.AddHook(hook) + }, }) } diff --git a/internal/conf/logger_observe.go b/internal/conf/logger_observe.go new file mode 100644 index 00000000..dc83a83e --- /dev/null +++ b/internal/conf/logger_observe.go @@ -0,0 +1,71 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package conf + +import ( + "log" + "net/http" + "time" + + hx "github.com/rocboss/paopao-ce/pkg/http" + "github.com/rocboss/paopao-ce/pkg/json" + "github.com/rocboss/paopao-ce/pkg/obx" + "github.com/sirupsen/logrus" +) + +type observeLogData struct { + Time time.Time `json:"time"` + Level logrus.Level `json:"level"` + Message string `json:"message"` + Data logrus.Fields `json:"data"` +} + +type observeLogHook struct { + client obx.OpenObserveClient +} + +func (h *observeLogHook) Fire(entry *logrus.Entry) error { + info := []observeLogData{{ + Time: entry.Time, + Level: entry.Level, + Message: entry.Message, + Data: entry.Data, + }} + data, _ := json.Marshal(info) + h.client.LogJson(data) + return nil +} + +func (h *observeLogHook) Levels() []logrus.Level { + return logrus.AllLevels +} + +func newObserveLogHook() *observeLogHook { + s := loggerOpenObserveSetting + obc := &obx.Config{ + Host: s.Host, + User: s.User, + Password: s.Password, + Organization: s.Organization, + Stream: s.Stream, + Secure: s.Secure, + } + acc := &hx.AsyncClientConf{ + MinWorker: s.MinWorker, + MaxRequestBuf: s.MaxLogBuffer, + MaxRequestTempBuf: 100, + MaxTickCount: 60, + TickWaitTime: time.Second, + } + return &observeLogHook{ + client: obx.NewClient(obc, acc, func(req *http.Request, resp *http.Response, err error) { + if err == nil && resp != nil && resp.Body != nil { + resp.Body.Close() + } else if err != nil { + log.Printf("logrus use observe do LogJson error: %s", err) + } + }), + } +} diff --git a/internal/conf/sentry.go b/internal/conf/sentry.go index 70c534e4..0cd64d76 100644 --- a/internal/conf/sentry.go +++ b/internal/conf/sentry.go @@ -7,7 +7,7 @@ package conf import ( "time" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/getsentry/sentry-go" "github.com/rocboss/paopao-ce/pkg/version" ) diff --git a/internal/conf/setting.go b/internal/conf/setting.go index ccb05cbf..fdd776c9 100644 --- a/internal/conf/setting.go +++ b/internal/conf/setting.go @@ -63,6 +63,17 @@ type loggerMeiliConf struct { MinWorker int } +type loggerOpenObserveConf struct { + Host string + Organization string + Stream string + User string + Password string + Secure bool + MaxLogBuffer int + MinWorker int +} + type httpServerConf struct { RunMode string HttpIp string @@ -79,12 +90,50 @@ type grpcServerConf struct { type appConf struct { RunMode string MaxCommentCount int64 + MaxWhisperDaily int64 + MaxCaptchaTimes int AttachmentIncomeRate float64 DefaultContextTimeout time.Duration DefaultPageSize int MaxPageSize int } +type cacheConf struct { + KeyPoolSize int + CientSideCacheExpire time.Duration + UnreadMsgExpire int64 + UserTweetsExpire int64 + IndexTweetsExpire int64 + MessagesExpire int64 + IndexTrendsExpire int64 + TweetCommentsExpire int64 + OnlineUserExpire int64 + UserInfoExpire int64 + UserProfileExpire int64 + UserRelationExpire int64 +} + +type eventManagerConf struct { + MinWorker int + MaxEventBuf int + MaxTempEventBuf int + MaxTickCount int + TickWaitTime time.Duration +} + +type metricManagerConf struct { + MinWorker int + MaxEventBuf int + MaxTempEventBuf int + MaxTickCount int + TickWaitTime time.Duration +} + +type jobManagerConf struct { + MaxOnlineInterval string + UpdateMetricsInterval string +} + type cacheIndexConf struct { MaxUpdateQPS int MinWorker int @@ -234,6 +283,27 @@ type jwtConf struct { Expire time.Duration } +type WebProfileConf struct { + UseFriendship bool `json:"use_friendship"` + EnableTrendsBar bool `json:"enable_trends_bar"` + EnableWallet bool `json:"enable_wallet"` + AllowTweetAttachment bool `json:"allow_tweet_attachment"` + AllowTweetAttachmentPrice bool `json:"allow_tweet_attachment_price"` + AllowTweetVideo bool `json:"allow_tweet_video"` + AllowUserRegister bool `json:"allow_user_register"` + AllowPhoneBind bool `json:"allow_phone_bind"` + DefaultTweetMaxLength int `json:"default_tweet_max_length"` + TweetWebEllipsisSize int `json:"tweet_web_ellipsis_size"` + TweetMobileEllipsisSize int `json:"tweet_mobile_ellipsis_size"` + DefaultTweetVisibility string `json:"default_tweet_visibility"` + DefaultMsgLoopInterval int `json:"default_msg_loop_interval"` + CopyrightTop string `json:"copyright_top"` + CopyrightLeft string `json:"copyright_left"` + CopyrightLeftLink string `json:"copyright_left_link"` + CopyrightRight string `json:"copyright_right"` + CopyrightRightLink string `json:"copyright_right_link"` +} + func (s *httpServerConf) GetReadTimeout() time.Duration { return s.ReadTimeout * time.Second } @@ -303,6 +373,7 @@ func (s *databaseConf) TableNames() (res TableNameMap) { TableAttachment, TableCaptcha, TableComment, + TableCommentMetric, TableCommentContent, TableCommentReply, TableFollowing, @@ -310,6 +381,7 @@ func (s *databaseConf) TableNames() (res TableNameMap) { TableContactGroup, TableMessage, TablePost, + TablePostMetric, TablePostByComment, TablePostByMedia, TablePostAttachmentBill, @@ -318,6 +390,8 @@ func (s *databaseConf) TableNames() (res TableNameMap) { TablePostStar, TableTag, TableUser, + TableUserRelation, + TableUserMetric, TableWalletRecharge, TableWalletStatement, } diff --git a/internal/core/cache.go b/internal/core/cache.go index 8d8c3b42..bff7ca5c 100644 --- a/internal/core/cache.go +++ b/internal/core/cache.go @@ -68,14 +68,14 @@ func NewIndexActionA(act IdxAct, tweet *cs.TweetInfo) *IndexActionA { // CacheIndexService cache index service interface type CacheIndexService interface { - IndexPostsService + // IndexPostsService SendAction(act IdxAct, post *dbr.Post) } // CacheIndexServantA cache index service interface type CacheIndexServantA interface { - IndexPostsServantA + // IndexPostsServantA SendAction(act IdxAct, tweet *cs.TweetInfo) } @@ -97,3 +97,22 @@ type RedisCache interface { SetRechargeStatus(ctx context.Context, tradeNo string) error DelRechargeStatus(ctx context.Context, tradeNo string) error } + +type AppCache interface { + Get(key string) ([]byte, error) + Set(key string, data []byte, ex int64) error + SetNx(key string, data []byte, ex int64) error + Delete(key ...string) error + DelAny(pattern string) error + Exist(key string) bool + Keys(pattern string) ([]string, error) +} + +type WebCache interface { + AppCache + GetUnreadMsgCountResp(uid int64) ([]byte, error) + PutUnreadMsgCountResp(uid int64, data []byte) error + DelUnreadMsgCountResp(uid int64) error + ExistUnreadMsgCountResp(uid int64) bool + PutHistoryMaxOnline(newScore int) (int, error) +} diff --git a/internal/core/comments.go b/internal/core/comments.go index cf917a82..a7115069 100644 --- a/internal/core/comments.go +++ b/internal/core/comments.go @@ -11,9 +11,8 @@ import ( // CommentService 评论检索服务 type CommentService interface { - GetComments(conditions *ms.ConditionsT, offset, limit int) ([]*ms.Comment, error) + GetComments(tweetId int64, style cs.StyleCommentType, limit int, offset int) ([]*ms.Comment, int64, error) GetCommentByID(id int64) (*ms.Comment, error) - GetCommentCount(conditions *ms.ConditionsT) (int64, error) GetCommentReplyByID(id int64) (*ms.CommentReply, error) GetCommentContentsByIDs(ids []int64) ([]*ms.CommentContent, error) GetCommentRepliesByID(ids []int64) ([]*ms.CommentReplyFormated, error) @@ -22,6 +21,7 @@ type CommentService interface { // CommentManageService 评论管理服务 type CommentManageService interface { + HighlightComment(userId, commentId int64) (int8, error) DeleteComment(comment *ms.Comment) error CreateComment(comment *ms.Comment) (*ms.Comment, error) CreateCommentReply(reply *ms.CommentReply) (*ms.CommentReply, error) diff --git a/internal/core/core.go b/internal/core/core.go index 810d1e97..bb3a0d5c 100644 --- a/internal/core/core.go +++ b/internal/core/core.go @@ -15,14 +15,19 @@ type DataService interface { // 话题服务 TopicService - // 广场泡泡服务 - IndexPostsService - // 推文服务 TweetService TweetManageService TweetHelpService + // 推文指标服务 + UserMetricServantA + TweetMetricServantA + CommentMetricServantA + + // 动态信息相关服务 + TrendsManageServantA + // 评论服务 CommentService CommentManageService @@ -31,6 +36,7 @@ type DataService interface { UserManageService ContactManageService FollowingManageService + UserRelationService // 安全服务 SecurityService diff --git a/internal/core/cs/comment_thumbs.go b/internal/core/cs/comments.go similarity index 82% rename from internal/core/cs/comment_thumbs.go rename to internal/core/cs/comments.go index cb6f7d0d..84a287b0 100644 --- a/internal/core/cs/comment_thumbs.go +++ b/internal/core/cs/comments.go @@ -4,6 +4,14 @@ package cs +const ( + StyleCommentDefault StyleCommentType = iota + StyleCommentHots + StyleCommentNewest +) + +type StyleCommentType uint8 + type CommentThumbs struct { UserID int64 `json:"user_id"` TweetID int64 `json:"tweet_id"` diff --git a/internal/core/cs/messages.go b/internal/core/cs/messages.go new file mode 100644 index 00000000..5ff45fdf --- /dev/null +++ b/internal/core/cs/messages.go @@ -0,0 +1,16 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +const ( + // 消息列表样式 + StyleMsgAll MessageStyle = "all" + StyleMsgSystem MessageStyle = "system" + StyleMsgWhisper MessageStyle = "whisper" + StyleMsgRequesting MessageStyle = "requesting" + StyleMsgUnread MessageStyle = "unread" +) + +type MessageStyle string diff --git a/internal/core/cs/metrics.go b/internal/core/cs/metrics.go new file mode 100644 index 00000000..c9d2a5c0 --- /dev/null +++ b/internal/core/cs/metrics.go @@ -0,0 +1,41 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +const ( + MetricActionCreateTweet uint8 = iota + MetricActionDeleteTweet +) + +type TweetMetric struct { + PostId int64 + CommentCount int64 + UpvoteCount int64 + CollectionCount int64 + ShareCount int64 + ThumbsUpCount int64 + ThumbsDownCount int64 +} + +type CommentMetric struct { + CommentId int64 + ReplyCount int32 + ThumbsUpCount int32 + ThumbsDownCount int32 +} + +func (m *TweetMetric) RankScore(motivationFactor int) int64 { + if motivationFactor == 0 { + motivationFactor = 1 + } + return (m.CommentCount + m.UpvoteCount*2 + m.CollectionCount*4 + m.ShareCount*8) * int64(motivationFactor) +} + +func (m *CommentMetric) RankScore(motivationFactor int) int64 { + if motivationFactor == 0 { + motivationFactor = 1 + } + return int64(m.ReplyCount*2+m.ThumbsUpCount*4-m.ThumbsDownCount) * int64(motivationFactor) +} diff --git a/internal/core/cs/trends.go b/internal/core/cs/trends.go new file mode 100644 index 00000000..5739e8aa --- /dev/null +++ b/internal/core/cs/trends.go @@ -0,0 +1,30 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +import "github.com/rocboss/paopao-ce/pkg/types" + +type TrendsItem struct { + Username string `json:"username"` + Nickname string `json:"nickname"` + Avatar string `json:"avatar"` + IsFresh bool `json:"is_fresh" gorm:"-"` +} + +func DistinctTrends(items []*TrendsItem) []*TrendsItem { + if len(items) == 0 { + return items + } + res := make([]*TrendsItem, 0, len(items)) + set := make(map[string]types.Empty, len(items)) + for _, item := range items { + if _, exist := set[item.Username]; exist { + continue + } + res = append(res, item) + set[item.Username] = types.Empty{} + } + return res +} diff --git a/internal/core/cs/tweets.go b/internal/core/cs/tweets.go index 34060030..49aa7763 100644 --- a/internal/core/cs/tweets.go +++ b/internal/core/cs/tweets.go @@ -16,10 +16,17 @@ const ( TweetBlockChargeAttachment // 推文可见性 - TweetVisitPublic TweetVisibleType = iota - TweetVisitPrivate - TweetVisitFriend - TweetVisitInvalid + TweetVisitPublic TweetVisibleType = 90 + TweetVisitPrivate TweetVisibleType = 0 + TweetVisitFriend TweetVisibleType = 50 + TweetVisitFollowing TweetVisibleType = 60 + + // 用户推文列表样式 + StyleUserTweetsGuest uint8 = iota + StyleUserTweetsSelf + StyleUserTweetsAdmin + StyleUserTweetsFriend + StyleUserTweetsFollowing // 附件类型 AttachmentTypeImage AttachmentType = iota + 1 @@ -32,7 +39,7 @@ type ( // TODO: 优化一下类型为 uint8, 需要底层数据库同步修改 TweetBlockType int - // TweetVisibleType 推文可见性,0公开,1私密,2好友 + // TweetVisibleType 推文可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开', TweetVisibleType uint8 // AttachmentType 附件类型, 1图片, 2视频, 3其他 @@ -139,3 +146,19 @@ type NewTweetReq struct { Visibility TweetVisibleType `json:"visibility"` ClientIP string `json:"-" binding:"-"` } + +func (t TweetVisibleType) ToOutValue() (res uint8) { + switch t { + case TweetVisitPublic: + res = 0 + case TweetVisitPrivate: + res = 1 + case TweetVisitFriend: + res = 2 + case TweetVisitFollowing: + res = 3 + default: + res = 1 + } + return +} diff --git a/internal/core/cs/user.go b/internal/core/cs/user.go index 240c235a..1d445283 100644 --- a/internal/core/cs/user.go +++ b/internal/core/cs/user.go @@ -5,7 +5,7 @@ package cs const ( - RelationUnknow RelationTyp = iota + RelationUnknown RelationTyp = iota RelationSelf RelationFriend RelationFollower @@ -39,6 +39,19 @@ type UserInfo struct { CreatedOn int64 `json:"created_on"` } +type UserProfile struct { + ID int64 `json:"id" db:"id"` + Nickname string `json:"nickname"` + Username string `json:"username"` + Phone string `json:"phone"` + Status int `json:"status"` + Avatar string `json:"avatar"` + Balance int64 `json:"balance"` + IsAdmin bool `json:"is_admin"` + CreatedOn int64 `json:"created_on"` + TweetsCount int `json:"tweets_count"` +} + func (t RelationTyp) String() string { switch t { case RelationSelf: @@ -51,9 +64,9 @@ func (t RelationTyp) String() string { return "following" case RelationAdmin: return "admin" - case RelationUnknow: + case RelationUnknown: fallthrough default: - return "unknow relation" + return "unknown" } } diff --git a/internal/core/messages.go b/internal/core/messages.go index 519e4e49..f45389e5 100644 --- a/internal/core/messages.go +++ b/internal/core/messages.go @@ -5,6 +5,7 @@ package core import ( + "github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/core/ms" ) @@ -14,6 +15,6 @@ type MessageService interface { GetUnreadCount(userID int64) (int64, error) GetMessageByID(id int64) (*ms.Message, error) ReadMessage(message *ms.Message) error - GetMessages(conditions *ms.ConditionsT, offset, limit int) ([]*ms.MessageFormated, error) - GetMessageCount(conditions *ms.ConditionsT) (int64, error) + ReadAllMessage(userId int64) error + GetMessages(userId int64, style cs.MessageStyle, limit, offset int) ([]*ms.MessageFormated, int64, error) } diff --git a/internal/core/metrics.go b/internal/core/metrics.go new file mode 100644 index 00000000..d2dbc0fb --- /dev/null +++ b/internal/core/metrics.go @@ -0,0 +1,27 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package core + +import ( + "github.com/rocboss/paopao-ce/internal/core/cs" +) + +type TweetMetricServantA interface { + UpdateTweetMetric(metric *cs.TweetMetric) error + AddTweetMetric(postId int64) error + DeleteTweetMetric(postId int64) error +} + +type CommentMetricServantA interface { + UpdateCommentMetric(metric *cs.CommentMetric) error + AddCommentMetric(commentId int64) error + DeleteCommentMetric(commentId int64) error +} + +type UserMetricServantA interface { + UpdateUserMetric(userId int64, action uint8) error + AddUserMetric(userId int64) error + DeleteUserMetric(userId int64) error +} diff --git a/internal/core/ms/tweets.go b/internal/core/ms/tweets.go index eab6d85c..f0d4e1e6 100644 --- a/internal/core/ms/tweets.go +++ b/internal/core/ms/tweets.go @@ -25,10 +25,10 @@ const ( ) const ( - PostVisitPublic PostVisibleT = iota - PostVisitPrivate - PostVisitFriend - PostVisitInvalid + PostVisitPublic = dbr.PostVisitPublic + PostVisitPrivate = dbr.PostVisitPrivate + PostVisitFriend = dbr.PostVisitFriend + PostVisitFollowing = dbr.PostVisitFollowing ) type ( diff --git a/internal/core/search.go b/internal/core/search.go index dc08e127..1cce77e0 100644 --- a/internal/core/search.go +++ b/internal/core/search.go @@ -15,14 +15,14 @@ const ( ) const ( - PostVisitPublic = dbr.PostVisitPublic - PostVisitPrivate = dbr.PostVisitPrivate - PostVisitFriend = dbr.PostVisitFriend - PostVisitInvalid = dbr.PostVisitInvalid + PostVisitPublic = dbr.PostVisitPublic + PostVisitPrivate = dbr.PostVisitPrivate + PostVisitFriend = dbr.PostVisitFriend + PostVisitFollowing = dbr.PostVisitFollowing ) type ( - // PostVisibleT 可访问类型,0公开,1私密,2好友 + // PostVisibleT 可访问类型,可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 PostVisibleT = dbr.PostVisibleT SearchType string diff --git a/internal/core/trends.go b/internal/core/trends.go new file mode 100644 index 00000000..6d04c4e1 --- /dev/null +++ b/internal/core/trends.go @@ -0,0 +1,14 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package core + +import ( + "github.com/rocboss/paopao-ce/internal/core/cs" +) + +// TrendsManageServantA 动态信息管理服务 +type TrendsManageServantA interface { + GetIndexTrends(userId int64, limit int, offset int) ([]*cs.TrendsItem, int64, error) +} diff --git a/internal/core/tweets.go b/internal/core/tweets.go index b5aee860..3c49136c 100644 --- a/internal/core/tweets.go +++ b/internal/core/tweets.go @@ -26,6 +26,11 @@ type TweetService interface { ListUserStarTweets(user *cs.VistUser, limit int, offset int) ([]*ms.PostStar, int64, error) ListUserMediaTweets(user *cs.VistUser, limit int, offset int) ([]*ms.Post, int64, error) ListUserCommentTweets(user *cs.VistUser, limit int, offset int) ([]*ms.Post, int64, error) + ListUserTweets(userId int64, style uint8, justEssence bool, limit, offset int) ([]*ms.Post, int64, error) + ListFollowingTweets(userId int64, limit, offset int) ([]*ms.Post, int64, error) + ListIndexNewestTweets(limit, offset int) ([]*ms.Post, int64, error) + ListIndexHotsTweets(limit, offset int) ([]*ms.Post, int64, error) + ListSyncSearchTweets(limit, offset int) ([]*ms.Post, int64, error) } // TweetManageService 推文管理服务,包括创建/删除/更新推文 @@ -35,7 +40,7 @@ type TweetManageService interface { LockPost(post *ms.Post) error StickPost(post *ms.Post) error HighlightPost(userId, postId int64) (int, error) - VisiblePost(post *ms.Post, visibility PostVisibleT) error + VisiblePost(post *ms.Post, visibility cs.TweetVisibleType) error UpdatePost(post *ms.Post) error CreatePostStar(postID, userID int64) (*ms.PostStar, error) DeletePostStar(p *ms.PostStar) error diff --git a/internal/core/user.go b/internal/core/user.go index fa1cd9b8..78ac1c8d 100644 --- a/internal/core/user.go +++ b/internal/core/user.go @@ -4,7 +4,10 @@ package core -import "github.com/rocboss/paopao-ce/internal/core/ms" +import ( + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" +) // UserManageService 用户管理服务 type UserManageService interface { @@ -13,8 +16,10 @@ type UserManageService interface { GetUserByPhone(phone string) (*ms.User, error) GetUsersByIDs(ids []int64) ([]*ms.User, error) GetUsersByKeyword(keyword string) ([]*ms.User, error) + UserProfileByName(username string) (*cs.UserProfile, error) CreateUser(user *ms.User) (*ms.User, error) UpdateUser(user *ms.User) error + GetRegisterUserCount() (int64, error) } // ContactManageService 联系人管理服务 @@ -36,3 +41,11 @@ type FollowingManageService interface { GetFollowCount(userId int64) (int64, int64, error) IsFollow(userId int64, followId int64) bool } + +// UserRelationService 用户关系服务 +type UserRelationService interface { + MyFriendIds(userId int64) ([]int64, error) + MyFollowIds(userId int64) ([]int64, error) + IsMyFriend(userId int64, friendIds ...int64) (map[int64]bool, error) + IsMyFollow(userId int64, followIds ...int64) (map[int64]bool, error) +} diff --git a/internal/dao/cache/cache.go b/internal/dao/cache/cache.go index 3a2938cb..2cee6684 100644 --- a/internal/dao/cache/cache.go +++ b/internal/dao/cache/cache.go @@ -6,6 +6,7 @@ package cache import ( "context" + "sync" "time" "github.com/allegro/bigcache/v3" @@ -14,6 +15,10 @@ import ( "github.com/sirupsen/logrus" ) +var ( + _onceInit sync.Once +) + func NewRedisCache() core.RedisCache { return &redisCache{ c: conf.MustRedisClient(), @@ -48,6 +53,16 @@ func NewRedisCacheIndexService(ips core.IndexPostsService, ams core.Authorizatio return cacheIndex, cacheIndex } +func NewWebCache() core.WebCache { + lazyInitial() + return _webCache +} + +func NewAppCache() core.AppCache { + lazyInitial() + return _appCache +} + func NewSimpleCacheIndexService(indexPosts core.IndexPostsService) (core.CacheIndexService, core.VersionInfo) { s := conf.SimpleCacheIndexSetting cacheIndex := &simpleCacheIndexServant{ @@ -88,3 +103,10 @@ func NewNoneCacheIndexService(indexPosts core.IndexPostsService) (core.CacheInde } return obj, obj } + +func lazyInitial() { + _onceInit.Do(func() { + _appCache = newAppCache() + _webCache = newWebCache(_appCache) + }) +} diff --git a/internal/dao/cache/common.go b/internal/dao/cache/common.go new file mode 100644 index 00000000..fe22b895 --- /dev/null +++ b/internal/dao/cache/common.go @@ -0,0 +1,124 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cache + +import ( + "bytes" + "encoding/gob" + + "github.com/RoaringBitmap/roaring/roaring64" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" +) + +type cacheDataService struct { + core.DataService + ac core.AppCache +} + +func NewCacheDataService(ds core.DataService) core.DataService { + lazyInitial() + return &cacheDataService{ + DataService: ds, + ac: _appCache, + } +} + +func (s *cacheDataService) GetUserByID(id int64) (res *ms.User, err error) { + // 先从缓存获取, 不处理错误 + key := conf.KeyUserInfoById.Get(id) + if data, xerr := s.ac.Get(key); xerr == nil { + buf := bytes.NewBuffer(data) + res = &ms.User{} + err = gob.NewDecoder(buf).Decode(res) + return + } + // 最后查库 + if res, err = s.DataService.GetUserByID(id); err == nil { + // 更新缓存 + onCacheUserInfoEvent(key, res) + } + return +} + +func (s *cacheDataService) GetUserByUsername(username string) (res *ms.User, err error) { + // 先从缓存获取, 不处理错误 + key := conf.KeyUserInfoByName.Get(username) + if data, xerr := s.ac.Get(key); xerr == nil { + buf := bytes.NewBuffer(data) + res = &ms.User{} + err = gob.NewDecoder(buf).Decode(res) + return + } + // 最后查库 + if res, err = s.DataService.GetUserByUsername(username); err == nil { + // 更新缓存 + onCacheUserInfoEvent(key, res) + } + return +} + +func (s *cacheDataService) UserProfileByName(username string) (res *cs.UserProfile, err error) { + // 先从缓存获取, 不处理错误 + key := conf.KeyUserProfileByName.Get(username) + if data, xerr := s.ac.Get(key); xerr == nil { + buf := bytes.NewBuffer(data) + res = &cs.UserProfile{} + err = gob.NewDecoder(buf).Decode(res) + return + } + // 最后查库 + if res, err = s.DataService.UserProfileByName(username); err == nil { + // 更新缓存 + onCacheObjectEvent(key, res, conf.CacheSetting.UserProfileExpire) + } + return +} + +func (s *cacheDataService) IsMyFriend(userId int64, friendIds ...int64) (res map[int64]bool, err error) { + size := len(friendIds) + res = make(map[int64]bool, size) + if size == 0 { + return + } + // 从缓存中获取 + key := conf.KeyMyFriendIds.Get(userId) + if data, xerr := s.ac.Get(key); xerr == nil { + bitmap := roaring64.New() + if err = bitmap.UnmarshalBinary(data); err == nil { + for _, friendId := range friendIds { + res[friendId] = bitmap.Contains(uint64(friendId)) + } + return + } + } + // 直接查库并触发缓存更新事件 + OnCacheMyFriendIdsEvent(s.DataService, userId) + return s.DataService.IsMyFriend(userId, friendIds...) +} + +func (s *cacheDataService) IsMyFollow(userId int64, followIds ...int64) (res map[int64]bool, err error) { + size := len(followIds) + res = make(map[int64]bool, size) + if size == 0 { + return + } + // 从缓存中获取 + key := conf.KeyMyFollowIds.Get(userId) + if data, xerr := s.ac.Get(key); xerr == nil { + bitmap := roaring64.New() + if err = bitmap.UnmarshalBinary(data); err == nil { + for _, followId := range followIds { + res[followId] = bitmap.Contains(uint64(followId)) + } + return + } + } + // 直接查库并触发缓存更新事件 + OnCacheMyFollowIdsEvent(s.DataService, userId, key) + return s.DataService.IsMyFollow(userId, followIds...) +} diff --git a/internal/dao/cache/events.go b/internal/dao/cache/events.go new file mode 100644 index 00000000..e8c0e62b --- /dev/null +++ b/internal/dao/cache/events.go @@ -0,0 +1,289 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cache + +import ( + "bytes" + "encoding/gob" + "fmt" + + "github.com/RoaringBitmap/roaring/roaring64" + "github.com/alimy/tryst/event" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/events" + "github.com/sirupsen/logrus" +) + +type BaseCacheEvent struct { + event.UnimplementedEvent + ac core.AppCache +} + +type expireIndexTweetsEvent struct { + event.UnimplementedEvent + ac core.AppCache + keysPattern []string +} + +type expireHotsTweetsEvent struct { + event.UnimplementedEvent + ac core.AppCache + keyPattern string +} + +type expireFollowTweetsEvent struct { + event.UnimplementedEvent + tweet *ms.Post + ac core.AppCache + keyPattern string +} + +type cacheObjectEvent struct { + event.UnimplementedEvent + ac core.AppCache + key string + data any + expire int64 +} + +type cacheUserInfoEvent struct { + event.UnimplementedEvent + ac core.AppCache + key string + data *ms.User + expire int64 +} + +type cacheMyFriendIdsEvent struct { + event.UnimplementedEvent + ac core.AppCache + urs core.UserRelationService + userIds []int64 + expire int64 +} + +type cacheMyFollowIdsEvent struct { + event.UnimplementedEvent + ac core.AppCache + urs core.UserRelationService + userId int64 + key string + expire int64 +} + +func NewBaseCacheEvent(ac core.AppCache) *BaseCacheEvent { + return &BaseCacheEvent{ + ac: ac, + } +} + +func OnExpireIndexTweetEvent(userId int64) { + // TODO: 这里暴躁的将所有 最新/热门/关注 的推文列表缓存都过期掉,后续需要更精细话处理 + events.OnEvent(&expireIndexTweetsEvent{ + ac: _appCache, + keysPattern: []string{ + conf.PrefixIdxTweetsNewest + "*", + conf.PrefixIdxTweetsHots + "*", + conf.PrefixIdxTweetsFollowing + "*", + fmt.Sprintf("%s%d:*", conf.PrefixUserTweets, userId), + }, + }) +} + +func OnExpireHotsTweetEvent() { + events.OnEvent(&expireHotsTweetsEvent{ + ac: _appCache, + keyPattern: conf.PrefixHotsTweets + "*", + }) +} + +func onExpireFollowTweetEvent(tweet *ms.Post) { + events.OnEvent(&expireFollowTweetsEvent{ + tweet: tweet, + ac: _appCache, + keyPattern: conf.PrefixFollowingTweets + "*", + }) +} + +func onCacheUserInfoEvent(key string, data *ms.User) { + events.OnEvent(&cacheUserInfoEvent{ + key: key, + data: data, + ac: _appCache, + expire: conf.CacheSetting.UserInfoExpire, + }) +} + +func onCacheObjectEvent(key string, data any, expire int64) { + events.OnEvent(&cacheObjectEvent{ + key: key, + data: data, + ac: _appCache, + expire: expire, + }) +} + +func OnCacheMyFriendIdsEvent(urs core.UserRelationService, userIds ...int64) { + if len(userIds) == 0 { + return + } + events.OnEvent(&cacheMyFriendIdsEvent{ + userIds: userIds, + urs: urs, + ac: _appCache, + expire: conf.CacheSetting.UserRelationExpire, + }) +} + +func OnCacheMyFollowIdsEvent(urs core.UserRelationService, userId int64, key ...string) { + cacheKey := "" + if len(key) > 0 { + cacheKey = key[0] + } else { + cacheKey = conf.KeyMyFollowIds.Get(userId) + } + events.OnEvent(&cacheMyFollowIdsEvent{ + userId: userId, + urs: urs, + key: cacheKey, + ac: _appCache, + expire: conf.CacheSetting.UserRelationExpire, + }) +} + +func (e *BaseCacheEvent) ExpireUserInfo(id int64, name string) error { + keys := make([]string, 0, 2) + if id >= 0 { + keys = append(keys, conf.KeyUserInfoById.Get(id)) + } + if len(name) > 0 { + keys = append(keys, conf.KeyUserInfoByName.Get(name)) + } + return e.ac.Delete(keys...) +} + +func (e *BaseCacheEvent) ExpireUserProfile(name string) error { + if len(name) > 0 { + return e.ac.Delete(conf.KeyUserProfileByName.Get(name)) + } + return nil +} + +func (e *BaseCacheEvent) ExpireUserData(id int64, name string) error { + keys := make([]string, 0, 3) + if id >= 0 { + keys = append(keys, conf.KeyUserInfoById.Get(id)) + } + if len(name) > 0 { + keys = append(keys, conf.KeyUserInfoByName.Get(name), conf.KeyUserProfileByName.Get(name)) + } + return e.ac.Delete(keys...) +} + +func (e *expireIndexTweetsEvent) Name() string { + return "expireIndexTweetsEvent" +} + +func (e *expireIndexTweetsEvent) Action() (err error) { + // logrus.Debug("expireIndexTweetsEvent action running") + for _, pattern := range e.keysPattern { + e.ac.DelAny(pattern) + } + return +} + +func (e *expireHotsTweetsEvent) Name() string { + return "expireHotsTweetsEvent" +} + +func (e *expireHotsTweetsEvent) Action() (err error) { + // logrus.Debug("expireHotsTweetsEvent action running") + e.ac.DelAny(e.keyPattern) + return +} + +func (e *expireFollowTweetsEvent) Name() string { + return "expireFollowTweetsEvent" +} + +func (e *expireFollowTweetsEvent) Action() (err error) { + // logrus.Debug("expireFollowTweetsEvent action running") + e.ac.DelAny(e.keyPattern) + return +} + +func (e *cacheUserInfoEvent) Name() string { + return "cacheUserInfoEvent" +} + +func (e *cacheUserInfoEvent) Action() (err error) { + buffer := &bytes.Buffer{} + ge := gob.NewEncoder(buffer) + if err = ge.Encode(e.data); err == nil { + e.ac.Set(e.key, buffer.Bytes(), e.expire) + } + return +} + +func (e *cacheObjectEvent) Name() string { + return "cacheObjectEvent" +} + +func (e *cacheObjectEvent) Action() (err error) { + buffer := &bytes.Buffer{} + ge := gob.NewEncoder(buffer) + if err = ge.Encode(e.data); err == nil { + e.ac.Set(e.key, buffer.Bytes(), e.expire) + } + return +} + +func (e *cacheMyFriendIdsEvent) Name() string { + return "cacheMyFriendIdsEvent" +} + +func (e *cacheMyFriendIdsEvent) Action() error { + logrus.Debug("cacheMyFriendIdsEvent action runnging") + for _, userId := range e.userIds { + myFriendIds, err := e.urs.MyFriendIds(userId) + if err != nil { + return err + } + bitmap := roaring64.New() + for _, friendId := range myFriendIds { + bitmap.Add(uint64(friendId)) + } + data, err := bitmap.MarshalBinary() + if err != nil { + return err + } + e.ac.Set(conf.KeyMyFriendIds.Get(userId), data, e.expire) + } + return nil +} + +func (e *cacheMyFollowIdsEvent) Name() string { + return "cacheMyFollowIdsEvent" +} + +func (e *cacheMyFollowIdsEvent) Action() (err error) { + logrus.Debug("cacheMyFollowIdsEvent action runnging") + myFollowIds, err := e.urs.MyFollowIds(e.userId) + if err != nil { + return err + } + bitmap := roaring64.New() + for _, followId := range myFollowIds { + bitmap.Add(uint64(followId)) + } + data, err := bitmap.MarshalBinary() + if err != nil { + return err + } + e.ac.Set(e.key, data, e.expire) + return nil +} diff --git a/internal/dao/cache/redis.go b/internal/dao/cache/redis.go index 50b581a7..0e106c5a 100644 --- a/internal/dao/cache/redis.go +++ b/internal/dao/cache/redis.go @@ -59,9 +59,22 @@ func (s *redisCacheTweetsCache) delTweets(keys []string) error { return s.c.Do(context.Background(), cmd).Error() } -func (s *redisCacheTweetsCache) allKeys() ([]string, error) { - cmd := s.c.B().Keys().Pattern(_cacheIndexKeyPattern).Build() - return s.c.Do(context.Background(), cmd).AsStrSlice() +func (s *redisCacheTweetsCache) allKeys() (res []string, err error) { + ctx, cursor := context.Background(), uint64(0) + for { + cmd := s.c.B().Scan().Cursor(cursor).Match(_cacheIndexKeyPattern).Count(50).Build() + entry, err := s.c.Do(ctx, cmd).AsScanEntry() + if err != nil { + return nil, err + } + res = append(res, entry.Elements...) + if entry.Cursor != 0 { + cursor = entry.Cursor + continue + } + break + } + return } func (s *redisCacheTweetsCache) Name() string { diff --git a/internal/dao/cache/tweets.go b/internal/dao/cache/tweets.go new file mode 100644 index 00000000..ecabf0bd --- /dev/null +++ b/internal/dao/cache/tweets.go @@ -0,0 +1,49 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cache + +import ( + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/sirupsen/logrus" +) + +type eventCacheIndexSrv struct { + tms core.TweetMetricServantA +} + +func (s *eventCacheIndexSrv) SendAction(act core.IdxAct, post *ms.Post) { + err := error(nil) + switch act { + case core.IdxActUpdatePost: + err = s.tms.UpdateTweetMetric(&cs.TweetMetric{ + PostId: post.ID, + CommentCount: post.CommentCount, + UpvoteCount: post.UpvoteCount, + CollectionCount: post.CollectionCount, + ShareCount: post.ShareCount, + }) + OnExpireIndexTweetEvent(post.UserID) + case core.IdxActCreatePost: + err = s.tms.AddTweetMetric(post.ID) + OnExpireIndexTweetEvent(post.UserID) + case core.IdxActDeletePost: + err = s.tms.DeleteTweetMetric(post.ID) + OnExpireIndexTweetEvent(post.UserID) + case core.IdxActStickPost, core.IdxActVisiblePost: + OnExpireIndexTweetEvent(post.UserID) + } + if err != nil { + logrus.Errorf("eventCacheIndexSrv.SendAction(%s) occurs error: %s", act, err) + } +} + +func NewEventCacheIndexSrv(tms core.TweetMetricServantA) core.CacheIndexService { + lazyInitial() + return &eventCacheIndexSrv{ + tms: tms, + } +} diff --git a/internal/dao/cache/web.go b/internal/dao/cache/web.go new file mode 100644 index 00000000..60418194 --- /dev/null +++ b/internal/dao/cache/web.go @@ -0,0 +1,163 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cache + +import ( + "context" + "time" + + "github.com/redis/rueidis" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/pkg/utils" +) + +var ( + _webCache core.WebCache = (*webCache)(nil) + _appCache core.AppCache = (*appCache)(nil) +) + +type appCache struct { + cscExpire time.Duration + c rueidis.Client +} + +type webCache struct { + core.AppCache + c rueidis.Client + unreadMsgExpire int64 +} + +func (s *appCache) Get(key string) ([]byte, error) { + res, err := rueidis.MGetCache(s.c, context.Background(), s.cscExpire, []string{key}) + if err != nil { + return nil, err + } + message := res[key] + return message.AsBytes() +} + +func (s *appCache) Set(key string, data []byte, ex int64) error { + ctx := context.Background() + cmd := s.c.B().Set().Key(key).Value(utils.String(data)) + if ex > 0 { + return s.c.Do(ctx, cmd.ExSeconds(ex).Build()).Error() + } + return s.c.Do(ctx, cmd.Build()).Error() +} + +func (s *appCache) SetNx(key string, data []byte, ex int64) error { + ctx := context.Background() + cmd := s.c.B().Set().Key(key).Value(utils.String(data)).Nx() + if ex > 0 { + return s.c.Do(ctx, cmd.ExSeconds(ex).Build()).Error() + } + return s.c.Do(ctx, cmd.Build()).Error() +} + +func (s *appCache) Delete(keys ...string) (err error) { + if len(keys) != 0 { + err = s.c.Do(context.Background(), s.c.B().Del().Key(keys...).Build()).Error() + } + return +} + +func (s *appCache) DelAny(pattern string) (err error) { + var ( + keys []string + cursor uint64 + entry rueidis.ScanEntry + ) + ctx := context.Background() + for { + cmd := s.c.B().Scan().Cursor(cursor).Match(pattern).Count(50).Build() + if entry, err = s.c.Do(ctx, cmd).AsScanEntry(); err != nil { + return + } + keys = append(keys, entry.Elements...) + if entry.Cursor != 0 { + cursor = entry.Cursor + continue + } + break + } + if len(keys) != 0 { + err = s.c.Do(ctx, s.c.B().Del().Key(keys...).Build()).Error() + } + return +} + +func (s *appCache) Exist(key string) bool { + cmd := s.c.B().Exists().Key(key).Build() + count, _ := s.c.Do(context.Background(), cmd).AsInt64() + return count > 0 +} + +func (s *appCache) Keys(pattern string) (res []string, err error) { + ctx, cursor := context.Background(), uint64(0) + for { + cmd := s.c.B().Scan().Cursor(cursor).Match(pattern).Count(50).Build() + entry, err := s.c.Do(ctx, cmd).AsScanEntry() + if err != nil { + return nil, err + } + res = append(res, entry.Elements...) + if entry.Cursor != 0 { + cursor = entry.Cursor + continue + } + break + } + return +} + +func (s *webCache) GetUnreadMsgCountResp(uid int64) ([]byte, error) { + key := conf.KeyUnreadMsg.Get(uid) + return s.Get(key) +} + +func (s *webCache) PutUnreadMsgCountResp(uid int64, data []byte) error { + return s.Set(conf.KeyUnreadMsg.Get(uid), data, s.unreadMsgExpire) +} + +func (s *webCache) DelUnreadMsgCountResp(uid int64) error { + return s.Delete(conf.KeyUnreadMsg.Get(uid)) +} + +func (s *webCache) ExistUnreadMsgCountResp(uid int64) bool { + return s.Exist(conf.KeyUnreadMsg.Get(uid)) +} + +func (s *webCache) PutHistoryMaxOnline(newScore int) (int, error) { + ctx := context.Background() + cmd := s.c.B().Zadd(). + Key(conf.KeySiteStatus). + Gt().ScoreMember(). + ScoreMember(float64(newScore), conf.KeyHistoryMaxOnline).Build() + if err := s.c.Do(ctx, cmd).Error(); err != nil { + return 0, err + } + cmd = s.c.B().Zscore().Key(conf.KeySiteStatus).Member(conf.KeyHistoryMaxOnline).Build() + if score, err := s.c.Do(ctx, cmd).ToFloat64(); err == nil { + return int(score), nil + } else { + return 0, err + } +} + +func newAppCache() *appCache { + return &appCache{ + cscExpire: conf.CacheSetting.CientSideCacheExpire, + c: conf.MustRedisClient(), + } +} + +func newWebCache(ac core.AppCache) *webCache { + return &webCache{ + AppCache: ac, + c: conf.MustRedisClient(), + unreadMsgExpire: conf.CacheSetting.UnreadMsgExpire, + } +} diff --git a/internal/dao/dao.go b/internal/dao/dao.go index b1f7d9f2..8b355e36 100644 --- a/internal/dao/dao.go +++ b/internal/dao/dao.go @@ -7,7 +7,7 @@ package dao import ( "sync" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/dao/jinzhu" "github.com/rocboss/paopao-ce/internal/dao/sakila" diff --git a/internal/dao/jinzhu/comments.go b/internal/dao/jinzhu/comments.go index 4ac08e18..d4b2671c 100644 --- a/internal/dao/jinzhu/comments.go +++ b/internal/dao/jinzhu/comments.go @@ -5,6 +5,7 @@ package jinzhu import ( + "fmt" "time" "github.com/rocboss/paopao-ce/internal/core" @@ -60,8 +61,27 @@ func (s *commentSrv) GetCommentThumbsMap(userId int64, tweetId int64) (cs.Commen return commentThumbs, replyThumbs, nil } -func (s *commentSrv) GetComments(conditions *ms.ConditionsT, offset, limit int) ([]*ms.Comment, error) { - return (&dbr.Comment{}).List(s.db, conditions, offset, limit) +func (s *commentSrv) GetComments(tweetId int64, style cs.StyleCommentType, limit int, offset int) (res []*ms.Comment, total int64, err error) { + db := s.db.Table(_comment_) + sort := "is_essence DESC, id ASC" + switch style { + case cs.StyleCommentHots: + // rank_score=评论回复数*2+点赞*4-点踩, order byrank_score DESC + db = db.Joins(fmt.Sprintf("LEFT JOIN %s m ON %s.id=m.comment_id AND m.is_del=0", _commentMetric_, _comment_)) + sort = fmt.Sprintf("is_essence DESC, m.rank_score DESC, %s.id DESC", _comment_) + case cs.StyleCommentNewest: + sort = "is_essence DESC, id DESC" + case cs.StyleCommentDefault: + fallthrough + default: + // nothing + } + db = db.Where("post_id=?", tweetId) + if err = db.Count(&total).Error; err != nil { + return + } + err = db.Order(sort).Limit(limit).Offset(offset).Find(&res).Error + return } func (s *commentSrv) GetCommentByID(id int64) (*ms.Comment, error) { @@ -99,11 +119,9 @@ func (s *commentSrv) GetCommentRepliesByID(ids []int64) ([]*ms.CommentReplyForma "comment_id IN ?": ids, "ORDER": "id ASC", }, 0, 0) - if err != nil { return nil, err } - userIds := []int64{} for _, reply := range replies { userIds = append(userIds, reply.UserID, reply.AtUserID) @@ -124,44 +142,61 @@ func (s *commentSrv) GetCommentRepliesByID(ids []int64) ([]*ms.CommentReplyForma replyFormated.AtUser = user.Format() } } - repliesFormated = append(repliesFormated, replyFormated) } return repliesFormated, nil } -func (s *commentManageSrv) DeleteComment(comment *ms.Comment) error { +func (s *commentManageSrv) HighlightComment(userId, commentId int64) (res int8, err error) { + post := &dbr.Post{} + comment := &dbr.Comment{} + db := s.db.Model(comment) + if err = db.Where("id=?", commentId).First(comment).Error; err != nil { + return + } + if err = s.db.Table(_post_).Where("id=?", comment.PostID).First(post).Error; err != nil { + return + } + if post.UserID != userId { + return 0, cs.ErrNoPermission + } + comment.IsEssence = 1 - comment.IsEssence + return comment.IsEssence, db.Save(comment).Error +} + +func (s *commentManageSrv) DeleteComment(comment *ms.Comment) (err error) { db := s.db.Begin() defer db.Rollback() - - err := comment.Delete(s.db) - if err != nil { - return err + if err = comment.Delete(db); err != nil { + return } err = db.Model(&dbr.TweetCommentThumbs{}).Where("user_id=? AND tweet_id=? AND comment_id=?", comment.UserID, comment.PostID, comment.ID).Updates(map[string]any{ "deleted_on": time.Now().Unix(), "is_del": 1, }).Error if err != nil { - return err + return } db.Commit() - return nil + return } func (s *commentManageSrv) CreateComment(comment *ms.Comment) (*ms.Comment, error) { return comment.Create(s.db) } -func (s *commentManageSrv) CreateCommentReply(reply *ms.CommentReply) (*ms.CommentReply, error) { - return reply.Create(s.db) +func (s *commentManageSrv) CreateCommentReply(reply *ms.CommentReply) (res *ms.CommentReply, err error) { + if res, err = reply.Create(s.db); err == nil { + // 宽松处理错误 + s.db.Table(_comment_).Where("id=?", reply.CommentID).Update("reply_count", gorm.Expr("reply_count+1")) + } + return } func (s *commentManageSrv) DeleteCommentReply(reply *ms.CommentReply) (err error) { db := s.db.Begin() defer db.Rollback() - err = reply.Delete(s.db) if err != nil { return @@ -174,6 +209,8 @@ func (s *commentManageSrv) DeleteCommentReply(reply *ms.CommentReply) (err error if err != nil { return } + // 宽松处理错误 + db.Table(_comment_).Where("id=?", reply.CommentID).Update("reply_count", gorm.Expr("reply_count-1")) db.Commit() return } diff --git a/internal/dao/jinzhu/dbr/comment.go b/internal/dao/jinzhu/dbr/comment.go index 4f673336..364253c4 100644 --- a/internal/dao/jinzhu/dbr/comment.go +++ b/internal/dao/jinzhu/dbr/comment.go @@ -17,6 +17,8 @@ type Comment struct { UserID int64 `json:"user_id"` IP string `json:"ip"` IPLoc string `json:"ip_loc"` + IsEssence int8 `json:"is_essense"` + ReplyCount int32 `json:"reply_count"` ThumbsUpCount int32 `json:"thumbs_up_count"` ThumbsDownCount int32 `json:"-"` } @@ -29,7 +31,9 @@ type CommentFormated struct { Contents []*CommentContent `json:"contents"` Replies []*CommentReplyFormated `json:"replies"` IPLoc string `json:"ip_loc"` + ReplyCount int32 `json:"reply_count"` ThumbsUpCount int32 `json:"thumbs_up_count"` + IsEssence int8 `json:"is_essence"` IsThumbsUp int8 `json:"is_thumbs_up"` IsThumbsDown int8 `json:"is_thumbs_down"` CreatedOn int64 `json:"created_on"` @@ -48,7 +52,9 @@ func (c *Comment) Format() *CommentFormated { Contents: []*CommentContent{}, Replies: []*CommentReplyFormated{}, IPLoc: c.IPLoc, + ReplyCount: c.ReplyCount, ThumbsUpCount: c.ThumbsUpCount, + IsEssence: c.IsEssence, IsThumbsUp: types.No, IsThumbsDown: types.No, CreatedOn: c.CreatedOn, @@ -116,7 +122,6 @@ func (c *Comment) Count(db *gorm.DB, conditions *ConditionsT) (int64, error) { func (c *Comment) Create(db *gorm.DB) (*Comment, error) { err := db.Create(&c).Error - return c, err } diff --git a/internal/dao/jinzhu/dbr/message.go b/internal/dao/jinzhu/dbr/message.go index 6c952bae..cac72cbf 100644 --- a/internal/dao/jinzhu/dbr/message.go +++ b/internal/dao/jinzhu/dbr/message.go @@ -38,6 +38,7 @@ type MessageFormated struct { SenderUserID int64 `json:"sender_user_id"` SenderUser *UserFormated `json:"sender_user"` ReceiverUserID int64 `json:"receiver_user_id"` + ReceiverUser *UserFormated `json:"receiver_user,omitempty"` Type MessageT `json:"type"` Brief string `json:"brief"` Content string `json:"content"` @@ -61,6 +62,7 @@ func (m *Message) Format() *MessageFormated { SenderUserID: m.SenderUserID, SenderUser: &UserFormated{}, ReceiverUserID: m.ReceiverUserID, + ReceiverUser: &UserFormated{}, Type: m.Type, Brief: m.Brief, Content: m.Content, @@ -114,39 +116,20 @@ func (m *Message) FetchBy(db *gorm.DB, predicates Predicates) ([]*Message, error return messages, nil } -func (c *Message) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*Message, error) { - var messages []*Message - var err error +func (c *Message) List(db *gorm.DB, userId int64, offset, limit int) (res []*Message, err error) { if offset >= 0 && limit > 0 { db = db.Offset(offset).Limit(limit) } - - for k, v := range *conditions { - if k == "ORDER" { - db = db.Order(v) - } else { - db = db.Where(k, v) - } - } - - if err = db.Where("is_del = ?", 0).Find(&messages).Error; err != nil { - return nil, err - } - - return messages, nil + err = db.Where("receiver_user_id=? OR (sender_user_id=? AND type=4)", userId, userId).Order("id DESC").Find(&res).Error + return } -func (m *Message) Count(db *gorm.DB, conditions *ConditionsT) (int64, error) { - var count int64 - - for k, v := range *conditions { - if k != "ORDER" { - db = db.Where(k, v) - } - } - if err := db.Model(m).Count(&count).Error; err != nil { - return 0, err - } +func (m *Message) Count(db *gorm.DB, userId int64) (res int64, err error) { + err = db.Model(m).Where("receiver_user_id=? OR (sender_user_id=? AND type=4)", userId, userId).Count(&res).Error + return +} - return count, nil +func (m *Message) CountUnread(db *gorm.DB, userId int64) (res int64, err error) { + err = db.Model(m).Where("receiver_user_id=? AND is_read=0", userId).Count(&res).Error + return } diff --git a/internal/dao/jinzhu/dbr/metrics.go b/internal/dao/jinzhu/dbr/metrics.go new file mode 100644 index 00000000..4210c701 --- /dev/null +++ b/internal/dao/jinzhu/dbr/metrics.go @@ -0,0 +1,72 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package dbr + +import ( + "time" + + "gorm.io/gorm" +) + +type PostMetric struct { + *Model + PostId int64 + RankScore int64 + IncentiveScore int + DecayFactor int + MotivationFactor int +} + +type CommentMetric struct { + *Model + CommentId int64 + RankScore int64 + IncentiveScore int + DecayFactor int + MotivationFactor int +} + +type UserMetric struct { + *Model + UserId int64 + TweetsCount int + LatestTrendsOn int64 +} + +func (m *PostMetric) Create(db *gorm.DB) (*PostMetric, error) { + err := db.Create(&m).Error + return m, err +} + +func (m *PostMetric) Delete(db *gorm.DB) error { + return db.Model(m).Where("post_id", m.PostId).Updates(map[string]any{ + "deleted_on": time.Now().Unix(), + "is_del": 1, + }).Error +} + +func (m *CommentMetric) Create(db *gorm.DB) (*CommentMetric, error) { + err := db.Create(&m).Error + return m, err +} + +func (m *CommentMetric) Delete(db *gorm.DB) error { + return db.Model(m).Where("comment_id", m.CommentId).Updates(map[string]any{ + "deleted_on": time.Now().Unix(), + "is_del": 1, + }).Error +} + +func (m *UserMetric) Create(db *gorm.DB) (*UserMetric, error) { + err := db.Create(&m).Error + return m, err +} + +func (m *UserMetric) Delete(db *gorm.DB) error { + return db.Model(m).Where("user_id", m.UserId).Updates(map[string]any{ + "deleted_on": time.Now().Unix(), + "is_del": 1, + }).Error +} diff --git a/internal/dao/jinzhu/dbr/post.go b/internal/dao/jinzhu/dbr/post.go index f3d3e824..76aa57c9 100644 --- a/internal/dao/jinzhu/dbr/post.go +++ b/internal/dao/jinzhu/dbr/post.go @@ -11,14 +11,14 @@ import ( "gorm.io/gorm" ) -// PostVisibleT 可访问类型,0公开,1私密,2好友 +// PostVisibleT 可访问类型,可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开', type PostVisibleT uint8 const ( - PostVisitPublic PostVisibleT = iota - PostVisitPrivate - PostVisitFriend - PostVisitInvalid + PostVisitPublic PostVisibleT = 90 + PostVisitPrivate PostVisibleT = 0 + PostVisitFriend PostVisibleT = 50 + PostVisitFollowing PostVisibleT = 60 ) type PostByMedia = Post @@ -64,6 +64,22 @@ type PostFormated struct { IPLoc string `json:"ip_loc"` } +func (t PostVisibleT) ToOutValue() (res uint8) { + switch t { + case PostVisitPublic: + res = 0 + case PostVisitPrivate: + res = 1 + case PostVisitFriend: + res = 2 + case PostVisitFollowing: + res = 3 + default: + res = 1 + } + return +} + func (p *Post) Format() *PostFormated { if p.Model != nil { tagsMap := map[string]int8{} @@ -211,8 +227,6 @@ func (p PostVisibleT) String() string { return "private" case PostVisitFriend: return "friend" - case PostVisitInvalid: - return "invalid" default: return "unknow" } diff --git a/internal/dao/jinzhu/dbr/user.go b/internal/dao/jinzhu/dbr/user.go index 7297e39f..4d7f7f6d 100644 --- a/internal/dao/jinzhu/dbr/user.go +++ b/internal/dao/jinzhu/dbr/user.go @@ -28,12 +28,14 @@ type User struct { } type UserFormated struct { - ID int64 `db:"id" json:"id"` - Nickname string `json:"nickname"` - Username string `json:"username"` - Status int `json:"status"` - Avatar string `json:"avatar"` - IsAdmin bool `json:"is_admin"` + ID int64 `db:"id" json:"id"` + Nickname string `json:"nickname"` + Username string `json:"username"` + Status int `json:"status"` + Avatar string `json:"avatar"` + IsAdmin bool `json:"is_admin"` + IsFriend bool `json:"is_friend"` + IsFollowing bool `json:"is_following"` } func (u *User) Format() *UserFormated { @@ -97,7 +99,6 @@ func (u *User) ListUserInfoById(db *gorm.DB, ids []int64) (res cs.UserInfoList, func (u *User) Create(db *gorm.DB) (*User, error) { err := db.Create(&u).Error - return u, err } diff --git a/internal/dao/jinzhu/gorm.go b/internal/dao/jinzhu/gorm.go index c5b0d4f6..0a0cdb27 100644 --- a/internal/dao/jinzhu/gorm.go +++ b/internal/dao/jinzhu/gorm.go @@ -15,6 +15,7 @@ var ( _attachment_ string _captcha_ string _comment_ string + _commentMetric_ string _commentContent_ string _commentReply_ string _following_ string @@ -22,6 +23,7 @@ var ( _contactGroup_ string _message_ string _post_ string + _post_metric_ string _post_by_comment_ string _post_by_media_ string _postAttachmentBill_ string @@ -30,6 +32,8 @@ var ( _postStar_ string _tag_ string _user_ string + _userRelation_ string + _userMetric_ string _walletRecharge_ string _walletStatement_ string ) @@ -41,6 +45,7 @@ func initTableName() { _attachment_ = m[conf.TableAttachment] _captcha_ = m[conf.TableCaptcha] _comment_ = m[conf.TableComment] + _commentMetric_ = m[conf.TableCommentMetric] _commentContent_ = m[conf.TableCommentContent] _commentReply_ = m[conf.TableCommentReply] _following_ = m[conf.TableFollowing] @@ -48,6 +53,7 @@ func initTableName() { _contactGroup_ = m[conf.TableContactGroup] _message_ = m[conf.TableMessage] _post_ = m[conf.TablePost] + _post_metric_ = m[conf.TablePostMetric] _post_by_comment_ = m[conf.TablePostByComment] _post_by_media_ = m[conf.TablePostByMedia] _postAttachmentBill_ = m[conf.TablePostAttachmentBill] @@ -56,6 +62,8 @@ func initTableName() { _postStar_ = m[conf.TablePostStar] _tag_ = m[conf.TableTag] _user_ = m[conf.TableUser] + _userRelation_ = m[conf.TableUserRelation] + _userMetric_ = m[conf.TableUserMetric] _walletRecharge_ = m[conf.TableWalletRecharge] _walletStatement_ = m[conf.TableWalletStatement] } diff --git a/internal/dao/jinzhu/jinzhu.go b/internal/dao/jinzhu/jinzhu.go index a3255010..16b6d64a 100644 --- a/internal/dao/jinzhu/jinzhu.go +++ b/internal/dao/jinzhu/jinzhu.go @@ -12,12 +12,10 @@ import ( "sync" "github.com/Masterminds/semver/v3" - "github.com/alimy/cfg" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/dao/cache" "github.com/rocboss/paopao-ce/internal/dao/security" - "github.com/sirupsen/logrus" ) var ( @@ -31,18 +29,22 @@ var ( ) type dataSrv struct { - core.IndexPostsService core.WalletService core.MessageService core.TopicService core.TweetService core.TweetManageService core.TweetHelpService + core.TweetMetricServantA core.CommentService core.CommentManageService + core.CommentMetricServantA + core.TrendsManageServantA core.UserManageService + core.UserMetricServantA core.ContactManageService core.FollowingManageService + core.UserRelationService core.SecurityService core.AttachmentCheckService } @@ -56,38 +58,16 @@ type webDataSrvA struct { func NewDataService() (core.DataService, core.VersionInfo) { lazyInitial() - - var ( - v core.VersionInfo - cis core.CacheIndexService - ) db := conf.MustGormDB() pvs := security.NewPhoneVerifyService() - ams := NewAuthorizationManageService() - ths := newTweetHelpService(db) - ips := newShipIndexService(db, ams, ths) - - // initialize core.CacheIndexService - cfg.On(cfg.Actions{ - "SimpleCacheIndex": func() { - // simpleCache use special post index service - ips = newSimpleIndexPostsService(db, ths) - cis, v = cache.NewSimpleCacheIndexService(ips) - }, - "BigCacheIndex": func() { - cis, v = cache.NewBigCacheIndexService(ips, ams) - }, - "RedisCacheIndex": func() { - cis, v = cache.NewRedisCacheIndexService(ips, ams) - }, - }, func() { - // defualt no cache - cis, v = cache.NewNoneCacheIndexService(ips) - }) - logrus.Infof("use %s as cache index service by version: %s", v.Name(), v.Version()) - + tms := newTweetMetricServentA(db) + ums := newUserMetricServentA(db) + cms := newCommentMetricServentA(db) + cis := cache.NewEventCacheIndexSrv(tms) ds := &dataSrv{ - IndexPostsService: cis, + TweetMetricServantA: tms, + CommentMetricServantA: cms, + UserMetricServantA: ums, WalletService: newWalletService(db), MessageService: newMessageService(db), TopicService: newTopicService(db), @@ -96,13 +76,15 @@ func NewDataService() (core.DataService, core.VersionInfo) { TweetHelpService: newTweetHelpService(db), CommentService: newCommentService(db), CommentManageService: newCommentManageService(db), - UserManageService: newUserManageService(db), + TrendsManageServantA: newTrendsManageServentA(db), + UserManageService: newUserManageService(db, ums), ContactManageService: newContactManageService(db), FollowingManageService: newFollowingManageService(db), + UserRelationService: newUserRelationService(db), SecurityService: newSecurityService(db, pvs), AttachmentCheckService: security.NewAttachmentCheckService(), } - return ds, ds + return cache.NewCacheDataService(ds), ds } func NewWebDataServantA() (core.WebDataServantA, core.VersionInfo) { diff --git a/internal/dao/jinzhu/messages.go b/internal/dao/jinzhu/messages.go index 00df949f..105618e9 100644 --- a/internal/dao/jinzhu/messages.go +++ b/internal/dao/jinzhu/messages.go @@ -6,6 +6,7 @@ package jinzhu import ( "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "gorm.io/gorm" @@ -30,10 +31,7 @@ func (s *messageSrv) CreateMessage(msg *ms.Message) (*ms.Message, error) { } func (s *messageSrv) GetUnreadCount(userID int64) (int64, error) { - return (&dbr.Message{}).Count(s.db, &dbr.ConditionsT{ - "receiver_user_id": userID, - "is_read": dbr.MsgStatusUnread, - }) + return (&dbr.Message{}).CountUnread(s.db, userID) } func (s *messageSrv) GetMessageByID(id int64) (*ms.Message, error) { @@ -49,21 +47,39 @@ func (s *messageSrv) ReadMessage(message *ms.Message) error { return message.Update(s.db) } -func (s *messageSrv) GetMessages(conditions *ms.ConditionsT, offset, limit int) ([]*ms.MessageFormated, error) { - messages, err := (&dbr.Message{}).List(s.db, conditions, offset, limit) - if err != nil { - return nil, err - } +func (s *messageSrv) ReadAllMessage(userId int64) error { + return s.db.Table(_message_).Where("receiver_user_id=? AND is_del=0", userId).Update("is_read", 1).Error +} - mfs := []*dbr.MessageFormated{} +func (s *messageSrv) GetMessages(userId int64, style cs.MessageStyle, limit int, offset int) (res []*ms.MessageFormated, total int64, err error) { + var messages []*dbr.Message + db := s.db.Table(_message_) + // 1动态,2评论,3回复,4私信,5好友申请,99系统通知' + switch style { + case cs.StyleMsgSystem: + db = db.Where("receiver_user_id=? AND type IN (1, 2, 3, 99)", userId) + case cs.StyleMsgWhisper: + db = db.Where("(receiver_user_id=? OR sender_user_id=?) AND type=4", userId, userId) + case cs.StyleMsgRequesting: + db = db.Where("receiver_user_id=? AND type=5", userId) + case cs.StyleMsgUnread: + db = db.Where("receiver_user_id=? AND is_read=0", userId) + case cs.StyleMsgAll: + fallthrough + default: + db = db.Where("receiver_user_id=? OR (sender_user_id=? AND type=4)", userId, userId) + } + if err = db.Count(&total).Error; err != nil || total == 0 { + return + } + if offset >= 0 && limit > 0 { + db = db.Limit(limit).Offset(offset) + } + if err = db.Order("id DESC").Find(&messages).Error; err != nil { + return + } for _, message := range messages { - mf := message.Format() - mfs = append(mfs, mf) + res = append(res, message.Format()) } - - return mfs, nil -} - -func (s *messageSrv) GetMessageCount(conditions *ms.ConditionsT) (int64, error) { - return (&dbr.Message{}).Count(s.db, conditions) + return } diff --git a/internal/dao/jinzhu/metrics.go b/internal/dao/jinzhu/metrics.go new file mode 100644 index 00000000..5df75fe9 --- /dev/null +++ b/internal/dao/jinzhu/metrics.go @@ -0,0 +1,113 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package jinzhu + +import ( + "time" + + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" + "gorm.io/gorm" +) + +type tweetMetricSrvA struct { + db *gorm.DB +} + +type commentMetricSrvA struct { + db *gorm.DB +} + +type userMetricSrvA struct { + db *gorm.DB +} + +func (s *tweetMetricSrvA) UpdateTweetMetric(metric *cs.TweetMetric) error { + return s.db.Transaction(func(tx *gorm.DB) (err error) { + postMetric := &dbr.PostMetric{PostId: metric.PostId} + db := s.db.Model(postMetric).Where("post_id=?", metric.PostId) + db.First(postMetric) + postMetric.RankScore = metric.RankScore(postMetric.MotivationFactor) + err = db.Save(postMetric).Error + return + }) +} + +func (s *tweetMetricSrvA) AddTweetMetric(postId int64) (err error) { + _, err = (&dbr.PostMetric{PostId: postId}).Create(s.db) + return +} + +func (s *tweetMetricSrvA) DeleteTweetMetric(postId int64) (err error) { + return (&dbr.PostMetric{PostId: postId}).Delete(s.db) +} + +func (s *commentMetricSrvA) UpdateCommentMetric(metric *cs.CommentMetric) error { + return s.db.Transaction(func(tx *gorm.DB) (err error) { + commentMetric := &dbr.CommentMetric{CommentId: metric.CommentId} + db := s.db.Model(commentMetric).Where("comment_id=?", metric.CommentId) + db.First(commentMetric) + commentMetric.RankScore = metric.RankScore(commentMetric.MotivationFactor) + err = db.Save(commentMetric).Error + return + }) +} + +func (s *commentMetricSrvA) AddCommentMetric(commentId int64) (err error) { + _, err = (&dbr.CommentMetric{CommentId: commentId}).Create(s.db) + return +} + +func (s *commentMetricSrvA) DeleteCommentMetric(commentId int64) (err error) { + return (&dbr.CommentMetric{CommentId: commentId}).Delete(s.db) +} + +func (s *userMetricSrvA) UpdateUserMetric(userId int64, action uint8) (err error) { + metric := &dbr.UserMetric{} + db := s.db.Model(metric) + if err = db.Where("user_id=?", userId).First(metric).Error; err != nil { + metric = &dbr.UserMetric{ + UserId: userId, + } + } + metric.LatestTrendsOn = time.Now().Unix() + switch action { + case cs.MetricActionCreateTweet: + metric.TweetsCount++ + case cs.MetricActionDeleteTweet: + if metric.TweetsCount > 0 { + metric.TweetsCount-- + } + } + return db.Save(metric).Error +} + +func (s *userMetricSrvA) AddUserMetric(userId int64) (err error) { + _, err = (&dbr.UserMetric{UserId: userId}).Create(s.db) + return +} + +func (s *userMetricSrvA) DeleteUserMetric(userId int64) (err error) { + return (&dbr.UserMetric{UserId: userId}).Delete(s.db) +} + +func newTweetMetricServentA(db *gorm.DB) core.TweetMetricServantA { + return &tweetMetricSrvA{ + db: db, + } +} + +func newCommentMetricServentA(db *gorm.DB) core.CommentMetricServantA { + return &commentMetricSrvA{ + db: db, + } +} + +func newUserMetricServentA(db *gorm.DB) core.UserMetricServantA { + return &userMetricSrvA{ + db: db, + } +} diff --git a/internal/dao/jinzhu/trends.go b/internal/dao/jinzhu/trends.go new file mode 100644 index 00000000..2d4aff4b --- /dev/null +++ b/internal/dao/jinzhu/trends.go @@ -0,0 +1,40 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package jinzhu + +import ( + "fmt" + + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "gorm.io/gorm" +) + +type trendsSrvA struct { + db *gorm.DB +} + +func (s *trendsSrvA) GetIndexTrends(userId int64, limit int, offset int) (res []*cs.TrendsItem, total int64, err error) { + db := s.db.Table(_user_). + Joins(fmt.Sprintf("JOIN %s r ON r.he_uid=%s.id", _userRelation_, _user_)). + Joins(fmt.Sprintf("JOIN %s m ON r.he_uid=m.user_id", _userMetric_)). + Where("r.user_id=? AND m.tweets_count>0 AND m.is_del=0", userId) + if err = db.Count(&total).Error; err != nil || total == 0 { + return + } + if offset >= 0 && limit > 0 { + db = db.Limit(limit).Offset(offset) + } + if err = db.Order("r.style ASC, m.latest_trends_on DESC").Select("username", "nickname", "avatar").Find(&res).Error; err == nil { + res = cs.DistinctTrends(res) + } + return +} + +func newTrendsManageServentA(db *gorm.DB) core.TrendsManageServantA { + return &trendsSrvA{ + db: db, + } +} diff --git a/internal/dao/jinzhu/tweets.go b/internal/dao/jinzhu/tweets.go index d7bead87..8139b1c1 100644 --- a/internal/dao/jinzhu/tweets.go +++ b/internal/dao/jinzhu/tweets.go @@ -5,6 +5,7 @@ package jinzhu import ( + "fmt" "strings" "time" @@ -214,7 +215,6 @@ func (s *tweetManageSrv) CreatePost(post *ms.Post) (*ms.Post, error) { func (s *tweetManageSrv) DeletePost(post *ms.Post) ([]string, error) { var mediaContents []string - postId := post.ID postContent := &dbr.PostContent{} err := s.db.Transaction( @@ -326,15 +326,15 @@ func (s *tweetManageSrv) HighlightPost(userId int64, postId int64) (res int, err return post.IsEssence, nil } -func (s *tweetManageSrv) VisiblePost(post *ms.Post, visibility core.PostVisibleT) (err error) { +func (s *tweetManageSrv) VisiblePost(post *ms.Post, visibility cs.TweetVisibleType) (err error) { oldVisibility := post.Visibility - post.Visibility = visibility + post.Visibility = ms.PostVisibleT(visibility) // TODO: 这个判断是否可以不要呢 - if oldVisibility == visibility { + if oldVisibility == ms.PostVisibleT(visibility) { return nil } // 私密推文 特殊处理 - if visibility == dbr.PostVisitPrivate { + if visibility == cs.TweetVisitPrivate { // 强制取消置顶 // TODO: 置顶推文用户是否有权设置成私密? 后续完善 post.IsTop = 0 @@ -350,7 +350,7 @@ func (s *tweetManageSrv) VisiblePost(post *ms.Post, visibility core.PostVisibleT if oldVisibility == dbr.PostVisitPrivate { // 从私密转为非私密才需要重新创建tag createTags(tx, post.UserID, tags) - } else if visibility == dbr.PostVisitPrivate { + } else if visibility == cs.TweetVisitPrivate { // 从非私密转为私密才需要删除tag deleteTags(tx, tags) } @@ -392,6 +392,131 @@ func (s *tweetSrv) GetPosts(conditions ms.ConditionsT, offset, limit int) ([]*ms return (&dbr.Post{}).List(s.db, conditions, offset, limit) } +func (s *tweetSrv) ListUserTweets(userId int64, style uint8, justEssence bool, limit, offset int) (res []*ms.Post, total int64, err error) { + db := s.db.Model(&dbr.Post{}).Where("user_id = ?", userId) + switch style { + case cs.StyleUserTweetsAdmin: + fallthrough + case cs.StyleUserTweetsSelf: + db = db.Where("visibility >= ?", cs.TweetVisitPrivate) + case cs.StyleUserTweetsFriend: + db = db.Where("visibility >= ?", cs.TweetVisitFriend) + case cs.StyleUserTweetsFollowing: + db = db.Where("visibility >= ?", cs.TweetVisitFollowing) + case cs.StyleUserTweetsGuest: + fallthrough + default: + db = db.Where("visibility >= ?", cs.TweetVisitPublic) + } + if justEssence { + db = db.Where("is_essence=1") + } + if err = db.Count(&total).Error; err != nil { + return + } + if offset >= 0 && limit > 0 { + db = db.Offset(offset).Limit(limit) + } + if err = db.Order("is_top DESC, latest_replied_on DESC").Find(&res).Error; err != nil { + return + } + return +} + +func (s *tweetSrv) ListIndexNewestTweets(limit, offset int) (res []*ms.Post, total int64, err error) { + db := s.db.Table(_post_).Where("visibility >= ?", cs.TweetVisitPublic) + if err = db.Count(&total).Error; err != nil { + return + } + if offset >= 0 && limit > 0 { + db = db.Offset(offset).Limit(limit) + } + if err = db.Order("is_top DESC, latest_replied_on DESC").Find(&res).Error; err != nil { + return + } + return +} + +func (s *tweetSrv) ListIndexHotsTweets(limit, offset int) (res []*ms.Post, total int64, err error) { + db := s.db.Table(_post_).Joins(fmt.Sprintf("LEFT JOIN %s metric ON %s.id=metric.post_id", _post_metric_, _post_)).Where(fmt.Sprintf("visibility >= ? AND %s.is_del=0 AND metric.is_del=0", _post_), cs.TweetVisitPublic) + if err = db.Count(&total).Error; err != nil { + return + } + if offset >= 0 && limit > 0 { + db = db.Offset(offset).Limit(limit) + } + if err = db.Order("is_top DESC, metric.rank_score DESC, latest_replied_on DESC").Find(&res).Error; err != nil { + return + } + return +} + +func (s *tweetSrv) ListSyncSearchTweets(limit, offset int) (res []*ms.Post, total int64, err error) { + db := s.db.Table(_post_).Where("visibility >= ?", cs.TweetVisitFriend) + if err = db.Count(&total).Error; err != nil { + return + } + if offset >= 0 && limit > 0 { + db = db.Offset(offset).Limit(limit) + } + if err = db.Find(&res).Error; err != nil { + return + } + return +} + +func (s *tweetSrv) ListFollowingTweets(userId int64, limit, offset int) (res []*ms.Post, total int64, err error) { + beFriendIds, beFollowIds, xerr := s.getUserRelation(userId) + if xerr != nil { + return nil, 0, xerr + } + beFriendCount, beFollowCount := len(beFriendIds), len(beFollowIds) + db := s.db.Model(&dbr.Post{}) + //可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开', + switch { + case beFriendCount > 0 && beFollowCount > 0: + db = db.Where("user_id=? OR (visibility>=50 AND user_id IN(?)) OR (visibility>=60 AND user_id IN(?))", userId, beFriendIds, beFollowIds) + case beFriendCount > 0 && beFollowCount == 0: + db = db.Where("user_id=? OR (visibility>=50 AND user_id IN(?))", userId, beFriendIds) + case beFriendCount == 0 && beFollowCount > 0: + db = db.Where("user_id=? OR (visibility>=60 AND user_id IN(?))", userId, beFollowIds) + case beFriendCount == 0 && beFollowCount == 0: + db = db.Where("user_id = ?", userId) + } + if err = db.Count(&total).Error; err != nil { + return + } + if offset >= 0 && limit > 0 { + db = db.Offset(offset).Limit(limit) + } + if err = db.Order("is_top DESC, latest_replied_on DESC").Find(&res).Error; err != nil { + return + } + return +} + +func (s *tweetSrv) getUserRelation(userId int64) (beFriendIds []int64, beFollowIds []int64, err error) { + if err = s.db.Table(_contact_).Where("friend_id=? AND status=2 AND is_del=0", userId).Select("user_id").Find(&beFriendIds).Error; err != nil { + return + } + if err = s.db.Table(_following_).Where("user_id=? AND is_del=0", userId).Select("follow_id").Find(&beFollowIds).Error; err != nil { + return + } + // 即是好友又是关注者,保留好友去除关注者 + for _, id := range beFriendIds { + for i := 0; i < len(beFollowIds); i++ { + // 找到item即删,数据库已经保证唯一性 + if beFollowIds[i] == id { + lastIdx := len(beFollowIds) - 1 + beFollowIds[i] = beFollowIds[lastIdx] + beFollowIds = beFollowIds[:lastIdx] + break + } + } + } + return +} + func (s *tweetSrv) GetPostCount(conditions ms.ConditionsT) (int64, error) { return (&dbr.Post{}).Count(s.db, conditions) } diff --git a/internal/dao/jinzhu/user.go b/internal/dao/jinzhu/user.go index 6bc18de3..6f5c2c71 100644 --- a/internal/dao/jinzhu/user.go +++ b/internal/dao/jinzhu/user.go @@ -5,9 +5,11 @@ package jinzhu import ( + "fmt" "strings" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "gorm.io/gorm" @@ -18,11 +20,41 @@ var ( ) type userManageSrv struct { + db *gorm.DB + ums core.UserMetricServantA + + _userProfileJoins string + _userProfileWhere string + _userProfileColoumns []string +} + +type userRelationSrv struct { db *gorm.DB } -func newUserManageService(db *gorm.DB) core.UserManageService { +func newUserManageService(db *gorm.DB, ums core.UserMetricServantA) core.UserManageService { return &userManageSrv{ + db: db, + ums: ums, + _userProfileJoins: fmt.Sprintf("LEFT JOIN %s m ON %s.id=m.user_id", _userMetric_, _user_), + _userProfileWhere: fmt.Sprintf("%s.username=? AND %s.is_del=0", _user_, _user_), + _userProfileColoumns: []string{ + fmt.Sprintf("%s.id", _user_), + fmt.Sprintf("%s.username", _user_), + fmt.Sprintf("%s.nickname", _user_), + fmt.Sprintf("%s.phone", _user_), + fmt.Sprintf("%s.status", _user_), + fmt.Sprintf("%s.avatar", _user_), + fmt.Sprintf("%s.balance", _user_), + fmt.Sprintf("%s.is_admin", _user_), + fmt.Sprintf("%s.created_on", _user_), + "m.tweets_count", + }, + } +} + +func newUserRelationService(db *gorm.DB) core.UserRelationService { + return &userRelationSrv{ db: db, } } @@ -43,6 +75,14 @@ func (s *userManageSrv) GetUserByUsername(username string) (*ms.User, error) { return user.Get(s.db) } +func (s *userManageSrv) UserProfileByName(username string) (res *cs.UserProfile, err error) { + err = s.db.Table(_user_).Joins(s._userProfileJoins). + Where(s._userProfileWhere, username). + Select(s._userProfileColoumns). + First(&res).Error + return +} + func (s *userManageSrv) GetUserByPhone(phone string) (*ms.User, error) { user := &dbr.User{ Phone: phone, @@ -71,10 +111,73 @@ func (s *userManageSrv) GetUsersByKeyword(keyword string) ([]*ms.User, error) { } } -func (s *userManageSrv) CreateUser(user *dbr.User) (*ms.User, error) { - return user.Create(s.db) +func (s *userManageSrv) CreateUser(user *dbr.User) (res *ms.User, err error) { + if res, err = user.Create(s.db); err == nil { + // 宽松处理错误 + s.ums.AddUserMetric(res.ID) + } + return } func (s *userManageSrv) UpdateUser(user *ms.User) error { return user.Update(s.db) } + +func (s *userManageSrv) GetRegisterUserCount() (res int64, err error) { + err = s.db.Model(&dbr.User{}).Count(&res).Error + return +} + +func (s *userRelationSrv) MyFriendIds(userId int64) (res []int64, err error) { + err = s.db.Table(_contact_).Where("user_id=? AND status=2 AND is_del=0", userId).Select("friend_id").Find(&res).Error + return +} + +func (s *userRelationSrv) MyFollowIds(userId int64) (res []int64, err error) { + err = s.db.Table(_following_).Where("user_id=? AND is_del=0", userId).Select("follow_id").Find(&res).Error + return +} + +func (s *userRelationSrv) IsMyFriend(userId int64, friendIds ...int64) (map[int64]bool, error) { + size := len(friendIds) + res := make(map[int64]bool, size) + if size == 0 { + return res, nil + } + myFriendIds, err := s.MyFriendIds(userId) + if err != nil { + return nil, err + } + for _, friendId := range friendIds { + res[friendId] = false + for _, myFriendId := range myFriendIds { + if friendId == myFriendId { + res[friendId] = true + break + } + } + } + return res, nil +} + +func (s *userRelationSrv) IsMyFollow(userId int64, followIds ...int64) (map[int64]bool, error) { + size := len(followIds) + res := make(map[int64]bool, size) + if size == 0 { + return res, nil + } + myFollowIds, err := s.MyFollowIds(userId) + if err != nil { + return nil, err + } + for _, followId := range followIds { + res[followId] = false + for _, myFollowId := range myFollowIds { + if followId == myFollowId { + res[followId] = true + break + } + } + } + return res, nil +} diff --git a/internal/dao/search/bridge.go b/internal/dao/search/bridge.go index bc4eb039..6c9ed164 100644 --- a/internal/dao/search/bridge.go +++ b/internal/dao/search/bridge.go @@ -65,7 +65,7 @@ func (s *bridgeTweetSearchServant) updateDocs(doc *documents) { // watch updateDocsTempch to continue handle update if needed. // cancel loop if no item had watched in 1 minute. - for count := 0; count > 60; count++ { + for count := 0; count < 60; count++ { select { case item := <-s.updateDocsTempCh: // reset count to continue handle docs update diff --git a/internal/dao/security/security.go b/internal/dao/security/security.go index 75cd003b..1556ad73 100644 --- a/internal/dao/security/security.go +++ b/internal/dao/security/security.go @@ -3,7 +3,7 @@ package security import ( "strings" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/rocboss/paopao-ce/internal/core" ) diff --git a/internal/dao/storage/storage.go b/internal/dao/storage/storage.go index 0f03fa20..c7b57947 100644 --- a/internal/dao/storage/storage.go +++ b/internal/dao/storage/storage.go @@ -12,7 +12,7 @@ import ( "strconv" "time" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/aliyun/aliyun-oss-go-sdk/oss" "github.com/huaweicloud/huaweicloud-sdk-go-obs/obs" "github.com/minio/minio-go/v7" diff --git a/internal/events/events.go b/internal/events/events.go new file mode 100644 index 00000000..69a976ea --- /dev/null +++ b/internal/events/events.go @@ -0,0 +1,112 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package events + +import ( + "sync" + + "github.com/alimy/tryst/cfg" + "github.com/alimy/tryst/pool" + "github.com/robfig/cron/v3" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/sirupsen/logrus" +) + +var ( + _defaultEventManager EventManager + _defaultJobManager JobManager = emptyJobManager{} + _onceInitial sync.Once +) + +func StartEventManager() { + _defaultEventManager.Start() +} + +func StopEventManager() { + _defaultEventManager.Stop() +} + +// OnEvent push event to gorotine pool then handled automatic. +func OnEvent(event Event) { + _defaultEventManager.OnEvent(event) +} + +func StartJobManager() { + _defaultJobManager.Start() +} + +func StopJobManager() { + _defaultJobManager.Stop() +} + +// NewJob create new Job instance +func NewJob(s cron.Schedule, fn JobFn) Job { + return &simpleJob{ + Schedule: s, + Job: fn, + } +} + +// RemoveJob an entry from being run in the future. +func RemoveJob(id EntryID) { + _defaultJobManager.Remove(id) +} + +// Schedule adds a Job to the Cron to be run on the given schedule. +// The job is wrapped with the configured Chain. +func Schedule(job Job) EntryID { + return _defaultJobManager.Schedule(job) +} + +// OnTask adds a Job to the Cron to be run on the given schedule. +// The job is wrapped with the configured Chain. +func OnTask(s cron.Schedule, fn JobFn) EntryID { + job := &simpleJob{ + Schedule: s, + Job: fn, + } + return _defaultJobManager.Schedule(job) +} + +func Initial() { + _onceInitial.Do(func() { + initEventManager() + cfg.Not("DisableJobManager", func() { + initJobManager() + logrus.Debugln("initial JobManager") + }) + }) +} + +func initJobManager() { + _defaultJobManager = NewJobManager() + StartJobManager() +} + +func initEventManager() { + var opts []pool.Option + s := conf.EventManagerSetting + if s.MinWorker > 5 { + opts = append(opts, pool.MinWorkerOpt(s.MinWorker)) + } else { + opts = append(opts, pool.MinWorkerOpt(5)) + } + if s.MaxEventBuf > 10 { + opts = append(opts, pool.MaxRequestBufOpt(s.MaxEventBuf)) + } else { + opts = append(opts, pool.MaxRequestBufOpt(10)) + } + if s.MaxTempEventBuf > 10 { + opts = append(opts, pool.MaxRequestTempBufOpt(s.MaxTempEventBuf)) + } else { + opts = append(opts, pool.MaxRequestTempBufOpt(10)) + } + opts = append(opts, pool.MaxTickCountOpt(s.MaxTickCount), pool.TickWaitTimeOpt(s.TickWaitTime)) + _defaultEventManager = NewEventManager(func(req Event, err error) { + if err != nil { + logrus.Errorf("handle event[%s] occurs error: %s", req.Name(), err) + } + }, opts...) +} diff --git a/internal/events/events_tryst.go b/internal/events/events_tryst.go new file mode 100644 index 00000000..0aaac020 --- /dev/null +++ b/internal/events/events_tryst.go @@ -0,0 +1,40 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package events + +import ( + "github.com/alimy/tryst/event" + "github.com/alimy/tryst/pool" +) + +type Event = event.Event + +type EventManager interface { + Start() + Stop() + OnEvent(event Event) +} + +type simpleEventManager struct { + em event.EventManager +} + +func (s *simpleEventManager) Start() { + s.em.Start() +} + +func (s *simpleEventManager) Stop() { + s.em.Stop() +} + +func (s *simpleEventManager) OnEvent(event Event) { + s.em.OnEvent(event) +} + +func NewEventManager(fn pool.RespFn[Event], opts ...pool.Option) EventManager { + return &simpleEventManager{ + em: event.NewEventManager(fn, opts...), + } +} diff --git a/internal/events/jobs.go b/internal/events/jobs.go new file mode 100644 index 00000000..40dc30eb --- /dev/null +++ b/internal/events/jobs.go @@ -0,0 +1,87 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package events + +import ( + "github.com/robfig/cron/v3" + "github.com/rocboss/paopao-ce/pkg/types" +) + +type ( + EntryID = cron.EntryID +) + +// JobFn job help function that implement cron.Job interface +type JobFn func() + +func (fn JobFn) Run() { + fn() +} + +// Job job interface +type Job interface { + cron.Schedule + cron.Job +} + +type simpleJob struct { + cron.Schedule + cron.Job +} + +// JobManager job manger interface +type JobManager interface { + Start() + Stop() + Remove(id EntryID) + Schedule(Job) EntryID +} + +type emptyJobManager types.Empty + +type simpleJobManager struct { + m *cron.Cron +} + +func (emptyJobManager) Start() { + // nothing +} + +func (emptyJobManager) Stop() { + // nothing +} + +func (emptyJobManager) Remove(id EntryID) { + // nothing +} + +func (emptyJobManager) Schedule(job Job) EntryID { + return 0 +} + +func (j *simpleJobManager) Start() { + j.m.Start() +} + +func (j *simpleJobManager) Stop() { + j.m.Stop() +} + +// Remove an entry from being run in the future. +func (j *simpleJobManager) Remove(id EntryID) { + j.m.Remove(id) +} + +// Schedule adds a Job to the Cron to be run on the given schedule. +// The job is wrapped with the configured Chain. +func (j *simpleJobManager) Schedule(job Job) EntryID { + return j.m.Schedule(job, job) +} + +func NewJobManager() JobManager { + return &simpleJobManager{ + m: cron.New(), + } +} diff --git a/internal/internal.go b/internal/internal.go index 926c9f75..20780a10 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -5,10 +5,16 @@ package internal import ( + "github.com/rocboss/paopao-ce/internal/events" + "github.com/rocboss/paopao-ce/internal/metrics" "github.com/rocboss/paopao-ce/internal/migration" ) func Initial() { // migrate database if needed migration.Run() + // event manager system initialize + events.Initial() + // metric manager system initialize + metrics.Initial() } diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go new file mode 100644 index 00000000..ffe7d12a --- /dev/null +++ b/internal/metrics/metrics.go @@ -0,0 +1,74 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package metrics + +import ( + "sync" + + "github.com/alimy/tryst/event" + "github.com/alimy/tryst/pool" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/sirupsen/logrus" +) + +var ( + _defaultMetricManager event.EventManager + _onceInitial sync.Once +) + +type Metric = event.Event + +type BaseMetric = event.UnimplementedEvent + +type MetricManager interface { + Start() + Stop() + OnMeasure(metric Metric) +} + +func StartMetricManager() { + _defaultMetricManager.Start() +} + +func StopMetricManager() { + _defaultMetricManager.Stop() +} + +// OnMeasure push Metric to gorotine pool then handled automatic. +func OnMeasure(metric Metric) { + _defaultMetricManager.OnEvent(metric) +} + +func Initial() { + _onceInitial.Do(func() { + initMetricManager() + }) +} + +func initMetricManager() { + var opts []pool.Option + s := conf.EventManagerSetting + if s.MinWorker > 5 { + opts = append(opts, pool.MinWorkerOpt(s.MinWorker)) + } else { + opts = append(opts, pool.MinWorkerOpt(5)) + } + if s.MaxEventBuf > 10 { + opts = append(opts, pool.MaxRequestBufOpt(s.MaxEventBuf)) + } else { + opts = append(opts, pool.MaxRequestBufOpt(10)) + } + if s.MaxTempEventBuf > 10 { + opts = append(opts, pool.MaxRequestTempBufOpt(s.MaxTempEventBuf)) + } else { + opts = append(opts, pool.MaxRequestTempBufOpt(10)) + } + opts = append(opts, pool.MaxTickCountOpt(s.MaxTickCount), pool.TickWaitTimeOpt(s.TickWaitTime)) + _defaultMetricManager = event.NewEventManager(func(req Metric, err error) { + if err != nil { + logrus.Errorf("handle event[%s] occurs error: %s", req.Name(), err) + } + }, opts...) +} diff --git a/internal/metrics/metrics_tryst.go b/internal/metrics/metrics_tryst.go new file mode 100644 index 00000000..ea0eb28d --- /dev/null +++ b/internal/metrics/metrics_tryst.go @@ -0,0 +1,32 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package metrics + +import ( + "github.com/alimy/tryst/event" + "github.com/alimy/tryst/pool" +) + +type simpleMetricManager struct { + mm event.EventManager +} + +func (s *simpleMetricManager) Start() { + s.mm.Start() +} + +func (s *simpleMetricManager) Stop() { + s.mm.Stop() +} + +func (s *simpleMetricManager) OnMeasure(metric Metric) { + s.mm.OnEvent(metric) +} + +func NewMetricManager(fn pool.RespFn[Metric], opts ...pool.Option) MetricManager { + return &simpleMetricManager{ + mm: event.NewEventManager(fn, opts...), + } +} diff --git a/internal/metrics/prometheus/metrics.go b/internal/metrics/prometheus/metrics.go new file mode 100644 index 00000000..d7c073b1 --- /dev/null +++ b/internal/metrics/prometheus/metrics.go @@ -0,0 +1,57 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package prometheus + +import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/sirupsen/logrus" +) + +type metrics struct { + siteInfo *prometheus.GaugeVec + ds core.DataService + wc core.WebCache +} + +func (m *metrics) updateSiteInfo() { + if onlineUserKeys, err := m.wc.Keys(conf.PrefixOnlineUser + "*"); err == nil { + maxOnline := len(onlineUserKeys) + m.siteInfo.With(prometheus.Labels{"name": "max_online"}).Set(float64(maxOnline)) + } else { + logrus.Warnf("update promethues metrics[site_info_max_online] occurs error: %s", err) + } + if registerUserCount, err := m.ds.GetRegisterUserCount(); err == nil { + m.siteInfo.With(prometheus.Labels{"name": "register_user_count"}).Set(float64(registerUserCount)) + } else { + logrus.Warnf("update promethues metrics[site_info_register_user_count] occurs error: %s", err) + } +} + +func (m *metrics) onUpdate() { + logrus.Debugf("update promethues metrics job running") + m.updateSiteInfo() +} + +func newMetrics(reg prometheus.Registerer, ds core.DataService, wc core.WebCache) *metrics { + m := &metrics{ + siteInfo: prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Namespace: "paopao", + Subsystem: "site", + Name: "simple_info", + Help: "paopao-ce site simple information.", + }, + []string{ + // metric name + "name", + }), + ds: ds, + wc: wc, + } + reg.MustRegister(m.siteInfo) + return m +} diff --git a/internal/metrics/prometheus/prometheus.go b/internal/metrics/prometheus/prometheus.go new file mode 100644 index 00000000..f9764464 --- /dev/null +++ b/internal/metrics/prometheus/prometheus.go @@ -0,0 +1,41 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package prometheus + +import ( + "net/http" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/collectors" + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/robfig/cron/v3" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/events" + "github.com/sirupsen/logrus" +) + +func scheduleJobs(metrics *metrics) { + spec := conf.JobManagerSetting.UpdateMetricsInterval + schedule, err := cron.ParseStandard(spec) + if err != nil { + panic(err) + } + events.OnTask(schedule, metrics.onUpdate) + logrus.Debug("shedule prometheus metrics update jobs complete") +} + +func NewHandler(ds core.DataService, wc core.WebCache) http.Handler { + // Create non-global registry. + registry := prometheus.NewRegistry() + // Add go runtime metrics and process collectors. + registry.MustRegister( + collectors.NewGoCollector(), + collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}), + ) + metrics := newMetrics(registry, ds, wc) + scheduleJobs(metrics) + return promhttp.HandlerFor(registry, promhttp.HandlerOpts{EnableOpenMetrics: true}) +} diff --git a/internal/migration/migration.go b/internal/migration/migration.go index 1cac6012..5f3c667d 100644 --- a/internal/migration/migration.go +++ b/internal/migration/migration.go @@ -8,7 +8,7 @@ package migration import ( - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/sirupsen/logrus" ) diff --git a/internal/migration/migration_embed.go b/internal/migration/migration_embed.go index c2232d29..da3fbab9 100644 --- a/internal/migration/migration_embed.go +++ b/internal/migration/migration_embed.go @@ -10,7 +10,7 @@ package migration import ( "database/sql" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/golang-migrate/migrate/v4" "github.com/golang-migrate/migrate/v4/database" "github.com/golang-migrate/migrate/v4/database/mysql" diff --git a/internal/model/joint/joint.go b/internal/model/joint/joint.go index fa7e4729..79246ece 100644 --- a/internal/model/joint/joint.go +++ b/internal/model/joint/joint.go @@ -14,3 +14,9 @@ type BasePageInfo struct { func (r *BasePageInfo) SetPageInfo(page int, pageSize int) { r.Page, r.PageSize = page, pageSize } + +type JsonResp struct { + Code int `json:"code"` + Msg string `json:"msg,omitempty"` + Data any `json:"data,omitempty"` +} diff --git a/internal/model/joint/json.go b/internal/model/joint/json.go new file mode 100644 index 00000000..0b4da5c6 --- /dev/null +++ b/internal/model/joint/json.go @@ -0,0 +1,34 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package joint + +import ( + stdJson "encoding/json" + "net/http" + + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/pkg/json" +) + +type CachePageResp struct { + Data *PageResp + JsonResp stdJson.RawMessage +} + +func (r *CachePageResp) Render(c *gin.Context) { + if len(r.JsonResp) != 0 { + c.JSON(http.StatusOK, r.JsonResp) + } else { + c.JSON(http.StatusOK, &JsonResp{ + Code: 0, + Msg: "success", + Data: r.Data, + }) + } +} + +func RespMarshal(data any) (stdJson.RawMessage, error) { + return json.Marshal(data) +} diff --git a/internal/model/joint/page.go b/internal/model/joint/page.go new file mode 100644 index 00000000..f2ba5d9c --- /dev/null +++ b/internal/model/joint/page.go @@ -0,0 +1,27 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package joint + +type Pager struct { + Page int `json:"page"` + PageSize int `json:"page_size"` + TotalRows int64 `json:"total_rows"` +} + +type PageResp struct { + List any `json:"list"` + Pager Pager `json:"pager"` +} + +func PageRespFrom(list any, page int, pageSize int, totalRows int64) *PageResp { + return &PageResp{ + List: list, + Pager: Pager{ + Page: page, + PageSize: pageSize, + TotalRows: totalRows, + }, + } +} diff --git a/internal/model/web/admin.go b/internal/model/web/admin.go index 6b1980ca..53f8af67 100644 --- a/internal/model/web/admin.go +++ b/internal/model/web/admin.go @@ -9,3 +9,14 @@ type ChangeUserStatusReq struct { ID int64 `json:"id" form:"id" binding:"required"` Status int `json:"status" form:"status" binding:"required,oneof=1 2"` } + +type SiteInfoReq struct { + SimpleInfo `json:"-" binding:"-"` +} + +type SiteInfoResp struct { + RegisterUserCount int64 `json:"register_user_count"` + OnlineUserCount int `json:"online_user_count"` + HistoryMaxOnline int `json:"history_max_online"` + ServerUpTime int64 `json:"server_up_time"` +} diff --git a/internal/model/web/audit.go b/internal/model/web/audit.go new file mode 100644 index 00000000..848ffbf6 --- /dev/null +++ b/internal/model/web/audit.go @@ -0,0 +1,40 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +const ( + AuditStyleUnknown AuditStyle = iota + AuditStyleUserTweet + AuditStyleUserTweetComment + AuditStyleUserTweetReply +) + +const ( + AuditHookCtxKey = "audit_ctx_key" + OnlineUserCtxKey = "online_user_ctx_key" +) + +type AuditStyle uint8 + +type AuditMetaInfo struct { + Style AuditStyle + Id int64 +} + +func (s AuditStyle) String() (res string) { + switch s { + case AuditStyleUserTweet: + res = "UserTweet" + case AuditStyleUserTweetComment: + res = "UserTweetComment" + case AuditStyleUserTweetReply: + res = "UserTweetReply" + case AuditStyleUnknown: + fallthrough + default: + res = "Unknown" + } + return +} diff --git a/internal/model/web/core.go b/internal/model/web/core.go index 78c04bb3..67a43b6a 100644 --- a/internal/model/web/core.go +++ b/internal/model/web/core.go @@ -7,11 +7,15 @@ package web import ( "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/model/joint" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/pkg/convert" "github.com/rocboss/paopao-ce/pkg/xerror" ) +type MessageStyle = cs.MessageStyle + type ChangeAvatarReq struct { BaseInfo `json:"-" binding:"-"` Avatar string `json:"avatar" form:"avatar" binding:"required"` @@ -27,35 +31,39 @@ type UserInfoReq struct { } type UserInfoResp struct { - Id int64 `json:"id"` - Nickname string `json:"nickname"` - Username string `json:"username"` - Status int `json:"status"` - Avatar string `json:"avatar"` - Balance int64 `json:"balance"` - Phone string `json:"phone"` - IsAdmin bool `json:"is_admin"` - CreatedOn int64 `json:"created_on"` - Follows int64 `json:"follows"` - Followings int64 `json:"followings"` -} - -type GetUnreadMsgCountReq struct { + Id int64 `json:"id"` + Nickname string `json:"nickname"` + Username string `json:"username"` + Status int `json:"status"` + Avatar string `json:"avatar"` + Balance int64 `json:"balance"` + Phone string `json:"phone"` + IsAdmin bool `json:"is_admin"` + CreatedOn int64 `json:"created_on"` + Follows int64 `json:"follows"` + Followings int64 `json:"followings"` + TweetsCount int `json:"tweets_count"` +} + +type GetMessagesReq struct { SimpleInfo `json:"-" binding:"-"` + joint.BasePageInfo + Style MessageStyle `form:"style" binding:"required"` } -type GetUnreadMsgCountResp struct { - Count int64 `json:"count"` +type GetMessagesResp struct { + joint.CachePageResp } -type GetMessagesReq BasePageReq - -type GetMessagesResp base.PageResp - type ReadMessageReq struct { SimpleInfo `json:"-" binding:"-"` ID int64 `json:"id" binding:"required"` } + +type ReadAllMessageReq struct { + SimpleInfo `json:"-" binding:"-"` +} + type SendWhisperReq struct { SimpleInfo `json:"-" binding:"-"` UserID int64 `json:"user_id" binding:"required"` @@ -128,10 +136,6 @@ func (r *UserInfoReq) Bind(c *gin.Context) mir.Error { return nil } -func (r *GetMessagesReq) Bind(c *gin.Context) mir.Error { - return (*BasePageReq)(r).Bind(c) -} - func (r *GetCollectionsReq) Bind(c *gin.Context) mir.Error { return (*BasePageReq)(r).Bind(c) } diff --git a/internal/model/web/friendship.go b/internal/model/web/friendship.go index 08f5fd27..144f0870 100644 --- a/internal/model/web/friendship.go +++ b/internal/model/web/friendship.go @@ -4,7 +4,9 @@ package web -import "github.com/rocboss/paopao-ce/internal/servants/base" +import ( + "github.com/rocboss/paopao-ce/internal/servants/base" +) type RequestingFriendReq struct { BaseInfo `json:"-" binding:"-"` diff --git a/internal/model/web/loose.go b/internal/model/web/loose.go index 8ab19584..edeec03b 100644 --- a/internal/model/web/loose.go +++ b/internal/model/web/loose.go @@ -7,8 +7,11 @@ package web import ( "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/model/joint" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/pkg/app" ) @@ -26,30 +29,41 @@ const ( UserPostsStyleHighlight = "highlight" UserPostsStyleMedia = "media" UserPostsStyleStar = "star" + + StyleTweetsNewest = "newest" + StyleTweetsHots = "hots" + StyleTweetsFollowing = "following" ) type TagType = cs.TagType +type CommentStyleType string + type TweetCommentsReq struct { - SimpleInfo `form:"-" binding:"-"` - TweetId int64 `form:"id" binding:"required"` - SortStrategy string `form:"sort_strategy"` - Page int `form:"-" binding:"-"` - PageSize int `form:"-" binding:"-"` + SimpleInfo `form:"-" binding:"-"` + TweetId int64 `form:"id" binding:"required"` + Style CommentStyleType `form:"style"` + Page int `form:"-" binding:"-"` + PageSize int `form:"-" binding:"-"` } -type TweetCommentsResp base.PageResp +type TweetCommentsResp struct { + joint.CachePageResp +} type TimelineReq struct { BaseInfo `form:"-" binding:"-"` Query string `form:"query"` Visibility []core.PostVisibleT `form:"query"` Type string `form:"type"` + Style string `form:"style"` Page int `form:"-" binding:"-"` PageSize int `form:"-" binding:"-"` } -type TimelineResp base.PageResp +type TimelineResp struct { + joint.CachePageResp +} type GetUserTweetsReq struct { BaseInfo `form:"-" binding:"-"` @@ -59,7 +73,9 @@ type GetUserTweetsReq struct { PageSize int `form:"-" binding:"-"` } -type GetUserTweetsResp base.PageResp +type GetUserTweetsResp struct { + joint.CachePageResp +} type GetUserProfileReq struct { BaseInfo `form:"-" binding:"-"` @@ -78,6 +94,7 @@ type GetUserProfileResp struct { CreatedOn int64 `json:"created_on"` Follows int64 `json:"follows"` Followings int64 `json:"followings"` + TweetsCount int `json:"tweets_count"` } type TopicListReq struct { @@ -94,6 +111,13 @@ type TopicListResp struct { ExtralTopics cs.TagList `json:"extral_topics,omitempty"` } +type TweetDetailReq struct { + SimpleInfo `form:"-" binding:"-"` + TweetId int64 `form:"id"` +} + +type TweetDetailResp ms.PostFormated + func (r *GetUserTweetsReq) SetPageInfo(page int, pageSize int) { r.Page, r.PageSize = page, pageSize } @@ -108,6 +132,34 @@ func (r *TimelineReq) Bind(c *gin.Context) mir.Error { User: user, } r.Page, r.PageSize = app.GetPageInfo(c) - r.Query, r.Type = c.Query("query"), "search" + r.Query, r.Type, r.Style = c.Query("query"), "search", c.Query("style") return nil } + +func (s CommentStyleType) ToInnerValue() (res cs.StyleCommentType) { + switch s { + case "hots": + res = cs.StyleCommentHots + case "newest": + res = cs.StyleCommentNewest + case "default": + fallthrough + default: + res = cs.StyleCommentDefault + } + return +} + +func (s CommentStyleType) String() (res string) { + switch s { + case "default": + res = conf.InfixCommentDefault + case "hots": + res = conf.InfixCommentHots + case "newest": + res = conf.InfixCommentNewest + default: + res = "_" + } + return +} diff --git a/internal/model/web/priv.go b/internal/model/web/priv.go index 7ce1aba0..239799f6 100644 --- a/internal/model/web/priv.go +++ b/internal/model/web/priv.go @@ -7,17 +7,31 @@ package web import ( "fmt" "mime/multipart" + "net/http" "strings" "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/model/joint" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/pkg/convert" "github.com/rocboss/paopao-ce/pkg/xerror" ) +const ( + // 推文可见性 + TweetVisitPublic TweetVisibleType = iota + TweetVisitPrivate + TweetVisitFriend + TweetVisitFollowing + TweetVisitInvalid +) + +type TweetVisibleType cs.TweetVisibleType + type TweetCommentThumbsReq struct { SimpleInfo `json:"-" binding:"-"` TweetId int64 `json:"tweet_id" binding:"required"` @@ -43,7 +57,7 @@ type CreateTweetReq struct { Tags []string `json:"tags" binding:"required"` Users []string `json:"users" binding:"required"` AttachmentPrice int64 `json:"attachment_price"` - Visibility core.PostVisibleT `json:"visibility"` + Visibility TweetVisibleType `json:"visibility"` ClientIP string `json:"-" binding:"-"` } @@ -101,12 +115,12 @@ type HighlightTweetResp struct { type VisibleTweetReq struct { BaseInfo `json:"-" binding:"-"` - ID int64 `json:"id"` - Visibility core.PostVisibleT `json:"visibility"` + ID int64 `json:"id"` + Visibility TweetVisibleType `json:"visibility"` } type VisibleTweetResp struct { - Visibility core.PostVisibleT `json:"visibility"` + Visibility TweetVisibleType `json:"visibility"` } type CreateCommentReq struct { @@ -133,6 +147,16 @@ type DeleteCommentReq struct { BaseInfo `json:"-" binding:"-"` ID int64 `json:"id" binding:"required"` } + +type HighlightCommentReq struct { + SimpleInfo `json:"-" binding:"-"` + CommentId int64 `json:"id" binding:"required"` +} + +type HighlightCommentResp struct { + HighlightStatus int8 `json:"highlight_status"` +} + type DeleteCommentReplyReq struct { BaseInfo `json:"-" binding:"-"` ID int64 `json:"id" binding:"required"` @@ -281,3 +305,35 @@ func (r *CreateCommentReq) Bind(c *gin.Context) mir.Error { r.ClientIP = c.ClientIP() return bindAny(c, r) } + +func (r *CreateTweetResp) Render(c *gin.Context) { + c.JSON(http.StatusOK, &joint.JsonResp{ + Code: 0, + Msg: "success", + Data: r, + }) + // 设置审核元信息,用于接下来的审核逻辑 + c.Set(AuditHookCtxKey, &AuditMetaInfo{ + Style: AuditStyleUserTweet, + Id: r.ID, + }) +} + +func (t TweetVisibleType) ToVisibleValue() (res cs.TweetVisibleType) { + // 原来的可见性: 0公开 1私密 2好友可见 3关注可见 + // 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 + switch t { + case TweetVisitPublic: + res = cs.TweetVisitPublic + case TweetVisitPrivate: + res = cs.TweetVisitPrivate + case TweetVisitFriend: + res = cs.TweetVisitFriend + case TweetVisitFollowing: + res = cs.TweetVisitFollowing + default: + // TODO: 默认私密 + res = cs.TweetVisitPrivate + } + return +} diff --git a/internal/model/web/pub.go b/internal/model/web/pub.go index 058288e8..3aa796c6 100644 --- a/internal/model/web/pub.go +++ b/internal/model/web/pub.go @@ -4,17 +4,6 @@ package web -import ( - "github.com/rocboss/paopao-ce/internal/core/ms" - "github.com/rocboss/paopao-ce/pkg/version" -) - -type TweetDetailReq struct { - TweetId int64 `form:"id"` -} - -type TweetDetailResp ms.PostFormated - type GetCaptchaResp struct { Id string `json:"id"` Content string `json:"b64s"` @@ -26,10 +15,6 @@ type SendCaptchaReq struct { ImgCaptchaID string `json:"img_captcha_id" form:"img_captcha_id" binding:"required"` } -type VersionResp struct { - BuildInfo *version.BuildInfo `json:"build_info"` -} - type LoginReq struct { Username string `json:"username" form:"username" binding:"required"` Password string `json:"password" form:"password" binding:"required"` diff --git a/internal/model/web/relax.go b/internal/model/web/relax.go new file mode 100644 index 00000000..e75ae315 --- /dev/null +++ b/internal/model/web/relax.go @@ -0,0 +1,34 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "encoding/json" + "net/http" + + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/model/joint" +) + +type GetUnreadMsgCountReq struct { + SimpleInfo `json:"-" binding:"-"` +} + +type GetUnreadMsgCountResp struct { + Count int64 `json:"count"` + JsonResp json.RawMessage `json:"-"` +} + +func (r *GetUnreadMsgCountResp) Render(c *gin.Context) { + if len(r.JsonResp) != 0 { + c.JSON(http.StatusOK, r.JsonResp) + } else { + c.JSON(http.StatusOK, &joint.JsonResp{ + Code: 0, + Msg: "success", + Data: r, + }) + } +} diff --git a/internal/model/web/site.go b/internal/model/web/site.go new file mode 100644 index 00000000..9173dc20 --- /dev/null +++ b/internal/model/web/site.go @@ -0,0 +1,16 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/pkg/version" +) + +type VersionResp struct { + BuildInfo *version.BuildInfo `json:"build_info"` +} + +type SiteProfileResp = conf.WebProfileConf diff --git a/internal/model/web/trends.go b/internal/model/web/trends.go new file mode 100644 index 00000000..61dd87df --- /dev/null +++ b/internal/model/web/trends.go @@ -0,0 +1,18 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/rocboss/paopao-ce/internal/model/joint" +) + +type GetIndexTrendsReq struct { + SimpleInfo `json:"-" binding:"-"` + joint.BasePageInfo +} + +type GetIndexTrendsResp struct { + joint.CachePageResp +} diff --git a/internal/model/web/xerror.go b/internal/model/web/xerror.go index 50c2f479..0d22a9ea 100644 --- a/internal/model/web/xerror.go +++ b/internal/model/web/xerror.go @@ -47,15 +47,18 @@ var ( ErrStickPostFailed = xerror.NewError(30011, "动态置顶失败") ErrVisblePostFailed = xerror.NewError(30012, "更新可见性失败") ErrHighlightPostFailed = xerror.NewError(30013, "动态设为亮点失败") + ErrGetPostsUnknowStyle = xerror.NewError(30014, "使用未知样式参数获取动态列表") + ErrGetPostsNilUser = xerror.NewError(30015, "使用游客账户获取动态详情失败") - ErrGetCommentsFailed = xerror.NewError(40001, "获取评论列表失败") - ErrCreateCommentFailed = xerror.NewError(40002, "评论发布失败") - ErrGetCommentFailed = xerror.NewError(40003, "获取评论详情失败") - ErrDeleteCommentFailed = xerror.NewError(40004, "评论删除失败") - ErrCreateReplyFailed = xerror.NewError(40005, "评论回复失败") - ErrGetReplyFailed = xerror.NewError(40006, "获取评论详情失败") - ErrMaxCommentCount = xerror.NewError(40007, "评论数已达最大限制") - ErrGetCommentThumbs = xerror.NewError(40008, "获取评论点赞信息失败") + ErrGetCommentsFailed = xerror.NewError(40001, "获取评论列表失败") + ErrCreateCommentFailed = xerror.NewError(40002, "评论发布失败") + ErrGetCommentFailed = xerror.NewError(40003, "获取评论详情失败") + ErrDeleteCommentFailed = xerror.NewError(40004, "评论删除失败") + ErrCreateReplyFailed = xerror.NewError(40005, "评论回复失败") + ErrGetReplyFailed = xerror.NewError(40006, "获取评论详情失败") + ErrMaxCommentCount = xerror.NewError(40007, "评论数已达最大限制") + ErrGetCommentThumbs = xerror.NewError(40008, "获取评论点赞信息失败") + ErrHighlightCommentFailed = xerror.NewError(40009, "设置精选评论失败") ErrGetMessagesFailed = xerror.NewError(50001, "获取消息列表失败") ErrReadMessageFailed = xerror.NewError(50002, "标记消息已读失败") @@ -87,6 +90,8 @@ var ( ErrNotAllowFollowSelf = xerror.NewError(80105, "不能关注自己") ErrNotAllowUnfollowSelf = xerror.NewError(80106, "不能取消关注自己") + ErrGetIndexTrendsFailed = xerror.NewError(802001, "获取动态条栏信息失败") + ErrFollowTopicFailed = xerror.NewError(90001, "关注话题失败") ErrUnfollowTopicFailed = xerror.NewError(90002, "取消关注话题失败") ErrStickTopicFailed = xerror.NewError(90003, "更行话题置顶状态失败") diff --git a/internal/servants/base/base.go b/internal/servants/base/base.go index e94e75af..4edf5e03 100644 --- a/internal/servants/base/base.go +++ b/internal/servants/base/base.go @@ -21,9 +21,11 @@ import ( "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao" "github.com/rocboss/paopao-ce/internal/dao/cache" + "github.com/rocboss/paopao-ce/internal/events" + "github.com/rocboss/paopao-ce/internal/model/joint" "github.com/rocboss/paopao-ce/pkg/app" + "github.com/rocboss/paopao-ce/pkg/types" "github.com/rocboss/paopao-ce/pkg/xerror" - "github.com/sirupsen/logrus" ) type BaseServant struct { @@ -39,12 +41,6 @@ type DaoServant struct { Redis core.RedisCache } -type JsonResp struct { - Code int `json:"code"` - Msg string `json:"msg,omitempty"` - Data any `json:"data,omitempty"` -} - type SentryHubSetter interface { SetSentryHub(hub *sentry.Hub) } @@ -145,13 +141,13 @@ func bindAnySentry(c *gin.Context, obj any) mir.Error { func RenderAny(c *gin.Context, data any, err mir.Error) { if err == nil { - c.JSON(http.StatusOK, &JsonResp{ + c.JSON(http.StatusOK, &joint.JsonResp{ Code: 0, Msg: "success", Data: data, }) } else { - c.JSON(xerror.HttpStatusCode(err), &JsonResp{ + c.JSON(xerror.HttpStatusCode(err), &joint.JsonResp{ Code: err.StatusCode(), Msg: err.Error(), }) @@ -164,19 +160,122 @@ func (s *BaseServant) Bind(c *gin.Context, obj any) mir.Error { func (s *BaseServant) Render(c *gin.Context, data any, err mir.Error) { if err == nil { - c.JSON(http.StatusOK, &JsonResp{ + c.JSON(http.StatusOK, &joint.JsonResp{ Code: 0, Msg: "success", Data: data, }) } else { - c.JSON(xerror.HttpStatusCode(err), &JsonResp{ + c.JSON(xerror.HttpStatusCode(err), &joint.JsonResp{ Code: err.StatusCode(), Msg: err.Error(), }) } } +func (s *DaoServant) PrepareUser(userId int64, user *ms.UserFormated) error { + // guest用户的userId<0 + if userId < 0 { + return nil + } + // friendMap, err := s.Ds.IsMyFriend(userId, user.ID) + // if err != nil { + // return err + // } + followMap, err := s.Ds.IsMyFollow(userId, user.ID) + if err != nil { + return err + } + // user.IsFriend, user.IsFollowing = friendMap[user.ID], followMap[user.ID] + user.IsFollowing = followMap[user.ID] + return nil +} + +func (s *DaoServant) PrepareMessages(userId int64, messages []*ms.MessageFormated) error { + // guest用户的userId<0 + if userId < 0 { + return nil + } + userIds := make([]int64, 0, len(messages)) + for _, msg := range messages { + if msg.SenderUser != nil { + userIds = append(userIds, msg.SenderUserID) + } + if msg.ReceiverUser != nil { + userIds = append(userIds, msg.ReceiverUserID) + } + } + // friendMap, err := s.Ds.IsMyFriend(userId, userIds...) + // if err != nil { + // return err + // } + followMap, err := s.Ds.IsMyFollow(userId, userIds...) + if err != nil { + return err + } + for _, msg := range messages { + if msg.SenderUser != nil { + // msg.SenderUser.IsFriend, msg.SenderUser.IsFollowing = friendMap[msg.SenderUserID], followMap[msg.SenderUserID] + msg.SenderUser.IsFollowing = followMap[msg.SenderUserID] + } + if msg.ReceiverUser != nil { + // msg.ReceiverUser.IsFriend, msg.ReceiverUser.IsFollowing = friendMap[msg.ReceiverUserID], followMap[msg.ReceiverUserID] + msg.ReceiverUser.IsFollowing = followMap[msg.ReceiverUserID] + } + } + return nil +} + +func (s *DaoServant) PrepareTweet(userId int64, tweet *ms.PostFormated) error { + // 转换一下可见性的值 + tweet.Visibility = ms.PostVisibleT(tweet.Visibility.ToOutValue()) + // guest用户的userId<0 + if userId < 0 { + return nil + } + // friendMap, err := s.Ds.IsMyFriend(userId, userIds) + // if err != nil { + // return err + // } + followMap, err := s.Ds.IsMyFollow(userId, tweet.UserID) + if err != nil { + return err + } + // tweet.User.IsFriend, tweet.User.IsFollowing = friendMap[tweet.UserID], followMap[tweet.UserID] + tweet.User.IsFollowing = followMap[tweet.UserID] + return nil +} + +func (s *DaoServant) PrepareTweets(userId int64, tweets []*ms.PostFormated) error { + userIdSet := make(map[int64]types.Empty, len(tweets)) + for _, tweet := range tweets { + userIdSet[tweet.UserID] = types.Empty{} + // 顺便转换一下可见性的值 + tweet.Visibility = ms.PostVisibleT(tweet.Visibility.ToOutValue()) + } + // guest用户的userId<0 + if userId < 0 { + return nil + } + userIds := make([]int64, 0, len(userIdSet)) + for id := range userIdSet { + userIds = append(userIds, id) + } + // friendMap, err := s.Ds.IsMyFriend(userId, userIds...) + // if err != nil { + // return err + // } + followMap, err := s.Ds.IsMyFollow(userId, userIds...) + if err != nil { + return err + } + for _, tweet := range tweets { + // tweet.User.IsFriend, tweet.User.IsFollowing = friendMap[tweet.UserID], followMap[tweet.UserID] + tweet.User.IsFollowing = followMap[tweet.UserID] + } + return nil +} + func (s *DaoServant) GetTweetBy(id int64) (*ms.PostFormated, error) { post, err := s.Ds.GetPostByID(id) if err != nil { @@ -203,20 +302,25 @@ func (s *DaoServant) GetTweetBy(id int64) (*ms.PostFormated, error) { return postFormated, nil } -func (s *DaoServant) PushPostsToSearch(c context.Context) { - if err := s.Redis.SetPushToSearchJob(c); err == nil { - defer s.Redis.DelPushToSearchJob(c) +func (s *DaoServant) PushAllPostToSearch() { + events.OnEvent(&pushAllPostToSearchEvent{ + fn: s.pushAllPostToSearch, + }) +} +func (s *DaoServant) pushAllPostToSearch() error { + ctx := context.Background() + if err := s.Redis.SetPushToSearchJob(ctx); err == nil { + defer s.Redis.DelPushToSearchJob(ctx) splitNum := 1000 - conditions := ms.ConditionsT{ - "visibility IN ?": []core.PostVisibleT{core.PostVisitPublic, core.PostVisitFriend}, + posts, totalRows, err := s.Ds.ListSyncSearchTweets(splitNum, 0) + if err != nil { + return fmt.Errorf("get first page tweets push to search failed: %s", err) } - totalRows, _ := s.Ds.GetPostCount(conditions) - pages := math.Ceil(float64(totalRows) / float64(splitNum)) - nums := int(pages) - for i := 0; i < nums; i++ { - posts, postsFormated, err := s.GetTweetList(conditions, i*splitNum, splitNum) - if err != nil || len(posts) != len(postsFormated) { + i, nums := 0, int(math.Ceil(float64(totalRows)/float64(splitNum))) + for { + postsFormated, xerr := s.Ds.MergePosts(posts) + if xerr != nil || len(posts) != len(postsFormated) { continue } for i, pf := range postsFormated { @@ -232,13 +336,27 @@ func (s *DaoServant) PushPostsToSearch(c context.Context) { }} s.Ts.AddDocuments(docs, fmt.Sprintf("%d", posts[i].ID)) } + if i++; i >= nums { + break + } + if posts, _, err = s.Ds.ListSyncSearchTweets(splitNum, i*splitNum); err != nil { + return fmt.Errorf("get tweets push to search failed: %s, limit[%d] offset[%d]", err, splitNum, i*splitNum) + } } } else { - logrus.Errorf("redis: set JOB_PUSH_TO_SEARCH error: %s", err) + return fmt.Errorf("redis: set JOB_PUSH_TO_SEARCH error: %w", err) } + return nil } func (s *DaoServant) PushPostToSearch(post *ms.Post) { + events.OnEvent(&pushPostToSearchEvent{ + fn: s.pushPostToSearch, + post: post, + }) +} + +func (s *DaoServant) pushPostToSearch(post *ms.Post) { postFormated := post.Format() postFormated.User = &ms.UserFormated{ ID: post.UserID, @@ -247,14 +365,12 @@ func (s *DaoServant) PushPostToSearch(post *ms.Post) { for _, content := range contents { postFormated.Contents = append(postFormated.Contents, content.Format()) } - contentFormated := "" for _, content := range postFormated.Contents { if content.Type == ms.ContentTypeText || content.Type == ms.ContentTypeTitle { contentFormated = contentFormated + content.Content + "\n" } } - docs := []core.TsDocItem{{ Post: post, Content: contentFormated, @@ -266,15 +382,6 @@ func (s *DaoServant) DeleteSearchPost(post *ms.Post) error { return s.Ts.DeleteDocuments([]string{fmt.Sprintf("%d", post.ID)}) } -func (s *DaoServant) GetTweetList(conditions ms.ConditionsT, offset, limit int) ([]*ms.Post, []*ms.PostFormated, error) { - posts, err := s.Ds.GetPosts(conditions, offset, limit) - if err != nil { - return nil, nil, err - } - postFormated, err := s.Ds.MergePosts(posts) - return posts, postFormated, err -} - func (s *DaoServant) RelationTypFrom(me *ms.User, username string) (res *cs.VistUser, err error) { res = &cs.VistUser{ RelTyp: cs.RelationSelf, diff --git a/internal/servants/base/events.go b/internal/servants/base/events.go new file mode 100644 index 00000000..2c840a2b --- /dev/null +++ b/internal/servants/base/events.go @@ -0,0 +1,129 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package base + +import ( + "fmt" + + "github.com/alimy/tryst/event" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/events" + "github.com/rocboss/paopao-ce/internal/model/joint" + "github.com/rocboss/paopao-ce/pkg/json" +) + +type CacheRespEvent struct { + event.UnimplementedEvent + ac core.AppCache + key string + data any + expire int64 +} + +type ExpireRespEvent struct { + event.UnimplementedEvent + ac core.AppCache + keys []string +} + +type ExpireAnyRespEvent struct { + event.UnimplementedEvent + ac core.AppCache + pattern string +} + +type pushPostToSearchEvent struct { + event.UnimplementedEvent + fn func(*ms.Post) + post *ms.Post +} + +type pushAllPostToSearchEvent struct { + event.UnimplementedEvent + fn func() error +} + +func OnCacheRespEvent(ac core.AppCache, key string, data any, expire int64) { + events.OnEvent(&CacheRespEvent{ + ac: ac, + key: key, + data: data, + expire: expire, + }) +} + +func OnExpireRespEvent(ac core.AppCache, keys ...string) { + if len(keys) != 0 { + events.OnEvent(&ExpireRespEvent{ + ac: ac, + keys: keys, + }) + } +} + +func OnExpireAnyRespEvent(ac core.AppCache, pattern string) { + events.OnEvent(&ExpireAnyRespEvent{ + ac: ac, + pattern: pattern, + }) +} + +func (p *CacheRespEvent) Name() string { + return "servants.base.CacheRespEvent" +} + +func (p *CacheRespEvent) Action() error { + if p.ac.Exist(p.key) { + // do nothing + return nil + } + resp := &joint.JsonResp{ + Code: 0, + Msg: "success", + Data: p.data, + } + data, err := json.Marshal(resp) + if err != nil { + return fmt.Errorf("CacheRespEvent action marshal resp occurs error: %w", err) + } + if err = p.ac.Set(p.key, data, p.expire); err != nil { + return fmt.Errorf("CacheRespEvent action put resp data to redis cache occurs error: %w", err) + } + return nil +} + +func (p *ExpireRespEvent) Name() string { + return "servants.base.ExpireRespEvent" +} + +func (p *ExpireRespEvent) Action() error { + return p.ac.Delete(p.keys...) +} + +func (p *ExpireAnyRespEvent) Name() string { + return "servants.base.ExpireAnyRespEvent" +} + +func (p *ExpireAnyRespEvent) Action() error { + return p.ac.DelAny(p.pattern) +} + +func (p *pushPostToSearchEvent) Name() string { + return "servants.base.pushPostToSearchEvent" +} + +func (p *pushPostToSearchEvent) Action() (err error) { + p.fn(p.post) + return +} + +func (p *pushAllPostToSearchEvent) Name() string { + return "servants.base.pushAllPostToSearchEvent" +} + +func (p *pushAllPostToSearchEvent) Action() error { + return p.fn() +} diff --git a/internal/servants/chain/audit.go b/internal/servants/chain/audit.go new file mode 100644 index 00000000..01976777 --- /dev/null +++ b/internal/servants/chain/audit.go @@ -0,0 +1,25 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package chain + +import ( + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +func AuditHook() gin.HandlerFunc { + return func(c *gin.Context) { + // 此midleware后面是真正的http handlder,让handler先执行 + c.Next() + // 审核hook 后处理逻辑 + var ami *web.AuditMetaInfo + if val, ok := c.Get(web.AuditHookCtxKey); ok { + if ami, ok = val.(*web.AuditMetaInfo); !ok { + return + } + } + OnAudiotHookEvent(ami) + } +} diff --git a/internal/servants/chain/chain.go b/internal/servants/chain/chain.go index 84faeca5..2a611bfc 100644 --- a/internal/servants/chain/chain.go +++ b/internal/servants/chain/chain.go @@ -9,16 +9,19 @@ import ( "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/dao" + "github.com/rocboss/paopao-ce/internal/dao/cache" ) var ( _ums core.UserManageService + _ac core.AppCache _onceUms sync.Once ) func userManageService() core.UserManageService { _onceUms.Do(func() { _ums = dao.DataService() + _ac = cache.NewAppCache() }) return _ums } diff --git a/internal/servants/chain/events.go b/internal/servants/chain/events.go new file mode 100644 index 00000000..d1d73777 --- /dev/null +++ b/internal/servants/chain/events.go @@ -0,0 +1,35 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package chain + +import ( + "github.com/alimy/tryst/event" + "github.com/rocboss/paopao-ce/internal/events" + "github.com/rocboss/paopao-ce/internal/model/web" + "github.com/sirupsen/logrus" +) + +type AuditHookEvent struct { + event.UnimplementedEvent + ami *web.AuditMetaInfo +} + +func (e *AuditHookEvent) Name() string { + return "AuditHookEvent" +} + +func (e *AuditHookEvent) Action() error { + // TODO: just log event now, will add real logic in future. + logrus.Debugf("auditHook event action style[%s] id[%d]", e.ami.Style, e.ami.Id) + return nil +} + +func OnAudiotHookEvent(ami *web.AuditMetaInfo) { + if ami != nil { + events.OnEvent(&AuditHookEvent{ + ami: ami, + }) + } +} diff --git a/internal/servants/chain/jwt.go b/internal/servants/chain/jwt.go index ae96d550..1400808d 100644 --- a/internal/servants/chain/jwt.go +++ b/internal/servants/chain/jwt.go @@ -5,11 +5,11 @@ package chain import ( + "errors" "strings" "github.com/gin-gonic/gin" - "github.com/golang-jwt/jwt/v4" - "github.com/rocboss/paopao-ce/internal/conf" + "github.com/golang-jwt/jwt/v5" "github.com/rocboss/paopao-ce/pkg/app" "github.com/rocboss/paopao-ce/pkg/xerror" ) @@ -40,7 +40,7 @@ func JWT() gin.HandlerFunc { // 加载用户信息 if user, err := ums.GetUserByID(claims.UID); err == nil { // 强制下线机制 - if (conf.JWTSetting.Issuer + ":" + user.Salt) == claims.Issuer { + if app.IssuerFrom(user.Salt) == claims.Issuer { c.Set("USER", user) c.Set("UID", claims.UID) c.Set("USERNAME", claims.Username) @@ -51,10 +51,53 @@ func JWT() gin.HandlerFunc { ecode = xerror.UnauthorizedAuthNotExist } } else { - switch err.(*jwt.ValidationError).Errors { - case jwt.ValidationErrorExpired: + if errors.Is(err, jwt.ErrTokenExpired) { ecode = xerror.UnauthorizedTokenTimeout - default: + } else { + ecode = xerror.UnauthorizedTokenError + } + } + } else { + ecode = xerror.InvalidParams + } + if ecode != xerror.Success { + response := app.NewResponse(c) + response.ToErrorResponse(ecode) + c.Abort() + return + } + c.Next() + } +} + +func JwtSurely() gin.HandlerFunc { + return func(c *gin.Context) { + var ( + token string + ecode = xerror.Success + ) + if s, exist := c.GetQuery("token"); exist { + token = s + } else { + token = c.GetHeader("Authorization") + // 验证前端传过来的token格式,不为空,开头为Bearer + if token == "" || !strings.HasPrefix(token, "Bearer ") { + response := app.NewResponse(c) + response.ToErrorResponse(xerror.UnauthorizedTokenError) + c.Abort() + return + } + // 验证通过,提取有效部分(除去Bearer) + token = token[7:] + } + if token != "" { + if claims, err := app.ParseToken(token); err == nil { + c.Set("UID", claims.UID) + c.Set("USERNAME", claims.Username) + } else { + if errors.Is(err, jwt.ErrTokenExpired) { + ecode = xerror.UnauthorizedTokenTimeout + } else { ecode = xerror.UnauthorizedTokenError } } @@ -89,7 +132,7 @@ func JwtLoose() gin.HandlerFunc { if claims, err := app.ParseToken(token); err == nil { // 加载用户信息 user, err := ums.GetUserByID(claims.UID) - if err == nil && (conf.JWTSetting.Issuer+":"+user.Salt) == claims.Issuer { + if err == nil && app.IssuerFrom(user.Salt) == claims.Issuer { c.Set("UID", claims.UID) c.Set("USERNAME", claims.Username) c.Set("USER", user) diff --git a/internal/servants/chain/measure.go b/internal/servants/chain/measure.go new file mode 100644 index 00000000..e3d94c52 --- /dev/null +++ b/internal/servants/chain/measure.go @@ -0,0 +1,21 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package chain + +import ( + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/servants/base" +) + +func OnlineUserMeasure() gin.HandlerFunc { + return func(c *gin.Context) { + // 此midleware后面是真正的http handlder,让handler先执行 + c.Next() + // 更新用户在线状态 + if uid, ok := base.UserIdFrom(c); ok { + OnUserOnlineMetric(_ac, uid) + } + } +} diff --git a/internal/servants/chain/metrics.go b/internal/servants/chain/metrics.go new file mode 100644 index 00000000..a6d550c6 --- /dev/null +++ b/internal/servants/chain/metrics.go @@ -0,0 +1,36 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package chain + +import ( + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/metrics" +) + +type OnlineUserMetric struct { + metrics.BaseMetric + ac core.AppCache + uid int64 + expire int64 +} + +func OnUserOnlineMetric(ac core.AppCache, uid int64) { + metrics.OnMeasure(&OnlineUserMetric{ + ac: ac, + uid: uid, + expire: conf.CacheSetting.OnlineUserExpire, + }) +} + +func (m *OnlineUserMetric) Name() string { + return "OnlineUserMetric" +} + +func (m *OnlineUserMetric) Action() (err error) { + // 暂时仅做标记,不存储其他相关信息 + m.ac.SetNx(conf.KeyOnlineUser.Get(m.uid), []byte{}, m.expire) + return +} diff --git a/internal/servants/chain/priv.go b/internal/servants/chain/priv.go index 420c3a9c..f3e43904 100644 --- a/internal/servants/chain/priv.go +++ b/internal/servants/chain/priv.go @@ -5,7 +5,7 @@ package chain import ( - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/pkg/app" diff --git a/internal/servants/docs/docs_embed.go b/internal/servants/docs/docs_embed.go index 8879896c..b7c76e86 100644 --- a/internal/servants/docs/docs_embed.go +++ b/internal/servants/docs/docs_embed.go @@ -8,7 +8,7 @@ package docs import ( - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/docs/openapi" ) diff --git a/internal/servants/servants.go b/internal/servants/servants.go index 35af4bdc..39d26d42 100644 --- a/internal/servants/servants.go +++ b/internal/servants/servants.go @@ -7,7 +7,7 @@ package servants import ( "net/http" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/bufbuild/connect-go" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/servants/admin" diff --git a/internal/servants/web/admin.go b/internal/servants/web/admin.go index 1d8241e6..1e996ad5 100644 --- a/internal/servants/web/admin.go +++ b/internal/servants/web/admin.go @@ -5,13 +5,18 @@ package web import ( + "time" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/chain" "github.com/rocboss/paopao-ce/pkg/xerror" + "github.com/sirupsen/logrus" ) var ( @@ -21,6 +26,8 @@ var ( type adminSrv struct { api.UnimplementedAdminServant *base.DaoServant + wc core.WebCache + serverUpTime int64 } func (s *adminSrv) Chain() gin.HandlersChain { @@ -40,8 +47,29 @@ func (s *adminSrv) ChangeUserStatus(req *web.ChangeUserStatusReq) mir.Error { return nil } -func newAdminSrv(s *base.DaoServant) api.Admin { +func (s *adminSrv) SiteInfo(req *web.SiteInfoReq) (*web.SiteInfoResp, mir.Error) { + res, err := &web.SiteInfoResp{ServerUpTime: s.serverUpTime}, error(nil) + res.RegisterUserCount, err = s.Ds.GetRegisterUserCount() + if err != nil { + logrus.Errorf("get SiteInfo[1] occurs error: %s", err) + } + onlineUserKeys, xerr := s.wc.Keys(conf.PrefixOnlineUser + "*") + if xerr == nil { + res.OnlineUserCount = len(onlineUserKeys) + if res.HistoryMaxOnline, err = s.wc.PutHistoryMaxOnline(res.OnlineUserCount); err != nil { + logrus.Errorf("get Siteinfo[3] occurs error: %s", err) + } + } else { + logrus.Errorf("get Siteinfo[2] occurs error: %s", err) + } + // 错误进行宽松赦免处理 + return res, nil +} + +func newAdminSrv(s *base.DaoServant, wc core.WebCache) api.Admin { return &adminSrv{ - DaoServant: s, + DaoServant: s, + wc: wc, + serverUpTime: time.Now().Unix(), } } diff --git a/internal/servants/web/core.go b/internal/servants/web/core.go index de092a60..4430f6ee 100644 --- a/internal/servants/web/core.go +++ b/internal/servants/web/core.go @@ -6,6 +6,7 @@ package web import ( "context" + "fmt" "time" "unicode/utf8" @@ -13,8 +14,10 @@ import ( "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" + "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/model/joint" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/chain" @@ -22,10 +25,10 @@ import ( "github.com/sirupsen/logrus" ) -const ( +var ( // _MaxWhisperNumDaily 当日单用户私信总数限制(TODO 配置化、积分兑换等) - _MaxWhisperNumDaily = 20 - _MaxCaptchaTimes = 2 + _maxWhisperNumDaily int64 = 200 + _maxCaptchaTimes int = 2 ) var ( @@ -35,8 +38,10 @@ var ( type coreSrv struct { api.UnimplementedCoreServant *base.DaoServant - - oss core.ObjectStorageService + oss core.ObjectStorageService + wc core.WebCache + messagesExpire int64 + prefixMessages string } func (s *coreSrv) Chain() gin.HandlersChain { @@ -45,7 +50,7 @@ func (s *coreSrv) Chain() gin.HandlersChain { func (s *coreSrv) SyncSearchIndex(req *web.SyncSearchIndexReq) mir.Error { if req.User != nil && req.User.IsAdmin { - go s.PushPostsToSearch(context.Background()) + s.PushAllPostToSearch() } else { logrus.Warnf("sync search index need admin permision user: %#v", req.User) } @@ -53,11 +58,9 @@ func (s *coreSrv) SyncSearchIndex(req *web.SyncSearchIndexReq) mir.Error { } func (s *coreSrv) GetUserInfo(req *web.UserInfoReq) (*web.UserInfoResp, mir.Error) { - user, err := s.Ds.GetUserByUsername(req.Username) + user, err := s.Ds.UserProfileByName(req.Username) if err != nil { - return nil, xerror.UnauthorizedAuthNotExist - } - if user.Model == nil || user.ID < 0 { + logrus.Errorf("coreSrv.GetUserInfo occurs error[1]: %s", err) return nil, xerror.UnauthorizedAuthNotExist } follows, followings, err := s.Ds.GetFollowCount(user.ID) @@ -65,16 +68,17 @@ func (s *coreSrv) GetUserInfo(req *web.UserInfoReq) (*web.UserInfoResp, mir.Erro return nil, web.ErrGetFollowCountFailed } resp := &web.UserInfoResp{ - Id: user.ID, - Nickname: user.Nickname, - Username: user.Username, - Status: user.Status, - Avatar: user.Avatar, - Balance: user.Balance, - IsAdmin: user.IsAdmin, - CreatedOn: user.CreatedOn, - Follows: follows, - Followings: followings, + Id: user.ID, + Nickname: user.Nickname, + Username: user.Username, + Status: user.Status, + Avatar: user.Avatar, + Balance: user.Balance, + IsAdmin: user.IsAdmin, + CreatedOn: user.CreatedOn, + Follows: follows, + Followings: followings, + TweetsCount: user.TweetsCount, } if user.Phone != "" && len(user.Phone) == 11 { resp.Phone = user.Phone[0:3] + "****" + user.Phone[7:] @@ -82,29 +86,31 @@ func (s *coreSrv) GetUserInfo(req *web.UserInfoReq) (*web.UserInfoResp, mir.Erro return resp, nil } -func (s *coreSrv) GetUnreadMsgCount(req *web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error) { - count, err := s.Ds.GetUnreadCount(req.Uid) - if err != nil { - return nil, xerror.ServerError +func (s *coreSrv) GetMessages(req *web.GetMessagesReq) (res *web.GetMessagesResp, _ mir.Error) { + limit, offset := req.PageSize, (req.Page-1)*req.PageSize + // 尝试直接从缓存中获取数据 + key, ok := "", false + if res, key, ok = s.messagesFromCache(req, limit, offset); ok { + // logrus.Debugf("coreSrv.GetMessages from cache key:%s", key) + return } - return &web.GetUnreadMsgCountResp{ - Count: count, - }, nil -} - -func (s *coreSrv) GetMessages(req *web.GetMessagesReq) (*web.GetMessagesResp, mir.Error) { - conditions := &ms.ConditionsT{ - "receiver_user_id": req.UserId, - "ORDER": "id DESC", + messages, totalRows, err := s.Ds.GetMessages(req.Uid, req.Style, limit, offset) + if err != nil { + logrus.Errorf("Ds.GetMessages err[1]: %s", err) + return nil, web.ErrGetMessagesFailed } - messages, err := s.Ds.GetMessages(conditions, (req.Page-1)*req.PageSize, req.PageSize) for _, mf := range messages { + // TODO: 优化处理这里的user获取逻辑以及错误处理 if mf.SenderUserID > 0 { - user, err := s.Ds.GetUserByID(mf.SenderUserID) - if err == nil { + if user, err := s.Ds.GetUserByID(mf.SenderUserID); err == nil { mf.SenderUser = user.Format() } } + if mf.Type == ms.MsgTypeWhisper && mf.ReceiverUserID != req.Uid { + if user, err := s.Ds.GetUserByID(mf.ReceiverUserID); err == nil { + mf.ReceiverUser = user.Format() + } + } // 好友申请消息不需要获取其他信息 if mf.Type == ms.MsgTypeRequestingFriend { continue @@ -129,12 +135,21 @@ func (s *coreSrv) GetMessages(req *web.GetMessagesReq) (*web.GetMessagesResp, mi } } if err != nil { - logrus.Errorf("Ds.GetMessages err: %v\n", err) + logrus.Errorf("Ds.GetMessages err[2]: %s", err) + return nil, web.ErrGetMessagesFailed + } + if err = s.PrepareMessages(req.Uid, messages); err != nil { + logrus.Errorf("get messages err[3]: %s", err) return nil, web.ErrGetMessagesFailed } - totalRows, _ := s.Ds.GetMessageCount(conditions) - resp := base.PageRespFrom(messages, req.Page, req.PageSize, totalRows) - return (*web.GetMessagesResp)(resp), nil + resp := joint.PageRespFrom(messages, req.Page, req.PageSize, totalRows) + // 缓存处理 + base.OnCacheRespEvent(s.wc, key, resp, s.messagesExpire) + return &web.GetMessagesResp{ + CachePageResp: joint.CachePageResp{ + Data: resp, + }, + }, nil } func (s *coreSrv) ReadMessage(req *web.ReadMessageReq) mir.Error { @@ -149,6 +164,18 @@ func (s *coreSrv) ReadMessage(req *web.ReadMessageReq) mir.Error { logrus.Errorf("Ds.ReadMessage err: %s", err) return web.ErrReadMessageFailed } + // 缓存处理 + onMessageActionEvent(_messageActionRead, req.Uid) + return nil +} + +func (s *coreSrv) ReadAllMessage(req *web.ReadAllMessageReq) mir.Error { + if err := s.Ds.ReadAllMessage(req.Uid); err != nil { + logrus.Errorf("coreSrv.Ds.ReadAllMessage err: %s", err) + return web.ErrReadMessageFailed + } + // 缓存处理 + onMessageActionEvent(_messageActionRead, req.Uid) return nil } @@ -157,13 +184,11 @@ func (s *coreSrv) SendUserWhisper(req *web.SendWhisperReq) mir.Error { if req.Uid == req.UserID { return web.ErrNoWhisperToSelf } - // 今日频次限制 ctx := context.Background() - if count, _ := s.Redis.GetCountWhisper(ctx, req.Uid); count >= _MaxWhisperNumDaily { + if count, _ := s.Redis.GetCountWhisper(ctx, req.Uid); count >= _maxWhisperNumDaily { return web.ErrTooManyWhisperNum } - // 创建私信 _, err := s.Ds.CreateMessage(&ms.Message{ SenderUserID: req.Uid, @@ -176,7 +201,8 @@ func (s *coreSrv) SendUserWhisper(req *web.SendWhisperReq) mir.Error { logrus.Errorf("Ds.CreateWhisper err: %s", err) return web.ErrSendWhisperFailed } - + // 缓存处理, 不需要处理错误 + onMessageActionEvent(_messageActionSendWhisper, req.Uid, req.UserID) // 写入当日(自然日)计数缓存 s.Redis.IncrCountWhisper(ctx, req.Uid) @@ -194,7 +220,6 @@ func (s *coreSrv) GetCollections(req *web.GetCollectionsReq) (*web.GetCollection logrus.Errorf("Ds.GetUserPostCollectionCount err: %s", err) return nil, web.ErrGetCollectionsFailed } - var posts []*ms.Post for _, collection := range collections { posts = append(posts, collection.Post) @@ -204,8 +229,11 @@ func (s *coreSrv) GetCollections(req *web.GetCollectionsReq) (*web.GetCollection logrus.Errorf("Ds.MergePosts err: %s", err) return nil, web.ErrGetCollectionsFailed } + if err = s.PrepareTweets(req.UserId, postsFormated); err != nil { + logrus.Errorf("get collections prepare tweets err: %s", err) + return nil, web.ErrGetCollectionsFailed + } resp := base.PageRespFrom(postsFormated, req.Page, req.PageSize, totalRows) - return (*web.GetCollectionsResp)(resp), nil } @@ -228,7 +256,7 @@ func (s *coreSrv) UserPhoneBind(req *web.UserPhoneBindReq) mir.Error { if c.ExpiredOn < time.Now().Unix() { return web.ErrErrorPhoneCaptcha } - if c.UseTimes >= _MaxCaptchaTimes { + if c.UseTimes >= _maxCaptchaTimes { return web.ErrMaxPhoneCaptchaUseTimes } // 更新检测次数 @@ -325,6 +353,8 @@ func (s *coreSrv) ChangeNickname(req *web.ChangeNicknameReq) mir.Error { logrus.Errorf("Ds.UpdateUser err: %s", err) return xerror.ServerError } + // 缓存处理 + onChangeUsernameEvent(user.ID, user.Username) return nil } @@ -349,6 +379,8 @@ func (s *coreSrv) ChangeAvatar(req *web.ChangeAvatarReq) (xerr mir.Error) { logrus.Errorf("Ds.UpdateUser failed: %s", err) return xerror.ServerError } + // 缓存处理 + onChangeUsernameEvent(user.ID, user.Username) return nil } @@ -374,9 +406,25 @@ func (s *coreSrv) TweetStarStatus(req *web.TweetStarStatusReq) (*web.TweetStarSt return resp, nil } -func newCoreSrv(s *base.DaoServant, oss core.ObjectStorageService) api.Core { +func (s *coreSrv) messagesFromCache(req *web.GetMessagesReq, limit int, offset int) (res *web.GetMessagesResp, key string, ok bool) { + key = fmt.Sprintf("%s%d:%s:%d:%d", s.prefixMessages, req.Uid, req.Style, limit, offset) + if data, err := s.wc.Get(key); err == nil { + ok, res = true, &web.GetMessagesResp{ + CachePageResp: joint.CachePageResp{ + JsonResp: data, + }, + } + } + return +} + +func newCoreSrv(s *base.DaoServant, oss core.ObjectStorageService, wc core.WebCache) api.Core { + cs := conf.CacheSetting return &coreSrv{ - DaoServant: s, - oss: oss, + DaoServant: s, + oss: oss, + wc: wc, + messagesExpire: cs.MessagesExpire, + prefixMessages: conf.PrefixMessages, } } diff --git a/internal/servants/web/events.go b/internal/servants/web/events.go new file mode 100644 index 00000000..79c23598 --- /dev/null +++ b/internal/servants/web/events.go @@ -0,0 +1,347 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "encoding/json" + "fmt" + + "github.com/alimy/tryst/event" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/dao/cache" + "github.com/rocboss/paopao-ce/internal/events" + "github.com/rocboss/paopao-ce/internal/model/joint" + "github.com/rocboss/paopao-ce/internal/model/web" + "github.com/sirupsen/logrus" +) + +const ( + _tweetActionCreate uint8 = iota + _tweetActionDelete +) + +const ( + _commentActionCreate uint8 = iota + _commentActionDelete + _commentActionThumbsUp + _commentActionThumbsDown + _commentActionReplyCreate + _commentActionReplyDelete + _commentActionReplyThumbsUp + _commentActionReplyThumbsDown + _commentActionHighlight +) + +const ( + _messageActionCreate uint8 = iota + _messageActionRead + _messageActionFollow + _messageActionSendWhisper +) + +const ( + _trendsActionCreateTweet uint8 = iota + _trendsActionDeleteTweet + _trendsActionFollowUser + _trendsActionUnfollowUser + _trendsActionAddFriend + _trendsActionDeleteFriend +) + +type cacheUnreadMsgEvent struct { + event.UnimplementedEvent + ds core.DataService + wc core.WebCache + uid int64 +} + +type createMessageEvent struct { + event.UnimplementedEvent + ds core.DataService + wc core.WebCache + message *ms.Message +} + +type tweetActionEvent struct { + event.UnimplementedEvent + ac core.AppCache + userId int64 + username string + action uint8 +} + +type commentActionEvent struct { + event.UnimplementedEvent + ds core.DataService + ac core.AppCache + tweetId int64 + commentId int64 + action uint8 +} + +type messageActionEvent struct { + event.UnimplementedEvent + wc core.WebCache + action uint8 + userId []int64 +} + +type trendsActionEvent struct { + event.UnimplementedEvent + ac core.AppCache + ds core.DataService + action uint8 + userIds []int64 +} + +type changeUserEvent struct { + *cache.BaseCacheEvent + userId int64 + username string +} + +func onChangeUsernameEvent(id int64, name string) { + events.OnEvent(&changeUserEvent{ + BaseCacheEvent: cache.NewBaseCacheEvent(_ac), + userId: id, + username: name, + }) +} + +func onTrendsActionEvent(action uint8, userIds ...int64) { + events.OnEvent(&trendsActionEvent{ + ac: _ac, + ds: _ds, + action: action, + userIds: userIds, + }) +} + +func onTweetActionEvent(action uint8, userId int64, username string) { + events.OnEvent(&tweetActionEvent{ + ac: _ac, + action: action, + userId: userId, + username: username, + }) +} + +func onMessageActionEvent(action uint8, userIds ...int64) { + events.OnEvent(&messageActionEvent{ + wc: _wc, + action: action, + userId: userIds, + }) +} + +func onCommentActionEvent(tweetId int64, commentId int64, action uint8) { + events.OnEvent(&commentActionEvent{ + ds: _ds, + ac: _ac, + tweetId: tweetId, + commentId: commentId, + action: action, + }) +} + +func onCacheUnreadMsgEvent(uid int64) { + events.OnEvent(&cacheUnreadMsgEvent{ + ds: _ds, + wc: _wc, + uid: uid, + }) +} + +func onCreateMessageEvent(data *ms.Message) { + events.OnEvent(&createMessageEvent{ + ds: _ds, + wc: _wc, + message: data, + }) +} + +func (e *cacheUnreadMsgEvent) Name() string { + return "cacheUnreadMsgEvent" +} + +func (e *cacheUnreadMsgEvent) Action() error { + if e.wc.ExistUnreadMsgCountResp(e.uid) { + // do nothing + return nil + } + count, err := e.ds.GetUnreadCount(e.uid) + if err != nil { + return fmt.Errorf("cacheUnreadMsgEvent action occurs error: %w", err) + } + resp := &joint.JsonResp{ + Code: 0, + Msg: "success", + Data: &web.GetUnreadMsgCountResp{ + Count: count, + }, + } + data, err := json.Marshal(resp) + if err != nil { + return fmt.Errorf("cacheUnreadMsgEvent action marshal resp occurs error: %w", err) + } + if err = e.wc.PutUnreadMsgCountResp(e.uid, data); err != nil { + return fmt.Errorf("cacheUnreadMsgEvent action put resp data to redis cache occurs error: %w", err) + } + return nil +} + +func (e *createMessageEvent) Name() string { + return "createMessageEvent" +} + +func (e *createMessageEvent) Action() (err error) { + if _, err = e.ds.CreateMessage(e.message); err == nil { + err = e.wc.DelUnreadMsgCountResp(e.message.ReceiverUserID) + } + return +} + +func (e *commentActionEvent) Name() string { + return "updateCommentMetricEvent" +} + +func (e *commentActionEvent) Action() (err error) { + // logrus.Debugf("trigger commentActionEvent action commentId[%d]", e.commentId) + switch e.action { + case _commentActionCreate: + err = e.ds.AddCommentMetric(e.commentId) + e.expireAllStyleComments() + case _commentActionDelete: + err = e.ds.DeleteCommentMetric(e.commentId) + e.expireAllStyleComments() + case _commentActionReplyCreate, _commentActionReplyDelete: + err = e.updateCommentMetric() + e.expireAllStyleComments() + case _commentActionThumbsUp, _commentActionThumbsDown: + err = e.updateCommentMetric() + e.expireHotsComments() + case _commentActionHighlight: + e.expireAllStyleComments() + default: + // nothing + } + return +} + +func (e *commentActionEvent) expireHotsComments() { + e.ac.DelAny(fmt.Sprintf("%s%d:%s:*", conf.PrefixTweetComment, e.tweetId, conf.InfixCommentHots)) +} + +func (e *commentActionEvent) expireAllStyleComments() { + e.ac.DelAny(fmt.Sprintf("%s%d:*", conf.PrefixTweetComment, e.tweetId)) +} + +func (e *commentActionEvent) updateCommentMetric() error { + // logrus.Debug("trigger commentActionEvent action[updateCommentMetric]") + comment, err := e.ds.GetCommentByID(e.commentId) + if err != nil { + return err + } + e.ds.UpdateCommentMetric(&cs.CommentMetric{ + CommentId: e.commentId, + ReplyCount: comment.ReplyCount, + ThumbsUpCount: comment.ThumbsUpCount, + ThumbsDownCount: comment.ThumbsDownCount, + }) + return nil +} + +func (e *messageActionEvent) Name() string { + return "expireMessagesEvent" +} + +func (e *messageActionEvent) Action() (err error) { + for _, userId := range e.userId { + switch e.action { + case _messageActionRead, + _messageActionSendWhisper: + // 清除未读消息数缓存,不需要处理错误 + e.wc.DelUnreadMsgCountResp(userId) + case _messageActionCreate, + _messageActionFollow: + fallthrough + default: + // TODO + } + //清除该用户所有消息缓存 + err = e.wc.DelAny(fmt.Sprintf("%s%d:*", conf.PrefixMessages, userId)) + } + return +} + +func (e *trendsActionEvent) Name() string { + return "trendsActionEvent" +} + +func (e *trendsActionEvent) Action() (err error) { + switch e.action { + case _trendsActionCreateTweet: + logrus.Debug("trigger trendsActionEvent by create tweet ") + e.updateUserMetric(cs.MetricActionCreateTweet) + e.expireFriendTrends() + case _trendsActionDeleteTweet: + logrus.Debug("trigger trendsActionEvent by delete tweet ") + e.updateUserMetric(cs.MetricActionDeleteTweet) + e.expireFriendTrends() + case _trendsActionAddFriend, _trendsActionDeleteFriend, + _trendsActionFollowUser, _trendsActionUnfollowUser: + e.expireMyTrends() + default: + // nothing + } + return +} + +func (e *trendsActionEvent) updateUserMetric(action uint8) { + for _, userId := range e.userIds { + e.ds.UpdateUserMetric(userId, action) + } +} + +func (e *trendsActionEvent) expireFriendTrends() { + for _, userId := range e.userIds { + if friendIds, err := e.ds.MyFriendIds(userId); err == nil { + for _, id := range friendIds { + e.ac.DelAny(fmt.Sprintf("%s%d:*", conf.PrefixIdxTrends, id)) + } + } + } +} + +func (e *trendsActionEvent) expireMyTrends() { + for _, userId := range e.userIds { + e.ac.DelAny(fmt.Sprintf("%s%d:*", conf.PrefixIdxTrends, userId)) + } +} + +func (e *tweetActionEvent) Name() string { + return "tweetActionEvent" +} + +func (e *tweetActionEvent) Action() (err error) { + switch e.action { + case _tweetActionCreate, _tweetActionDelete: + e.ac.Delete(conf.KeyUserProfileByName.Get(e.username)) + default: + // nothing + } + return +} + +func (e *changeUserEvent) Name() string { + return "changeUserEvent" +} + +func (e *changeUserEvent) Action() error { + return e.ExpireUserData(e.userId, e.username) +} diff --git a/internal/servants/web/followship.go b/internal/servants/web/followship.go index def1e10e..22b41635 100644 --- a/internal/servants/web/followship.go +++ b/internal/servants/web/followship.go @@ -8,6 +8,7 @@ import ( "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" + "github.com/rocboss/paopao-ce/internal/dao/cache" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/chain" @@ -84,6 +85,12 @@ func (s *followshipSrv) UnfollowUser(r *web.UnfollowUserReq) mir.Error { logrus.Errorf("Ds.UnfollowUser err: %s userId: %d followId: %d", err, r.User.ID, r.UserId) return web.ErrUnfollowUserFailed } + // 触发缓存更新事件 + // TODO: 合并成一个事件 + cache.OnCacheMyFollowIdsEvent(s.Ds, r.User.ID) + cache.OnExpireIndexTweetEvent(r.User.ID) + onMessageActionEvent(_messageActionFollow, r.User.ID) + onTrendsActionEvent(_trendsActionUnfollowUser, r.User.ID) return nil } @@ -97,6 +104,12 @@ func (s *followshipSrv) FollowUser(r *web.FollowUserReq) mir.Error { logrus.Errorf("Ds.FollowUser err: %s userId: %d followId: %d", err, r.User.ID, r.UserId) return web.ErrUnfollowUserFailed } + // 触发缓存更新事件 + // TODO: 合并成一个事件 + cache.OnCacheMyFollowIdsEvent(s.Ds, r.User.ID) + cache.OnExpireIndexTweetEvent(r.User.ID) + onMessageActionEvent(_messageActionFollow, r.User.ID) + onTrendsActionEvent(_trendsActionFollowUser, r.User.ID) return nil } diff --git a/internal/servants/web/friendship.go b/internal/servants/web/friendship.go index 4a419666..e0436b72 100644 --- a/internal/servants/web/friendship.go +++ b/internal/servants/web/friendship.go @@ -55,6 +55,9 @@ func (s *friendshipSrv) DeleteFriend(req *web.DeleteFriendReq) mir.Error { logrus.Errorf("Ds.DeleteFriend err: %s", err) return web.ErrDeleteFriendFailed } + // 触发用户关系缓存更新事件 + // cache.OnCacheMyFriendIdsEvent(s.Ds, req.User.ID, req.UserId) + onTrendsActionEvent(_trendsActionDeleteFriend, req.User.ID, req.UserId) return nil } @@ -89,6 +92,9 @@ func (s *friendshipSrv) AddFriend(req *web.AddFriendReq) mir.Error { logrus.Errorf("Ds.AddFriend err: %s", err) return web.ErrAddFriendFailed } + // 触发用户关系缓存更新事件 + // cache.OnCacheMyFriendIdsEvent(s.Ds, req.User.ID, req.UserId) + onTrendsActionEvent(_trendsActionAddFriend, req.User.ID, req.UserId) return nil } diff --git a/internal/servants/web/jobs.go b/internal/servants/web/jobs.go new file mode 100644 index 00000000..eb06589c --- /dev/null +++ b/internal/servants/web/jobs.go @@ -0,0 +1,39 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/alimy/tryst/cfg" + "github.com/robfig/cron/v3" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/events" + "github.com/sirupsen/logrus" +) + +func onMaxOnlineJob() { + spec := conf.JobManagerSetting.MaxOnlineInterval + schedule, err := cron.ParseStandard(spec) + if err != nil { + panic(err) + } + events.OnTask(schedule, func() { + onlineUserKeys, err := _wc.Keys(conf.PrefixOnlineUser + "*") + if maxOnline := len(onlineUserKeys); err == nil && maxOnline > 0 { + if _, err = _wc.PutHistoryMaxOnline(maxOnline); err != nil { + logrus.Warnf("onMaxOnlineJob[2] occurs error: %s", err) + } + } else if err != nil { + logrus.Warnf("onMaxOnlineJob[1] occurs error: %s", err) + } + }) +} + +func scheduleJobs() { + cfg.Not("DisableJobManager", func() { + lazyInitial() + onMaxOnlineJob() + logrus.Debug("schedule inner jobs complete") + }) +} diff --git a/internal/servants/web/loose.go b/internal/servants/web/loose.go index 27f33f77..3fe3517f 100644 --- a/internal/servants/web/loose.go +++ b/internal/servants/web/loose.go @@ -5,13 +5,17 @@ package web import ( + "fmt" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" + "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" + "github.com/rocboss/paopao-ce/internal/model/joint" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/chain" @@ -25,6 +29,15 @@ var ( type looseSrv struct { api.UnimplementedLooseServant *base.DaoServant + ac core.AppCache + userTweetsExpire int64 + idxTweetsExpire int64 + tweetCommentsExpire int64 + prefixUserTweets string + prefixIdxTweetsNewest string + prefixIdxTweetsHots string + prefixIdxTweetsFollowing string + prefixTweetComment string } func (s *looseSrv) Chain() gin.HandlersChain { @@ -32,33 +45,130 @@ func (s *looseSrv) Chain() gin.HandlersChain { } func (s *looseSrv) Timeline(req *web.TimelineReq) (*web.TimelineResp, mir.Error) { - var resp *base.PageResp - offset, limit := (req.Page-1)*req.PageSize, req.PageSize + limit, offset := req.PageSize, (req.Page-1)*req.PageSize if req.Query == "" && req.Type == "search" { - res, err := s.Ds.IndexPosts(req.User, offset, limit) - if err != nil { - logrus.Errorf("Ds.IndexPosts err: %s", err) - return nil, web.ErrGetPostsFailed - } - resp = base.PageRespFrom(res.Tweets, req.Page, req.PageSize, res.Total) - } else { - q := &core.QueryReq{ - Query: req.Query, - Type: core.SearchType(req.Type), + return s.getIndexTweets(req, limit, offset) + } + q := &core.QueryReq{ + Query: req.Query, + Type: core.SearchType(req.Type), + } + res, err := s.Ts.Search(req.User, q, offset, limit) + if err != nil { + logrus.Errorf("Ts.Search err: %s", err) + return nil, web.ErrGetPostsFailed + } + posts, err := s.Ds.RevampPosts(res.Items) + if err != nil { + logrus.Errorf("Ds.RevampPosts err: %s", err) + return nil, web.ErrGetPostsFailed + } + userId := int64(-1) + if req.User != nil { + userId = req.User.ID + } + if err := s.PrepareTweets(userId, posts); err != nil { + logrus.Errorf("timeline occurs error[2]: %s", err) + return nil, web.ErrGetPostsFailed + } + resp := joint.PageRespFrom(posts, req.Page, req.PageSize, res.Total) + return &web.TimelineResp{ + CachePageResp: joint.CachePageResp{ + Data: resp, + }, + }, nil +} + +func (s *looseSrv) getIndexTweets(req *web.TimelineReq, limit int, offset int) (res *web.TimelineResp, err mir.Error) { + // 尝试直接从缓存中获取数据 + key, ok := "", false + if res, key, ok = s.indexTweetsFromCache(req, limit, offset); ok { + // logrus.Debugf("getIndexTweets from cache key:%s", key) + return + } + var ( + posts []*ms.Post + total int64 + xerr error + ) + switch req.Style { + case web.StyleTweetsFollowing: + if req.User != nil { + posts, total, xerr = s.Ds.ListFollowingTweets(req.User.ID, limit, offset) + } else { + // return nil, web.ErrGetPostsNilUser + // 宽松处理,前端退出登录后马上获取动态列表,可能错误走到这里 + posts, total, xerr = s.Ds.ListIndexNewestTweets(limit, offset) } - res, err := s.Ts.Search(req.User, q, offset, limit) - if err != nil { - logrus.Errorf("Ts.Search err: %s", err) - return nil, web.ErrGetPostsFailed + case web.StyleTweetsNewest: + posts, total, xerr = s.Ds.ListIndexNewestTweets(limit, offset) + case web.StyleTweetsHots: + posts, total, xerr = s.Ds.ListIndexHotsTweets(limit, offset) + default: + return nil, web.ErrGetPostsUnknowStyle + } + if xerr != nil { + logrus.Errorf("getIndexTweets occurs error[1]: %s", xerr) + return nil, web.ErrGetPostFailed + } + postsFormated, verr := s.Ds.MergePosts(posts) + if verr != nil { + logrus.Errorf("getIndexTweets in merge posts occurs error: %s", verr) + return nil, web.ErrGetPostFailed + } + userId := int64(-1) + if req.User != nil { + userId = req.User.ID + } + if err := s.PrepareTweets(userId, postsFormated); err != nil { + logrus.Errorf("getIndexTweets occurs error[2]: %s", err) + return nil, web.ErrGetPostsFailed + } + resp := joint.PageRespFrom(postsFormated, req.Page, req.PageSize, total) + // 缓存处理 + base.OnCacheRespEvent(s.ac, key, resp, s.idxTweetsExpire) + return &web.TimelineResp{ + CachePageResp: joint.CachePageResp{ + Data: resp, + }, + }, nil +} + +func (s *looseSrv) indexTweetsFromCache(req *web.TimelineReq, limit int, offset int) (res *web.TimelineResp, key string, ok bool) { + username := "_" + if req.User != nil { + username = req.User.Username + } + switch req.Style { + case web.StyleTweetsFollowing: + key = fmt.Sprintf("%s%s:%d:%d", s.prefixIdxTweetsFollowing, username, offset, limit) + case web.StyleTweetsNewest: + key = fmt.Sprintf("%s%s:%d:%d", s.prefixIdxTweetsNewest, username, offset, limit) + case web.StyleTweetsHots: + key = fmt.Sprintf("%s%s:%d:%d", s.prefixIdxTweetsHots, username, offset, limit) + default: + return + } + if data, err := s.ac.Get(key); err == nil { + ok, res = true, &web.TimelineResp{ + CachePageResp: joint.CachePageResp{ + JsonResp: data, + }, } - posts, err := s.Ds.RevampPosts(res.Items) - if err != nil { - logrus.Errorf("Ds.RevampPosts err: %s", err) - return nil, web.ErrGetPostsFailed + } + return +} + +func (s *looseSrv) tweetCommentsFromCache(req *web.TweetCommentsReq, limit int, offset int) (res *web.TweetCommentsResp, key string, ok bool) { + key = fmt.Sprintf("%s%d:%s:%d:%d", s.prefixTweetComment, req.TweetId, req.Style, limit, offset) + if data, err := s.ac.Get(key); err == nil { + ok, res = true, &web.TweetCommentsResp{ + CachePageResp: joint.CachePageResp{ + JsonResp: data, + }, } - resp = base.PageRespFrom(posts, req.Page, req.PageSize, res.Total) } - return (*web.TimelineResp)(resp), nil + return } func (s *looseSrv) GetUserTweets(req *web.GetUserTweetsReq) (res *web.GetUserTweetsResp, err mir.Error) { @@ -66,6 +176,13 @@ func (s *looseSrv) GetUserTweets(req *web.GetUserTweetsReq) (res *web.GetUserTwe if xerr != nil { return nil, err } + // 尝试直接从缓存中获取数据 + key, ok := "", false + if res, key, ok = s.userTweetsFromCache(req, user); ok { + // logrus.Debugf("GetUserTweets from cache key:%s", key) + return + } + // 缓存获取未成功,只能查库了 switch req.Style { case web.UserPostsStyleComment, web.UserPostsStyleMedia: res, err = s.listUserTweets(req, user) @@ -78,13 +195,38 @@ func (s *looseSrv) GetUserTweets(req *web.GetUserTweetsReq) (res *web.GetUserTwe default: res, err = s.getUserPostTweets(req, user, false) } + // 缓存处理 + if err == nil { + base.OnCacheRespEvent(s.ac, key, res.Data, s.userTweetsExpire) + } + return +} + +func (s *looseSrv) userTweetsFromCache(req *web.GetUserTweetsReq, user *cs.VistUser) (res *web.GetUserTweetsResp, key string, ok bool) { + switch req.Style { + case web.UserPostsStylePost, web.UserPostsStyleHighlight, web.UserPostsStyleMedia: + key = fmt.Sprintf("%s%d:%s:%s:%d:%d", s.prefixUserTweets, user.UserId, req.Style, user.RelTyp, req.Page, req.PageSize) + default: + meName := "_" + if user.RelTyp != cs.RelationGuest { + meName = req.User.Username + } + key = fmt.Sprintf("%s%d:%s:%s:%d:%d", s.prefixUserTweets, user.UserId, req.Style, meName, req.Page, req.PageSize) + } + if data, err := s.ac.Get(key); err == nil { + ok, res = true, &web.GetUserTweetsResp{ + CachePageResp: joint.CachePageResp{ + JsonResp: data, + }, + } + } return } func (s *looseSrv) getUserStarTweets(req *web.GetUserTweetsReq, user *cs.VistUser) (*web.GetUserTweetsResp, mir.Error) { stars, totalRows, err := s.Ds.ListUserStarTweets(user, req.PageSize, (req.Page-1)*req.PageSize) if err != nil { - logrus.Errorf("Ds.GetUserPostStars err: %s", err) + logrus.Errorf("getUserStarTweets err[1]: %s", err) return nil, web.ErrGetStarsFailed } var posts []*ms.Post @@ -98,8 +240,20 @@ func (s *looseSrv) getUserStarTweets(req *web.GetUserTweetsReq, user *cs.VistUse logrus.Errorf("Ds.MergePosts err: %s", err) return nil, web.ErrGetStarsFailed } - resp := base.PageRespFrom(postsFormated, req.Page, req.PageSize, totalRows) - return (*web.GetUserTweetsResp)(resp), nil + userId := int64(-1) + if req.User != nil { + userId = req.User.ID + } + if err := s.PrepareTweets(userId, postsFormated); err != nil { + logrus.Errorf("getUserStarTweets err[2]: %s", err) + return nil, web.ErrGetPostsFailed + } + resp := joint.PageRespFrom(postsFormated, req.Page, req.PageSize, totalRows) + return &web.GetUserTweetsResp{ + CachePageResp: joint.CachePageResp{ + Data: resp, + }, + }, nil } func (s *looseSrv) listUserTweets(req *web.GetUserTweetsReq, user *cs.VistUser) (*web.GetUserTweetsResp, mir.Error) { @@ -113,63 +267,80 @@ func (s *looseSrv) listUserTweets(req *web.GetUserTweetsReq, user *cs.VistUser) } else if req.Style == web.UserPostsStyleMedia { tweets, total, err = s.Ds.ListUserMediaTweets(user, req.PageSize, (req.Page-1)*req.PageSize) } else { - logrus.Errorf("s.listUserTweets unknow style: %s", req.Style) + logrus.Errorf("s.listUserTweets unknow style[1]: %s", req.Style) return nil, web.ErrGetPostsFailed } if err != nil { - logrus.Errorf("s.listUserTweets err: %s", err) + logrus.Errorf("s.listUserTweets err[2]: %s", err) return nil, web.ErrGetPostsFailed } - postFormated, err := s.Ds.MergePosts(tweets) + postsFormated, err := s.Ds.MergePosts(tweets) if err != nil { - logrus.Errorf("s.listUserTweets err: %s", err) + logrus.Errorf("s.listUserTweets err[3]: %s", err) return nil, web.ErrGetPostsFailed } - resp := base.PageRespFrom(postFormated, req.Page, req.PageSize, total) - return (*web.GetUserTweetsResp)(resp), nil + userId := int64(-1) + if req.User != nil { + userId = req.User.ID + } + if err := s.PrepareTweets(userId, postsFormated); err != nil { + logrus.Errorf("s.listUserTweets err[4]: %s", err) + return nil, web.ErrGetPostsFailed + } + resp := joint.PageRespFrom(postsFormated, req.Page, req.PageSize, total) + return &web.GetUserTweetsResp{ + CachePageResp: joint.CachePageResp{ + Data: resp, + }, + }, nil } func (s *looseSrv) getUserPostTweets(req *web.GetUserTweetsReq, user *cs.VistUser, isHighlight bool) (*web.GetUserTweetsResp, mir.Error) { - visibilities := []core.PostVisibleT{core.PostVisitPublic} + style := cs.StyleUserTweetsGuest switch user.RelTyp { - case cs.RelationAdmin, cs.RelationSelf: - visibilities = append(visibilities, core.PostVisitPrivate, core.PostVisitFriend) + case cs.RelationAdmin: + style = cs.StyleUserTweetsAdmin + case cs.RelationSelf: + style = cs.StyleUserTweetsSelf case cs.RelationFriend: - visibilities = append(visibilities, core.PostVisitFriend) + style = cs.StyleUserTweetsFriend + case cs.RelationFollowing: + style = cs.StyleUserTweetsFollowing case cs.RelationGuest: fallthrough default: // nothing } - conditions := ms.ConditionsT{ - "user_id": user.UserId, - "visibility IN ?": visibilities, - "ORDER": "latest_replied_on DESC", - } - if isHighlight { - conditions["is_essence"] = 1 - } - _, posts, err := s.GetTweetList(conditions, (req.Page-1)*req.PageSize, req.PageSize) + posts, total, err := s.Ds.ListUserTweets(user.UserId, style, isHighlight, req.PageSize, (req.Page-1)*req.PageSize) if err != nil { - logrus.Errorf("s.GetTweetList err: %s", err) + logrus.Errorf("s.GetTweetList error[1]: %s", err) return nil, web.ErrGetPostsFailed } - totalRows, err := s.Ds.GetPostCount(conditions) - if err != nil { - logrus.Errorf("s.GetPostCount err: %s", err) + postsFormated, xerr := s.Ds.MergePosts(posts) + if xerr != nil { + logrus.Errorf("s.GetTweetList error[2]: %s", err) + return nil, web.ErrGetPostsFailed + } + userId := int64(-1) + if req.User != nil { + userId = req.User.ID + } + if err := s.PrepareTweets(userId, postsFormated); err != nil { + logrus.Errorf("s.GetTweetList error[3]: %s", err) return nil, web.ErrGetPostsFailed } - resp := base.PageRespFrom(posts, req.Page, req.PageSize, totalRows) - return (*web.GetUserTweetsResp)(resp), nil + resp := joint.PageRespFrom(postsFormated, req.Page, req.PageSize, total) + return &web.GetUserTweetsResp{ + CachePageResp: joint.CachePageResp{ + Data: resp, + }, + }, nil } func (s *looseSrv) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) { - he, err := s.Ds.GetUserByUsername(req.Username) + he, err := s.Ds.UserProfileByName(req.Username) if err != nil { - logrus.Errorf("Ds.GetUserByUsername err: %s", err) - return nil, web.ErrNoExistUsername - } - if he.Model == nil && he.ID <= 0 { + logrus.Errorf("looseSrv.GetUserProfile occurs error[1]: %s", err) return nil, web.ErrNoExistUsername } // 设定自己不是自己的朋友 @@ -197,6 +368,7 @@ func (s *looseSrv) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfi CreatedOn: he.CreatedOn, Follows: follows, Followings: followings, + TweetsCount: he.TweetsCount, }, nil } @@ -235,18 +407,18 @@ func (s *looseSrv) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Err }, nil } -func (s *looseSrv) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) { - sort := "id ASC" - if req.SortStrategy == "newest" { - sort = "id DESC" - } - conditions := &ms.ConditionsT{ - "post_id": req.TweetId, - "ORDER": sort, +func (s *looseSrv) TweetComments(req *web.TweetCommentsReq) (res *web.TweetCommentsResp, err mir.Error) { + limit, offset := req.PageSize, (req.Page-1)*req.PageSize + // 尝试直接从缓存中获取数据 + key, ok := "", false + if res, key, ok = s.tweetCommentsFromCache(req, limit, offset); ok { + logrus.Debugf("looseSrv.TweetComments from cache key:%s", key) + return } - comments, err := s.Ds.GetComments(conditions, (req.Page-1)*req.PageSize, req.PageSize) - if err != nil { + comments, totalRows, xerr := s.Ds.GetComments(req.TweetId, req.Style.ToInnerValue(), limit, offset) + if xerr != nil { + logrus.Errorf("looseSrv.TweetComments occurs error[1]: %s", xerr) return nil, web.ErrGetCommentsFailed } @@ -257,25 +429,29 @@ func (s *looseSrv) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsR commentIDs = append(commentIDs, comment.ID) } - users, err := s.Ds.GetUsersByIDs(userIDs) - if err != nil { + users, xerr := s.Ds.GetUsersByIDs(userIDs) + if xerr != nil { + logrus.Errorf("looseSrv.TweetComments occurs error[2]: %s", xerr) return nil, web.ErrGetCommentsFailed } - contents, err := s.Ds.GetCommentContentsByIDs(commentIDs) - if err != nil { + contents, xerr := s.Ds.GetCommentContentsByIDs(commentIDs) + if xerr != nil { + logrus.Errorf("looseSrv.TweetComments occurs error[3]: %s", xerr) return nil, web.ErrGetCommentsFailed } - replies, err := s.Ds.GetCommentRepliesByID(commentIDs) - if err != nil { + replies, xerr := s.Ds.GetCommentRepliesByID(commentIDs) + if xerr != nil { + logrus.Errorf("looseSrv.TweetComments occurs error[4]: %s", xerr) return nil, web.ErrGetCommentsFailed } var commentThumbs, replyThumbs cs.CommentThumbsMap if req.Uid > 0 { - commentThumbs, replyThumbs, err = s.Ds.GetCommentThumbsMap(req.Uid, req.TweetId) - if err != nil { + commentThumbs, replyThumbs, xerr = s.Ds.GetCommentThumbsMap(req.Uid, req.TweetId) + if xerr != nil { + logrus.Errorf("looseSrv.TweetComments occurs error[5]: %s", xerr) return nil, web.ErrGetCommentsFailed } } @@ -315,15 +491,55 @@ func (s *looseSrv) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsR } commentsFormated = append(commentsFormated, commentFormated) } + resp := joint.PageRespFrom(commentsFormated, req.Page, req.PageSize, totalRows) + // 缓存处理 + base.OnCacheRespEvent(s.ac, key, resp, s.tweetCommentsExpire) + return &web.TweetCommentsResp{ + CachePageResp: joint.CachePageResp{ + Data: resp, + }, + }, nil +} - // 获取总量 - totalRows, _ := s.Ds.GetCommentCount(conditions) - resp := base.PageRespFrom(commentsFormated, req.Page, req.PageSize, totalRows) - return (*web.TweetCommentsResp)(resp), nil +func (s *looseSrv) TweetDetail(req *web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) { + post, err := s.Ds.GetPostByID(req.TweetId) + if err != nil { + return nil, web.ErrGetPostFailed + } + postContents, err := s.Ds.GetPostContentsByIDs([]int64{post.ID}) + if err != nil { + return nil, web.ErrGetPostFailed + } + users, err := s.Ds.GetUsersByIDs([]int64{post.UserID}) + if err != nil { + return nil, web.ErrGetPostFailed + } + // 数据整合 + postFormated := post.Format() + for _, user := range users { + postFormated.User = user.Format() + } + for _, content := range postContents { + if content.PostID == post.ID { + postFormated.Contents = append(postFormated.Contents, content.Format()) + } + } + s.PrepareTweet(req.Uid, postFormated) + return (*web.TweetDetailResp)(postFormated), nil } -func newLooseSrv(s *base.DaoServant) api.Loose { +func newLooseSrv(s *base.DaoServant, ac core.AppCache) api.Loose { + cs := conf.CacheSetting return &looseSrv{ - DaoServant: s, + DaoServant: s, + ac: ac, + userTweetsExpire: cs.UserTweetsExpire, + idxTweetsExpire: cs.IndexTweetsExpire, + tweetCommentsExpire: cs.TweetCommentsExpire, + prefixUserTweets: conf.PrefixUserTweets, + prefixIdxTweetsNewest: conf.PrefixIdxTweetsNewest, + prefixIdxTweetsHots: conf.PrefixIdxTweetsHots, + prefixIdxTweetsFollowing: conf.PrefixIdxTweetsFollowing, + prefixTweetComment: conf.PrefixTweetComment, } } diff --git a/internal/servants/web/priv.go b/internal/servants/web/priv.go index f3654415..875a48bf 100644 --- a/internal/servants/web/priv.go +++ b/internal/servants/web/priv.go @@ -10,6 +10,7 @@ import ( "time" "github.com/alimy/mir/v4" + "github.com/alimy/tryst/cfg" "github.com/disintegration/imaging" "github.com/gin-gonic/gin" "github.com/gofrs/uuid/v5" @@ -27,7 +28,8 @@ import ( ) var ( - _ api.Priv = (*privSrv)(nil) + _ api.Priv = (*privSrv)(nil) + _ api.PrivChain = (*privChain)(nil) _uploadAttachmentTypeMap = map[string]ms.AttachmentType{ "public/image": ms.AttachmentTypeImage, @@ -35,12 +37,6 @@ var ( "public/video": ms.AttachmentTypeVideo, "attachment": ms.AttachmentTypeOther, } - _uploadAttachmentTypes = map[string]cs.AttachmentType{ - "public/image": cs.AttachmentTypeImage, - "public/avatar": cs.AttachmentTypeImage, - "public/video": cs.AttachmentTypeVideo, - "attachment": cs.AttachmentTypeOther, - } ) type privSrv struct { @@ -50,6 +46,17 @@ type privSrv struct { oss core.ObjectStorageService } +type privChain struct { + api.UnimplementedPrivChain +} + +func (s *privChain) ChainCreateTweet() (res gin.HandlersChain) { + if cfg.If("UseAuditHook") { + res = gin.HandlersChain{chain.AuditHook()} + } + return +} + func (s *privSrv) Chain() gin.HandlersChain { return gin.HandlersChain{chain.JWT(), chain.Priv()} } @@ -75,6 +82,8 @@ func (s *privSrv) ThumbsDownTweetComment(req *web.TweetCommentThumbsReq) mir.Err logrus.Errorf("thumbs down tweet comment error: %s req:%v", err, req) return web.ErrThumbsDownTweetComment } + // 缓存处理 + onCommentActionEvent(req.TweetId, req.CommentId, _commentActionThumbsDown) return nil } @@ -83,6 +92,8 @@ func (s *privSrv) ThumbsUpTweetComment(req *web.TweetCommentThumbsReq) mir.Error logrus.Errorf("thumbs up tweet comment error: %s req:%v", err, req) return web.ErrThumbsUpTweetComment } + // 缓存处理 + onCommentActionEvent(req.TweetId, req.CommentId, _commentActionThumbsUp) return nil } @@ -242,7 +253,7 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp, IP: req.ClientIP, IPLoc: utils.GetIPLoc(req.ClientIP), AttachmentPrice: req.AttachmentPrice, - Visibility: req.Visibility, + Visibility: ms.PostVisibleT(req.Visibility.ToVisibleValue()), } post, err = s.Ds.CreatePost(post) if err != nil { @@ -286,8 +297,7 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp, } // 创建消息提醒 - // TODO: 优化消息提醒处理机制 - go s.Ds.CreateMessage(&ms.Message{ + onCreateMessageEvent(&ms.Message{ SenderUserID: req.User.ID, ReceiverUserID: user.ID, Type: ms.MsgTypePost, @@ -303,6 +313,10 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp, logrus.Infof("Ds.RevampPosts err: %s", err) return nil, web.ErrCreatePostFailed } + // 缓存处理 + // TODO: 缓存逻辑合并处理 + onTrendsActionEvent(_trendsActionCreateTweet, req.User.ID) + onTweetActionEvent(_tweetActionCreate, req.User.ID, req.User.Username) return (*web.CreateTweetResp)(formatedPosts[0]), nil } @@ -331,6 +345,10 @@ func (s *privSrv) DeleteTweet(req *web.DeleteTweetReq) mir.Error { logrus.Errorf("s.DeleteSearchPost failed: %s", err) return web.ErrDeletePostFailed } + // 缓存处理 + // TODO: 缓存逻辑合并处理 + onTrendsActionEvent(_trendsActionDeleteTweet, req.User.ID) + onTweetActionEvent(_tweetActionDelete, req.User.ID, req.User.Username) return nil } @@ -349,10 +367,14 @@ func (s *privSrv) DeleteCommentReply(req *web.DeleteCommentReplyReq) mir.Error { logrus.Errorf("s.deletePostCommentReply err: %s", err) return web.ErrDeleteCommentFailed } + // 缓存处理, 宽松处理错误 + if comment, err := s.Ds.GetCommentByID(reply.CommentID); err == nil { + onCommentActionEvent(comment.PostID, comment.ID, _commentActionReplyDelete) + } return nil } -func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.CreateCommentReplyResp, mir.Error) { +func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (_ *web.CreateCommentReplyResp, xerr mir.Error) { var ( post *ms.Post comment *ms.Comment @@ -390,7 +412,7 @@ func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.Creat // 创建用户消息提醒 commentMaster, err := s.Ds.GetUserByID(comment.UserID) if err == nil && commentMaster.ID != req.Uid { - go s.Ds.CreateMessage(&ms.Message{ + onCreateMessageEvent(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: commentMaster.ID, Type: ms.MsgTypeReply, @@ -402,7 +424,7 @@ func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.Creat } postMaster, err := s.Ds.GetUserByID(post.UserID) if err == nil && postMaster.ID != req.Uid && commentMaster.ID != postMaster.ID { - go s.Ds.CreateMessage(&ms.Message{ + onCreateMessageEvent(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: postMaster.ID, Type: ms.MsgTypeReply, @@ -416,7 +438,7 @@ func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.Creat user, err := s.Ds.GetUserByID(atUserID) if err == nil && user.ID != req.Uid && commentMaster.ID != user.ID && postMaster.ID != user.ID { // 创建消息提醒 - go s.Ds.CreateMessage(&ms.Message{ + onCreateMessageEvent(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: user.ID, Type: ms.MsgTypeReply, @@ -427,6 +449,8 @@ func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.Creat }) } } + // 缓存处理 + onCommentActionEvent(comment.PostID, comment.ID, _commentActionReplyCreate) return (*web.CreateCommentReplyResp)(reply), nil } @@ -455,9 +479,26 @@ func (s *privSrv) DeleteComment(req *web.DeleteCommentReq) mir.Error { logrus.Errorf("Ds.DeleteComment err: %s", err) return web.ErrDeleteCommentFailed } + onCommentActionEvent(comment.PostID, comment.ID, _commentActionDelete) return nil } +func (s *privSrv) HighlightComment(req *web.HighlightCommentReq) (*web.HighlightCommentResp, mir.Error) { + status, err := s.Ds.HighlightComment(req.Uid, req.CommentId) + if err == cs.ErrNoPermission { + return nil, web.ErrNoPermission + } else if err != nil { + return nil, web.ErrHighlightCommentFailed + } + // 缓存处理, 宽松处理错误 + if comment, err := s.Ds.GetCommentByID(req.CommentId); err == nil { + onCommentActionEvent(comment.PostID, comment.ID, _commentActionHighlight) + } + return &web.HighlightCommentResp{ + HighlightStatus: status, + }, nil +} + func (s *privSrv) CreateComment(req *web.CreateCommentReq) (_ *web.CreateCommentResp, xerr mir.Error) { var ( mediaContents []string @@ -522,7 +563,7 @@ func (s *privSrv) CreateComment(req *web.CreateCommentReq) (_ *web.CreateComment // 创建用户消息提醒 postMaster, err := s.Ds.GetUserByID(post.UserID) if err == nil && postMaster.ID != req.Uid { - go s.Ds.CreateMessage(&ms.Message{ + onCreateMessageEvent(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: postMaster.ID, Type: ms.MsgtypeComment, @@ -538,7 +579,7 @@ func (s *privSrv) CreateComment(req *web.CreateCommentReq) (_ *web.CreateComment } // 创建消息提醒 - go s.Ds.CreateMessage(&ms.Message{ + onCreateMessageEvent(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: user.ID, Type: ms.MsgtypeComment, @@ -547,7 +588,8 @@ func (s *privSrv) CreateComment(req *web.CreateCommentReq) (_ *web.CreateComment CommentID: comment.ID, }) } - + // 缓存处理 + onCommentActionEvent(comment.PostID, comment.ID, _commentActionCreate) return (*web.CreateCommentResp)(comment), nil } @@ -592,7 +634,7 @@ func (s *privSrv) StarTweet(req *web.StarTweetReq) (*web.StarTweetResp, mir.Erro } func (s *privSrv) VisibleTweet(req *web.VisibleTweetReq) (*web.VisibleTweetResp, mir.Error) { - if req.Visibility >= core.PostVisitInvalid { + if req.Visibility >= web.TweetVisitInvalid { return nil, xerror.InvalidParams } post, err := s.Ds.GetPostByID(req.ID) @@ -602,13 +644,13 @@ func (s *privSrv) VisibleTweet(req *web.VisibleTweetReq) (*web.VisibleTweetResp, if xerr := checkPermision(req.User, post.UserID); xerr != nil { return nil, xerr } - if err = s.Ds.VisiblePost(post, req.Visibility); err != nil { + if err = s.Ds.VisiblePost(post, req.Visibility.ToVisibleValue()); err != nil { logrus.Warnf("s.Ds.VisiblePost: %s", err) return nil, web.ErrVisblePostFailed } // 推送Search - post.Visibility = req.Visibility + post.Visibility = ms.PostVisibleT(req.Visibility.ToVisibleValue()) s.PushPostToSearch(post) return &web.VisibleTweetResp{ @@ -847,3 +889,7 @@ func newPrivSrv(s *base.DaoServant, oss core.ObjectStorageService) api.Priv { oss: oss, } } + +func newPrivChain() api.PrivChain { + return &privChain{} +} diff --git a/internal/servants/web/pub.go b/internal/servants/web/pub.go index f12f74ee..a1611034 100644 --- a/internal/servants/web/pub.go +++ b/internal/servants/web/pub.go @@ -42,32 +42,6 @@ type pubSrv struct { *base.DaoServant } -func (s *pubSrv) TweetDetail(req *web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) { - post, err := s.Ds.GetPostByID(req.TweetId) - if err != nil { - return nil, web.ErrGetPostFailed - } - postContents, err := s.Ds.GetPostContentsByIDs([]int64{post.ID}) - if err != nil { - return nil, web.ErrGetPostFailed - } - users, err := s.Ds.GetUsersByIDs([]int64{post.UserID}) - if err != nil { - return nil, web.ErrGetPostFailed - } - // 数据整合 - postFormated := post.Format() - for _, user := range users { - postFormated.User = user.Format() - } - for _, content := range postContents { - if content.PostID == post.ID { - postFormated.Contents = append(postFormated.Contents, content.Format()) - } - } - return (*web.TweetDetailResp)(postFormated), nil -} - func (s *pubSrv) SendCaptcha(req *web.SendCaptchaReq) mir.Error { ctx := context.Background() diff --git a/internal/servants/web/relax.go b/internal/servants/web/relax.go new file mode 100644 index 00000000..4c230f66 --- /dev/null +++ b/internal/servants/web/relax.go @@ -0,0 +1,64 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" + "github.com/redis/rueidis" + api "github.com/rocboss/paopao-ce/auto/api/v1" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/model/web" + "github.com/rocboss/paopao-ce/internal/servants/base" + "github.com/rocboss/paopao-ce/internal/servants/chain" + "github.com/sirupsen/logrus" +) + +var ( + _ api.Relax = (*relaxSrv)(nil) +) + +type relaxSrv struct { + api.UnimplementedRelaxServant + *base.DaoServant + wc core.WebCache +} + +type relaxChain struct { + api.UnimplementedRelaxChain +} + +func (s *relaxChain) ChainGetUnreadMsgCount() gin.HandlersChain { + return gin.HandlersChain{chain.OnlineUserMeasure()} +} + +func (s *relaxSrv) Chain() gin.HandlersChain { + return gin.HandlersChain{chain.JwtSurely()} +} + +func (s *relaxSrv) GetUnreadMsgCount(req *web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error) { + if data, xerr := s.wc.GetUnreadMsgCountResp(req.Uid); xerr == nil && len(data) > 0 { + // logrus.Debugln("GetUnreadMsgCount get resp from cache") + return &web.GetUnreadMsgCountResp{ + JsonResp: data, + }, nil + } else if !rueidis.IsRedisNil(xerr) { + logrus.Warnf("GetUnreadMsgCount from cache occurs error: %s", xerr) + } + // 使用缓存机制特殊处理 + onCacheUnreadMsgEvent(req.Uid) + return &web.GetUnreadMsgCountResp{}, nil +} + +func newRelaxSrv(s *base.DaoServant, wc core.WebCache) api.Relax { + return &relaxSrv{ + DaoServant: s, + wc: wc, + } +} + +func newRelaxChain() api.RelaxChain { + return &relaxChain{} +} diff --git a/internal/servants/web/site.go b/internal/servants/web/site.go new file mode 100644 index 00000000..ce137fbf --- /dev/null +++ b/internal/servants/web/site.go @@ -0,0 +1,39 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/alimy/mir/v4" + api "github.com/rocboss/paopao-ce/auto/api/v1" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/model/web" + "github.com/rocboss/paopao-ce/internal/servants/base" + "github.com/rocboss/paopao-ce/pkg/version" +) + +var ( + _ api.Site = (*siteSrv)(nil) +) + +type siteSrv struct { + api.UnimplementedSiteServant + *base.BaseServant +} + +func (*siteSrv) Profile() (*web.SiteProfileResp, mir.Error) { + return conf.WebProfileSetting, nil +} + +func (*siteSrv) Version() (*web.VersionResp, mir.Error) { + return &web.VersionResp{ + BuildInfo: version.ReadBuildInfo(), + }, nil +} + +func newSiteSrv() api.Site { + return &siteSrv{ + BaseServant: base.NewBaseServant(), + } +} diff --git a/internal/servants/web/trends.go b/internal/servants/web/trends.go new file mode 100644 index 00000000..58171606 --- /dev/null +++ b/internal/servants/web/trends.go @@ -0,0 +1,81 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "fmt" + + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" + api "github.com/rocboss/paopao-ce/auto/api/v1" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/model/joint" + "github.com/rocboss/paopao-ce/internal/model/web" + "github.com/rocboss/paopao-ce/internal/servants/base" + "github.com/rocboss/paopao-ce/internal/servants/chain" + "github.com/sirupsen/logrus" +) + +var ( + _ api.Trends = (*trendsSrv)(nil) +) + +type trendsSrv struct { + api.UnimplementedTrendsServant + *base.DaoServant + ac core.AppCache + indexTrendsExpire int64 + prefixTrends string +} + +func (s *trendsSrv) Chain() gin.HandlersChain { + return gin.HandlersChain{chain.JWT()} +} + +func (s *trendsSrv) GetIndexTrends(req *web.GetIndexTrendsReq) (res *web.GetIndexTrendsResp, _ mir.Error) { + limit, offset := req.PageSize, (req.Page-1)*req.PageSize + // 尝试直接从缓存中获取数据 + key, ok := "", false + if res, key, ok = s.trendsFromCache(req, limit, offset); ok { + // logrus.Debugf("trendsSrv.GetIndexTrends from cache key:%s", key) + return + } + trends, totalRows, err := s.Ds.GetIndexTrends(req.Uid, limit, offset) + if err != nil { + logrus.Errorf("Ds.GetIndexTrends err[1]: %s", err) + return nil, web.ErrGetIndexTrendsFailed + } + resp := joint.PageRespFrom(trends, req.Page, req.PageSize, totalRows) + // 缓存处理 + base.OnCacheRespEvent(s.ac, key, resp, s.indexTrendsExpire) + return &web.GetIndexTrendsResp{ + CachePageResp: joint.CachePageResp{ + Data: resp, + }, + }, nil +} + +func (s *trendsSrv) trendsFromCache(req *web.GetIndexTrendsReq, limit int, offset int) (res *web.GetIndexTrendsResp, key string, ok bool) { + key = fmt.Sprintf("%s%d:%d:%d", s.prefixTrends, req.Uid, limit, offset) + if data, err := s.ac.Get(key); err == nil { + ok, res = true, &web.GetIndexTrendsResp{ + CachePageResp: joint.CachePageResp{ + JsonResp: data, + }, + } + } + return +} + +func newTrendsSrv(s *base.DaoServant) api.Trends { + cs := conf.CacheSetting + return &trendsSrv{ + DaoServant: s, + ac: _ac, + indexTrendsExpire: cs.IndexTrendsExpire, + prefixTrends: conf.PrefixIdxTrends, + } +} diff --git a/internal/servants/web/web.go b/internal/servants/web/web.go index e58a426b..7f95eee2 100644 --- a/internal/servants/web/web.go +++ b/internal/servants/web/web.go @@ -7,39 +7,49 @@ package web import ( "sync" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/dao" + "github.com/rocboss/paopao-ce/internal/dao/cache" "github.com/rocboss/paopao-ce/internal/servants/base" ) var ( _enablePhoneVerify bool _disallowUserRegister bool + _ds core.DataService + _ac core.AppCache + _wc core.WebCache + _oss core.ObjectStorageService _onceInitial sync.Once ) // RouteWeb register web route func RouteWeb(e *gin.Engine) { lazyInitial() - oss := dao.ObjectStorageService() ds := base.NewDaoServant() // aways register servants - api.RegisterAdminServant(e, newAdminSrv(ds)) - api.RegisterCoreServant(e, newCoreSrv(ds, oss)) - api.RegisterLooseServant(e, newLooseSrv(ds)) - api.RegisterPrivServant(e, newPrivSrv(ds, oss)) + api.RegisterAdminServant(e, newAdminSrv(ds, _wc)) + api.RegisterCoreServant(e, newCoreSrv(ds, _oss, _wc)) + api.RegisterRelaxServant(e, newRelaxSrv(ds, _wc), newRelaxChain()) + api.RegisterLooseServant(e, newLooseSrv(ds, _ac)) + api.RegisterPrivServant(e, newPrivSrv(ds, _oss), newPrivChain()) api.RegisterPubServant(e, newPubSrv(ds)) + api.RegisterTrendsServant(e, newTrendsSrv(ds)) api.RegisterFollowshipServant(e, newFollowshipSrv(ds)) api.RegisterFriendshipServant(e, newFriendshipSrv(ds)) + api.RegisterSiteServant(e, newSiteSrv()) // regster servants if needed by configure cfg.Be("Alipay", func() { client := conf.MustAlipayClient() api.RegisterAlipayPubServant(e, newAlipayPubSrv(ds)) api.RegisterAlipayPrivServant(e, newAlipayPrivSrv(ds, client)) }) + // shedule jobs if need + scheduleJobs() } // lazyInitial do some package lazy initialize for performance @@ -47,5 +57,11 @@ func lazyInitial() { _onceInitial.Do(func() { _enablePhoneVerify = cfg.If("Sms") _disallowUserRegister = cfg.If("Web:DisallowUserRegister") + _maxWhisperNumDaily = conf.AppSetting.MaxWhisperDaily + _maxCaptchaTimes = conf.AppSetting.MaxCaptchaTimes + _oss = dao.ObjectStorageService() + _ds = dao.DataService() + _ac = cache.NewAppCache() + _wc = cache.NewWebCache() }) } diff --git a/internal/service/http_service.go b/internal/service/http_service.go index df93786c..0cc094df 100644 --- a/internal/service/http_service.go +++ b/internal/service/http_service.go @@ -15,7 +15,9 @@ type baseHttpService struct { } func (s *baseHttpService) registerRoute(srv Service, h func(e *gin.Engine)) { - h(s.server.e) + if h != nil { + h(s.server.e) + } s.server.addService(srv) } diff --git a/internal/service/metrics.go b/internal/service/metrics.go new file mode 100644 index 00000000..d83a5fd4 --- /dev/null +++ b/internal/service/metrics.go @@ -0,0 +1,63 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package service + +import ( + "fmt" + "net/http" + + "github.com/Masterminds/semver/v3" + "github.com/fatih/color" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/dao" + "github.com/rocboss/paopao-ce/internal/dao/cache" + "github.com/rocboss/paopao-ce/internal/metrics/prometheus" +) + +var ( + _ Service = (*metricsService)(nil) +) + +type metricsService struct { + *baseHttpService +} + +func (s *metricsService) Name() string { + return "MetricsService" +} + +func (s *metricsService) Version() *semver.Version { + return semver.MustParse("v0.1.0") +} + +func (s *metricsService) OnInit() error { + s.registerRoute(s, nil) + return nil +} + +func (s *metricsService) String() string { + return fmt.Sprintf("listen on %s\n", color.GreenString("http://%s:%s", conf.MetricsServerSetting.HttpIp, conf.MetricsServerSetting.HttpPort)) +} + +func newMetricsService() Service { + addr := conf.MetricsServerSetting.HttpIp + ":" + conf.MetricsServerSetting.HttpPort + server := httpServers.from(addr, func() *httpServer { + ds, wc := dao.DataService(), cache.NewWebCache() + mux := http.NewServeMux() + mux.Handle("/metrics", prometheus.NewHandler(ds, wc)) + return &httpServer{ + baseServer: newBaseServe(), + server: &http.Server{ + Addr: addr, + Handler: mux, + }, + } + }) + return &metricsService{ + baseHttpService: &baseHttpService{ + server: server, + }, + } +} diff --git a/internal/service/pprof.go b/internal/service/pprof.go index 80f8c07e..97501c32 100644 --- a/internal/service/pprof.go +++ b/internal/service/pprof.go @@ -10,7 +10,6 @@ import ( "github.com/Masterminds/semver/v3" "github.com/fatih/color" - "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/conf" ) @@ -31,7 +30,7 @@ func (s *pprofService) Version() *semver.Version { } func (s *pprofService) OnInit() error { - s.registerRoute(s, func(*gin.Engine) {}) + s.registerRoute(s, nil) return nil } @@ -43,10 +42,8 @@ func newPprofService() Service { addr := conf.PprofServerSetting.HttpIp + ":" + conf.PprofServerSetting.HttpPort // notice this step just to register pprof server to start. don't share server with pprof. server := httpServers.from(addr, func() *httpServer { - engine := newWebEngine() return &httpServer{ baseServer: newBaseServe(), - e: engine, server: &http.Server{ Addr: addr, Handler: http.DefaultServeMux, diff --git a/internal/service/service.go b/internal/service/service.go index ad248695..d85692da 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -8,7 +8,7 @@ import ( "log" "github.com/Masterminds/semver/v3" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/rocboss/paopao-ce/pkg/types" ) @@ -75,6 +75,9 @@ func newService() (ss []Service) { "Pprof": func() { ss = append(ss, newPprofService()) }, + "Metrics": func() { + ss = append(ss, newMetricsService()) + }, }) return } diff --git a/internal/service/web.go b/internal/service/web.go index c158f732..ec1c353e 100644 --- a/internal/service/web.go +++ b/internal/service/web.go @@ -30,7 +30,7 @@ func (s *webService) Name() string { } func (s *webService) Version() *semver.Version { - return semver.MustParse("v0.1.0") + return semver.MustParse("v0.5.0") } func (s *webService) OnInit() error { diff --git a/mirc/web/v1/admin.go b/mirc/web/v1/admin.go index 49c07ce4..cbd71d26 100644 --- a/mirc/web/v1/admin.go +++ b/mirc/web/v1/admin.go @@ -16,5 +16,6 @@ type Admin struct { Group `mir:"v1"` // ChangeUserStatus 管理·禁言/解封用户 - ChangeUserStatus func(Post, web.ChangeUserStatusReq) `mir:"/admin/user/status"` + ChangeUserStatus func(Post, web.ChangeUserStatusReq) `mir:"/admin/user/status"` + SiteInfo func(Get, web.SiteInfoReq) web.SiteInfoResp `mir:"/admin/site/status"` } diff --git a/mirc/web/v1/core.go b/mirc/web/v1/core.go index f12c7018..28d93177 100644 --- a/mirc/web/v1/core.go +++ b/mirc/web/v1/core.go @@ -21,15 +21,15 @@ type Core struct { // GetUserInfo 获取当前用户信息 GetUserInfo func(Get, web.UserInfoReq) web.UserInfoResp `mir:"/user/info"` - // GetUnreadMsgCount 获取当前用户未读消息数量 - GetUnreadMsgCount func(Get, web.GetUnreadMsgCountReq) web.GetUnreadMsgCountResp `mir:"/user/msgcount/unread"` - // GetMessages 获取消息列表 GetMessages func(Get, web.GetMessagesReq) web.GetMessagesResp `mir:"/user/messages"` - // ReadMessage 标记消息已读 + // ReadMessage 标记未读消息已读 ReadMessage func(Post, web.ReadMessageReq) `mir:"/user/message/read"` + // ReadAllMessage 标记所有未读消息已读 + ReadAllMessage func(Post, web.ReadAllMessageReq) `mir:"/user/message/readall"` + // SendUserWhisper 发送用户私信 SendUserWhisper func(Post, web.SendWhisperReq) `mir:"/user/whisper"` diff --git a/mirc/web/v1/loose.go b/mirc/web/v1/loose.go index a7fe6d7e..0c6ecf51 100644 --- a/mirc/web/v1/loose.go +++ b/mirc/web/v1/loose.go @@ -29,4 +29,7 @@ type Loose struct { // TweetComments 获取动态评论 TweetComments func(Get, web.TweetCommentsReq) web.TweetCommentsResp `mir:"/post/comments"` + + // TweetDetail 获取动态详情 + TweetDetail func(Get, web.TweetDetailReq) web.TweetDetailResp `mir:"/post"` } diff --git a/mirc/web/v1/priv.go b/mirc/web/v1/priv.go index 567de00d..414fb55d 100644 --- a/mirc/web/v1/priv.go +++ b/mirc/web/v1/priv.go @@ -25,7 +25,7 @@ type Priv struct { DownloadAttachment func(Get, web.DownloadAttachmentReq) web.DownloadAttachmentResp `mir:"/attachment"` // CreateTweet 发布动态 - CreateTweet func(Post, web.CreateTweetReq) web.CreateTweetResp `mir:"/post"` + CreateTweet func(Post, Chain, web.CreateTweetReq) web.CreateTweetResp `mir:"/post"` // DeleteTweet 删除动态 DeleteTweet func(Delete, web.DeleteTweetReq) `mir:"/post"` @@ -54,6 +54,9 @@ type Priv struct { // DeletePostComment 删除动态评论 DeleteComment func(Delete, web.DeleteCommentReq) `mir:"/post/comment"` + // HighlightComment 精选动态评论 + HighlightComment func(Post, web.HighlightCommentReq) web.HighlightCommentResp `mir:"/post/comment/highlight"` + // CreateCommentReply 发布评论回复 CreateCommentReply func(Post, web.CreateCommentReplyReq) web.CreateCommentReplyResp `mir:"/post/comment/reply"` @@ -66,7 +69,7 @@ type Priv struct { // ThumbsDownTweetComment 点踩评论 ThumbsDownTweetComment func(Post, web.TweetCommentThumbsReq) `mir:"/tweet/comment/thumbsdown"` - // ThumbsUpTweetReply 点赞评论回复 + // ThumbsUpTweetReply 点赞评论回复· ThumbsUpTweetReply func(Post, web.TweetReplyThumbsReq) `mir:"/tweet/reply/thumbsup"` // ThumbsDownTweetReply 点踩评论回复 diff --git a/mirc/web/v1/pub.go b/mirc/web/v1/pub.go index 89a90162..60fb182d 100644 --- a/mirc/web/v1/pub.go +++ b/mirc/web/v1/pub.go @@ -28,7 +28,4 @@ type Pub struct { // SendCaptcha 发送验证码 SendCaptcha func(Post, web.SendCaptchaReq) `mir:"/captcha"` - - // TweetDetail 获取动态详情 - TweetDetail func(Get, web.TweetDetailReq) web.TweetDetailResp `mir:"/post"` } diff --git a/mirc/web/v1/relax.go b/mirc/web/v1/relax.go new file mode 100644 index 00000000..3bdfdb91 --- /dev/null +++ b/mirc/web/v1/relax.go @@ -0,0 +1,20 @@ +package v1 + +import ( + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +func init() { + Entry[Relax]() +} + +// Relax 放宽授权的服务 +type Relax struct { + Chain `mir:"-"` + Group `mir:"v1"` + + // GetUnreadMsgCount 获取当前用户未读消息数量 + GetUnreadMsgCount func(Get, Chain, web.GetUnreadMsgCountReq) web.GetUnreadMsgCountResp `mir:"/user/msgcount/unread"` +} diff --git a/mirc/web/v1/site.go b/mirc/web/v1/site.go new file mode 100644 index 00000000..ba8ca294 --- /dev/null +++ b/mirc/web/v1/site.go @@ -0,0 +1,22 @@ +package v1 + +import ( + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +func init() { + Entry[Site]() +} + +// Site 站点本身相关的信息服务 +type Site struct { + Group `mir:"v1"` + + // Version 获取后台版本信息 + Version func(Get) web.VersionResp `mir:"/site/version"` + + // Profile 站点配置概要信息 + Profile func(Get) web.SiteProfileResp `mir:"/site/profile"` +} diff --git a/mirc/web/v1/trends.go b/mirc/web/v1/trends.go new file mode 100644 index 00000000..c6bc0f91 --- /dev/null +++ b/mirc/web/v1/trends.go @@ -0,0 +1,20 @@ +package v1 + +import ( + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +func init() { + Entry[Trends]() +} + +// Trends 动态相关 服务 +type Trends struct { + Chain `mir:"-"` + Group `mir:"v1"` + + // GetIndexTrends 获取广场页面动态条栏的索引item + GetIndexTrends func(Get, web.GetIndexTrendsReq) web.GetIndexTrendsResp `mir:"/trends/index"` +} diff --git a/pkg/app/jwt.go b/pkg/app/jwt.go index a861faa2..75a43f7a 100644 --- a/pkg/app/jwt.go +++ b/pkg/app/jwt.go @@ -5,9 +5,11 @@ package app import ( + "crypto/md5" + "encoding/hex" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core/ms" ) @@ -22,14 +24,14 @@ func GetJWTSecret() []byte { return []byte(conf.JWTSetting.Secret) } -func GenerateToken(User *ms.User) (string, error) { +func GenerateToken(user *ms.User) (string, error) { expireTime := time.Now().Add(conf.JWTSetting.Expire) claims := Claims{ - UID: User.ID, - Username: User.Username, + UID: user.ID, + Username: user.Username, RegisteredClaims: jwt.RegisteredClaims{ ExpiresAt: jwt.NewNumericDate(expireTime), - Issuer: conf.JWTSetting.Issuer + ":" + User.Salt, + Issuer: IssuerFrom(user.Salt), }, } @@ -38,18 +40,23 @@ func GenerateToken(User *ms.User) (string, error) { return token, err } -func ParseToken(token string) (*Claims, error) { - tokenClaims, err := jwt.ParseWithClaims(token, &Claims{}, func(token *jwt.Token) (any, error) { +func ParseToken(token string) (res *Claims, err error) { + var tokenClaims *jwt.Token + tokenClaims, err = jwt.ParseWithClaims(token, &Claims{}, func(_ *jwt.Token) (any, error) { return GetJWTSecret(), nil }) - if err != nil { - return nil, err - } - if tokenClaims != nil { - if claims, ok := tokenClaims.Claims.(*Claims); ok && tokenClaims.Valid { - return claims, nil - } + if err == nil && tokenClaims != nil && tokenClaims.Valid { + res, _ = tokenClaims.Claims.(*Claims) + } else { + err = jwt.ErrTokenNotValidYet } + return +} - return nil, err +func IssuerFrom(data string) string { + contents := make([]byte, 0, len(conf.JWTSetting.Issuer)+len(data)) + copy(contents, []byte(conf.JWTSetting.Issuer)) + contents = append(contents, []byte(data)...) + res := md5.Sum(contents) + return hex.EncodeToString(res[:]) } diff --git a/pkg/debug/pyroscope.go b/pkg/debug/pyroscope.go index 60a8ed74..f34acfb5 100644 --- a/pkg/debug/pyroscope.go +++ b/pkg/debug/pyroscope.go @@ -8,7 +8,7 @@ package debug import ( - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/sirupsen/logrus" ) diff --git a/pkg/debug/pyroscope_embed.go b/pkg/debug/pyroscope_embed.go index 80a9e149..73db8870 100644 --- a/pkg/debug/pyroscope_embed.go +++ b/pkg/debug/pyroscope_embed.go @@ -10,7 +10,7 @@ package debug import ( "os" - "github.com/alimy/cfg" + "github.com/alimy/tryst/cfg" "github.com/pyroscope-io/client/pyroscope" "github.com/rocboss/paopao-ce/internal/conf" "github.com/sirupsen/logrus" diff --git a/pkg/http/client.go b/pkg/http/client.go new file mode 100644 index 00000000..d77c1d14 --- /dev/null +++ b/pkg/http/client.go @@ -0,0 +1,74 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package http + +import ( + "net/http" + "time" + + gp "github.com/alimy/tryst/pool" +) + +var ( + _ AsyncClient = (*wormClient)(nil) +) + +const ( + _minRequestBuf = 10 + _minRequestTempBuf = 10 + _minWorker = 5 +) + +// ResponseFn a function used handle the response of http.Client.Do +type ResponseFn = gp.ResponseFn[*http.Request, *http.Response] + +// AsyncClient asynchronous client interface +type AsyncClient interface { + Do(req *http.Request, fn ResponseFn) +} + +// AsyncClientConf client configure used to create an AsynClient instance +type AsyncClientConf struct { + MinWorker int + MaxRequestBuf int + MaxRequestTempBuf int + MaxTickCount int + TickWaitTime time.Duration +} + +type wormClient struct { + pool gp.GoroutinePool[*http.Request, *http.Response] +} + +func (s *wormClient) Do(req *http.Request, fn ResponseFn) { + s.pool.Do(req, fn) +} + +// NewAsyncClient create an AsyncClient instance +func NewAsyncClient(client *http.Client, conf *AsyncClientConf) AsyncClient { + minWorker := _minWorker + maxRequestBuf := _minRequestBuf + maxRequestTempBuf := _minRequestTempBuf + if conf.MaxRequestBuf > _minRequestBuf { + maxRequestBuf = conf.MaxRequestBuf + } + if conf.MaxRequestTempBuf > _minRequestTempBuf { + maxRequestTempBuf = conf.MaxRequestTempBuf + } + if conf.MinWorker > _minWorker { + minWorker = conf.MinWorker + } + return &wormClient{ + pool: gp.NewGoroutinePool(func(req *http.Request) (*http.Response, error) { + return client.Do(req) + }, + gp.MinWorkerOpt(minWorker), + gp.MaxRequestBufOpt(maxRequestBuf), + gp.MaxRequestTempBufOpt(maxRequestTempBuf), + gp.MaxTickCountOpt(conf.MaxTickCount), + gp.TickWaitTimeOpt(conf.TickWaitTime), + ), + } +} diff --git a/pkg/http/http.go b/pkg/http/http.go index efb096d7..86e5035b 100644 --- a/pkg/http/http.go +++ b/pkg/http/http.go @@ -1,5 +1,7 @@ -// Copyright 2023 Michael Li . All rights reserved. -// Use of this source code is governed by Apache License 2.0 that -// can be found in the LICENSE file. +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +// package http contain some custom help function for std http library. package http diff --git a/pkg/http/http_suite_test.go b/pkg/http/http_suite_test.go index ef72f36b..b2594602 100644 --- a/pkg/http/http_suite_test.go +++ b/pkg/http/http_suite_test.go @@ -1,6 +1,6 @@ -// Copyright 2023 Michael Li . All rights reserved. -// Use of this source code is governed by Apache License 2.0 that -// can be found in the LICENSE file. +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. package http_test diff --git a/pkg/http/mux.go b/pkg/http/mux.go index 46a76b02..caf184b4 100644 --- a/pkg/http/mux.go +++ b/pkg/http/mux.go @@ -1,6 +1,6 @@ -// Copyright 2023 Michael Li . All rights reserved. -// Use of this source code is governed by Apache License 2.0 that -// can be found in the LICENSE file. +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. package http diff --git a/pkg/http/mux_test.go b/pkg/http/mux_test.go index e67d5f47..eb6db568 100644 --- a/pkg/http/mux_test.go +++ b/pkg/http/mux_test.go @@ -1,6 +1,6 @@ -// Copyright 2023 Michael Li . All rights reserved. -// Use of this source code is governed by Apache License 2.0 that -// can be found in the LICENSE file. +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. package http diff --git a/pkg/obx/obx.go b/pkg/obx/obx.go new file mode 100644 index 00000000..0a6b2c0f --- /dev/null +++ b/pkg/obx/obx.go @@ -0,0 +1,81 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +// package obx contain some help function for OpenObserve. +package obx + +import ( + "bytes" + "net/http" + + hx "github.com/rocboss/paopao-ce/pkg/http" +) + +var ( + _ OpenObserveClient = (*obxClient)(nil) +) + +const ( + _userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" +) + +// OpenObserveClient OpenObserve client interface +type OpenObserveClient interface { + LogJson(data []byte) +} + +// Config confiugre used for create a OpenObserveClient instance +type Config struct { + Host string + User string + Password string + Organization string + Stream string + UserAgent string + Secure bool +} + +type obxClient struct { + endpoint string + user string + password string + userAgent string + respFn hx.ResponseFn + client hx.AsyncClient +} + +func (c *Config) Endpoint() string { + schema := "http" + if c.Secure { + schema = "https" + } + return schema + "://" + c.Host + "/api/" + c.Organization + "/" + c.Stream + "/_json" +} + +func (s *obxClient) LogJson(data []byte) { + req, err := http.NewRequest("POST", s.endpoint, bytes.NewReader(data)) + if err != nil { + s.respFn(nil, nil, err) + } + req.SetBasicAuth(s.user, s.password) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("User-Agent", s.userAgent) + s.client.Do(req, s.respFn) +} + +// NewClient create OpenObserve client instance +func NewClient(conf *Config, acc *hx.AsyncClientConf, fn hx.ResponseFn) OpenObserveClient { + userAgent := _userAgent + if conf.UserAgent != "" { + userAgent = conf.UserAgent + } + return &obxClient{ + endpoint: conf.Endpoint(), + user: conf.User, + password: conf.Password, + userAgent: userAgent, + respFn: fn, + client: hx.NewAsyncClient(http.DefaultClient, acc), + } +} diff --git a/pkg/types/types.go b/pkg/types/types.go index 725f18e4..d8321ad4 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -23,3 +23,7 @@ type Boxes[T any] interface { Box(t T) Unbox() T } + +type Integer interface { + ~int8 | ~int16 | ~int32 | ~int64 | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~uint +} diff --git a/pkg/utils/str.go b/pkg/utils/str.go index a69f02ec..199ad092 100644 --- a/pkg/utils/str.go +++ b/pkg/utils/str.go @@ -7,6 +7,7 @@ package utils import ( "math/rand" "time" + "unsafe" ) type StrType int @@ -41,3 +42,10 @@ func RandStr(size int, kind StrType) []byte { } return result } + +func String(data []byte) string { + if size := len(data); size > 0 { + return unsafe.String(unsafe.SliceData(data), size) + } + return "" +} diff --git a/pkg/version/version.go b/pkg/version/version.go index ce30181c..86491239 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -8,12 +8,23 @@ import ( "fmt" ) -var version, commitID, buildDate string +const ( + series = "v0.5" +) + +var ( + version = "unknown" + commitID = "unknown" + buildDate = "unknown" + buildTags = "unknown" +) type BuildInfo struct { + Series string `json:"series"` Version string `json:"version"` Sum string `json:"sum"` BuildDate string `json:"build_date"` + BuildTags string `json:"build_tags"` } func VersionInfo() string { @@ -21,12 +32,11 @@ func VersionInfo() string { } func ReadBuildInfo() *BuildInfo { - if version == "" { - version = "unknow" - } return &BuildInfo{ + Series: series, Version: version, Sum: commitID, BuildDate: buildDate, + BuildTags: buildTags, } } diff --git a/run.sh b/run.sh new file mode 100755 index 00000000..bf4ee85f --- /dev/null +++ b/run.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# eg.1 : sh run.sh +# eg.2, push all release: sh run.sh push +# eg.3, push all release with dev branch: sh run.sh push dev + +function push { + if [ -n "$1" ]; then + echo "git push origin $1:$1" + git push origin $1:$1 + + echo "git push alimy $1:$1" + git push alimy $1:$1 + + echo "git push bitbus $1:$1" + git push bitbus $1:$1 + else + push_all dev r/paopao-ce r/paopao-ce-plus r/paopao-ce-pro r/paopao-ce-xtra + fi +} + +function push_all { + if [ $# -eq 0 ]; then + push + else + while [ $# -gt 0 ]; do + push $1 + shift + done + fi +} + +case $1 in +"push") + shift + push_all $@ + ;; +"merge") + echo "merge command" + ;; +*) + push_all + ;; +esac \ No newline at end of file diff --git a/scripts/migration/mysql/0009_create_view_post_filter.down.sql b/scripts/migration/mysql/0009_create_view_post_filter.down.sql index b1550d2e..e0343c6d 100644 --- a/scripts/migration/mysql/0009_create_view_post_filter.down.sql +++ b/scripts/migration/mysql/0009_create_view_post_filter.down.sql @@ -1,5 +1,2 @@ DROP VIEW IF EXISTS p_post_by_media; DROP VIEW IF EXISTS p_post_by_comment; - - - diff --git a/scripts/migration/mysql/0011_home_timeline.down.sql b/scripts/migration/mysql/0011_home_timeline.down.sql new file mode 100644 index 00000000..c781500b --- /dev/null +++ b/scripts/migration/mysql/0011_home_timeline.down.sql @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS `p_post_metric`; + +-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见 +-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 +UPDATE p_post a, p_post b +SET a.visibility = ( + CASE b.visibility + WHEN 90 THEN 0 + WHEN 0 THEN 1 + WHEN 50 THEN 2 + WHEN 60 THEN 3 + ELSE 0 + END +) +WHERE a.ID = b.ID; diff --git a/scripts/migration/mysql/0011_home_timeline.up.sql b/scripts/migration/mysql/0011_home_timeline.up.sql new file mode 100644 index 00000000..e61fe700 --- /dev/null +++ b/scripts/migration/mysql/0011_home_timeline.up.sql @@ -0,0 +1,35 @@ +CREATE TABLE `p_post_metric` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `post_id` bigint unsigned NOT NULL, + `rank_score` bigint unsigned NOT NULL DEFAULT 0, + `incentive_score` int unsigned NOT NULL DEFAULT 0, + `decay_factor` int unsigned NOT NULL DEFAULT 0, + `motivation_factor` int unsigned NOT NULL DEFAULT 0, + `is_del` tinyint NOT NULL DEFAULT 0, -- 是否删除, 0否, 1是 + `created_on` bigint unsigned NOT NULL DEFAULT '0', + `modified_on` bigint unsigned NOT NULL DEFAULT '0', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_post_metric_post_id_rank_score` (`post_id`,`rank_score`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO p_post_metric (post_id, rank_score, created_on) +SELECT id AS post_id, + comment_count + upvote_count*2 + collection_count*4 AS rank_score, + created_on +FROM p_post +WHERE is_del=0; + +-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见 +-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 +UPDATE p_post a, p_post b +SET a.visibility = ( + CASE b.visibility + WHEN 0 THEN 90 + WHEN 1 THEN 0 + WHEN 2 THEN 50 + WHEN 3 THEN 60 + ELSE 0 + END +) +WHERE a.ID = b.ID; diff --git a/scripts/migration/mysql/0012_comment_essence.down.sql b/scripts/migration/mysql/0012_comment_essence.down.sql new file mode 100644 index 00000000..3e98ff4d --- /dev/null +++ b/scripts/migration/mysql/0012_comment_essence.down.sql @@ -0,0 +1 @@ +ALTER TABLE `p_comment` DROP COLUMN `is_essence`; \ No newline at end of file diff --git a/scripts/migration/mysql/0012_comment_essence.up.sql b/scripts/migration/mysql/0012_comment_essence.up.sql new file mode 100644 index 00000000..229d6597 --- /dev/null +++ b/scripts/migration/mysql/0012_comment_essence.up.sql @@ -0,0 +1 @@ +ALTER TABLE `p_comment` ADD COLUMN `is_essence` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否精选'; diff --git a/scripts/migration/mysql/0013_rank_metrics.down.sql b/scripts/migration/mysql/0013_rank_metrics.down.sql new file mode 100644 index 00000000..1e53dea4 --- /dev/null +++ b/scripts/migration/mysql/0013_rank_metrics.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE `p_comment` DROP COLUMN `reply_count`; +DROP TABLE IF EXISTS `p_comment_metric`; +DROP TABLE IF EXISTS `p_user_metric`; diff --git a/scripts/migration/mysql/0013_rank_metrics.up.sql b/scripts/migration/mysql/0013_rank_metrics.up.sql new file mode 100644 index 00000000..63122be1 --- /dev/null +++ b/scripts/migration/mysql/0013_rank_metrics.up.sql @@ -0,0 +1,48 @@ +ALTER TABLE `p_comment` ADD COLUMN `reply_count` int unsigned NOT NULL DEFAULT 0 COMMENT '回复数'; + +UPDATE p_comment comment +SET reply_count = ( + SELECT count(*) FROM p_comment_reply reply WHERE reply.comment_id=comment.id AND reply.is_del=0 +) +WHERE is_del=0; + +CREATE TABLE `p_comment_metric` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `comment_id` bigint unsigned NOT NULL, + `rank_score` bigint unsigned NOT NULL DEFAULT 0, + `incentive_score` int unsigned NOT NULL DEFAULT 0, + `decay_factor` int unsigned NOT NULL DEFAULT 0, + `motivation_factor` int unsigned NOT NULL DEFAULT 0, + `is_del` tinyint NOT NULL DEFAULT 0, + `created_on` bigint unsigned NOT NULL DEFAULT 0, + `modified_on` bigint unsigned NOT NULL DEFAULT 0, + `deleted_on` bigint unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_comment_metric_comment_id_rank_score` (`comment_id`, `rank_score`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO p_comment_metric (comment_id, rank_score, created_on) +SELECT id AS comment_id, + reply_count*2 + thumbs_up_count*4 - thumbs_down_count AS rank_score, + created_on +FROM p_comment +WHERE is_del=0; + +CREATE TABLE `p_user_metric` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `user_id` bigint unsigned NOT NULL, + `tweets_count` int unsigned NOT NULL DEFAULT 0, + `latest_trends_on` bigint unsigned NOT NULL DEFAULT 0 COMMENT '最新动态时间', + `is_del` tinyint NOT NULL DEFAULT 0, + `created_on` bigint unsigned NOT NULL DEFAULT 0, + `modified_on` bigint unsigned NOT NULL DEFAULT 0, + `deleted_on` bigint unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_user_metric_user_id_tweets_count_trends` (`user_id`, `tweets_count`, `latest_trends_on`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +INSERT INTO p_user_metric (user_id, tweets_count) +SELECT user_id, count(*) AS tweets_count +FROM p_post +WHERE is_del=0 +GROUP BY user_id; \ No newline at end of file diff --git a/scripts/migration/mysql/0014_user_relation_view.down.sql b/scripts/migration/mysql/0014_user_relation_view.down.sql new file mode 100644 index 00000000..2db1b265 --- /dev/null +++ b/scripts/migration/mysql/0014_user_relation_view.down.sql @@ -0,0 +1 @@ +DROP VIEW IF EXISTS p_user_relation; diff --git a/scripts/migration/mysql/0014_user_relation_view.up.sql b/scripts/migration/mysql/0014_user_relation_view.up.sql new file mode 100644 index 00000000..d821659d --- /dev/null +++ b/scripts/migration/mysql/0014_user_relation_view.up.sql @@ -0,0 +1,6 @@ +CREATE VIEW p_user_relation AS +SELECT user_id, friend_id he_uid, 5 AS style +FROM p_contact WHERE status=2 AND is_del=0 +UNION +SELECT user_id, follow_id he_uid, 10 AS style +FROM p_following WHERE is_del=0; diff --git a/scripts/migration/postgres/0007_content_type_alter.up.sql b/scripts/migration/postgres/0007_content_type_alter.up.sql index 4df0470d..2315fa6c 100644 --- a/scripts/migration/postgres/0007_content_type_alter.up.sql +++ b/scripts/migration/postgres/0007_content_type_alter.up.sql @@ -1,3 +1,3 @@ -ALTER TABLE p_post_content ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT ''; -ALTER TABLE p_comment_content ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT ''; -ALTER TABLE p_comment_reply ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT ''; +ALTER TABLE p_post_content ALTER COLUMN content SET DATA TYPE TEXT, ALTER COLUMN content SET NOT NULL, ALTER COLUMN content SET DEFAULT ''; +ALTER TABLE p_comment_content ALTER COLUMN content SET DATA TYPE TEXT, ALTER COLUMN content SET NOT NULL, ALTER COLUMN content SET DEFAULT ''; +ALTER TABLE p_comment_reply ALTER COLUMN content SET DATA TYPE TEXT, ALTER COLUMN content SET NOT NULL, ALTER COLUMN content SET DEFAULT ''; diff --git a/scripts/migration/postgres/0010_home_timeline.down.sql b/scripts/migration/postgres/0010_home_timeline.down.sql new file mode 100644 index 00000000..77f27bda --- /dev/null +++ b/scripts/migration/postgres/0010_home_timeline.down.sql @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS p_post_metric; + +-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见 +-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 +UPDATE p_post a +SET visibility = ( + SELECT + CASE visibility + WHEN 90 THEN 0 + WHEN 0 THEN 1 + WHEN 50 THEN 2 + WHEN 60 THEN 3 + ELSE 0 + END + FROM + p_post b + WHERE + a.ID = b.ID +); \ No newline at end of file diff --git a/scripts/migration/postgres/0010_home_timeline.up.sql b/scripts/migration/postgres/0010_home_timeline.up.sql new file mode 100644 index 00000000..0a426a7f --- /dev/null +++ b/scripts/migration/postgres/0010_home_timeline.up.sql @@ -0,0 +1,40 @@ +CREATE TABLE p_post_metric ( + ID BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL, + rank_score BIGINT NOT NULL DEFAULT 0, + incentive_score INT NOT NULL DEFAULT 0, + decay_factor INT NOT NULL DEFAULT 0, + motivation_factor INT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_metric_post_id_rank_score ON p_post_metric USING btree ( post_id, rank_score ); + +INSERT INTO p_post_metric ( post_id, rank_score, created_on ) SELECT ID AS +post_id, +comment_count + upvote_count * 2 + collection_count * 4 AS rank_score, +created_on +FROM + p_post +WHERE + is_del = 0; + +-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见 +-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 +UPDATE p_post a +SET visibility = ( + SELECT + CASE visibility + WHEN 0 THEN 90 + WHEN 1 THEN 0 + WHEN 2 THEN 50 + WHEN 3 THEN 60 + ELSE 0 + END + FROM + p_post b + WHERE + a.ID = b.ID +); diff --git a/scripts/migration/postgres/0011_comment_essence.down.sql b/scripts/migration/postgres/0011_comment_essence.down.sql new file mode 100644 index 00000000..c9bef95c --- /dev/null +++ b/scripts/migration/postgres/0011_comment_essence.down.sql @@ -0,0 +1 @@ +ALTER TABLE p_comment DROP COLUMN is_essence; \ No newline at end of file diff --git a/scripts/migration/postgres/0011_comment_essence.up.sql b/scripts/migration/postgres/0011_comment_essence.up.sql new file mode 100644 index 00000000..7f26544d --- /dev/null +++ b/scripts/migration/postgres/0011_comment_essence.up.sql @@ -0,0 +1 @@ +ALTER TABLE p_comment ADD COLUMN is_essence SMALLINT NOT NULL DEFAULT 0; diff --git a/scripts/migration/postgres/0012_rank_metrics.down.sql b/scripts/migration/postgres/0012_rank_metrics.down.sql new file mode 100644 index 00000000..e27369c4 --- /dev/null +++ b/scripts/migration/postgres/0012_rank_metrics.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE p_comment DROP COLUMN IF EXISTS reply_count; +DROP TABLE IF EXISTS p_comment_metric; +DROP TABLE IF EXISTS p_user_metric; diff --git a/scripts/migration/postgres/0012_rank_metrics.up.sql b/scripts/migration/postgres/0012_rank_metrics.up.sql new file mode 100644 index 00000000..270c8330 --- /dev/null +++ b/scripts/migration/postgres/0012_rank_metrics.up.sql @@ -0,0 +1,51 @@ +ALTER TABLE p_comment ADD COLUMN reply_count INT NOT NULL DEFAULT 0; + +WITH comment_reply AS ( + SELECT comment_id, count(*) AS count + FROM p_comment_reply + WHERE is_del=0 + GROUP By comment_id +) +UPDATE p_comment comment +SET reply_count = reply.count +FROM comment_reply reply +WHERE comment.id = reply.comment_id; + +CREATE TABLE p_comment_metric ( + id BIGSERIAL PRIMARY KEY, + comment_id BIGINT NOT NULL, + rank_score BIGINT NOT NULL DEFAULT 0, + incentive_score INT NOT NULL DEFAULT 0, + decay_factor INT NOT NULL DEFAULT 0, + motivation_factor INT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_comment_metric_comment_id_rank_score ON p_comment_metric USING btree (comment_id, rank_score); + +INSERT INTO p_comment_metric (comment_id, rank_score, created_on) +SELECT id AS comment_id, + reply_count*2 + thumbs_up_count*4 - thumbs_down_count AS rank_score, + created_on +FROM p_comment +WHERE is_del=0; + +CREATE TABLE p_user_metric ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL, + tweets_count INT NOT NULL DEFAULT 0, + latest_trends_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_user_metric_user_id_tweets_count_trends ON p_user_metric USING btree (user_id, tweets_count, latest_trends_on); + +INSERT INTO p_user_metric (user_id, tweets_count) +SELECT user_id, count(*) AS tweets_count +FROM p_post +WHERE is_del=0 +GROUP BY user_id; diff --git a/scripts/migration/postgres/0013_user_relation_view.down.sql b/scripts/migration/postgres/0013_user_relation_view.down.sql new file mode 100644 index 00000000..2db1b265 --- /dev/null +++ b/scripts/migration/postgres/0013_user_relation_view.down.sql @@ -0,0 +1 @@ +DROP VIEW IF EXISTS p_user_relation; diff --git a/scripts/migration/postgres/0013_user_relation_view.up.sql b/scripts/migration/postgres/0013_user_relation_view.up.sql new file mode 100644 index 00000000..d821659d --- /dev/null +++ b/scripts/migration/postgres/0013_user_relation_view.up.sql @@ -0,0 +1,6 @@ +CREATE VIEW p_user_relation AS +SELECT user_id, friend_id he_uid, 5 AS style +FROM p_contact WHERE status=2 AND is_del=0 +UNION +SELECT user_id, follow_id he_uid, 10 AS style +FROM p_following WHERE is_del=0; diff --git a/scripts/migration/sqlite3/0011_home_timeline.down.sql b/scripts/migration/sqlite3/0011_home_timeline.down.sql new file mode 100644 index 00000000..f48b9804 --- /dev/null +++ b/scripts/migration/sqlite3/0011_home_timeline.down.sql @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS "p_post_metric"; + +-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见 +-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 +UPDATE p_post AS a +SET visibility = ( + SELECT + CASE visibility + WHEN 90 THEN 0 + WHEN 0 THEN 1 + WHEN 50 THEN 2 + WHEN 60 THEN 3 + ELSE 0 + END + FROM + p_post AS b + WHERE + a.ID = b.ID +); diff --git a/scripts/migration/sqlite3/0011_home_timeline.up.sql b/scripts/migration/sqlite3/0011_home_timeline.up.sql new file mode 100644 index 00000000..5aed4970 --- /dev/null +++ b/scripts/migration/sqlite3/0011_home_timeline.up.sql @@ -0,0 +1,44 @@ +CREATE TABLE "p_post_metric" ( + "id" integer NOT NULL, + "post_id" integer NOT NULL, + "rank_score" integer NOT NULL, + "incentive_score" integer NOT NULL DEFAULT 0, + "decay_factor" integer NOT NULL DEFAULT 0, + "motivation_factor" integer NOT NULL DEFAULT 0, + "is_del" integer NOT NULL DEFAULT 0, + "created_on" integer NOT NULL DEFAULT 0, + "modified_on" integer NOT NULL DEFAULT 0, + "deleted_on" integer NOT NULL DEFAULT 0, + PRIMARY KEY ("id") +); + +CREATE INDEX "idx_post_metric_post_id_rank_score" +ON "p_post_metric" ( + "post_id" ASC, + "rank_score" ASC +); + +INSERT INTO p_post_metric (post_id, rank_score, created_on) +SELECT id AS post_id, + comment_count+upvote_count*2+collection_count*4 AS rank_score, + created_on +FROM p_post +WHERE is_del=0; + +-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见 +-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 +UPDATE p_post AS a +SET visibility = ( + SELECT + CASE visibility + WHEN 0 THEN 90 + WHEN 1 THEN 0 + WHEN 2 THEN 50 + WHEN 3 THEN 60 + ELSE 0 + END + FROM + p_post AS b + WHERE + a.ID = b.ID +); diff --git a/scripts/migration/sqlite3/0012_comment_essence.down.sql b/scripts/migration/sqlite3/0012_comment_essence.down.sql new file mode 100644 index 00000000..863eb612 --- /dev/null +++ b/scripts/migration/sqlite3/0012_comment_essence.down.sql @@ -0,0 +1 @@ +ALTER TABLE "p_comment" DROP COLUMN "is_essence"; diff --git a/scripts/migration/sqlite3/0012_comment_essence.up.sql b/scripts/migration/sqlite3/0012_comment_essence.up.sql new file mode 100644 index 00000000..10cac932 --- /dev/null +++ b/scripts/migration/sqlite3/0012_comment_essence.up.sql @@ -0,0 +1 @@ +ALTER TABLE "p_comment" ADD COLUMN "is_essence" integer NOT NULL DEFAULT 0; diff --git a/scripts/migration/sqlite3/0013_rank_metrics.down.sql b/scripts/migration/sqlite3/0013_rank_metrics.down.sql new file mode 100644 index 00000000..48eb80d9 --- /dev/null +++ b/scripts/migration/sqlite3/0013_rank_metrics.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE "p_comment" DROP COLUMN "reply_count"; +DROP TABLE IF EXISTS "p_comment_metric"; +DROP TABLE IF EXISTS "p_user_metric"; diff --git a/scripts/migration/sqlite3/0013_rank_metrics.up.sql b/scripts/migration/sqlite3/0013_rank_metrics.up.sql new file mode 100644 index 00000000..aa4d9c84 --- /dev/null +++ b/scripts/migration/sqlite3/0013_rank_metrics.up.sql @@ -0,0 +1,62 @@ +ALTER TABLE "p_comment" ADD COLUMN "reply_count" integer NOT NULL DEFAULT 0; + +UPDATE p_comment AS comment +SET reply_count = ( + SELECT count(*) + FROM + p_comment_reply AS reply + WHERE + comment.id=reply.comment_id AND comment.is_del=0 AND reply.is_del=0 +); + +CREATE TABLE p_comment_metric ( + "id" integer, + "comment_id" integer NOT NULL, + "rank_score" integer NOT NULL DEFAULT 0, + "incentive_score" integer NOT NULL DEFAULT 0, + "decay_factor" integer NOT NULL DEFAULT 0, + "motivation_factor" integer NOT NULL DEFAULT 0, + "is_del" integer NOT NULL DEFAULT 0, + "created_on" integer NOT NULL DEFAULT 0, + "modified_on" integer NOT NULL DEFAULT 0, + "deleted_on" integer NOT NULL DEFAULT 0, + PRIMARY KEY ("id") +); + +CREATE INDEX "idx_comment_metric_comment_id_rank_score" +ON "p_comment_metric" ( + "comment_id" ASC, + "rank_score" ASC +); + +INSERT INTO p_comment_metric (comment_id, rank_score, created_on) +SELECT id AS comment_id, + reply_count*2 + thumbs_up_count*4 - thumbs_down_count AS rank_score, + created_on +FROM p_comment +WHERE is_del=0; + +CREATE TABLE "p_user_metric" ( + "id" integer, + "user_id" integer NOT NULL, + "tweets_count" integer NOT NULL DEFAULT 0, + "latest_trends_on" integer NOT NULL DEFAULT 0, + "is_del" integer NOT NULL DEFAULT 0, + "created_on" integer NOT NULL DEFAULT 0, + "modified_on" integer NOT NULL DEFAULT 0, + "deleted_on" integer NOT NULL DEFAULT 0, + PRIMARY KEY ("id") +); + +CREATE INDEX "idx_user_metric_user_id_tweets_count_trends" +ON "p_user_metric" ( + "user_id" ASC, + "tweets_count" ASC, + "latest_trends_on" ASC +); + +INSERT INTO p_user_metric (user_id, tweets_count) +SELECT user_id, count(*) AS tweets_count +FROM p_post +WHERE is_del=0 +GROUP BY user_id; diff --git a/scripts/migration/sqlite3/0014_user_relation_view.down.sql b/scripts/migration/sqlite3/0014_user_relation_view.down.sql new file mode 100644 index 00000000..2db1b265 --- /dev/null +++ b/scripts/migration/sqlite3/0014_user_relation_view.down.sql @@ -0,0 +1 @@ +DROP VIEW IF EXISTS p_user_relation; diff --git a/scripts/migration/sqlite3/0014_user_relation_view.up.sql b/scripts/migration/sqlite3/0014_user_relation_view.up.sql new file mode 100644 index 00000000..d821659d --- /dev/null +++ b/scripts/migration/sqlite3/0014_user_relation_view.up.sql @@ -0,0 +1,6 @@ +CREATE VIEW p_user_relation AS +SELECT user_id, friend_id he_uid, 5 AS style +FROM p_contact WHERE status=2 AND is_del=0 +UNION +SELECT user_id, follow_id he_uid, 10 AS style +FROM p_following WHERE is_del=0; diff --git a/scripts/paopao-mysql.sql b/scripts/paopao-mysql.sql index dc758513..fddeaaac 100644 --- a/scripts/paopao-mysql.sql +++ b/scripts/paopao-mysql.sql @@ -6,17 +6,17 @@ SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- DROP TABLE IF EXISTS `p_attachment`; CREATE TABLE `p_attachment` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `user_id` bigint unsigned NOT NULL DEFAULT '0', - `file_size` bigint unsigned NOT NULL, - `img_width` bigint unsigned NOT NULL DEFAULT '0', - `img_height` bigint unsigned NOT NULL DEFAULT '0', - `type` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '1图片,2视频,3其他附件', + `id` BIGINT NOT NULL AUTO_INCREMENT, + `user_id` BIGINT NOT NULL DEFAULT '0', + `file_size` BIGINT NOT NULL, + `img_width` BIGINT NOT NULL DEFAULT '0', + `img_height` BIGINT NOT NULL DEFAULT '0', + `type` tinyint NOT NULL DEFAULT '1' COMMENT '1图片,2视频,3其他附件', `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_attachment_user` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=100041 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='附件'; @@ -26,15 +26,15 @@ CREATE TABLE `p_attachment` ( -- ---------------------------- DROP TABLE IF EXISTS `p_captcha`; CREATE TABLE `p_captcha` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '验证码ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '验证码ID', `phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', `captcha` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '验证码', - `use_times` int unsigned NOT NULL DEFAULT '0' COMMENT '使用次数', - `expired_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '过期时间', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `use_times` int NOT NULL DEFAULT '0' COMMENT '使用次数', + `expired_on` BIGINT NOT NULL DEFAULT '0' COMMENT '过期时间', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_captcha_phone` (`phone`) USING BTREE, KEY `idx_captcha_expired_on` (`expired_on`) USING BTREE, @@ -46,17 +46,19 @@ CREATE TABLE `p_captcha` ( -- ---------------------------- DROP TABLE IF EXISTS `p_comment`; CREATE TABLE `p_comment` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '评论ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '评论ID', + `post_id` BIGINT NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', - `thumbs_up_count` int unsigned NOT NULL DEFAULT '0' COMMENT '点赞数', - `thumbs_down_count` int unsigned NOT NULL DEFAULT '0' COMMENT '点踩数', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `is_essence` tinyint NOT NULL DEFAULT 0 COMMENT '是否精选', + `reply_count` int NOT NULL DEFAULT 0 COMMENT '回复数', + `thumbs_up_count` int NOT NULL DEFAULT 0 COMMENT '点赞数', + `thumbs_down_count` int NOT NULL DEFAULT 0 COMMENT '点踩数', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_comment_post_id` (`post_id`) USING BTREE, KEY `idx_comment_user_id` (`user_id`) USING BTREE @@ -67,16 +69,16 @@ CREATE TABLE `p_comment` ( -- ---------------------------- DROP TABLE IF EXISTS `p_comment_content`; CREATE TABLE `p_comment_content` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '内容ID', - `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '内容ID', + `comment_id` BIGINT NOT NULL DEFAULT '0' COMMENT '评论ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', - `type` tinyint unsigned NOT NULL DEFAULT '2' COMMENT '类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址', - `sort` bigint unsigned NOT NULL DEFAULT '100' COMMENT '排序,越小越靠前', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `type` tinyint NOT NULL DEFAULT '2' COMMENT '类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址', + `sort` BIGINT NOT NULL DEFAULT '100' COMMENT '排序,越小越靠前', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_comment_content_comment_id` (`comment_id`) USING BTREE, KEY `idx_comment_content_user_id` (`user_id`) USING BTREE, @@ -89,40 +91,59 @@ CREATE TABLE `p_comment_content` ( -- ---------------------------- DROP TABLE IF EXISTS `p_comment_reply`; CREATE TABLE `p_comment_reply` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '回复ID', - `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `at_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '@用户ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '回复ID', + `comment_id` BIGINT NOT NULL DEFAULT '0' COMMENT '评论ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', + `at_user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '@用户ID', `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', - `thumbs_up_count` int unsigned NOT NULL DEFAULT '0' COMMENT '点赞数', - `thumbs_down_count` int unsigned NOT NULL DEFAULT '0' COMMENT '点踩数', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `thumbs_up_count` int NOT NULL DEFAULT '0' COMMENT '点赞数', + `thumbs_down_count` int NOT NULL DEFAULT '0' COMMENT '点踩数', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_comment_reply_comment_id` (`comment_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=12000015 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='评论回复'; +-- ---------------------------- +-- Table structure for p_comment_metric +-- ---------------------------- +DROP TABLE IF EXISTS `p_comment_metric`; +CREATE TABLE `p_comment_metric` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `comment_id` BIGINT NOT NULL, + `rank_score` BIGINT NOT NULL DEFAULT 0, + `incentive_score` int NOT NULL DEFAULT 0, + `decay_factor` int NOT NULL DEFAULT 0, + `motivation_factor` int NOT NULL DEFAULT 0, + `is_del` tinyint NOT NULL DEFAULT 0, + `created_on` BIGINT NOT NULL DEFAULT 0, + `modified_on` BIGINT NOT NULL DEFAULT 0, + `deleted_on` BIGINT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_comment_metric_comment_id_rank_score` (`comment_id`, `rank_score`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + -- ---------------------------- -- Table structure for p_tweet_comment_thumbs -- ---------------------------- DROP TABLE IF EXISTS `p_tweet_comment_thumbs`; CREATE TABLE `p_tweet_comment_thumbs` ( - `id` BIGINT unsigned NOT NULL AUTO_INCREMENT COMMENT 'thumbs ID', - `user_id` BIGINT unsigned NOT NULL, - `tweet_id` BIGINT unsigned NOT NULL COMMENT '推文ID', - `comment_id` BIGINT unsigned NOT NULL COMMENT '评论ID', - `reply_id` BIGINT unsigned COMMENT '评论回复ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'thumbs ID', + `user_id` BIGINT NOT NULL, + `tweet_id` BIGINT NOT NULL COMMENT '推文ID', + `comment_id` BIGINT NOT NULL COMMENT '评论ID', + `reply_id` BIGINT COMMENT '评论回复ID', `comment_type` TINYINT NOT NULL DEFAULT '0' COMMENT '评论类型 0为推文评论、1为评论回复', - `is_thumbs_up` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否点赞', - `is_thumbs_down` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否点踩', - `created_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `is_thumbs_up` TINYINT NOT NULL DEFAULT '0' COMMENT '是否点赞', + `is_thumbs_down` TINYINT NOT NULL DEFAULT '0' COMMENT '是否点踩', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` TINYINT NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_tweet_comment_thumbs_uid_tid` (`user_id`, `tweet_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='推文评论点赞'; @@ -132,20 +153,20 @@ CREATE TABLE `p_tweet_comment_thumbs` ( -- ---------------------------- DROP TABLE IF EXISTS `p_message`; CREATE TABLE `p_message` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '消息通知ID', - `sender_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '发送方用户ID', - `receiver_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '接收方用户ID', - `type` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '通知类型,1动态,2评论,3回复,4私信,99系统通知', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '消息通知ID', + `sender_user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '发送方用户ID', + `receiver_user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '接收方用户ID', + `type` tinyint NOT NULL DEFAULT '1' COMMENT '通知类型,1动态,2评论,3回复,4私信,99系统通知', `brief` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '摘要说明', `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细内容', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '动态ID', - `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', - `reply_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '回复ID', - `is_read` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否已读', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `post_id` BIGINT NOT NULL DEFAULT '0' COMMENT '动态ID', + `comment_id` BIGINT NOT NULL DEFAULT '0' COMMENT '评论ID', + `reply_id` BIGINT NOT NULL DEFAULT '0' COMMENT '回复ID', + `is_read` tinyint NOT NULL DEFAULT '0' COMMENT '是否已读', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_message_receiver_user_id` (`receiver_user_id`) USING BTREE, KEY `idx_message_is_read` (`is_read`) USING BTREE, @@ -157,43 +178,62 @@ CREATE TABLE `p_message` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post`; CREATE TABLE `p_post` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主题ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `comment_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论数', - `collection_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '收藏数', - `upvote_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '点赞数', - `share_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '分享数', - `visibility` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '可见性 0公开 1私密 2好友可见', - `is_top` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否置顶', - `is_essence` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否精华', - `is_lock` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否锁定', - `latest_replied_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '最新回复时间', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主题ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', + `comment_count` BIGINT NOT NULL DEFAULT '0' COMMENT '评论数', + `collection_count` BIGINT NOT NULL DEFAULT '0' COMMENT '收藏数', + `upvote_count` BIGINT NOT NULL DEFAULT '0' COMMENT '点赞数', + `share_count` BIGINT NOT NULL DEFAULT '0' COMMENT '分享数', + `visibility` tinyint NOT NULL DEFAULT '0' COMMENT '可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开', + `is_top` tinyint NOT NULL DEFAULT '0' COMMENT '是否置顶', + `is_essence` tinyint NOT NULL DEFAULT '0' COMMENT '是否精华', + `is_lock` tinyint NOT NULL DEFAULT '0' COMMENT '是否锁定', + `latest_replied_on` BIGINT NOT NULL DEFAULT '0' COMMENT '最新回复时间', `tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标签', - `attachment_price` bigint unsigned NOT NULL DEFAULT '0' COMMENT '附件价格(分)', + `attachment_price` BIGINT NOT NULL DEFAULT '0' COMMENT '附件价格(分)', `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_post_user_id` (`user_id`) USING BTREE, KEY `idx_post_visibility` (`visibility`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1080017989 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='冒泡/文章'; +-- ---------------------------- +-- Table structure for p_post_metric +-- ---------------------------- +DROP TABLE IF EXISTS `p_post_metric`; +CREATE TABLE `p_post_metric` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `post_id` BIGINT NOT NULL, + `rank_score` BIGINT NOT NULL DEFAULT 0, + `incentive_score` int NOT NULL DEFAULT 0, + `decay_factor` int NOT NULL DEFAULT 0, + `motivation_factor` int NOT NULL DEFAULT 0, + `is_del` tinyint NOT NULL DEFAULT 0, -- 是否删除, 0否, 1是 + `created_on` BIGINT NOT NULL DEFAULT '0', + `modified_on` BIGINT NOT NULL DEFAULT '0', + `deleted_on` BIGINT NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_post_metric_post_id_rank_score` (`post_id`,`rank_score`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + -- ---------------------------- -- Table structure for p_post_attachment_bill -- ---------------------------- DROP TABLE IF EXISTS `p_post_attachment_bill`; CREATE TABLE `p_post_attachment_bill` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '购买记录ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `paid_amount` bigint unsigned NOT NULL DEFAULT '0' COMMENT '支付金额', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '购买记录ID', + `post_id` BIGINT NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', + `paid_amount` BIGINT NOT NULL DEFAULT '0' COMMENT '支付金额', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_post_attachment_bill_post_id` (`post_id`) USING BTREE, KEY `idx_post_attachment_bill_user_id` (`user_id`) USING BTREE @@ -204,13 +244,13 @@ CREATE TABLE `p_post_attachment_bill` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post_collection`; CREATE TABLE `p_post_collection` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '收藏ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '收藏ID', + `post_id` BIGINT NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_post_collection_post_id` (`post_id`) USING BTREE, KEY `idx_post_collection_user_id` (`user_id`) USING BTREE @@ -221,16 +261,16 @@ CREATE TABLE `p_post_collection` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post_content`; CREATE TABLE `p_post_content` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '内容ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '内容ID', + `post_id` BIGINT NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', - `type` tinyint unsigned NOT NULL DEFAULT '2' COMMENT '类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源,8收费资源', - `sort` int unsigned NOT NULL DEFAULT '100' COMMENT '排序,越小越靠前', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `type` tinyint NOT NULL DEFAULT '2' COMMENT '类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源,8收费资源', + `sort` int NOT NULL DEFAULT '100' COMMENT '排序,越小越靠前', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_post_content_post_id` (`post_id`) USING BTREE, KEY `idx_post_content_user_id` (`user_id`) USING BTREE @@ -241,13 +281,13 @@ CREATE TABLE `p_post_content` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post_star`; CREATE TABLE `p_post_star` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '收藏ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '收藏ID', + `post_id` BIGINT NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_post_star_post_id` (`post_id`) USING BTREE, KEY `idx_post_star_user_id` (`user_id`) USING BTREE @@ -258,14 +298,14 @@ CREATE TABLE `p_post_star` ( -- ---------------------------- DROP TABLE IF EXISTS `p_tag`; CREATE TABLE `p_tag` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '标签ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '标签ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '创建者ID', `tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标签名', - `quote_num` bigint unsigned NOT NULL DEFAULT '0' COMMENT '引用数', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `quote_num` BIGINT NOT NULL DEFAULT '0' COMMENT '引用数', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `idx_tag_tag` (`tag`) USING BTREE, KEY `idx_tag_user_id` (`user_id`) USING BTREE, @@ -277,17 +317,17 @@ CREATE TABLE `p_tag` ( -- ---------------------------- DROP TABLE IF EXISTS `p_topic_user`; CREATE TABLE `p_topic_user` ( - `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, - `topic_id` BIGINT UNSIGNED NOT NULL COMMENT '标签ID', - `user_id` BIGINT UNSIGNED NOT NULL COMMENT '创建者ID', + `id` BIGINT NOT NULL AUTO_INCREMENT, + `topic_id` BIGINT NOT NULL COMMENT '标签ID', + `user_id` BIGINT NOT NULL COMMENT '创建者ID', `alias_name` VARCHAR ( 255 ) COMMENT '别名', `remark` VARCHAR ( 512 ) COMMENT '备注', - `quote_num` BIGINT UNSIGNED COMMENT '引用数', - `is_top` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否置顶 0 为未置顶、1 为已置顶', - `created_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `quote_num` BIGINT COMMENT '引用数', + `is_top` TINYINT NOT NULL DEFAULT '0' COMMENT '是否置顶 0 为未置顶、1 为已置顶', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` TINYINT NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', `reserve_a` VARCHAR ( 255 ) COMMENT '保留字段a', `reserve_b` VARCHAR ( 255 ) COMMENT '保留字段b', PRIMARY KEY ( `id` ) USING BTREE, @@ -299,37 +339,54 @@ CREATE TABLE `p_topic_user` ( -- ---------------------------- DROP TABLE IF EXISTS `p_user`; CREATE TABLE `p_user` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '用户ID', `nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '昵称', `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户名', `phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', `password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'MD5密码', `salt` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '盐值', - `status` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '状态,1正常,2停用', + `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态,1正常,2停用', `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户头像', - `balance` bigint unsigned NOT NULL COMMENT '用户余额(分)', - `is_admin` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否管理员', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `balance` BIGINT NOT NULL COMMENT '用户余额(分)', + `is_admin` tinyint NOT NULL DEFAULT '0' COMMENT '是否管理员', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `idx_user_username` (`username`) USING BTREE, KEY `idx_user_phone` (`phone`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=100058 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户'; +-- ---------------------------- +-- Table structure for p_user_metric +-- ---------------------------- +DROP TABLE IF EXISTS `p_user_metric`; +CREATE TABLE `p_user_metric` ( + `id` BIGINT NOT NULL AUTO_INCREMENT, + `user_id` BIGINT NOT NULL, + `tweets_count` int NOT NULL DEFAULT 0, + `latest_trends_on` BIGINT NOT NULL DEFAULT 0 COMMENT '最新动态时间', + `is_del` tinyint NOT NULL DEFAULT 0, + `created_on` BIGINT NOT NULL DEFAULT 0, + `modified_on` BIGINT NOT NULL DEFAULT 0, + `deleted_on` BIGINT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_user_metric_user_id_tweets_count_trends` (`user_id`, `tweets_count`, `latest_trends_on`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + -- ---------------------------- -- Table structure for p_following -- ---------------------------- DROP TABLE IF EXISTS `p_following`; CREATE TABLE `p_following` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `user_id` bigint unsigned NOT NULL, - `follow_id` bigint unsigned NOT NULL, + `id` BIGINT NOT NULL AUTO_INCREMENT, + `user_id` BIGINT NOT NULL, + `follow_id` BIGINT NOT NULL, `is_del` tinyint NOT NULL DEFAULT 0, -- 是否删除, 0否, 1是 - `created_on` bigint unsigned NOT NULL DEFAULT '0', - `modified_on` bigint unsigned NOT NULL DEFAULT '0', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0', + `created_on` BIGINT NOT NULL DEFAULT '0', + `modified_on` BIGINT NOT NULL DEFAULT '0', + `deleted_on` BIGINT NOT NULL DEFAULT '0', PRIMARY KEY (`id`) USING BTREE, KEY `idx_following_user_follow` (`user_id`,`follow_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; @@ -339,19 +396,19 @@ CREATE TABLE `p_following` ( -- ---------------------------- DROP TABLE IF EXISTS `p_contact`; CREATE TABLE `p_contact` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '联系人ID', - `user_id` bigint unsigned NOT NULL COMMENT '用户ID', - `friend_id` bigint unsigned NOT NULL COMMENT '好友ID', - `group_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '好友分组ID:默认为0无分组', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '联系人ID', + `user_id` BIGINT NOT NULL COMMENT '用户ID', + `friend_id` BIGINT NOT NULL COMMENT '好友ID', + `group_id` BIGINT NOT NULL DEFAULT '0' COMMENT '好友分组ID:默认为0无分组', `remark` varchar(32) NOT NULL DEFAULT '' COMMENT '好友备注', `status` tinyint NOT NULL DEFAULT '0' COMMENT '好友状态: 1请求好友, 2已好友, 3拒绝好友, 4已删好友', `is_top` tinyint NOT NULL DEFAULT '0' COMMENT '是否置顶, 0否, 1是', `is_black` tinyint NOT NULL DEFAULT '0' COMMENT '是否为黑名单, 0否, 1是', `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除好友, 0否, 1是', `notice_enable` tinyint NOT NULL DEFAULT '0' COMMENT '是否有消息提醒, 0否, 1是', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `idx_contact_user_friend` (`user_id`,`friend_id`) USING BTREE, KEY `idx_contact_user_friend_status` (`user_id`, `friend_id`, `status`) USING BTREE @@ -362,13 +419,13 @@ CREATE TABLE `p_contact` ( -- ---------------------------- DROP TABLE IF EXISTS `p_contact_group`; CREATE TABLE `p_contact_group` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '联系人ID', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '联系人ID', `user_id` int NOT NULL DEFAULT '0' COMMENT '用户id', `name` varchar(32) NOT NULL DEFAULT '' COMMENT '分组名称', `is_del` tinyint NOT NULL DEFAULT '1' COMMENT '是否删除, 0否, 1是', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='联系人分组'; @@ -377,15 +434,15 @@ CREATE TABLE `p_contact_group` ( -- ---------------------------- DROP TABLE IF EXISTS `p_wallet_recharge`; CREATE TABLE `p_wallet_recharge` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '充值ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `amount` bigint NOT NULL DEFAULT '0' COMMENT '充值金额', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '充值ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', + `amount` BIGINT NOT NULL DEFAULT '0' COMMENT '充值金额', `trade_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付宝订单号', `trade_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '交易状态', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_wallet_recharge_user_id` (`user_id`) USING BTREE, KEY `idx_wallet_recharge_trade_no` (`trade_no`) USING BTREE, @@ -397,16 +454,16 @@ CREATE TABLE `p_wallet_recharge` ( -- ---------------------------- DROP TABLE IF EXISTS `p_wallet_statement`; CREATE TABLE `p_wallet_statement` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '账单ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `change_amount` bigint NOT NULL DEFAULT '0' COMMENT '变动金额', - `balance_snapshot` bigint NOT NULL DEFAULT '0' COMMENT '资金快照', + `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '账单ID', + `user_id` BIGINT NOT NULL DEFAULT '0' COMMENT '用户ID', + `change_amount` BIGINT NOT NULL DEFAULT '0' COMMENT '变动金额', + `balance_snapshot` BIGINT NOT NULL DEFAULT '0' COMMENT '资金快照', `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '变动原因', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '关联动态', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `post_id` BIGINT NOT NULL DEFAULT '0' COMMENT '关联动态', + `created_on` BIGINT NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_wallet_statement_user_id` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=10010 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='钱包流水'; @@ -446,4 +503,12 @@ FROM WHERE P.is_del = 0; +DROP VIEW IF EXISTS p_user_relation; +CREATE VIEW p_user_relation AS +SELECT user_id, friend_id he_uid, 5 AS style +FROM p_contact WHERE status=2 AND is_del=0 +UNION +SELECT user_id, follow_id he_uid, 10 AS style +FROM p_following WHERE is_del=0; + SET FOREIGN_KEY_CHECKS = 1; diff --git a/scripts/paopao-postgres.sql b/scripts/paopao-postgres.sql index 93e15c20..276abdde 100644 --- a/scripts/paopao-postgres.sql +++ b/scripts/paopao-postgres.sql @@ -43,8 +43,10 @@ CREATE TABLE p_comment ( user_id BIGINT NOT NULL DEFAULT 0, ip VARCHAR(64) NOT NULL DEFAULT '', ip_loc VARCHAR(64) NOT NULL DEFAULT '', - thumbs_up_count int NOT NULL DEFAULT 0, -- 点赞数 - thumbs_down_count int NOT NULL DEFAULT 0, -- 点踩数 + is_essence SMALLINT NOT NULL DEFAULT 0, + reply_count INT NOT NULL DEFAULT 0, -- 回复数 + thumbs_up_count INT NOT NULL DEFAULT 0, -- 点赞数 + thumbs_down_count INT NOT NULL DEFAULT 0, -- 点踩数 created_on BIGINT NOT NULL DEFAULT 0, modified_on BIGINT NOT NULL DEFAULT 0, deleted_on BIGINT NOT NULL DEFAULT 0, @@ -89,6 +91,20 @@ CREATE TABLE p_comment_reply ( ); CREATE INDEX idx_comment_reply_comment_id ON p_comment_reply USING btree (comment_id); +CREATE TABLE p_comment_metric ( + id BIGSERIAL PRIMARY KEY, + comment_id BIGINT NOT NULL, + rank_score BIGINT NOT NULL DEFAULT 0, + incentive_score INT NOT NULL DEFAULT 0, + decay_factor INT NOT NULL DEFAULT 0, + motivation_factor INT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_comment_metric_comment_id_rank_score ON p_comment_metric USING btree (comment_id, rank_score); + DROP TABLE IF EXISTS p_tweet_comment_thumbs; CREATE TABLE p_tweet_comment_thumbs ( id BIGSERIAL PRIMARY KEY, @@ -136,7 +152,7 @@ CREATE TABLE p_post ( collection_count BIGINT NOT NULL DEFAULT 0, upvote_count BIGINT NOT NULL DEFAULT 0, share_count BIGINT NOT NULL DEFAULT 0, - visibility SMALLINT NOT NULL DEFAULT 0, -- 可见性 0公开 1私密 2好友可见 + visibility SMALLINT NOT NULL DEFAULT 0, -- 可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 is_top SMALLINT NOT NULL DEFAULT 0, -- 是否置顶 is_essence SMALLINT NOT NULL DEFAULT 0, -- 是否精华 is_lock SMALLINT NOT NULL DEFAULT 0, -- 是否锁定 @@ -154,6 +170,21 @@ CREATE TABLE p_post ( CREATE INDEX idx_post_user_id ON p_post USING btree (user_id); CREATE INDEX idx_post_visibility ON p_post USING btree (visibility); +DROP TABLE IF EXISTS p_post_metric; +CREATE TABLE p_post_metric ( + ID BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL, + rank_score BIGINT NOT NULL DEFAULT 0, + incentive_score INT NOT NULL DEFAULT 0, + decay_factor INT NOT NULL DEFAULT 0, + motivation_factor INT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_metric_post_id_rank_score ON p_post_metric USING btree (post_id, rank_score); + DROP TABLE IF EXISTS p_post_attachment_bill; CREATE TABLE p_post_attachment_bill ( id BIGSERIAL PRIMARY KEY, @@ -265,6 +296,18 @@ CREATE TABLE p_user ( CREATE UNIQUE INDEX idx_user_username ON p_user USING btree (username); CREATE INDEX idx_user_phone ON p_user USING btree (phone); +CREATE TABLE p_user_metric ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL, + tweets_count INT NOT NULL DEFAULT 0, + latest_trends_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_user_metric_user_id_tweets_count_trends ON p_user_metric USING btree (user_id, tweets_count, latest_trends_on); + DROP TABLE IF EXISTS p_following; CREATE TABLE p_following ( id BIGSERIAL PRIMARY KEY, @@ -372,3 +415,11 @@ FROM C JOIN p_post P ON C.post_id = P.ID WHERE P.is_del = 0; + +DROP VIEW IF EXISTS p_user_relation; +CREATE VIEW p_user_relation AS +SELECT user_id, friend_id he_uid, 5 AS style +FROM p_contact WHERE status=2 AND is_del=0 +UNION +SELECT user_id, follow_id he_uid, 10 AS style +FROM p_following WHERE is_del=0; diff --git a/scripts/paopao-sqlite3.sql b/scripts/paopao-sqlite3.sql index 7655f3a5..32fbd9e2 100644 --- a/scripts/paopao-sqlite3.sql +++ b/scripts/paopao-sqlite3.sql @@ -46,6 +46,7 @@ CREATE TABLE "p_comment" ( "user_id" integer NOT NULL, "ip" text(64) NOT NULL, "ip_loc" text(64) NOT NULL, + "is_essence" integer NOT NULL DEFAULT 0, "thumbs_up_count" integer NOT NULL DEFAULT 0, -- 点赞数 "thumbs_down_count" integer NOT NULL DEFAULT 0, -- 点踩数 "created_on" integer NOT NULL, @@ -94,6 +95,23 @@ CREATE TABLE "p_comment_reply" ( PRIMARY KEY ("id") ); +-- ---------------------------- +-- Table structure for p_comment_metric +-- ---------------------------- +CREATE TABLE p_comment_metric ( + "id" integer, + "comment_id" integer NOT NULL, + "rank_score" integer NOT NULL DEFAULT 0, + "incentive_score" integer NOT NULL DEFAULT 0, + "decay_factor" integer NOT NULL DEFAULT 0, + "motivation_factor" integer NOT NULL DEFAULT 0, + "is_del" integer NOT NULL DEFAULT 0, + "created_on" integer NOT NULL DEFAULT 0, + "modified_on" integer NOT NULL DEFAULT 0, + "deleted_on" integer NOT NULL DEFAULT 0, + PRIMARY KEY ("id") +); + -- ---------------------------- -- Table structure for p_tweet_comment_thumbs -- ---------------------------- @@ -209,10 +227,28 @@ CREATE TABLE "p_post" ( "modified_on" integer NOT NULL, "deleted_on" integer NOT NULL, "is_del" integer NOT NULL, - "visibility" integer NOT NULL, + "visibility" integer NOT NULL, -- 可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开 PRIMARY KEY ("id") ); +-- ---------------------------- +-- Table structure for p_post_metric +-- ---------------------------- +DROP TABLE IF EXISTS "p_post_metric"; +CREATE TABLE "p_post_metric" ( + "id" integer NOT NULL, + "post_id" integer NOT NULL, + "rank_score" integer NOT NULL, + "incentive_score" integer NOT NULL DEFAULT 0, + "decay_factor" integer NOT NULL DEFAULT 0, + "motivation_factor" integer NOT NULL DEFAULT 0, + "is_del" integer NOT NULL DEFAULT 0, + "created_on" integer NOT NULL DEFAULT 0, + "modified_on" integer NOT NULL DEFAULT 0, + "deleted_on" integer NOT NULL DEFAULT 0, + PRIMARY KEY ("id") +); + -- ---------------------------- -- Table structure for p_post_attachment_bill -- ---------------------------- @@ -336,6 +372,21 @@ CREATE TABLE "p_user" ( PRIMARY KEY ("id") ); +-- ---------------------------- +-- Table structure for p_user_metric +-- ---------------------------- +CREATE TABLE "p_user_metric" ( + "id" integer, + "user_id" integer NOT NULL, + "tweets_count" integer NOT NULL DEFAULT 0, + "latest_trends_on" integer NOT NULL DEFAULT 0, + "is_del" integer NOT NULL DEFAULT 0, + "created_on" integer NOT NULL DEFAULT 0, + "modified_on" integer NOT NULL DEFAULT 0, + "deleted_on" integer NOT NULL DEFAULT 0, + PRIMARY KEY ("id") +); + -- ---------------------------- -- Table structure for p_wallet_recharge -- ---------------------------- @@ -406,6 +457,14 @@ FROM WHERE P.is_del = 0; +DROP VIEW IF EXISTS p_user_relation; +CREATE VIEW p_user_relation AS +SELECT user_id, friend_id he_uid, 5 AS style +FROM p_contact WHERE status=2 AND is_del=0 +UNION +SELECT user_id, follow_id he_uid, 10 AS style +FROM p_following WHERE is_del=0; + -- ---------------------------- -- Indexes structure for table p_attachment -- ---------------------------- @@ -470,6 +529,15 @@ ON "p_comment_reply" ( "comment_id" ASC ); +-- ---------------------------- +-- Indexes structure for table p_comment_metric +-- ---------------------------- +CREATE INDEX "idx_comment_metric_comment_id_rank_score" +ON "p_comment_metric" ( + "comment_id" ASC, + "rank_score" ASC +); + -- ---------------------------- -- Indexes structure for table idx_tweet_comment_thumbs_uid_tid -- ---------------------------- @@ -531,6 +599,15 @@ ON "p_post" ( "visibility" ASC ); +-- ---------------------------- +-- Indexes structure for table idx_post_metric_post_id_rank_score +-- ---------------------------- +CREATE INDEX "idx_post_metric_post_id_rank_score" +ON "p_post_metric" ( + "post_id" ASC, + "rank_score" ASC +); + -- ---------------------------- -- Indexes structure for table p_post_attachment_bill -- ---------------------------- @@ -616,6 +693,16 @@ ON "p_user" ( "username" ASC ); +-- ---------------------------- +-- Indexes structure for table p_user_metric +-- ---------------------------- +CREATE INDEX "idx_user_metric_user_id_tweets_count_trends" +ON "p_user_metric" ( + "user_id" ASC, + "tweets_count" ASC, + "latest_trends_on" ASC +); + -- ---------------------------- -- Indexes structure for table p_wallet_recharge -- ---------------------------- diff --git a/web/.env b/web/.env index 720afc11..e3ffe2c3 100644 --- a/web/.env +++ b/web/.env @@ -1,8 +1,13 @@ VITE_HOST="" +# 功能特性开启 +VITE_USE_FRIENDSHIP=true +VITE_USE_WEB_PROFILE=true # 是否使用后端web服务提供的WebProfile来自定义前端的功能特性 + # 模块开启 VITE_ENABLE_ANOUNCEMENT=false VITE_ENABLE_WALLET=false +VITE_ENABLE_TRENDS_BAR=true # 功能开启 VITE_ALLOW_TWEET_ATTACHMENT=true @@ -14,13 +19,15 @@ VITE_ALLOW_ACTIVATION=false VITE_ALLOW_PHONE_BIND=true # 局部参数 -VITE_DEFAULT_MSG_LOOP_INTERVAL=5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms -VITE_DEFAULT_TWEET_VISIBILITY=friend # 推文可见性,默认好友可见 -VITE_DEFAULT_TWEET_MAX_LENGTH=400 # 推文最大长度, 默认400字 -VITE_DEFAULT_COMMENT_MAX_LENGTH=300 # 评论最大长度, 默认300字 -VITE_DEFAULT_REPLY_MAX_LENGTH=300 # 评论最大长度, 默认300字 -VITE_RIGHT_FOLLOW_TOPIC_MAX_SIZE=6 # 右侧关注话题最大条目数, 默认6条 -VITE_RIGHT_HOT_TOPIC_MAX_SIZE=12 # 右侧热门话题最大条目数, 默认12条 +VITE_DEFAULT_MSG_LOOP_INTERVAL=5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms +VITE_DEFAULT_TWEET_VISIBILITY=friend # 推文默认可见性,默认好友可见 值: public/following/friend/private +VITE_DEFAULT_TWEET_MAX_LENGTH=2000 # 推文允许输入的最大长度, 默认2000字,值的范围需要查询后端支持的最大字数 +VITE_TWEET_WEB_ELLIPSIS_SIZE=400 # Web端推文作为feed显示的最长字数,默认400字 +VITE_TWEET_MOBILE_ELLIPSIS_SIZE=300 # 移动端推文作为feed显示的最长字数,默认300字 +VITE_DEFAULT_COMMENT_MAX_LENGTH=300 # 评论最大长度, 默认300字 +VITE_DEFAULT_REPLY_MAX_LENGTH=300 # 评论最大长度, 默认300字 +VITE_RIGHT_FOLLOW_TOPIC_MAX_SIZE=6 # 右侧关注话题最大条目数, 默认6条 +VITE_RIGHT_HOT_TOPIC_MAX_SIZE=12 # 右侧热门话题最大条目数, 默认12条 VITE_COPYRIGHT_TOP="2023 paopao.info" VITE_COPYRIGHT_LEFT="Roc's Me" VITE_COPYRIGHT_LEFT_LINK="" diff --git a/web/dist/assets/404-5027c57d.js b/web/dist/assets/404-5027c57d.js new file mode 100644 index 00000000..b3f60963 --- /dev/null +++ b/web/dist/assets/404-5027c57d.js @@ -0,0 +1 @@ +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-eecf2ec3.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-3489d7cc.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */const v=l({__name:"404",setup(h){const e=i(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=a;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const O=g(v,[["__scopeId","data-v-e62daa85"]]);export{O as default}; diff --git a/web/dist/assets/404-590de622.js b/web/dist/assets/404-590de622.js deleted file mode 100644 index 771f276c..00000000 --- a/web/dist/assets/404-590de622.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{u as a}from"./vue-router-b8e3382f.js";import{F as i,e as c,a2 as u}from"./naive-ui-e703c4e6.js";import{d as l,c as d,V as t,a1 as o,o as f,e as x}from"./@vue-e0e89260.js";import{_ as g}from"./index-26a2b065.js";import"./vuex-473b3783.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-0524c43e.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; diff --git a/web/dist/assets/@babel-725317a4.js b/web/dist/assets/@babel-725317a4.js new file mode 100644 index 00000000..b285ce54 --- /dev/null +++ b/web/dist/assets/@babel-725317a4.js @@ -0,0 +1 @@ +var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}export{o as c,l as g}; diff --git a/web/dist/assets/@css-render-580d83ec.js b/web/dist/assets/@css-render-7124a1a5.js similarity index 96% rename from web/dist/assets/@css-render-580d83ec.js rename to web/dist/assets/@css-render-7124a1a5.js index 049d462d..60115763 100644 --- a/web/dist/assets/@css-render-580d83ec.js +++ b/web/dist/assets/@css-render-7124a1a5.js @@ -1,3 +1,3 @@ -import{i as d}from"./@vue-e0e89260.js";function C(i){let r=".",s="__",m="--",f;if(i){let e=i.blockPrefix;e&&(r=e),e=i.elementPrefix,e&&(s=e),e=i.modifierPrefix,e&&(m=e)}const b={install(e){f=e.c;const l=e.context;l.bem={},l.bem.b=null,l.bem.els=null}};function y(e){let l,n;return{before(t){l=t.bem.b,n=t.bem.els,t.bem.els=null},after(t){t.bem.b=l,t.bem.els=n},$({context:t,props:u}){return e=typeof e=="string"?e:e({context:t,props:u}),t.bem.b=e,`${(u==null?void 0:u.bPrefix)||r}${t.bem.b}`}}}function v(e){let l;return{before(n){l=n.bem.els},after(n){n.bem.els=l},$({context:n,props:t}){return e=typeof e=="string"?e:e({context:n,props:t}),n.bem.els=e.split(",").map(u=>u.trim()),n.bem.els.map(u=>`${(t==null?void 0:t.bPrefix)||r}${n.bem.b}${s}${u}`).join(", ")}}}function P(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=e.split(",").map(o=>o.trim());function u(o){return t.map(x=>`&${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${o!==void 0?`${s}${o}`:""}${m}${x}`).join(", ")}const c=l.bem.els;return c!==null?u(c[0]):u()}}}function _(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=l.bem.els;return`&:not(${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${t!==null&&t.length>0?`${s}${t[0]}`:""}${m}${e})`}}}return Object.assign(b,{cB:(...e)=>f(y(e[0]),e[1],e[2]),cE:(...e)=>f(v(e[0]),e[1],e[2]),cM:(...e)=>f(P(e[0]),e[1],e[2]),cNotM:(...e)=>f(_(e[0]),e[1],e[2])}),b}const $=Symbol("@css-render/vue3-ssr");function M(i,r){return``}function S(i,r){const s=d($,null);if(s===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:m,ids:f}=s;f.has(i)||m!==null&&(f.add(i),m.push(M(i,r)))}const j=typeof document<"u";function N(){if(j)return;const i=d($,null);if(i!==null)return{adapter:S,context:i}}export{C as p,N as u}; diff --git a/web/dist/assets/@opentiny-0f942bd4.css b/web/dist/assets/@opentiny-0f942bd4.css new file mode 100644 index 00000000..d40f7ac8 --- /dev/null +++ b/web/dist/assets/@opentiny-0f942bd4.css @@ -0,0 +1 @@ +.tiny-icon-success{fill:#5cb300}.tiny-icon-error{fill:#f23030}.tiny-icon-warning-triangle{fill:#f80}.tiny-icon-prompt{fill:#1476ff}.tiny-icon-text-type{fill:#9185f0}[class*=tiny-]{-webkit-box-sizing:border-box;box-sizing:border-box}[class*=tiny-] :after,[class*=tiny-] :before{-webkit-box-sizing:border-box;box-sizing:border-box}[class*=tiny-] a{cursor:pointer;background-image:none;text-decoration:none;outline:0}[class*=tiny-] a:active,[class*=tiny-] a:focus,[class*=tiny-] a:hover{outline:0;text-decoration:none}[class*=tiny-] dd,[class*=tiny-] dl,[class*=tiny-] dt,[class*=tiny-] li,[class*=tiny-] ol,[class*=tiny-] td,[class*=tiny-] th,[class*=tiny-] ul{margin:0;padding:0}[class*=tiny-] ol,[class*=tiny-] ul{list-style:none}[class*=tiny-] audio,[class*=tiny-] canvas,[class*=tiny-] video{display:inline-block}[class*=tiny-] audio:not([controls]){display:none;height:0}[class*=tiny-] mark{background:#ff0;color:#000}[class*=tiny-] pre{white-space:pre-wrap}[class*=tiny-] sub,[class*=tiny-] sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}[class*=tiny-] sup{top:-.5em}[class*=tiny-] sub{bottom:-.25em}[class*=tiny-] fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}[class*=tiny-] legend{border:0;padding:0}[class*=tiny-] input::-ms-clear,[class*=tiny-] input::-ms-reveal{display:none}[class*=tiny-] button::-moz-focus-inner,[class*=tiny-] input::-moz-focus-inner{border:0;padding:0}[class*=tiny-] textarea{overflow:auto;vertical-align:top}[class*=tiny-] table{border-collapse:collapse;border-spacing:0}[class*=tiny-] .tiny-hide{display:none}[class*=tiny-] .popper__arrow,[class*=tiny-] .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}@media (min-width:768px){[class*=tiny-] ::-webkit-scrollbar{width:var(--ti-common-scrollbar-width);height:var(--ti-common-scrollbar-height)}[class*=tiny-] ::-webkit-scrollbar-track-piece{background:var(--ti-common-scrollbar-track-piece-bg-color)}[class*=tiny-] ::-webkit-scrollbar-thumb{background:var(--ti-common-scrollbar-thumb-bg-color);border-radius:var(--ti-common-scrollbar-thumb-border-radius)}[class*=tiny-] ::-webkit-scrollbar-thumb:hover{background:var(--ti-common-scrollbar-thumb-hover-bg-color)}[class*=tiny-] ::-webkit-scrollbar-thumb:active{background:var(--ti-common-scrollbar-thumb-active-bg-color)}[class*=tiny-] .tiny-scrollbar::-webkit-scrollbar{width:8px;height:8px}[class*=tiny-] .tiny-scrollbar::-webkit-scrollbar-track-piece{background:0 0;border:0}[class*=tiny-] .tiny-scrollbar::-webkit-scrollbar-thumb{background:#bfbfbf;border-radius:4px}[class*=tiny-] .tiny-scrollbar::-webkit-scrollbar-thumb:hover{background:#999}[class*=tiny-] .tiny-scrollbar::-webkit-scrollbar-thumb:active{background:#999}[class*=tiny-] .tiny-min-scrollbar::-webkit-scrollbar{width:4px;height:4px}[class*=tiny-] .tiny-min-scrollbar::-webkit-scrollbar-track-piece{background:0 0;border:0}[class*=tiny-] .tiny-min-scrollbar::-webkit-scrollbar-thumb{background:#bfbfbf;border-radius:2px}[class*=tiny-] .tiny-min-scrollbar::-webkit-scrollbar-thumb:hover{background:#999}[class*=tiny-] .tiny-min-scrollbar::-webkit-scrollbar-thumb:active{background:#999}}:root{--ti-base-color-white:#fff;--ti-base-color-transparent:transparent;--ti-base-color-brand-6:#5e7ce0;--ti-base-color-brand-8:#344899;--ti-base-color-brand-7:#526ecc;--ti-base-color-brand-5:#7693f5;--ti-base-color-brand-4:#96adfa;--ti-base-color-brand-3:#beccfa;--ti-base-color-brand-2:#e9edfa;--ti-base-color-brand-1:#f2f5fc;--ti-base-color-common-9:#181818;--ti-base-color-common-8:#282b33;--ti-base-color-common-7:#252b3a;--ti-base-color-common-6:#464c59;--ti-base-color-common-5:#575d6c;--ti-base-color-common-4:#5c6173;--ti-base-color-common-3:#8a8e99;--ti-base-color-common-2:#adb0b8;--ti-base-color-common-1:#dfe1e6;--ti-base-color-bg-9:#b12220;--ti-base-color-bg-8:#c7000b;--ti-base-color-bg-7:#d64a52;--ti-base-color-bg-6:#eef0f5;--ti-base-color-bg-5:#f5f5f6;--ti-base-color-bg-4:#fafafa;--ti-base-color-bg-3:#ffffff;--ti-base-color-bg-2:#ffffff;--ti-base-color-bg-1:#ffffff;--ti-base-color-error-4:#de504e;--ti-base-color-error-3:#f66f6a;--ti-base-color-error-2:#ffbcba;--ti-base-color-error-1:#ffeeed;--ti-base-color-success-4:#3ac295;--ti-base-color-success-3:#50d4ab;--ti-base-color-success-2:#acf2dc;--ti-base-color-success-1:#edfff9;--ti-base-color-warn-5:#e37d29;--ti-base-color-warn-4:#fa9841;--ti-base-color-warn-3:#fac20a;--ti-base-color-warn-2:#ffd0a6;--ti-base-color-warn-1:#fff3e8;--ti-base-color-prompt-4:var(--ti-base-color-brand-7);--ti-base-color-prompt-3:var(--ti-base-color-brand-6);--ti-base-color-prompt-2:var(--ti-base-color-brand-3);--ti-base-color-prompt-1:#ebf6ff;--ti-base-color-prompt-icon-from:#7769e8;--ti-base-color-prompt-icon-to:#58bbff;--ti-base-color-icon-info:#6cbfff;--ti-base-color-data-3:#a6dd82;--ti-base-color-data-4:#f3689a;--ti-base-color-data-5:#a97af8;--ti-common-color-transparent:var(--ti-base-color-transparent);--ti-common-color-light:#fff;--ti-common-color-dark:#000;--ti-common-color-success:var(--ti-base-color-success-3);--ti-common-color-text-success:var(--ti-base-color-success-4);--ti-common-color-success-bg:var(--ti-base-color-success-1);--ti-common-color-success-border:var(--ti-base-color-success-2);--ti-common-color-error:var(--ti-base-color-error-3);--ti-common-color-error-text:var(--ti-base-color-error-4);--ti-common-color-error-bg:var(--ti-base-color-error-1);--ti-common-color-error-border:var(--ti-base-color-error-3);--ti-common-color-error-border-secondary:var(--ti-base-color-error-2);--ti-common-color-info:var(--ti-base-color-common-7);--ti-common-color-info-text:var(--ti-base-color-common-7);--ti-common-color-info-bg:rgba(51, 51, 51, .06);--ti-common-color-info-border:#d3d4d6;--ti-common-color-warn:var(--ti-base-color-warn-4);--ti-common-color-warn-text:var(--ti-base-color-warn-5);--ti-common-color-warn-bg:var(--ti-base-color-warn-1);--ti-common-color-warn-border:var(--ti-base-color-warn-2);--ti-common-color-warn-secondary:var(--ti-base-color-warn-3);--ti-common-color-prompt:var(--ti-base-color-prompt-3);--ti-common-color-prompt-text:var(--ti-base-color-prompt-4);--ti-common-color-prompt-bg:var(--ti-base-color-prompt-1);--ti-common-color-prompt-border:var(--ti-base-color-prompt-2);--ti-common-color-prompt-icon-from:var(--ti-base-color-prompt-icon-from);--ti-common-color-prompt-icon-to:var(--ti-base-color-prompt-icon-to);--ti-common-color-primary-normal:var(--ti-base-color-brand-6);--ti-common-color-primary-hover:var(--ti-base-color-brand-5);--ti-common-color-primary-active:var(--ti-base-color-brand-5);--ti-common-color-primary-disabled:#a0cfff;--ti-common-color-primary-disabled-bgcolor:var(--ti-common-color-bg-disabled);--ti-common-color-primary-disabled-border:var(--ti-common-color-line-disabled);--ti-common-color-primary-disabled-text:var(--ti-common-color-text-disabled);--ti-common-color-primary-plain-disabled-bg-color:rgba(191, 191, 191, .1);--ti-common-color-success-normal:var(--ti-common-color-success);--ti-common-color-success-hover:var(--ti-common-color-success-border);--ti-common-color-success-active:var(--ti-common-color-success-border);--ti-common-color-success-disabled:#a6c3b9;--ti-common-color-success-disabled-bgcolor:var(--ti-common-color-bg-disabled);--ti-common-color-success-disabled-border:var(--ti-common-color-line-disabled);--ti-common-color-success-disabled-text:var(--ti-common-color-text-disabled);--ti-common-color-success-plain-disabled-bg-color:rgba(166, 195, 185, .1);--ti-common-color-warning-normal:var(--ti-common-color-warn);--ti-common-color-warning-hover:var(--ti-common-color-warn-secondary);--ti-common-color-warning-active:var(--ti-common-color-warn-secondary);--ti-common-color-warning-disabled:#d3c6a2;--ti-common-color-warning-disabled-bgcolor:var(--ti-common-color-bg-disabled);--ti-common-color-warning-disabled-border:var(--ti-common-color-line-disabled);--ti-common-color-warning-disabled-text:var(--ti-common-color-text-disabled);--ti-common-color-warning-plain-disabled-bg-color:rgba(211, 198, 162, .1);--ti-common-color-danger-normal:var(--ti-common-bg-primary);--ti-common-color-danger-hover:var(--ti-common-bg-primary-hover);--ti-common-color-danger-active:var(--ti-common-bg-primary-active);--ti-common-color-danger-disabled:#d8bab5;--ti-common-color-danger-disabled-bgcolor:var(--ti-common-color-bg-disabled);--ti-common-color-danger-disabled-border:var(--ti-common-color-line-disabled);--ti-common-color-danger-disabled-text:var(--ti-common-color-text-disabled);--ti-common-color-danger-plain-disabled-bg-color:rgba(216, 186, 181, .1);--ti-common-color-info-normal:var(--ti-base-color-common-7);--ti-common-color-info-hover:var(--ti-base-color-common-4);--ti-common-color-info-active:var(--ti-base-color-common-4);--ti-common-color-info-disabled:#bfbfbf;--ti-common-color-info-disabled-bgcolor:var(--ti-common-color-bg-disabled);--ti-common-color-info-disabled-border:var(--ti-common-color-line-disabled);--ti-common-color-info-disabled-text:var(--ti-common-color-text-disabled);--ti-common-color-info-plain-disabled-bg-color:rgba(191, 191, 191, .1);--ti-common-color-text-primary:var(--ti-base-color-common-7);--ti-common-color-text-secondary:var(--ti-base-color-common-5);--ti-common-color-text-weaken:var(--ti-base-color-common-3);--ti-common-color-text-disabled:var(--ti-base-color-common-2);--ti-common-color-text-darkbg:var(--ti-base-color-common-2);--ti-common-color-text-darkbg-disabled:var(--ti-base-color-common-5);--ti-common-color-text-link:var(--ti-base-color-brand-7);--ti-common-color-text-link-hover:var(--ti-base-color-brand-8);--ti-common-color-text-link-darkbg:var(--ti-base-color-brand-4);--ti-common-color-text-link-darkbg-hover:var(--ti-base-color-brand-3);--ti-common-color-text-highlight:var(--ti-base-color-brand-7);--ti-common-color-text-white:var(--ti-base-color-white);--ti-common-color-text-gray:var(--ti-base-color-white);--ti-common-color-text-gray-disabled:var(--ti-base-color-common-4);--ti-common-color-text-important:var(--ti-base-color-error-4);--ti-common-color-placeholder:var(--ti-base-color-common-2);--ti-common-color-selected-text-color:var(--ti-common-color-light);--ti-common-color-icon-normal:var(--ti-base-color-common-5);--ti-common-color-icon-hover:var(--ti-base-color-brand-6);--ti-common-color-icon-active:var(--ti-base-color-brand-6);--ti-common-color-icon-disabled:var(--ti-base-color-common-2);--ti-common-color-icon-white:var(--ti-base-color-white);--ti-common-color-icon-graybg-normal:var(--ti-base-color-common-2);--ti-common-color-icon-graybg-hover:var(--ti-base-color-brand-6);--ti-common-color-icon-graybg-active:var(--ti-base-color-brand-6);--ti-common-color-icon-graybg-disabled:var(--ti-base-color-common-1);--ti-common-color-icon-darkbg-normal:var(--ti-base-color-common-2);--ti-common-color-icon-darkbg-hover:var(--ti-base-color-brand-5);--ti-common-color-icon-darkbg-active:var(--ti-base-color-brand-5);--ti-common-color-icon-darkbg-disabled:var(--ti-base-color-common-5);--ti-common-color-icon-info:var(--ti-base-color-icon-info);--ti-common-color-bg-normal:var(--ti-base-color-bg-6);--ti-common-color-bg-emphasize:var(--ti-base-color-brand-6);--ti-common-color-bg-disabled:var(--ti-base-color-bg-5);--ti-common-color-bg-hover:var(--ti-base-color-brand-8);--ti-common-color-bg-gray:var(--ti-base-color-bg-4);--ti-common-color-bg-secondary:var(--ti-base-color-common-2);--ti-common-bg-primary:var(--ti-base-color-bg-8);--ti-common-bg-primary-hover:var(--ti-base-color-bg-7);--ti-common-bg-primary-active:var(--ti-base-color-bg-9);--ti-common-bg-minor:var(--ti-base-color-bg-2);--ti-common-bg-minor-hover:var(--ti-base-color-bg-1);--ti-common-bg-minor-active:var(--ti-base-color-bg-3);--ti-common-color-bg-white-normal:var(--ti-base-color-white);--ti-common-color-bg-white-emphasize:var(--ti-base-color-brand-1);--ti-common-color-bg-light-normal:var(--ti-base-color-brand-2);--ti-common-color-bg-light-emphasize:var(--ti-base-color-brand-3);--ti-common-color-bg-dark-normal:var(--ti-base-color-common-6);--ti-common-color-bg-dark-emphasize:var(--ti-base-color-common-4);--ti-common-color-bg-dark-active:var(--ti-common-color-bg-normal);--ti-common-color-bg-dark-deep:var(--ti-base-color-common-6);--ti-common-color-bg-dark-disabled:var(--ti-base-color-common-1);--ti-common-color-bg-navigation:var(--ti-base-color-common-8);--ti-common-color-bg-dark-select:var(--ti-base-color-common-9);--ti-common-color-selected-background:var(--ti-base-color-brand-6);--ti-common-color-hover-background:var(--ti-base-color-brand-1);--ti-common-color-data-1:var(--ti-base-color-success-3);--ti-common-color-data-2:var(--ti-base-color-icon-info);--ti-common-color-data-3:var(--ti-base-color-data-3);--ti-common-color-data-4:var(--ti-base-color-data-4);--ti-common-color-data-5:var(--ti-base-color-data-5);--ti-common-color-data-6:var(--ti-base-color-warn-3);--ti-common-color-data-7:var(--ti-base-color-warn-4);--ti-common-color-data-8:var(--ti-base-color-error-3);--ti-common-line-height-number:1.5;--ti-common-line-height-base:12px;--ti-common-line-height-1:14px;--ti-common-line-height-2:16px;--ti-common-line-height-3:18px;--ti-common-line-height-4:20px;--ti-common-line-height-5:24px;--ti-common-line-height-6:32px;--ti-common-line-height-7:36px;--ti-common-space-base:4px;--ti-common-space-2x:calc(var(--ti-common-space-base) * 2);--ti-common-space-3x:calc(var(--ti-common-space-base) * 3);--ti-common-space-4x:calc(var(--ti-common-space-base) * 4);--ti-common-space-5x:calc(var(--ti-common-space-base) * 5);--ti-common-space-6x:calc(var(--ti-common-space-base) * 6);--ti-common-space-8x:calc(var(--ti-common-space-base) * 8);--ti-common-space-10x:calc(var(--ti-common-space-base) * 10);--ti-common-space-0:0px;--ti-common-space-1:1px;--ti-common-space-6:6px;--ti-common-space-10:10px;--ti-common-dropdown-gap:2px;--ti-common-shadow-none:none;--ti-common-shadow-1-up:0 -1px 4px 0 rgba(0, 0, 0, .1);--ti-common-shadow-1-down:0 1px 4px 0 rgba(0, 0, 0, .1);--ti-common-shadow-1-left:-1px 0px 4px 0 rgba(0, 0, 0, .1);--ti-common-shadow-1-right:1px 0px 4px 0 rgba(0, 0, 0, .1);--ti-common-shadow-2-up:0 -2px 8px 0 rgba(0, 0, 0, .2);--ti-common-shadow-2-down:0 2px 8px 0 rgba(0, 0, 0, .2);--ti-common-shadow-2-left:-2px 0 8px 0 rgba(238, 10, 10, .2);--ti-common-shadow-2-right:2px 0 8px 0 rgba(252, 5, 5, .2);--ti-common-shadow-3-up:0 -4px 16px 0 rgba(0, 0, 0, .2);--ti-common-shadow-3-down:0 4px 16px 0 rgba(0, 0, 0, .2);--ti-common-shadow-3-left:-4px 0 16px 0 rgba(0, 0, 0, .2);--ti-common-shadow-3-right:4px 0 16px 0 rgba(0, 0, 0, .2);--ti-common-shadow-4-up:0 -8px 40px 0 rgba(0, 0, 0, .2);--ti-common-shadow-4-down:0 8px 40px 0 rgba(0, 0, 0, .2);--ti-common-shadow-4-left:-8px 0 40px 0 rgba(0, 0, 0, .2);--ti-common-shadow-4-right:8px 0 40px 0 rgba(0, 0, 0, .2);--ti-common-shadow-error:0 1px 3px 0 rgba(199, 54, 54, .25);--ti-common-shadow-warn:0 1px 3px 0 rgba(204, 100, 20, .25);--ti-common-shadow-prompt:0 1px 3px 0 rgba(70, 94, 184, .25);--ti-common-shadow-success:0 1px 3px 0 rgba(39, 176, 128, .25);--ti-common-font-family:"Helvetica","Arial","PingFangSC-Regular","Hiragino Sans GB","Microsoft YaHei","微软雅黑","Microsoft JhengHei";--ti-common-font-size-base:12px;--ti-common-font-size-1:14px;--ti-common-font-size-2:16px;--ti-common-font-size-3:18px;--ti-common-font-size-4:20px;--ti-common-font-size-5:24px;--ti-common-font-size-6:32px;--ti-common-font-size-7:36px;--ti-common-font-weight-1:100;--ti-common-font-weight-2:200;--ti-common-font-weight-3:300;--ti-common-font-weight-4:normal;--ti-common-font-weight-5:500;--ti-common-font-weight-6:600;--ti-common-font-weight-7:bold;--ti-common-font-weight-8:800;--ti-common-font-weight-9:900;--ti-common-font-weight-bold:700;--ti-common-color-line-normal:var(--ti-base-color-common-2);--ti-common-color-line-hover:var(--ti-base-color-common-5);--ti-common-color-line-active:var(--ti-base-color-brand-6);--ti-common-color-line-disabled:var(--ti-base-color-common-1);--ti-common-color-line-dividing:var(--ti-base-color-common-1);--ti-common-color-dash-line-normal:var(--ti-base-color-common-5);--ti-common-color-dash-line-hover:var(--ti-base-color-brand-7);--ti-common-color-border:var(--ti-base-color-common-2);--ti-common-color-border-hover:var(--ti-base-color-common-5);--ti-common-border-weight-normal:1px;--ti-common-border-weight-1:2px;--ti-common-border-weight-2:3px;--ti-common-border-style-dashed:dashed;--ti-common-border-style-dotted:dotted;--ti-common-border-style-solid:solid;--ti-common-border-radius-normal:2px;--ti-common-border-radius-0:0px;--ti-common-border-radius-1:4px;--ti-common-border-radius-2:8px;--ti-common-border-radius-3:50%;--ti-common-size-base:4px;--ti-common-size-2x:calc(var(--ti-common-size-base) * 2);--ti-common-size-3x:calc(var(--ti-common-size-base) * 3);--ti-common-size-4x:calc(var(--ti-common-size-base) * 4);--ti-common-size-5x:calc(var(--ti-common-size-base) * 5);--ti-common-size-6x:calc(var(--ti-common-size-base) * 6);--ti-common-size-7x:calc(var(--ti-common-size-base) * 7);--ti-common-size-8x:calc(var(--ti-common-size-base) * 8);--ti-common-size-9x:calc(var(--ti-common-size-base) * 9);--ti-common-size-10x:calc(var(--ti-common-size-base) * 10);--ti-common-size-11x:calc(var(--ti-common-size-base) * 11);--ti-common-size-12x:calc(var(--ti-common-size-base) * 12);--ti-common-size-13x:calc(var(--ti-common-size-base) * 13);--ti-common-size-14x:calc(var(--ti-common-size-base) * 14);--ti-common-size-15x:calc(var(--ti-common-size-base) * 15);--ti-common-size-16x:calc(var(--ti-common-size-base) * 16);--ti-common-size-17x:calc(var(--ti-common-size-base) * 17);--ti-common-size-18x:calc(var(--ti-common-size-base) * 18);--ti-common-size-19x:calc(var(--ti-common-size-base) * 19);--ti-common-size-20x:calc(var(--ti-common-size-base) * 20);--ti-common-size-21x:calc(var(--ti-common-size-base) * 21);--ti-common-size-22x:calc(var(--ti-common-size-base) * 22);--ti-common-size-23x:calc(var(--ti-common-size-base) * 23);--ti-common-size-24x:calc(var(--ti-common-size-base) * 24);--ti-common-size-25x:calc(var(--ti-common-size-base) * 25);--ti-common-size-26x:calc(var(--ti-common-size-base) * 26);--ti-common-size-27x:calc(var(--ti-common-size-base) * 27);--ti-common-size-28x:calc(var(--ti-common-size-base) * 28);--ti-common-size-29x:calc(var(--ti-common-size-base) * 29);--ti-common-size-30x:calc(var(--ti-common-size-base) * 30);--ti-common-size-31x:calc(var(--ti-common-size-base) * 31);--ti-common-size-32x:calc(var(--ti-common-size-base) * 32);--ti-common-size-33x:calc(var(--ti-common-size-base) * 33);--ti-common-size-34x:calc(var(--ti-common-size-base) * 34);--ti-common-size-35x:calc(var(--ti-common-size-base) * 35);--ti-common-size-36x:calc(var(--ti-common-size-base) * 36);--ti-common-size-37x:calc(var(--ti-common-size-base) * 37);--ti-common-size-38x:calc(var(--ti-common-size-base) * 38);--ti-common-size-39x:calc(var(--ti-common-size-base) * 39);--ti-common-size-40x:calc(var(--ti-common-size-base) * 40);--ti-common-size-41x:calc(var(--ti-common-size-base) * 41);--ti-common-size-42x:calc(var(--ti-common-size-base) * 42);--ti-common-size-43x:calc(var(--ti-common-size-base) * 43);--ti-common-size-44x:calc(var(--ti-common-size-base) * 44);--ti-common-size-45x:calc(var(--ti-common-size-base) * 45);--ti-common-size-46x:calc(var(--ti-common-size-base) * 46);--ti-common-size-47x:calc(var(--ti-common-size-base) * 47);--ti-common-size-48x:calc(var(--ti-common-size-base) * 48);--ti-common-size-49x:calc(var(--ti-common-size-base) * 49);--ti-common-size-50x:calc(var(--ti-common-size-base) * 50);--ti-common-size-0:0px;--ti-common-size-auto:auto;--ti-common-size-width-large:var(--ti-common-size-33x);--ti-common-size-width-medium:var(--ti-common-size-30x);--ti-common-size-width-normal:var(--ti-common-size-20x);--ti-common-size-height-large:var(--ti-common-size-12x);--ti-common-size-height-medium:var(--ti-common-size-10x);--ti-common-size-height-small:var(--ti-common-size-8x);--ti-common-size-height-normal:var(--ti-common-size-7x);--ti-common-size-height-mini:var(--ti-common-size-6x);--ti-common-scrollbar-width:4px;--ti-common-scrollbar-height:4px;--ti-common-scrollbar-track-piece-bg-color:var(--ti-base-color-bg-4);--ti-common-scrollbar-thumb-bg-color:#bfbfbf;--ti-common-scrollbar-thumb-border-radius:6px;--ti-common-scrollbar-thumb-hover-bg-color:#999999;--ti-common-scrollbar-thumb-active-bg-color:#999999}:root{--ti-errortips-box-bg-color:var(--ti-common-color-light);--ti-errortips-body-text-color:#5a5e66;--ti-errortips-body-font-size:var(--ti-common-font-size-1);--ti-errortips-body-code-font-size:100px;--ti-errortips-body-code-text-color:#9ac7ef;--ti-errortips-body-content-font-size:var(--ti-common-font-size-2);--ti-errortips-body-bottom-font-weight:var(--ti-common-font-weight-8);--ti-errortips-sso-box-bg-color:var(--ti-common-color-light);--ti-errortips-sso-body-text-color:#5a5e66;--ti-errortips-sso-body-font-size:var(--ti-common-font-size-1);--ti-errortips-not-sso-bg-color:#dcdfe4;--ti-errortips-not-sso-body-bg-color:#f4f5f9;--ti-errortips-not-sso-body-border-color:#d4d5d7;--ti-errortips-not-sso-body-title-border-color:#b6babf;--ti-errortips-not-sso-body-title-font-size:var(--ti-common-font-size-4);--ti-errortips-not-sso-body-login-font-size:var(--ti-common-font-size-2);--ti-errortips-not-sso-body-text-color:#5a5e66;--ti-errortips-not-sso-body-input-border-color:var(--ti-base-color-bg-5);--ti-errortips-not-sso-body-input-border-radius:var(--ti-common-border-radius-normal);--ti-errortips-not-sso-body-placeholder-text-color:var(--ti-common-color-placeholder);--ti-errortips-not-sso-body-input-hover-text-color:var(--ti-common-color-placeholder);--ti-errortips-not-sso-body-input-focus-text-color:var(--ti-common-color-border);--ti-errortips-not-sso-body-input-danger-border-color:var(--ti-base-color-bg-8);--ti-errortips-not-sso-body-button-text-color:var(--ti-common-color-light);--ti-errortips-not-sso-body-button-bg-color:var(--ti-base-color-brand-6);--ti-errortips-not-sso-body-button-border-radius:var(--ti-common-border-radius-normal);--ti-errortips-not-sso-body-button-hover-bg-color:var(--ti-base-color-brand-5);--ti-errortips-not-sso-body-errmessage-text-color:#f00}.tiny-popup__wrapper{z-index:2147483647!important;background:rgba(0,0,0,.5);position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.tiny-popup__wrapper .tiny-errortips__box{position:absolute;width:var(--ti-errortips-width);min-height:var(--ti-errortips-min-height);max-height:var(--ti-errortips-max-height);top:0;left:0;right:0;bottom:0;margin:auto;overflow:hidden;background:var(--ti-errortips-box-bg-color);border:1px solid transparent;-webkit-box-shadow:2px 2px 2px 0 rgba(0,0,0,.2);box-shadow:2px 2px 2px #0003;text-align:center;overflow-y:auto}.tiny-popup__wrapper .tiny-errortips__box .tiny-errortips__body{height:100%;text-align:initial;padding:20px;color:var(--ti-errortips-body-text-color);font-size:var(--ti-errortips-body-font-size);display:table;margin:auto}.tiny-popup__wrapper .tiny-errortips__box .tiny-errortips__body .errortips{text-align:center;display:table-cell;vertical-align:middle}.tiny-popup__wrapper .tiny-errortips__box .tiny-errortips__body .errortips .error-code{font-size:var(--ti-errortips-body-code-font-size);color:var(--ti-errortips-body-code-text-color);margin:0 auto -45px;text-shadow:0 2px 0 #fff,-2px 0 0 #fff,2px 0 0 #fff}.tiny-popup__wrapper .tiny-errortips__box .tiny-errortips__body .errortips .error-img{width:260px;height:180px;margin:0 auto;background:url(/assets/errortips-bg-e8a5d5c7.png) no-repeat}.tiny-popup__wrapper .tiny-errortips__box .tiny-errortips__body .errortips .error-content{font-size:var(--ti-errortips-body-content-font-size);margin:24px 0;font-weight:700}.tiny-popup__wrapper .tiny-errortips__box .tiny-errortips__body .errortips .error-bottom a{font-weight:var(--ti-errortips-body-bottom-font-weight);cursor:pointer}.tiny-popup__wrapper .tiny-errortips__box .tiny-errortips__body .errortips .error-bottom span{padding-right:15px}.tiny-popup__wrapper .tiny-sso__box{position:absolute;background:var(--ti-errortips-sso-box-bg-color);border:1px solid transparent;-webkit-box-shadow:2px 2px 2px 0 rgba(0,0,0,.2);box-shadow:2px 2px 2px #0003;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.tiny-popup__wrapper .tiny-sso__box .tiny-sso__body{text-align:initial;padding:20px;color:var(--ti-errortips-sso-body-text-color);line-height:32px;font-size:var(--ti-errortips-sso-body-font-size)}.tiny-popup__wrapper .tiny-sso__box .tiny-sso__body .tiny-sso__body-iframe{width:350px;height:350px;overflow:hidden}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.tiny-popup__wrapper .tiny-sso__box .tiny-sso__body .tiny-sso__body-iframe{height:460px}}@supports (-ms-ime-align:auto){.tiny-popup__wrapper .tiny-sso__box .tiny-sso__body .tiny-sso__body-iframe{height:460px}}.tiny-popup__wrapper.login-not-sso{background:var(--ti-errortips-not-sso-bg-color);background-size:cover}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box{width:100%;height:100%;overflow:hidden}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body{width:650px;height:400px;background:var(--ti-errortips-not-sso-body-bg-color);position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;border:1px solid var(--ti-errortips-not-sso-body-border-color);-webkit-box-shadow:0 2px 4px #989a9e;box-shadow:0 2px 4px #989a9e}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .title{background:-webkit-gradient(linear,left top,left bottom,from(#ecedf1),to(#dadde2));background:linear-gradient(to bottom,#ecedf1,#dadde2);border-bottom:1px solid var(--ti-errortips-not-sso-body-title-border-color);padding:16px 20px;font-size:var(--ti-errortips-not-sso-body-title-font-size)}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login{width:100%;border-collapse:collapse;border-spacing:0;font-size:var(--ti-errortips-not-sso-body-login-font-size);margin-top:28px}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item{height:60px;line-height:60px}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.label{width:30%;text-align:right;color:var(--ti-errortips-not-sso-body-text-color)}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell{width:70%;text-align:left;padding-left:12px}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell input{border:1px solid var(--ti-errortips-not-sso-body-input-border-color);border-radius:var(--ti-errortips-not-sso-body-input-border-radius);outline:0;width:75%;height:40px;line-height:40px;padding:0 8px;background:0 0;color:var(--ti-errortips-not-sso-body-text-color)}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell input::-webkit-input-placeholder{color:var(--ti-errortips-not-sso-body-placeholder-text-color)}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell input:hover{border-color:var(--ti-errortips-not-sso-body-placeholder-text-color)}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell input:focus::-webkit-input-placeholder{color:var(--ti-errortips-not-sso-body-input-focus-text-color)}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell input.text-danger{border-color:var(--ti-errortips-not-sso-body-input-danger-border-color)}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell button{width:75%;height:40px;line-height:40px;padding:0 24px;text-align:center;color:var(--ti-errortips-not-sso-body-button-text-color);background-color:var(--ti-errortips-not-sso-body-button-bg-color);border:none;border-radius:var(--ti-errortips-not-sso-body-button-border-radius);-webkit-transition:.3s;transition:.3s;outline:0}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell button:hover{background-color:var(--ti-errortips-not-sso-body-button-hover-bg-color)}.tiny-popup__wrapper.login-not-sso .tiny-not-sso__box .tiny-not-sso__body .tbl-login .form-item td.cell .errmessage{color:var(--ti-errortips-not-sso-body-errmessage-text-color);line-height:20px}.tiny-svg{width:1em;height:1em;vertical-align:middle;overflow:hidden;display:inline-block}.tiny-slide-bar{--ti-slider-progress-box-border-color:var(--ti-common-color-light);--ti-slider-progress-box-hover-border-color:rgba(153, 153, 153, .7);--ti-slider-progress-box-arrow-normal-text-color:#f2f2f2;--ti-slider-progress-box-arrow-hover-text-color:#808080;--ti-slider-progress-box-middleline-border-color:#ebebeb;--ti-slider-progress-box-middleline-icon-color:#ebebeb;padding:0 32px;position:relative}.tiny-slide-bar>.tiny-svg{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:2em;cursor:pointer;fill:var(--ti-slider-progress-box-arrow-normal-text-color)}.tiny-slide-bar>.tiny-svg:hover{fill:var(--ti-slider-progress-box-arrow-hover-text-color)}.tiny-slide-bar>.tiny-svg.tiny-disabled,.tiny-slide-bar>.tiny-svg.tiny-disabled:hover{background:0 0;fill:#fff;cursor:default}.tiny-slide-bar>.icon-chevron-left{left:0}.tiny-slide-bar>.icon-chevron-right{right:0}.tiny-slide-bar li li div{margin:15px 0;font-size:var(--ti-common-font-size-base);color:#4e5e67}.tiny-slide-bar li li div:nth-child(2){border-bottom:1px solid var(--ti-slider-progress-box-middleline-border-color)}.tiny-slide-bar li li div svg{float:right;margin:-6px 0 0;background:#fff;fill:var(--ti-slider-progress-box-middleline-icon-color)}.tiny-slide-bar .tiny-slide-bar__content{width:100%;min-height:170px;position:relative;overflow:hidden}.tiny-slide-bar .tiny-slide-bar__list{position:absolute;min-height:170px;display:-webkit-box;display:-ms-flexbox;display:flex}.tiny-slide-bar .tiny-slide-bar__list>li{width:23%;padding:20px;float:left;margin-left:2%;position:relative;border:5px solid var(--ti-slider-progress-box-border-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.tiny-slide-bar .tiny-slide-bar__list>li:first-child{margin-left:0}.tiny-slide-bar .tiny-slide-bar__list>li:hover{border-color:var(--ti-slider-progress-box-hover-border-color)}.tiny-slide-bar .tiny-slide-bar__list>li>.icon-chevron-down{position:absolute;top:98.8%;left:50%;margin-left:-10px;font-size:2em;width:22px;display:none!important}.tiny-slide-bar .tiny-slide-bar__list>li>.icon-chevron-down:before{content:"";position:absolute;width:20px;height:20px;border-right:5px solid var(--ti-slider-progress-box-hover-border-color);border-bottom:5px solid var(--ti-slider-progress-box-hover-border-color);-webkit-transform:rotate(45deg);transform:rotate(45deg);background:#fff;top:-5px}.tiny-slide-bar .tiny-slide-bar__list>li>ul{width:100%;list-style:none}.tiny-slide-bar .tiny-slide-bar__list>li.tiny-slide-bar__select{border-color:var(--ti-slider-progress-box-hover-border-color)}.tiny-slide-bar .tiny-slide-bar__list>li.tiny-slide-bar__select>.icon-chevron-down{display:block!important}.tiny-slide-bar .tiny-slide-bar__list>li.tiny-slide-bar__select li .tiny-icon{color:var(--ti-slider-progress-box-hover-border-color)}.tiny-slide-bar .tiny-slide-bar__list>li.tiny-slide-bar__select li:nth-child(2){border-bottom:1px solid var(--ti-slider-progress-box-hover-border-color)} diff --git a/web/dist/assets/@opentiny-d73a2d67.js b/web/dist/assets/@opentiny-d73a2d67.js new file mode 100644 index 00000000..27b72d90 --- /dev/null +++ b/web/dist/assets/@opentiny-d73a2d67.js @@ -0,0 +1,2 @@ +import{h as it}from"./vue-1e3b54ec.js";import{l as Ee}from"./xss-a5544f63.js";import{d as ur,c as pr,a as fr,h as mr,g as G,i as we,p as gr,o as hr,b as vr,n as $t,m as yr,e as H,f as ae,j as D,r as Me,k as me,l as Ce,w as Ne,q as lt,s as st,t as ct,F as br,u as wr,v as xr,x as dt,T as Sr,y as Tr}from"./@vue-a481fc63.js";const It=Object.prototype.toString,He=Object.prototype.hasOwnProperty,Mr=Object.getPrototypeOf,Et=He.toString,Cr=Et.call(Object),Nr={"[object Error]":"error","[object Object]":"object","[object RegExp]":"regExp","[object Date]":"date","[object Array]":"array","[object Function]":"function","[object String]":"string","[object Number]":"number","[object Boolean]":"boolean"},Z=e=>e==null||e==="undefined",ge=e=>Z(e)?String(e):Nr[It.call(e)]||"object",ut=e=>ge(e)==="object",$=e=>{if(!e||It.call(e)!=="[object Object]")return!1;const t=Mr(e);if(!t)return!0;const r=He.call(t,"constructor")&&t.constructor;return typeof r=="function"&&Et.call(r)===Cr},Ve=e=>typeof e=="number"&&isFinite(e),pt=e=>e-parseFloat(e)>=0,he=e=>ge(e)==="date",ft=(e,t)=>{if(typeof t=="function"){for(const r in e)if(He.call(e,r)&&t(r,e[r])===!1)break}};let q;const ke=(e,t,r)=>{if(!e||!$(e)||!t||typeof t!="string")return;t=t.split(".");let n=e;const a=t.length;if(a>1){const o=r?1:0;for(let i=o;i{if(!e||!$(e)||!t||typeof t!="string")return e;t=t.split(".");const a=e;let o=t.length,i=t[0];if(o>1){o--;let l=a,s,c;for(let d=0;d{const a=(i,l,s,c,d)=>{const u=c.indexOf(s)===0,p=c.split(s),f=p[1]&&p[1].indexOf(".")===0;s===c||u&&f?s!==c&&ft(ke(i,s),g=>{a(i,l,`${s}.${g}`,c)}):t.includes(s)||mt(l,s,ke(i,s),d)},o=(i,l,s,c)=>{const d={};return c?ft(i,u=>l.forEach(p=>a(i,d,u,p,s))):l.forEach(u=>mt(d,u,ke(i,u),s)),d};return $(e)?Array.isArray(t)?o(e,t,r,n):q(r!==!1,{},e):e},Dr=e=>Array.isArray(e)?e.map(t=>kr(t)):e,Ar=(e,t,r,n,a)=>{let o;if(r&&n&&($(n)||(o=Array.isArray(n))))if(o)o=!1,e[t]=Dr(n);else{const i=a&&$(a)?a:{};e[t]=q(r,i,n)}else if(n!==void 0)try{e[t]=n}catch{}};q=function(){const e=arguments,t=e.length;let r=e[0]||{},n=1,a=!1;for(ge(r)==="boolean"&&(a=r,r=e[n]||{},n++),!ut(r)&&ge(r)!=="function"&&(r={}),n===t&&(r=this,n--);n{let e=8;return document.addEventListener&&window.performance&&(e=9,window.atob&&window.matchMedia&&(e=10,!window.attachEvent&&!document.all&&(e=11))),e},Ir=e=>{e.chrome&&~navigator.userAgent.indexOf("Edg")?(e.name="edge",e.edge=!0,delete e.chrome):!document.documentMode&&window.StyleMedia&&(e.name="edge",e.edge=!0)},Rt=typeof window<"u"&&typeof document<"u"&&window.document===document;(()=>{const e={name:void 0,version:void 0,isDoc:typeof document<"u",isMobile:!1,isPC:!0,isNode:typeof window>"u"};if(Rt){const t=/(Android|webOS|iPhone|iPad|iPod|SymbianOS|BlackBerry|Windows Phone)/.test(navigator.userAgent);e.isMobile=t,e.isPC=!t;let r;if(window.chrome&&(window.chrome.webstore||/^Google\b/.test(window.navigator.vendor))?(e.name="chrome",e.chrome=!0,r=navigator.userAgent.match(/chrome\/(\d+)/i),e.version=!!r&&!!r[1]&&parseInt(r[1],10),r=void 0):document.all||document.documentMode?(e.name="ie",e.version=$r(),e.ie=!0):typeof window.InstallTrigger<"u"?(e.name="firefox",e.firefox=!0):Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0?(e.name="safari",e.safari=!0):(window.opr&&window.opr.addons||window.opera)&&(e.name="opera",e.opera=!0),Ir(e),!~["ie","chrome"].indexOf(e.name)){const n=e.name+"/(\\d+)";r=navigator.userAgent.match(new RegExp(n,"i")),e.version=!!r&&!!r[1]&&parseInt(r[1],10),r=void 0}if(e.isDoc){const n=document.body||document.documentElement;["webkit","khtml","moz","ms","o"].forEach(a=>{e["-"+a]=!!n[a+"MatchesSelector"]})}}return e})();const ie=Rt?window.BigInt:global.BigInt;function Re(){return typeof ie=="function"}function te(e){let t=e.toString().trim(),r=t.startsWith("-");r&&(t=t.slice(1)),t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),t.startsWith(".")&&(t="0".concat(t));let n=t||"0",a=n.split("."),o=a[0]||"0",i=a[1]||"0";o==="0"&&i==="0"&&(r=!1);let l=r?"-":"";return{negative:r,negativeStr:l,trimStr:n,integerStr:o,decimalStr:i,fullStr:"".concat(l).concat(n)}}function Ge(e){let t=String(e);return!isNaN(Number(t))&&~t.indexOf("e")}function Pt(e){return typeof e=="number"?!isNaN(e):e?/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e):!1}function Pe(e){let t=String(e);if(Ge(e)){let r=Number(t.slice(t.indexOf("e-")+2)),n=t.match(/\.(\d+)/);return n!=null&&n[1]&&(r+=n[1].length),r}return~t.indexOf(".")&&Pt(t)?t.length-t.indexOf(".")-1:0}function Ft(e){let t=String(e);if(Ge(e)){if(e>Number.MAX_SAFE_INTEGER)return String(Re()?ie(e).toString():Number.MAX_SAFE_INTEGER);if(e{const i=o.replace(/^0+/,"")||"0";return n(`return BigInt(${i})`)()};if(Pt(r)){const o=te(r);this.negative=o.negative;const i=o.trimStr.split(".");this.integer=ie(i[0]);const l=i[1]||"0";this.decimal=a(l),this.decimalLen=l.length}else this.nan=!0}getDecimalStr(){return this.decimal.toString().padStart(this.decimalLen,"0")}getIntegerStr(){return this.integer.toString()}getMark(){return this.negative?"-":""}alignDecimal(t){const r=`${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(t,"0")}`;return ie(r)}add(t){if(this.isInvalidate())return new re(t);const r=new re(t);if(r.isInvalidate())return this;const n=Math.max(this.getDecimalStr().length,r.getDecimalStr().length),a=r.alignDecimal(n),i=`${this.alignDecimal(n)+a}`,{negativeStr:l,trimStr:s}=te(i),c=`${l}${s.padStart(n+1,"0")}`;return Ye(`${c.slice(0,-n)}.${c.slice(-n)}`)}negate(){const t=new re(this.toString());return t.negative=!t.negative,t}isNaN(){return this.nan}isEmpty(){return this.empty}isInvalidate(){return this.isEmpty()||this.isNaN()}lessEquals(t){return this.add(t.negate().toString()).toNumber()<=0}equals(t){return this.toString()===(t&&t.toString())}toNumber(){return this.isNaN()?NaN:Number(this.toString())}toString(t=!0){return t?this.isInvalidate()?"":te(`${this.getMark()}${this.getIntegerStr()}.${this.getDecimalStr()}`).fullStr:this.origin}}class W{constructor(t=""){if(!t&&t!==0||!String(t).trim()){this.empty=!0;return}this.origin="",this.number=void 0,this.empty=void 0,this.origin=String(t),this.number=Number(t)}negate(){return new W(-this.toNumber())}add(t){if(this.isInvalidate())return new W(t);const r=Number(t);if(isNaN(r))return this;const n=this.number+r;if(nNumber.MAX_SAFE_INTEGER)return new W(Number.MAX_SAFE_INTEGER);const a=Math.max(Pe(r),Pe(this.number));return new W(n.toFixed(a))}isNaN(){return isNaN(this.number)}isEmpty(){return this.empty}isInvalidate(){return this.isEmpty()||this.isNaN()}equals(t){return this.toNumber()===(t&&t.toNumber())}lessEquals(t){return this.add(t.negate().toString()).toNumber()<=0}toNumber(){return this.number}toString(t=!0){return t?this.isInvalidate()?"":Ft(this.number):this.origin}}zt=function(e){Fe.CLS=Re()?re:typeof e=="function"?e:W};function Ot(e,t,r=5){if(e==="")return"";const n=".",{negativeStr:a,integerStr:o,decimalStr:i}=te(e),l=`${n}${i}`,s=`${a}${o}`;if(t>=0){const c=Number(i[t]);if(c>=r&&r!==0){const d=Ye(`${o}${n}${i}`).add(`0.${bt("",t,!0)}${10-c}`);return Ot(a+d.toString(),t,0)}return t===0?s:`${s}${n}${bt(i,t,!0).slice(0,t)}`}return l===".0"?s:`${s}${l}`}const Rr=(e,{secondaryGroupSize:t=3,groupSize:r=0,groupSeparator:n=","})=>{const a=/^-\d+/.test(e);let o=a?e.slice(1):e;const i=t||r;if(r&&o.length>r){let l=o.slice(0,0-r);const s=o.slice(0-r);l=l.replace(new RegExp(`\\B(?=(\\d{${i}})+(?!\\d))`,"g"),n),o=`${l}${n}${s}`}return`${a?"-":""}${o}`},gt=e=>{const t=[];for(let r=0;r{const n=new RegExp(`\\B(?=(\\d{${t}})+(?!\\d))`,"g");return gt(gt(e).replace(n,r))},Fr=(e,t={})=>{const{fraction:r,rounding:n,prefix:a="",decimalSeparator:o=".",suffix:i=""}=t;let l=Ye(e);if(l.isNaN()||!l.toString())return e;l=Ot(l.toString(),r,n),t.zeroize===!1&&l.match(/\./)&&(l=l.replace(/\.?0+$/g,""));const s=l.toString().split(".").slice(0,2).map((c,d)=>d?Pr(c,t):Rr(c,t)).join(o);return`${a}${s}${i}`},zr=(e,t={})=>{const{prefix:r="",suffix:n="",decimalSeparator:a="."}=t;let o=e;return typeof e=="string"&&(o=e.replace(new RegExp(`^${r}(.+)${n}$`),(i,l)=>l).split(a).map(i=>i.replace(/[^\d]/g,"")).join(".")),Number(o)};let qe=function(){return typeof window>"u"?global:window},Lt=function(){return!(typeof window>"u")},Or=qe(),Lr="tcirzywvqlkjhgfbZQG_FLOWHSUBDNIMYREVKCAJxp57XP043891T62-modnaesu",_t=Lr.split("").reverse().join(""),R,P,_r=function(e){return new Uint8Array(new ArrayBuffer(e))},ht=function(e){return Or.crypto.getRandomValues(e)},jt=function(e){!R||R.lengthR.length&&(ht(R),P=0),P+=e},jr=function(e){e===void 0&&(e=21),jt(e-=0);let t="";for(let r=P-e;r{yt[t]=rn(e,t)}),yt};nn(tn);let on=Jr;function an(e){let t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}const ln=/\B([A-Z])/g,sn=an(e=>e.replace(ln,"-$1").toLowerCase()),bt=(e,t,r,n="0")=>{if(typeof e=="string"&&typeof n=="string"&&Ve(t)){let a=e.length-t;if(a>0)return r?e.substr(0,t):e.substr(a,t);{const o=[];for(a=Math.abs(a)/n.length;a>0;a--)o.push(n);const i=o.join("");return r?e+i:i+e}}};on.random;const Bt=[31,28,31,30,31,30,31,31,30,31,30,31],cn=new RegExp("^(\\d{4})(/|-)(((0)?[1-9])|(1[0-2]))((/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1])))?( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"),dn=new RegExp("^(((0)?[1-9])|(1[0-2]))(/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1]))?(/|-)?(\\d{4})( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"),un=new RegExp("^(\\d{4})-(((0)?[1-9])|(1[0-2]))-(((0)?[1-9])|([1-2][0-9])|(3[0-1]))T(((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?(Z|([+-])((0)?[0-9]|1[0-9]|20|21|22|23):?([0-5]?[0-9]))$"),j={YEAR:9999,MONTH:11,DATE:31,HOUR:23,MINUTE:59,SECOND:59,MILLISECOND:999},pn="-12:00,-11:00,-10:00,-09:30,-08:00,-07:00,-06:00,-05:00,-04:30,-04:00,-03:30,-02:00,-01:00",fn="-00:00,+00:00,+01:00,+02:00,+03:00,+03:30,+04:00,+04:30,+05:00,+05:30,+05:45,+06:00",mn="+06:30,+07:00,+08:00,+09:00,+10:00,+10:30,+11:00,+11:30,+12:00,+12:45,+13:00,+14:00",gn=[].concat(pn.split(","),fn.split(","),mn.split(",")),Ut=e=>e%400===0||e%4===0&&e%100!==0,Ze=({year:e,month:t,date:r,hours:n,minutes:a,seconds:o,milliseconds:i})=>{let l=Bt[t];if(Ut(e)&&t===1&&(l+=1),r<=l)return new Date(e,t,r,n,a,o,i)},hn=e=>{if(e.length===23){const t=Number(e[1]),r=e[3]-1,n=Number(e[9]||1),a=e[15]||0,o=e[17]||0,i=e[20]||0,l=e[22]||0;return Ze({date:n,year:t,hours:a,month:r,seconds:i,minutes:o,milliseconds:l})}},vn=e=>{if(e.length===22){const t=Number(e[12]),r=e[1]-1,n=Number(e[6]||1),a=e[14]||0,o=e[16]||0,i=e[19]||0,l=e[21]||0;return Ze({year:t,month:r,date:n,hours:a,minutes:o,seconds:i,milliseconds:l})}},yn=e=>{if(e.length!==25)return;const t=Number(e[1]),r=e[2]-1,n=Number(e[6]),a=new Date(t,r,n).getTimezoneOffset(),o=e[12]||0,i=e[14]||0,l=e[17]||0,s=e[19]||0;let c=e[20];const d=e[21],u=e[22]||0,p=e[24]||0;let f=Bt[r],g,v;if(Ut(t)&&r===1&&(f+=1),n<=f){if(c==="Z")g=o-a/60,v=i;else{if(c.includes(":")||(c=c.substr(0,3)+":"+c.substr(3)),!gn.includes(c))return;g=d==="+"?o-u-a/60:Number(o)+Number(u)-a/60,v=d==="+"?i-p:Number(i)+Number(p)}return new Date(t,r,n,g,v,l,s)}},De=[[cn,hn],[dn,vn],[un,yn]],bn=e=>{for(let t=0,r=De.length;t0)return De[t][1](n)}},wn=(e,t,r)=>{if(r)switch(r){case"yyyy":case"yy":e[0]=t;break;case"M":case"MM":e[1]=t-1;break;case"d":case"dd":e[2]=t;break;case"h":case"hh":e[3]=t;break;case"m":case"mm":e[4]=t;break;case"s":case"ss":e[5]=t;break;case"S":case"SS":case"SSS":e[6]=t;break}},xn=(e,t)=>{const r=[0,-1,0,0,0,0];if(e.length!==t.length)return r;let n=0,a=0;for(let o=0,i=e.length;oisNaN(e)||er,Sn=({year:e,month:t,date:r,hours:n,minutes:a,seconds:o,milliseconds:i})=>B(e,0,j.YEAR)||B(t,0,j.MONTH)||B(r,0,j.DATE)||B(n,0,j.HOUR)||B(a,0,j.MINUTE)||B(o,0,j.SECOND)||B(i,0,j.MILLISECOND),Tn=(e,t)=>{if(typeof t=="string"){const r=xn(e,t),n=Number(r[0]),a=Number(r[1]),o=Number(r[2]||1),i=Number(r[3]||0),l=Number(r[4]||0),s=Number(r[5]||0),c=Number(r[6]||0);return Sn({year:n,month:a,date:o,hours:i,minutes:l,seconds:s,milliseconds:c})?void 0:Ze({year:n,date:o,month:a,minutes:l,hours:i,milliseconds:c,seconds:s})}else return bn(e)},Le=(e,t,r)=>{let n;if(Ve(e)?n=new Date(e):typeof e=="string"&&(n=Tn(e,t)),r){const a=r&&Le(r)||new Date(1,1,1,0,0,0);return n&&n{if(!he(e)||!pt(t)||!pt(r))return;const n=-t*60,a=-r*60,o=e.getTime()+n*6e4;return new Date(o-a*6e4)},Cn="date,datetime,time,time-select,week,month,year,years,yearrange,daterange,monthrange,timerange,datetimerange,dates",se={Day:"day",Date:"date",Dates:"dates",Year:"year",Years:"years",YearRange:"yearrange",PanelYearNum:12,Month:"month",Week:"week",Normal:"normal",Today:"today",PreMonth:"pre-month",NextMonth:"next-month",YearI18n:"ui.datepicker.year",List:[38,40,37,39],YearObj:{38:-4,40:4,37:-1,39:1},WeekObj:{38:-1,40:1,37:-1,39:1},DayObj:{38:-7,40:7,37:-1,39:1},Aviailable:"available",Default:"default",Current:"current",InRange:"in-range",StartDate:"start-date",EndDate:"end-date",Selected:"selected",Disabled:"disabled",Range:"range",fullMonths:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),fullWeeks:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],MonhtList:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],Weeks:["sun","mon","tue","wed","thu","fri","sat"],PlacementMap:{left:"bottom-start",center:"bottom",right:"bottom-end"},TriggerTypes:Cn.split(","),DateFormats:{year:"yyyy",years:"yyyy",yearrange:"yyyy",month:"yyyy-MM",time:"HH:mm:ss",week:"yyyywWW",date:"yyyy-MM-dd",timerange:"HH:mm:ss",monthrange:"yyyy-MM",daterange:"yyyy-MM-dd",datetime:"yyyy-MM-dd HH:mm:ss",datetimerange:"yyyy-MM-dd HH:mm:ss"},Time:"time",TimeRange:"timerange",IconTime:"icon-time",IconDate:"icon-Calendar",DateRange:"daterange",DateTimeRange:"datetimerange",MonthRange:"monthrange",TimeSelect:"time-select",TimesTamp:"timestamp",DateTime:"datetime",SelectbaleRange:"selectableRange",Start:"09:00",End:"18:00",Step:"00:30",CompareOne:"-1:-1",CompareHundred:"100:100",selClass:".selected",queryClass:".tiny-picker-panel__content",disableClass:".time-select-item:not(.disabled)",defaultClass:".default",Qurtyli:"li",MappingKeyCode:{40:1,38:-1},DatePicker:"DatePicker",TimePicker:"TimePicker"},A={},Ke=["\\d\\d?","\\d{3}","\\d{4}"],I=Ke[0],Nn=Ke[1],kn=Ke[2],Q="[^\\s]+",Wt=/\[([^]*?)\]/gm,wt=()=>{},Dn={shortDate:"M/D/yy",mediumDate:"MMM d, yyyy",longDate:"MMMM d, yyyy",fullDate:"dddd, MMMM d, yyyy",default:"ddd MMM dd yyyy HH:mm:ss",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Ht=(e,t)=>{let r=[];for(let n=0,a=e.length;n(t,r,n)=>{const a=n[e].indexOf(r.charAt(0).toUpperCase()+r.substr(1).toLowerCase());~a&&(t.month=a)},M=(e,t)=>{for(e=String(e),t=t||2;e.lengthe.replace(/[|\\{()[^$+*?.-]/g,"\\$&"),Vt=/d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Gt=se.fullWeeks,Yt=se.fullMonths,$n=Ht(Yt,3),In=Ht(Gt,3),En=["th","st","nd","rd"];A.i18n={dayNames:Gt,monthNames:Yt,dayNamesShort:In,monthNamesShort:$n,amPm:["am","pm"],doFn:e=>e+En[e%10>3?0:(e-e%10!==10)*e%10]};const St={D:e=>e.getDay(),DD:e=>M(e.getDay()),Do:(e,t)=>t.doFn(e.getDate()),d:e=>e.getDate(),dd:e=>M(e.getDate()),ddd:(e,t)=>t.dayNamesShort[e.getDay()],dddd:(e,t)=>t.dayNames[e.getDay()],M:e=>e.getMonth()+1,MM:e=>M(e.getMonth()+1),MMM:(e,t)=>t.monthNamesShort[e.getMonth()],MMMM:(e,t)=>t.monthNames[e.getMonth()],yy:e=>M(String(e.getFullYear()),4).substr(2),yyyy:e=>M(e.getFullYear(),4),h:e=>e.getHours()%12||12,hh:e=>M(e.getHours()%12||12),H:e=>e.getHours(),HH:e=>M(e.getHours()),m:e=>e.getMinutes(),mm:e=>M(e.getMinutes()),s:e=>e.getSeconds(),ss:e=>M(e.getSeconds()),S:e=>Math.round(e.getMilliseconds()/100),SS:e=>M(Math.round(e.getMilliseconds()/10),2),SSS:e=>M(e.getMilliseconds(),3),a:(e,t)=>e.getHours()<12?t.amPm[0]:t.amPm[1],A:(e,t)=>e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase(),ZZ:e=>{const t=e.getTimezoneOffset();return(t>0?"-":"+")+M(Math.floor(Math.abs(t)/60)*100+Math.abs(t)%60,4)}},F={d:[I,(e,t)=>{e.day=t}],Do:[I+Q,(e,t)=>{e.day=parseInt(t,10)}],M:[I,(e,t)=>{e.month=t-1}],yy:[I,(e,t)=>{const n=Number(String(new Date().getFullYear()).substr(0,2));e.year=String(t>68?n-1:n)+t}],h:[I,(e,t)=>{e.hour=t}],m:[I,(e,t)=>{e.minute=t}],s:[I,(e,t)=>{e.second=t}],yyyy:[kn,(e,t)=>{e.year=t}],S:["\\d",(e,t)=>{e.millisecond=t*100}],SS:["\\d{2}",(e,t)=>{e.millisecond=t*10}],SSS:[Nn,(e,t)=>{e.millisecond=t}],D:[I,wt],ddd:[Q,wt],MMM:[Q,xt("monthNamesShort")],MMMM:[Q,xt("monthNames")],a:[Q,(e,t,r)=>{const n=t.toLowerCase();n===r.amPm[0]?e.isPm=!1:n===r.amPm[1]&&(e.isPm=!0)}],ZZ:["[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z",(e,t)=>{let r=String(t).match(/([+-]|\d\d)/gi),n;r&&(n=Number(r[1]*60)+parseInt(r[2],10),e.timezoneOffset=r[0]==="+"?n:-n)}]},Rn=["A","DD","dd","mm","hh","MM","ss","hh","H","HH"];A.masks=Dn;F.dddd=F.ddd;Rn.forEach(e=>{e==="MM"?F[e]=F[e.substr(0,1)]:F[e]=F[e.substr(0,1).toLowerCase()]});A.format=(e,t,r)=>{const n=r||A.i18n;if(typeof e=="number"&&(e=new Date(e)),!he(e)||isNaN(e.getTime()))throw new Error("Invalid Date in fecha.format");t=A.masks[t]||t||A.masks.default;let a=[];return t=t.replace(Wt,(o,i)=>(a.push(i),"@@@")),t=t.replace(Vt,o=>o in St?St[o](e,n):o.slice(1,o.length-1)),t.replace(/@@@/g,()=>a.shift())};const Pn=(e,t)=>{let r=[],n=An(e).replace(Vt,a=>{if(F[a]){const o=F[a];return t.push(o[1]),"("+o[0]+")"}return a});return n=n.replace(/@@@/g,()=>r.shift()),n},Fn=e=>{let t;const r=new Date;if(Z(e.timezoneOffset)){const{year:n,month:a,day:o,hour:i,minute:l,second:s,millisecond:c}=e;t=new Date(n||r.getFullYear(),a||0,o||1,i||0,l||0,s||0,c||0)}else{e.minute=Number(e.minute||0)-Number(e.timezoneOffset);const{year:n,month:a,day:o,hour:i,minute:l,second:s,millisecond:c}=e;t=new Date(Date.UTC(n||r.getFullYear(),a||0,o||1,i||0,l||0,s||0,c||0))}return t};A.parse=(e,t,r)=>{const n=r||A.i18n;if(typeof t!="string")throw new TypeError("Invalid format in fecha.parse");if(t=A.masks[t]||t,e.length>1e3)return null;let a={},o=[];t=t.replace(Wt,(s,c)=>"@@@");const i=Pn(t,o),l=e.match(new RegExp(i,"i"));if(!l)return null;for(let s=1,c=l.length;s({dayNamesShort:Tt.map(t=>e(`ui.datepicker.weeks.${t}`)),dayNames:Tt.map(t=>e(`ui.datepicker.weeks.${t}`)),monthNamesShort:Mt.map(t=>e(`ui.datepicker.months.${t}`)),monthNames:Mt.map((t,r)=>e(`ui.datepicker.month${r+1}`)),amPm:["am","pm"]}),_n=function(e){return!(Z(e)||isNaN(new Date(e).getTime())||Array.isArray(e))},jn=e=>_n(e)?new Date(e):null,Bn=(e,t,r)=>(e=jn(e),e?zn.format(e,t||On,Ln(r)):"");function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),n=1;n=-12&&t<=12?t:r};function Yn(e){return function(t){var r=Y({},Gn(t),{NumberFormat:Vn(t.NumberFormat),DbTimezone:Ae(t.DbTimezone),Timezone:Ae(t.Timezone)}),n={getFormatConfig:function(){return r},setFormatConfig:function(o){Object.assign(r,o)},getNumberFormat:function(){return r.NumberFormat},getDateFormat:function(){return{DateTimeFormat:r.DateTimeFormat,TimeFormat:r.TimeFormat,Timezone:r.Timezone,DateFormat:r.DateFormat,DbTimezone:r.DbTimezone}},formatDate:function(o,i){if(Z(o))return o;var l=he(o)?o:Le(o),s=r.DbTimezone,c=o.match&&o.match(er),d=i===!1||arguments[2]===!1;return c&&(s=Ae(o),l=Le(o.replace("T"," ").slice(0,-5))),d||(l=this.getDateWithNewTimezone(l,s,r.Timezone)),he(l)?Bn(l,i||r.DateFormat,e):null},formatNumber:function(o,i){return Fr(o,Y({},r.NumberFormat,i))},recoverNumber:function(o,i){return zr(o,Y({},r.NumberFormat,i))},getDateWithNewTimezone:function(o,i,l){return i=i===0?i:i||r.DbTimezone,l=l===0?l:l||r.Timezone,Mn(o,i,l)}};return n}}z.use;var _e=z.t;z.i18n;z.initI18n;z.extend;z.zhCN;z.enUS;var qn=z.language,Zn=Yn(_e);Y({},Qt,{language:qn,globalization:Zn});function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"&&Object.defineProperty(t,"$emitter",{get:function(){return r}})},oo=function(t){var r=function(a,o,i,l){var s=a.subTree&&a.subTree.children||a.children;Array.isArray(s)&&s.forEach(function(c){var d=c.type&&c.type.componentName,u=c.component;d===o?(u.emit(i,l),u.$emitter&&u.$emitter.emit(i,l)):r(c,o,i,l)})};return{dispatch:function(a,o,i){for(var l=t.parent||t.root,s=l.type&&l.type.componentName;l&&(!s||s!==a);)l=l.parent,l&&(s=l.type&&l.type.componentName);if(l){var c,d;(c=l).emit.apply(c,[o].concat(i)),l.$emitter&&(d=l.$emitter).emit.apply(d,[o].concat(i))}},broadcast:function(a,o,i){r(t,a,o,i)}}},ye=function(t){if(t&&t.parent)return t.parent.type.name==="AsyncComponentWrapper"&&t.parent.parent?t.parent.parent:t.parent},ao=function(t){return function(r){var n=ye(t),a=0,o=function(l){return{level:a,vm:V({},l),el:l.vnode.el,options:l.type}};if(typeof r!="function")return n?o(n):{};for(a++;n&&!r(o(n));)n=ye(n),a++}},io=function(t){return function(r){if(typeof r!="function")return or(t.subTree);var n=1,a=function o(i){if(i){var l=i.children||i.dynamicChildren,s=n++;if(Array.isArray(l)){if(l.some(function(c){return c.component&&r({level:s,vm:V({},c.component),el:c.el,options:c.type,isLevel1:!0})}))return;l.forEach(function(c){return o(c)})}}};a(t.subTree)}},lo=/^on[A-Z]/,so=function(t){var r={},n={};for(var a in t){var o=t[a];if(lo.test(a)&&typeof o=="function"){n[sn(a.substr(2))]=o;continue}r[a]=o}return{$attrs:r,$listeners:n}},or=function(t){var r=[];if(r.refs={},t){var n=t.dynamicChildren||t.children;Array.isArray(n)?n.forEach(function(a){if(a.component){var o=V({},a.component);r.push(o),a.props.ref&&(r.refs[a.props.ref]=o)}}):t.component&&r.push(V({},t.component))}return r},$e=function(t,r,n,a){var o=function(s){if(typeof a=="function"&&a(s))return 1;Object.defineProperty(t,s,{configurable:!0,enumerable:!0,get:function(){return r[n][s]},set:function(d){return r[n][s]=d}})};for(var i in r[n])o(i);return t},Ct=function(t){return t.indexOf("_")===0},ar=function(t,r){return $e(t,r,"setupState",null),$e(t,r,"props",Ct),$e(t,r,"ctx",Ct),t},V=function e(t,r,n){n===void 0&&(n=null);var a=so(r.attrs),o=a.$attrs,i=a.$listeners,l=r.$emitter;l||(nr(r),l=r.$emitter);var s=function(){for(var u=arguments.length,p=new Array(u),f=0;f"u"&&ye(o),w=y?V({},y):o.parent?V({},o.parent):null,ce=function(C){var K,J=C.name,_=C.value,pe=y?y.ctx:o==null||(K=o.parent)==null?void 0:K.ctx;pe[J]=_,w[J]=_},de=function(C){Object.defineProperties(m,C),Object.defineProperties(o==null?void 0:o.ctx,C)},ue=function(C){w&&Object.defineProperties(w,C)};return hr(function(){return ar(m,o)}),vr(function(){return co(o,T)}),{framework:"vue3",vm:m,emit:x,emitter:tr,route:s,router:c,dispatch:p,broadcast:f,parentHandler:g,childrenHandler:v,i18n:d,refs:T,slots:o==null?void 0:o.slots,scopedSlots:o==null?void 0:o.slots,attrs:t.attrs,parent:w,nextTick:$t,constants:o==null?void 0:o.props._constants,mode:r,isPCMode:r==="pc",isMobileMode:r==="mobile",service:i==null?void 0:i.$service,getService:function(){return i==null?void 0:i.$getService(m)},setParentAttribute:ce,defineInstanceProperties:de,defineParentInstanceProperties:ue}},et=ur,ir=function(t){var r=[];return Object.keys(t).forEach(function(n){return t[n]&&r.push(n)}),r.join(" ")},po=function(t){var r=[];return t.forEach(function(n){typeof n=="string"?r.push(n):typeof n=="object"&&r.push(ir(n))}),r.join(" ")},fo=function(t){if(!t||Array.isArray(t)&&!t.length)return"";var r=[];return t.forEach(function(n){n&&(typeof n=="string"?r.push(n):Array.isArray(n)?r.push(po(n)):typeof n=="object"&&r.push(ir(n)))}),r.join(" ")};function mo(){for(var e=0,t,r,n="";ee&&(t=0,n=r,r=new Map)}return{get:function(i){var l=r.get(i);if(l!==void 0)return l;if((l=n.get(i))!==void 0)return a(i,l),l},set:function(i,l){r.has(i)?r.set(i,l):a(i,l)}}}var tt="-";function ho(e){var t=yo(e);function r(a){var o=a.split(tt);return o[0]===""&&o.length!==1&&o.shift(),sr(o,t)||vo(a)}function n(a){return e.conflictingClassGroups[a]||[]}return{getClassGroupId:r,getConflictingClassGroupIds:n}}function sr(e,t){var r;if(e.length===0)return t.classGroupId;var n=e[0],a=t.nextPart.get(n),o=a?sr(e.slice(1),a):void 0;if(o)return o;if(t.validators.length!==0){var i=e.join(tt);return(r=t.validators.find(function(l){var s=l.validator;return s(i)}))==null?void 0:r.classGroupId}}var Nt=/^\[(.+)\]$/;function vo(e){if(Nt.test(e)){var t=Nt.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function yo(e){var t=e.theme,r=e.prefix,n={nextPart:new Map,validators:[]},a=wo(Object.entries(e.classGroups),r);return a.forEach(function(o){var i=o[0],l=o[1];Be(l,n,i,t)}),n}function Be(e,t,r,n){e.forEach(function(a){if(typeof a=="string"){var o=a===""?t:kt(t,a);o.classGroupId=r;return}if(typeof a=="function"){if(bo(a)){Be(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(function(i){var l=i[0],s=i[1];Be(s,kt(t,l),r,n)})})}function kt(e,t){var r=e;return t.split(tt).forEach(function(n){r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function bo(e){return e.isThemeGetter}function wo(e,t){return t?e.map(function(r){var n=r[0],a=r[1],o=a.map(function(i){return typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(function(l){var s=l[0],c=l[1];return[t+s,c]})):i});return[n,o]}):e}var cr="!";function xo(e){var t=e.separator||":";return function(n){for(var a=0,o=[],i=0,l=0;l{let n=!1;if(typeof e=="function"&&typeof t=="string"){const a=document.createEvent("HTMLEvents");a.initEvent(t,!1,!0),a.preventDefault=()=>{n=!0},r.unshift(a),r.unshift(t),e.apply(null,r)}return!n},Yo=({api:e,props:t,refs:r,state:n})=>()=>{n.leftLength>=0||(n.leftLength=n.leftLength+(n.blockWidth+n.blockMargin)*t.wheelBlocks,r.insider.style.left=n.leftLength+"px",e.changeState())},qo=({api:e,props:t,refs:r,state:n})=>()=>{n.blockWrapper({item:r,index:n})=>{Go(e,"before-click")&&(t.currentIndex=n,e("click",r,n))},Ko=({state:e})=>()=>{const t=e.blockWrapper;e.showLeft=!(parseInt(e.leftLength,10)>=0),e.showRight=t<=Math.abs(e.leftLength)+e.wrapperWidth},Jo=({api:e,state:t})=>r=>{r.wheelDelta>=0?t.leftLength<0&&e.leftClick():t.blockWrapper>Math.abs(t.leftLength)+t.wrapperWidth&&e.rightClick()},Xo=({props:e,state:t,refs:r})=>()=>{t.wrapperWidth=r.wrapper.offsetWidth,t.blockWidth=parseInt((1-(e.initBlocks-1)*.02)/e.initBlocks*t.wrapperWidth,10),t.blockMargin=parseInt(t.wrapperWidth*.02,10),t.blockWrapper=e.modelValue.length*t.blockWidth+(e.modelValue.length-1)*t.blockMargin},Qo=["state","mouseEvent","rightClick","leftClick","blockClick"],ea=(e,{onMounted:t,reactive:r},{refs:n,parent:a,emit:o})=>{const i={},l=r({leftLength:0,blockWidth:0,blockMargin:0,showLeft:!1,showRight:!1,blockWrapper:0,wrapperWidth:0,currentIndex:-1,offsetWidth:0});return Object.assign(i,{state:l,blockClick:Zo({emit:o,state:l}),changeState:Ko({props:e,state:l}),changeSize:Xo({props:e,refs:n,state:l}),leftClick:Yo({api:i,props:e,refs:n,state:l}),mouseEvent:Jo({api:i,props:e,refs:n,state:l}),rightClick:qo({api:i,parent:a,props:e,refs:n,state:l})}),t(i.changeSize),i};var ta={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","xml:space":"preserve"},ra=D("path",{class:"chevron-left_svg__st0",d:"M17 21c-.2 0-.5-.1-.6-.2l-9.9-8c-.4-.2-.5-.5-.5-.8 0-.3.1-.6.4-.8l9.9-7.9c.4-.4 1.1-.3 1.4.2.4.4.3 1.1-.2 1.4L8.7 12l8.9 7.2c.4.4.5 1 .2 1.4-.3.3-.5.4-.8.4z"},null,-1),na=[ra];function oa(e,t){return H(),ae("svg",ta,na)}var aa={render:oa},ia=function(){return nt({name:"IconChevronLeft",component:aa})()},la={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","xml:space":"preserve"},sa=D("path",{class:"chevron-right_svg__st0",d:"M7 21c.2 0 .5-.1.6-.2l9.9-8c.2-.2.4-.5.4-.8 0-.3-.1-.6-.4-.8L7.6 3.3c-.4-.4-1.1-.3-1.4.2-.4.4-.3 1.1.2 1.4l8.9 7.2-8.9 7.2c-.4.4-.5 1-.2 1.4.2.2.5.3.8.3z"},null,-1),ca=[sa];function da(e,t){return H(),ae("svg",la,ca)}var ua={render:da},pa=function(){return nt({name:"IconChevronRight",component:ua})()},fa={viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},ma=D("path",{d:"M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 1a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z"},null,-1),ga=D("path",{d:"M3.757 12.243a6 6 0 1 0 8.486-8.486 6 6 0 0 0-8.486 8.486Z",fill:"#FFF"},null,-1),ha=[ma,ga];function va(e,t){return H(),ae("svg",fa,ha)}var ya={render:va},ba=function(){return nt({name:"IconRadio",component:ya})()};function wa(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=xa(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xa(e,t){if(e){if(typeof e=="string")return At(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return At(e,t)}}function At(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r',5),lt=[st],_1=o({name:"EyeOffOutline",render:function(s,l){return n(),e("svg",rt,lt)}}),it={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ct=t("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),ht=t("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),dt=[ct,ht],k1=o({name:"EyeOutline",render:function(s,l){return n(),e("svg",it,dt)}}),at={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},wt=t("path",{d:"M112 320c0-93 124-165 96-272c66 0 192 96 192 272a144 144 0 0 1-288 0z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),ut=t("path",{d:"M320 368c0 57.71-32 80-64 80s-64-22.29-64-80s40-86 32-128c42 0 96 70.29 96 128z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),_t=[wt,ut],p1=o({name:"FlameOutline",render:function(s,l){return n(),e("svg",at,_t)}}),kt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},pt=t("path",{d:"M256 448a32 32 0 0 1-18-5.57c-78.59-53.35-112.62-89.93-131.39-112.8c-40-48.75-59.15-98.8-58.61-153C48.63 114.52 98.46 64 159.08 64c44.08 0 74.61 24.83 92.39 45.51a6 6 0 0 0 9.06 0C278.31 88.81 308.84 64 352.92 64c60.62 0 110.45 50.52 111.08 112.64c.54 54.21-18.63 104.26-58.61 153c-18.77 22.87-52.8 59.45-131.39 112.8a32 32 0 0 1-18 5.56z",fill:"currentColor"},null,-1),xt=[pt],x1=o({name:"Heart",render:function(s,l){return n(),e("svg",kt,xt)}}),mt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},gt=t("path",{d:"M352.92 80C288 80 256 144 256 144s-32-64-96.92-64c-52.76 0-94.54 44.14-95.08 96.81c-1.1 109.33 86.73 187.08 183 252.42a16 16 0 0 0 18 0c96.26-65.34 184.09-143.09 183-252.42c-.54-52.67-42.32-96.81-95.08-96.81z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),vt=[gt],m1=o({name:"HeartOutline",render:function(s,l){return n(),e("svg",mt,vt)}}),$t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ft=t("path",{d:"M80 212v236a16 16 0 0 0 16 16h96V328a24 24 0 0 1 24-24h80a24 24 0 0 1 24 24v136h96a16 16 0 0 0 16-16V212",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ct=t("path",{d:"M480 256L266.89 52c-5-5.28-16.69-5.34-21.78 0L32 256",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Mt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M400 179V64h-48v69"},null,-1),Ot=[ft,Ct,Mt],g1=o({name:"HomeOutline",render:function(s,l){return n(),e("svg",$t,Ot)}}),jt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},zt=t("rect",{x:"48",y:"80",width:"416",height:"352",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),Bt=t("circle",{cx:"336",cy:"176",r:"32",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Lt=t("path",{d:"M304 335.79l-90.66-90.49a32 32 0 0 0-43.87-1.3L48 352",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ht=t("path",{d:"M224 432l123.34-123.34a32 32 0 0 1 43.11-2L464 368",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Vt=[zt,Bt,Lt,Ht],v1=o({name:"ImageOutline",render:function(s,l){return n(),e("svg",jt,Vt)}}),At={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},yt=t("path",{d:"M321.89 171.42C233 114 141 155.22 56 65.22c-19.8-21-8.3 235.5 98.1 332.7c77.79 71 197.9 63.08 238.4-5.92s18.28-163.17-70.61-220.58z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),bt=t("path",{d:"M173 253c86 81 175 129 292 147",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Pt=[yt,bt],$1=o({name:"LeafOutline",render:function(s,l){return n(),e("svg",At,Pt)}}),St={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Tt=t("path",{d:"M208 352h-64a96 96 0 0 1 0-192h64",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36"},null,-1),Dt=t("path",{d:"M304 160h64a96 96 0 0 1 0 192h-64",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36"},null,-1),Et=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36",d:"M163.29 256h187.42"},null,-1),Rt=[Tt,Dt,Et],f1=o({name:"LinkOutline",render:function(s,l){return n(),e("svg",St,Rt)}}),Ft={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},qt=t("path",{d:"M336 208v-95a80 80 0 0 0-160 0v95",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),It=t("rect",{x:"96",y:"208",width:"320",height:"272",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Nt=[qt,It],C1=o({name:"LockClosedOutline",render:function(s,l){return n(),e("svg",Ft,Nt)}}),Ut={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Wt=t("path",{d:"M336 112a80 80 0 0 0-160 0v96",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Gt=t("rect",{x:"96",y:"208",width:"320",height:"272",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Jt=[Wt,Gt],M1=o({name:"LockOpenOutline",render:function(s,l){return n(),e("svg",Ut,Jt)}}),Kt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Qt=t("path",{d:"M304 336v40a40 40 0 0 1-40 40H104a40 40 0 0 1-40-40V136a40 40 0 0 1 40-40h152c22.09 0 48 17.91 48 40v40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Xt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 336l80-80l-80-80"},null,-1),Yt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 256h256"},null,-1),Zt=[Qt,Xt,Yt],O1=o({name:"LogOutOutline",render:function(s,l){return n(),e("svg",Kt,Zt)}}),to={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},oo=t("path",{d:"M102.41 32C62.38 32 32 64.12 32 103.78v304.45C32 447.86 64.38 480 104.41 480h303.2c40 0 72.39-32.14 72.39-71.77v-3.11c-1.35-.56-115.47-48.57-174.5-76.7c-39.82 48.57-91.18 78-144.5 78c-90.18 0-120.8-78.22-78.1-129.72c9.31-11.22 25.15-21.94 49.73-28c38.45-9.36 99.64 5.85 157 24.61a309.41 309.41 0 0 0 25.46-61.67H138.34V194h91.13v-31.83H119.09v-17.75h110.38V99s0-7.65 7.82-7.65h44.55v53H391v17.75H281.84V194h89.08a359.41 359.41 0 0 1-37.72 94.43c27 9.69 49.31 18.88 67.39 24.89c60.32 20 77.23 22.45 79.41 22.7V103.78C480 64.12 447.6 32 407.61 32h-305.2zM152 274.73q-5.81.06-11.67.63c-11.3 1.13-32.5 6.07-44.09 16.23c-34.74 30-13.94 84.93 56.37 84.93c40.87 0 81.71-25.9 113.79-67.37c-41.36-20-77-34.85-114.4-34.42z",fill:"currentColor"},null,-1),no=[oo],j1=o({name:"LogoAlipay",render:function(s,l){return n(),e("svg",to,no)}}),eo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ro=i('',6),so=[ro],z1=o({name:"MegaphoneOutline",render:function(s,l){return n(),e("svg",eo,so)}}),lo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},io=t("path",{d:"M53.12 199.94l400-151.39a8 8 0 0 1 10.33 10.33l-151.39 400a8 8 0 0 1-15-.34l-67.4-166.09a16 16 0 0 0-10.11-10.11L53.46 215a8 8 0 0 1-.34-15.06z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),co=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M460 52L227 285"},null,-1),ho=[io,co],B1=o({name:"PaperPlaneOutline",render:function(s,l){return n(),e("svg",lo,ho)}}),ao={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},wo=t("path",{d:"M402 168c-2.93 40.67-33.1 72-66 72s-63.12-31.32-66-72c-3-42.31 26.37-72 66-72s69 30.46 66 72z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),uo=t("path",{d:"M336 304c-65.17 0-127.84 32.37-143.54 95.41c-2.08 8.34 3.15 16.59 11.72 16.59h263.65c8.57 0 13.77-8.25 11.72-16.59C463.85 335.36 401.18 304 336 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),_o=t("path",{d:"M200 185.94c-2.34 32.48-26.72 58.06-53 58.06s-50.7-25.57-53-58.06C91.61 152.15 115.34 128 147 128s55.39 24.77 53 57.94z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),ko=t("path",{d:"M206 306c-18.05-8.27-37.93-11.45-59-11.45c-52 0-102.1 25.85-114.65 76.2c-1.65 6.66 2.53 13.25 9.37 13.25H154",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),po=[wo,uo,_o,ko],L1=o({name:"PeopleOutline",render:function(s,l){return n(),e("svg",ao,po)}}),xo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},mo=t("path",{d:"M376 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),go=t("path",{d:"M288 304c-87 0-175.3 48-191.64 138.6c-2 10.92 4.21 21.4 15.65 21.4H464c11.44 0 17.62-10.48 15.65-21.4C463.3 352 375 304 288 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),vo=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M88 176v112"},null,-1),$o=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 232H32"},null,-1),fo=[mo,go,vo,$o],H1=o({name:"PersonAddOutline",render:function(s,l){return n(),e("svg",xo,fo)}}),Co={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Mo=t("path",{d:"M344 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Oo=t("path",{d:"M256 304c-87 0-175.3 48-191.64 138.6C62.39 453.52 68.57 464 80 464h352c11.44 0 17.62-10.48 15.65-21.4C431.3 352 343 304 256 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),jo=[Mo,Oo],V1=o({name:"PersonOutline",render:function(s,l){return n(),e("svg",Co,jo)}}),zo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Bo=t("path",{d:"M376 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Lo=t("path",{d:"M288 304c-87 0-175.3 48-191.64 138.6c-2 10.92 4.21 21.4 15.65 21.4H464c11.44 0 17.62-10.48 15.65-21.4C463.3 352 375 304 288 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Ho=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 232H32"},null,-1),Vo=[Bo,Lo,Ho],A1=o({name:"PersonRemoveOutline",render:function(s,l){return n(),e("svg",zo,Vo)}}),Ao={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},yo=t("path",{d:"M336 336h40a40 40 0 0 0 40-40V88a40 40 0 0 0-40-40H136a40 40 0 0 0-40 40v208a40 40 0 0 0 40 40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),bo=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 240l80-80l80 80"},null,-1),Po=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 464V176"},null,-1),So=[yo,bo,Po],y1=o({name:"PushOutline",render:function(s,l){return n(),e("svg",Ao,So)}}),To={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Do=t("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8a124.95 124.95 0 0 1-124.8-124.8z",fill:"currentColor"},null,-1),Eo=[Do],b1=o({name:"Search",render:function(s,l){return n(),e("svg",To,Eo)}}),Ro={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Fo=t("path",{d:"M262.29 192.31a64 64 0 1 0 57.4 57.4a64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22a155.3 155.3 0 0 1-21.46-12.57a16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22a155.3 155.3 0 0 1 21.46 12.57a16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),qo=[Fo],P1=o({name:"SettingsOutline",render:function(s,l){return n(),e("svg",Ro,qo)}}),Io={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},No=t("path",{d:"M336 192h40a40 40 0 0 1 40 40v192a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V232a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Uo=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 128l-80-80l-80 80"},null,-1),Wo=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 321V48"},null,-1),Go=[No,Uo,Wo],S1=o({name:"ShareOutline",render:function(s,l){return n(),e("svg",Io,Go)}}),Jo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ko=i('',5),Qo=[Ko],T1=o({name:"ShareSocialOutline",render:function(s,l){return n(),e("svg",Jo,Qo)}}),Xo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Yo=i('',6),Zo=[Yo],D1=o({name:"TrashOutline",render:function(s,l){return n(),e("svg",Xo,Zo)}}),tn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},on=t("path",{d:"M374.79 308.78L457.5 367a16 16 0 0 0 22.5-14.62V159.62A16 16 0 0 0 457.5 145l-82.71 58.22A16 16 0 0 0 368 216.3v79.4a16 16 0 0 0 6.79 13.08z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),nn=t("path",{d:"M268 384H84a52.15 52.15 0 0 1-52-52V180a52.15 52.15 0 0 1 52-52h184.48A51.68 51.68 0 0 1 320 179.52V332a52.15 52.15 0 0 1-52 52z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),en=[on,nn],E1=o({name:"VideocamOutline",render:function(s,l){return n(),e("svg",tn,en)}}),rn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},sn=i('',5),ln=[sn],R1=o({name:"WalkOutline",render:function(s,l){return n(),e("svg",rn,ln)}}),cn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},hn=t("rect",{x:"48",y:"144",width:"416",height:"288",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),dn=t("path",{d:"M411.36 144v-30A50 50 0 0 0 352 64.9L88.64 109.85A50 50 0 0 0 48 159v49",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),an=t("path",{d:"M368 320a32 32 0 1 1 32-32a32 32 0 0 1-32 32z",fill:"currentColor"},null,-1),wn=[hn,dn,an],F1=o({name:"WalletOutline",render:function(s,l){return n(),e("svg",cn,wn)}}),un={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},_n=t("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M9 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-3"}),t("path",{d:"M9 15h3l8.5-8.5a1.5 1.5 0 0 0-3-3L9 12v3"}),t("path",{d:"M16 5l3 3"})],-1),kn=[_n],q1=o({name:"Edit",render:function(s,l){return n(),e("svg",un,kn)}}),pn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},xn=i('',1),mn=[xn],I1=o({name:"Hash",render:function(s,l){return n(),e("svg",pn,mn)}}),gn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},vn=i('',1),$n=[vn],N1=o({name:"Trash",render:function(s,l){return n(),e("svg",gn,$n)}}),fn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Cn=t("path",{d:"M14.71 6.71a.996.996 0 0 0-1.41 0L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59a.996.996 0 1 0 1.41-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41z",fill:"currentColor"},null,-1),Mn=[Cn],U1=o({name:"ChevronLeftRound",render:function(s,l){return n(),e("svg",fn,Mn)}}),On={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},jn=t("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1),zn=[jn],W1=o({name:"DarkModeOutlined",render:function(s,l){return n(),e("svg",On,zn)}}),Bn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ln=t("path",{d:"M2 17c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1zm0-5c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1zm0-5c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1z",fill:"currentColor"},null,-1),Hn=[Ln],G1=o({name:"DehazeRound",render:function(s,l){return n(),e("svg",Bn,Hn)}}),Vn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},An=t("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3s-3-1.35-3-3s1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5s5-2.24 5-5s-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 0 0-1.41 0a.996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 0 0-1.41 0a.996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 0 0 0-1.41a.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 0 0 0-1.41a.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"},null,-1),yn=[An],J1=o({name:"LightModeOutlined",render:function(s,l){return n(),e("svg",Vn,yn)}}),bn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Pn=t("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1),Sn=[Pn],K1=o({name:"MoreHorizFilled",render:function(s,l){return n(),e("svg",bn,Sn)}}),Tn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Dn=t("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1),En=[Dn],Q1=o({name:"MoreVertOutlined",render:function(s,l){return n(),e("svg",Tn,En)}}),Rn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fn=t("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57l-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h4v12h-4z",fill:"currentColor"},null,-1),qn=[Fn],X1=o({name:"ThumbDownOutlined",render:function(s,l){return n(),e("svg",Rn,qn)}}),In={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Nn=t("path",{opacity:".3",d:"M3 12v2h9l-1.34 5.34L15 15V5H6z",fill:"currentColor"},null,-1),Un=t("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57l-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h4v12h-4z",fill:"currentColor"},null,-1),Wn=[Nn,Un],Y1=o({name:"ThumbDownTwotone",render:function(s,l){return n(),e("svg",In,Wn)}}),Gn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Jn=t("path",{d:"M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57l.03-.32c0-.41-.17-.79-.44-1.06L14.17 1L7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h4v12H1z",fill:"currentColor"},null,-1),Kn=[Jn],Z1=o({name:"ThumbUpOutlined",render:function(s,l){return n(),e("svg",Gn,Kn)}}),Qn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Xn=t("path",{opacity:".3",d:"M21 12v-2h-9l1.34-5.34L9 9v10h9z",fill:"currentColor"},null,-1),Yn=t("path",{d:"M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57l.03-.32c0-.41-.17-.79-.44-1.06L14.17 1L7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h4v12H1z",fill:"currentColor"},null,-1),Zn=[Xn,Yn],te=o({name:"ThumbUpTwotone",render:function(s,l){return n(),e("svg",Qn,Zn)}});export{W1 as $,o1 as A,s1 as B,i1 as C,A1 as D,k1 as E,p1 as F,H1 as G,g1 as H,v1 as I,S1 as J,h1 as K,$1 as L,z1 as M,d1 as N,c1 as O,L1 as P,f1 as Q,a1 as R,b1 as S,N1 as T,j1 as U,E1 as V,F1 as W,q1 as X,G1 as Y,U1 as Z,J1 as _,P1 as a,I1 as b,O1 as c,w1 as d,Z1 as e,te as f,X1 as g,Y1 as h,K1 as i,m1 as j,x1 as k,l1 as l,r1 as m,e1 as n,T1 as o,D1 as p,C1 as q,M1 as r,y1 as s,_1 as t,V1 as u,Q1 as v,B1 as w,u1 as x,R1 as y,n1 as z}; diff --git a/web/dist/assets/@vicons-f0266f88.js b/web/dist/assets/@vicons-f0266f88.js new file mode 100644 index 00000000..15be166c --- /dev/null +++ b/web/dist/assets/@vicons-f0266f88.js @@ -0,0 +1 @@ +import{d as o,e as n,f as e,j as t,z as i}from"./@vue-a481fc63.js";const c={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},h=t("path",{d:"M320 254.27c-4.5 51-40.12 80-80.55 80s-67.34-35.82-63.45-80s37.12-80 77.55-80s70.33 36 66.45 80z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),d=t("path",{d:"M319.77 415.77c-28.56 12-47.28 14.5-79.28 14.5c-97.2 0-169-78.8-160.49-176s94.31-176 191.51-176C381 78.27 441.19 150 432.73 246c-6.31 71.67-52.11 92.32-76.09 88.07c-22.56-4-41.18-24.42-37.74-63.5l8.48-96.25",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),a=[h,d],B1=o({name:"AtOutline",render:function(s,l){return n(),e("svg",c,a)}}),w={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},u=t("path",{d:"M216.08 192v143.85a40.08 40.08 0 0 0 80.15 0l.13-188.55a67.94 67.94 0 1 0-135.87 0v189.82a95.51 95.51 0 1 0 191 0V159.74",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),k=[u],L1=o({name:"AttachOutline",render:function(s,l){return n(),e("svg",w,k)}}),_={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},p=t("circle",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",cx:"256",cy:"56",r:"40"},null,-1),x=t("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M199.3 295.62h0l-30.4 172.2a24 24 0 0 0 19.5 27.8a23.76 23.76 0 0 0 27.6-19.5l21-119.9v.2s5.2-32.5 17.5-32.5h3.1c12.5 0 17.5 32.5 17.5 32.5v-.1l21 119.9a23.92 23.92 0 1 0 47.1-8.4l-30.4-172.2l-4.9-29.7c-2.9-18.1-4.2-47.6.5-59.7c4-10.4 14.13-14.2 23.2-14.2H424a24 24 0 0 0 0-48H88a24 24 0 0 0 0 48h92.5c9.23 0 19.2 3.8 23.2 14.2c4.7 12.1 3.4 41.6.5 59.7z"},null,-1),g=[p,x],H1=o({name:"BodyOutline",render:function(s,l){return n(),e("svg",_,g)}}),m={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},v=t("path",{d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16z",fill:"currentColor"},null,-1),$=[v],V1=o({name:"Bookmark",render:function(s,l){return n(),e("svg",m,$)}}),f={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},C=t("path",{d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),M=[C],y1=o({name:"BookmarkOutline",render:function(s,l){return n(),e("svg",f,M)}}),j={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},O=t("path",{d:"M128 80V64a48.14 48.14 0 0 1 48-48h224a48.14 48.14 0 0 1 48 48v368l-80-64",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),z=t("path",{d:"M320 96H112a48.14 48.14 0 0 0-48 48v352l152-128l152 128V144a48.14 48.14 0 0 0-48-48z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),B=[O,z],A1=o({name:"BookmarksOutline",render:function(s,l){return n(),e("svg",j,B)}}),L={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},H=t("path",{d:"M408 64H104a56.16 56.16 0 0 0-56 56v192a56.16 56.16 0 0 0 56 56h40v80l93.72-78.14a8 8 0 0 1 5.13-1.86H408a56.16 56.16 0 0 0 56-56V120a56.16 56.16 0 0 0-56-56z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),V=[H],b1=o({name:"ChatboxOutline",render:function(s,l){return n(),e("svg",L,V)}}),y={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},A=t("path",{d:"M87.48 380c1.2-4.38-1.43-10.47-3.94-14.86a42.63 42.63 0 0 0-2.54-3.8a199.81 199.81 0 0 1-33-110C47.64 139.09 140.72 48 255.82 48C356.2 48 440 117.54 459.57 209.85a199 199 0 0 1 4.43 41.64c0 112.41-89.49 204.93-204.59 204.93c-18.31 0-43-4.6-56.47-8.37s-26.92-8.77-30.39-10.11a31.14 31.14 0 0 0-11.13-2.07a30.7 30.7 0 0 0-12.08 2.43L81.5 462.78a15.92 15.92 0 0 1-4.66 1.22a9.61 9.61 0 0 1-9.58-9.74a15.85 15.85 0 0 1 .6-3.29z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),b=t("circle",{cx:"160",cy:"256",r:"32",fill:"currentColor"},null,-1),S=t("circle",{cx:"256",cy:"256",r:"32",fill:"currentColor"},null,-1),T=t("circle",{cx:"352",cy:"256",r:"32",fill:"currentColor"},null,-1),D=[A,b,S,T],S1=o({name:"ChatbubbleEllipsesOutline",render:function(s,l){return n(),e("svg",y,D)}}),P={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},E=t("path",{d:"M431 320.6c-1-3.6 1.2-8.6 3.3-12.2a33.68 33.68 0 0 1 2.1-3.1A162 162 0 0 0 464 215c.3-92.2-77.5-167-173.7-167c-83.9 0-153.9 57.1-170.3 132.9a160.7 160.7 0 0 0-3.7 34.2c0 92.3 74.8 169.1 171 169.1c15.3 0 35.9-4.6 47.2-7.7s22.5-7.2 25.4-8.3a26.44 26.44 0 0 1 9.3-1.7a26 26 0 0 1 10.1 2l56.7 20.1a13.52 13.52 0 0 0 3.9 1a8 8 0 0 0 8-8a12.85 12.85 0 0 0-.5-2.7z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),I=t("path",{d:"M66.46 232a146.23 146.23 0 0 0 6.39 152.67c2.31 3.49 3.61 6.19 3.21 8s-11.93 61.87-11.93 61.87a8 8 0 0 0 2.71 7.68A8.17 8.17 0 0 0 72 464a7.26 7.26 0 0 0 2.91-.6l56.21-22a15.7 15.7 0 0 1 12 .2c18.94 7.38 39.88 12 60.83 12A159.21 159.21 0 0 0 284 432.11",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),R=[E,I],T1=o({name:"ChatbubblesOutline",render:function(s,l){return n(),e("svg",P,R)}}),U={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},F=t("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208s208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 0 1-12 5.71h-.27a16 16 0 0 1-11.89-5.3l-57.6-64a16 16 0 1 1 23.78-21.4l45.29 50.32l122.59-145.91a16 16 0 0 1 24.5 20.58z",fill:"currentColor"},null,-1),q=[F],D1=o({name:"CheckmarkCircle",render:function(s,l){return n(),e("svg",U,q)}}),W={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},N=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M464 128L240 384l-96-96"},null,-1),G=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 384l-96-96"},null,-1),J=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128L232 284"},null,-1),K=[N,G,J],P1=o({name:"CheckmarkDoneOutline",render:function(s,l){return n(),e("svg",W,K)}}),Q={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},X=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1),Y=[X],E1=o({name:"CheckmarkOutline",render:function(s,l){return n(),e("svg",Q,Y)}}),Z={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},tt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 368L144 144"},null,-1),ot=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 144L144 368"},null,-1),nt=[tt,ot],I1=o({name:"CloseOutline",render:function(s,l){return n(),e("svg",Z,nt)}}),et={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},rt=t("path",{d:"M320 336h76c55 0 100-21.21 100-75.6s-53-73.47-96-75.6C391.11 99.74 329 48 256 48c-69 0-113.44 45.79-128 91.2c-60 5.7-112 35.88-112 98.4S70 336 136 336h56",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),st=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 400.1l64 63.9l64-63.9"},null,-1),lt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 224v224.03"},null,-1),it=[rt,st,lt],R1=o({name:"CloudDownloadOutline",render:function(s,l){return n(),e("svg",et,it)}}),ct={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ht=t("path",{d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),dt=t("path",{d:"M350.67 150.93l-117.2 46.88a64 64 0 0 0-35.66 35.66l-46.88 117.2a8 8 0 0 0 10.4 10.4l117.2-46.88a64 64 0 0 0 35.66-35.66l46.88-117.2a8 8 0 0 0-10.4-10.4zM256 280a24 24 0 1 1 24-24a24 24 0 0 1-24 24z",fill:"currentColor"},null,-1),at=[ht,dt],U1=o({name:"CompassOutline",render:function(s,l){return n(),e("svg",ct,at)}}),wt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ut=t("path",{d:"M448 341.37V170.61A32 32 0 0 0 432.11 143l-152-88.46a47.94 47.94 0 0 0-48.24 0L79.89 143A32 32 0 0 0 64 170.61v170.76A32 32 0 0 0 79.89 369l152 88.46a48 48 0 0 0 48.24 0l152-88.46A32 32 0 0 0 448 341.37z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),kt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M69 153.99l187 110l187-110"},null,-1),_t=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 463.99v-200"},null,-1),pt=[ut,kt,_t],F1=o({name:"CubeOutline",render:function(s,l){return n(),e("svg",wt,pt)}}),xt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},gt=i('',5),mt=[gt],q1=o({name:"EyeOffOutline",render:function(s,l){return n(),e("svg",xt,mt)}}),vt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},$t=t("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),ft=t("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Ct=[$t,ft],W1=o({name:"EyeOutline",render:function(s,l){return n(),e("svg",vt,Ct)}}),Mt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},jt=t("path",{d:"M112 320c0-93 124-165 96-272c66 0 192 96 192 272a144 144 0 0 1-288 0z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ot=t("path",{d:"M320 368c0 57.71-32 80-64 80s-64-22.29-64-80s40-86 32-128c42 0 96 70.29 96 128z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),zt=[jt,Ot],N1=o({name:"FlameOutline",render:function(s,l){return n(),e("svg",Mt,zt)}}),Bt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Lt=t("path",{d:"M256 448a32 32 0 0 1-18-5.57c-78.59-53.35-112.62-89.93-131.39-112.8c-40-48.75-59.15-98.8-58.61-153C48.63 114.52 98.46 64 159.08 64c44.08 0 74.61 24.83 92.39 45.51a6 6 0 0 0 9.06 0C278.31 88.81 308.84 64 352.92 64c60.62 0 110.45 50.52 111.08 112.64c.54 54.21-18.63 104.26-58.61 153c-18.77 22.87-52.8 59.45-131.39 112.8a32 32 0 0 1-18 5.56z",fill:"currentColor"},null,-1),Ht=[Lt],G1=o({name:"Heart",render:function(s,l){return n(),e("svg",Bt,Ht)}}),Vt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},yt=t("path",{d:"M352.92 80C288 80 256 144 256 144s-32-64-96.92-64c-52.76 0-94.54 44.14-95.08 96.81c-1.1 109.33 86.73 187.08 183 252.42a16 16 0 0 0 18 0c96.26-65.34 184.09-143.09 183-252.42c-.54-52.67-42.32-96.81-95.08-96.81z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),At=[yt],J1=o({name:"HeartOutline",render:function(s,l){return n(),e("svg",Vt,At)}}),bt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},St=t("path",{d:"M80 212v236a16 16 0 0 0 16 16h96V328a24 24 0 0 1 24-24h80a24 24 0 0 1 24 24v136h96a16 16 0 0 0 16-16V212",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Tt=t("path",{d:"M480 256L266.89 52c-5-5.28-16.69-5.34-21.78 0L32 256",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Dt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M400 179V64h-48v69"},null,-1),Pt=[St,Tt,Dt],K1=o({name:"HomeOutline",render:function(s,l){return n(),e("svg",bt,Pt)}}),Et={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},It=t("rect",{x:"48",y:"80",width:"416",height:"352",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),Rt=t("circle",{cx:"336",cy:"176",r:"32",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Ut=t("path",{d:"M304 335.79l-90.66-90.49a32 32 0 0 0-43.87-1.3L48 352",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ft=t("path",{d:"M224 432l123.34-123.34a32 32 0 0 1 43.11-2L464 368",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),qt=[It,Rt,Ut,Ft],Q1=o({name:"ImageOutline",render:function(s,l){return n(),e("svg",Et,qt)}}),Wt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Nt=t("path",{d:"M434.8 137.65l-149.36-68.1c-16.19-7.4-42.69-7.4-58.88 0L77.3 137.65c-17.6 8-17.6 21.09 0 29.09l148 67.5c16.89 7.7 44.69 7.7 61.58 0l148-67.5c17.52-8 17.52-21.1-.08-29.09z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Gt=t("path",{d:"M160 308.52l-82.7 37.11c-17.6 8-17.6 21.1 0 29.1l148 67.5c16.89 7.69 44.69 7.69 61.58 0l148-67.5c17.6-8 17.6-21.1 0-29.1l-79.94-38.47",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Jt=t("path",{d:"M160 204.48l-82.8 37.16c-17.6 8-17.6 21.1 0 29.1l148 67.49c16.89 7.7 44.69 7.7 61.58 0l148-67.49c17.7-8 17.7-21.1.1-29.1L352 204.48",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Kt=[Nt,Gt,Jt],X1=o({name:"LayersOutline",render:function(s,l){return n(),e("svg",Wt,Kt)}}),Qt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Xt=t("path",{d:"M321.89 171.42C233 114 141 155.22 56 65.22c-19.8-21-8.3 235.5 98.1 332.7c77.79 71 197.9 63.08 238.4-5.92s18.28-163.17-70.61-220.58z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Yt=t("path",{d:"M173 253c86 81 175 129 292 147",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Zt=[Xt,Yt],Y1=o({name:"LeafOutline",render:function(s,l){return n(),e("svg",Qt,Zt)}}),to={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},oo=t("path",{d:"M208 352h-64a96 96 0 0 1 0-192h64",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36"},null,-1),no=t("path",{d:"M304 160h64a96 96 0 0 1 0 192h-64",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36"},null,-1),eo=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36",d:"M163.29 256h187.42"},null,-1),ro=[oo,no,eo],Z1=o({name:"LinkOutline",render:function(s,l){return n(),e("svg",to,ro)}}),so={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},lo=t("path",{d:"M336 208v-95a80 80 0 0 0-160 0v95",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),io=t("rect",{x:"96",y:"208",width:"320",height:"272",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),co=[lo,io],te=o({name:"LockClosedOutline",render:function(s,l){return n(),e("svg",so,co)}}),ho={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ao=t("path",{d:"M336 112a80 80 0 0 0-160 0v96",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),wo=t("rect",{x:"96",y:"208",width:"320",height:"272",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),uo=[ao,wo],oe=o({name:"LockOpenOutline",render:function(s,l){return n(),e("svg",ho,uo)}}),ko={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},_o=t("path",{d:"M304 336v40a40 40 0 0 1-40 40H104a40 40 0 0 1-40-40V136a40 40 0 0 1 40-40h152c22.09 0 48 17.91 48 40v40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),po=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 336l80-80l-80-80"},null,-1),xo=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 256h256"},null,-1),go=[_o,po,xo],ne=o({name:"LogOutOutline",render:function(s,l){return n(),e("svg",ko,go)}}),mo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},vo=t("path",{d:"M102.41 32C62.38 32 32 64.12 32 103.78v304.45C32 447.86 64.38 480 104.41 480h303.2c40 0 72.39-32.14 72.39-71.77v-3.11c-1.35-.56-115.47-48.57-174.5-76.7c-39.82 48.57-91.18 78-144.5 78c-90.18 0-120.8-78.22-78.1-129.72c9.31-11.22 25.15-21.94 49.73-28c38.45-9.36 99.64 5.85 157 24.61a309.41 309.41 0 0 0 25.46-61.67H138.34V194h91.13v-31.83H119.09v-17.75h110.38V99s0-7.65 7.82-7.65h44.55v53H391v17.75H281.84V194h89.08a359.41 359.41 0 0 1-37.72 94.43c27 9.69 49.31 18.88 67.39 24.89c60.32 20 77.23 22.45 79.41 22.7V103.78C480 64.12 447.6 32 407.61 32h-305.2zM152 274.73q-5.81.06-11.67.63c-11.3 1.13-32.5 6.07-44.09 16.23c-34.74 30-13.94 84.93 56.37 84.93c40.87 0 81.71-25.9 113.79-67.37c-41.36-20-77-34.85-114.4-34.42z",fill:"currentColor"},null,-1),$o=[vo],ee=o({name:"LogoAlipay",render:function(s,l){return n(),e("svg",mo,$o)}}),fo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Co=i('',6),Mo=[Co],re=o({name:"MegaphoneOutline",render:function(s,l){return n(),e("svg",fo,Mo)}}),jo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Oo=i('',9),zo=[Oo],se=o({name:"OptionsOutline",render:function(s,l){return n(),e("svg",jo,zo)}}),Bo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Lo=t("path",{d:"M53.12 199.94l400-151.39a8 8 0 0 1 10.33 10.33l-151.39 400a8 8 0 0 1-15-.34l-67.4-166.09a16 16 0 0 0-10.11-10.11L53.46 215a8 8 0 0 1-.34-15.06z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ho=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M460 52L227 285"},null,-1),Vo=[Lo,Ho],le=o({name:"PaperPlaneOutline",render:function(s,l){return n(),e("svg",Bo,Vo)}}),yo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ao=t("path",{d:"M402 168c-2.93 40.67-33.1 72-66 72s-63.12-31.32-66-72c-3-42.31 26.37-72 66-72s69 30.46 66 72z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),bo=t("path",{d:"M336 304c-65.17 0-127.84 32.37-143.54 95.41c-2.08 8.34 3.15 16.59 11.72 16.59h263.65c8.57 0 13.77-8.25 11.72-16.59C463.85 335.36 401.18 304 336 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),So=t("path",{d:"M200 185.94c-2.34 32.48-26.72 58.06-53 58.06s-50.7-25.57-53-58.06C91.61 152.15 115.34 128 147 128s55.39 24.77 53 57.94z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),To=t("path",{d:"M206 306c-18.05-8.27-37.93-11.45-59-11.45c-52 0-102.1 25.85-114.65 76.2c-1.65 6.66 2.53 13.25 9.37 13.25H154",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Do=[Ao,bo,So,To],ie=o({name:"PeopleOutline",render:function(s,l){return n(),e("svg",yo,Do)}}),Po={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Eo=t("path",{d:"M376 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Io=t("path",{d:"M288 304c-87 0-175.3 48-191.64 138.6c-2 10.92 4.21 21.4 15.65 21.4H464c11.44 0 17.62-10.48 15.65-21.4C463.3 352 375 304 288 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Ro=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M88 176v112"},null,-1),Uo=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 232H32"},null,-1),Fo=[Eo,Io,Ro,Uo],ce=o({name:"PersonAddOutline",render:function(s,l){return n(),e("svg",Po,Fo)}}),qo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Wo=t("path",{d:"M344 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),No=t("path",{d:"M256 304c-87 0-175.3 48-191.64 138.6C62.39 453.52 68.57 464 80 464h352c11.44 0 17.62-10.48 15.65-21.4C431.3 352 343 304 256 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Go=[Wo,No],he=o({name:"PersonOutline",render:function(s,l){return n(),e("svg",qo,Go)}}),Jo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ko=t("path",{d:"M376 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Qo=t("path",{d:"M288 304c-87 0-175.3 48-191.64 138.6c-2 10.92 4.21 21.4 15.65 21.4H464c11.44 0 17.62-10.48 15.65-21.4C463.3 352 375 304 288 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Xo=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 232H32"},null,-1),Yo=[Ko,Qo,Xo],de=o({name:"PersonRemoveOutline",render:function(s,l){return n(),e("svg",Jo,Yo)}}),Zo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},tn=t("path",{d:"M336 336h40a40 40 0 0 0 40-40V88a40 40 0 0 0-40-40H136a40 40 0 0 0-40 40v208a40 40 0 0 0 40 40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),on=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 240l80-80l80 80"},null,-1),nn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 464V176"},null,-1),en=[tn,on,nn],ae=o({name:"PushOutline",render:function(s,l){return n(),e("svg",Zo,en)}}),rn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},sn=t("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8a124.95 124.95 0 0 1-124.8-124.8z",fill:"currentColor"},null,-1),ln=[sn],we=o({name:"Search",render:function(s,l){return n(),e("svg",rn,ln)}}),cn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},hn=t("path",{d:"M262.29 192.31a64 64 0 1 0 57.4 57.4a64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22a155.3 155.3 0 0 1-21.46-12.57a16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22a155.3 155.3 0 0 1 21.46 12.57a16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),dn=[hn],ue=o({name:"SettingsOutline",render:function(s,l){return n(),e("svg",cn,dn)}}),an={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},wn=t("path",{d:"M336 192h40a40 40 0 0 1 40 40v192a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V232a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),un=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 128l-80-80l-80 80"},null,-1),kn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 321V48"},null,-1),_n=[wn,un,kn],ke=o({name:"ShareOutline",render:function(s,l){return n(),e("svg",an,_n)}}),pn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},xn=i('',5),gn=[xn],_e=o({name:"ShareSocialOutline",render:function(s,l){return n(),e("svg",pn,gn)}}),mn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},vn=i('',6),$n=[vn],pe=o({name:"TrashOutline",render:function(s,l){return n(),e("svg",mn,$n)}}),fn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Cn=t("path",{d:"M374.79 308.78L457.5 367a16 16 0 0 0 22.5-14.62V159.62A16 16 0 0 0 457.5 145l-82.71 58.22A16 16 0 0 0 368 216.3v79.4a16 16 0 0 0 6.79 13.08z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Mn=t("path",{d:"M268 384H84a52.15 52.15 0 0 1-52-52V180a52.15 52.15 0 0 1 52-52h184.48A51.68 51.68 0 0 1 320 179.52V332a52.15 52.15 0 0 1-52 52z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),jn=[Cn,Mn],xe=o({name:"VideocamOutline",render:function(s,l){return n(),e("svg",fn,jn)}}),On={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},zn=i('',5),Bn=[zn],ge=o({name:"WalkOutline",render:function(s,l){return n(),e("svg",On,Bn)}}),Ln={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Hn=t("rect",{x:"48",y:"144",width:"416",height:"288",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),Vn=t("path",{d:"M411.36 144v-30A50 50 0 0 0 352 64.9L88.64 109.85A50 50 0 0 0 48 159v49",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),yn=t("path",{d:"M368 320a32 32 0 1 1 32-32a32 32 0 0 1-32 32z",fill:"currentColor"},null,-1),An=[Hn,Vn,yn],me=o({name:"WalletOutline",render:function(s,l){return n(),e("svg",Ln,An)}}),bn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Sn=i('',1),Tn=[Sn],ve=o({name:"ArrowBarDown",render:function(s,l){return n(),e("svg",bn,Tn)}}),Dn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Pn=i('',1),En=[Pn],$e=o({name:"ArrowBarToUp",render:function(s,l){return n(),e("svg",Dn,En)}}),In={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Rn=t("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M9 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-3"}),t("path",{d:"M9 15h3l8.5-8.5a1.5 1.5 0 0 0-3-3L9 12v3"}),t("path",{d:"M16 5l3 3"})],-1),Un=[Rn],fe=o({name:"Edit",render:function(s,l){return n(),e("svg",In,Un)}}),Fn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},qn=i('',1),Wn=[qn],Ce=o({name:"Hash",render:function(s,l){return n(),e("svg",Fn,Wn)}}),Nn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Gn=i('',1),Jn=[Gn],Me=o({name:"Trash",render:function(s,l){return n(),e("svg",Nn,Jn)}}),Kn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Qn=t("path",{d:"M14.71 6.71a.996.996 0 0 0-1.41 0L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59a.996.996 0 1 0 1.41-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41z",fill:"currentColor"},null,-1),Xn=[Qn],je=o({name:"ChevronLeftRound",render:function(s,l){return n(),e("svg",Kn,Xn)}}),Yn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Zn=t("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1),t1=[Zn],Oe=o({name:"DarkModeOutlined",render:function(s,l){return n(),e("svg",Yn,t1)}}),o1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},n1=t("path",{d:"M2 17c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1zm0-5c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1zm0-5c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1z",fill:"currentColor"},null,-1),e1=[n1],ze=o({name:"DehazeRound",render:function(s,l){return n(),e("svg",o1,e1)}}),r1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},s1=t("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3s-3-1.35-3-3s1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5s5-2.24 5-5s-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 0 0-1.41 0a.996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 0 0-1.41 0a.996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 0 0 0-1.41a.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 0 0 0-1.41a.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"},null,-1),l1=[s1],Be=o({name:"LightModeOutlined",render:function(s,l){return n(),e("svg",r1,l1)}}),i1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},c1=t("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1),h1=[c1],Le=o({name:"MoreHorizFilled",render:function(s,l){return n(),e("svg",i1,h1)}}),d1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},a1=t("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1),w1=[a1],He=o({name:"MoreVertOutlined",render:function(s,l){return n(),e("svg",d1,w1)}}),u1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},k1=t("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57l-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h4v12h-4z",fill:"currentColor"},null,-1),_1=[k1],Ve=o({name:"ThumbDownOutlined",render:function(s,l){return n(),e("svg",u1,_1)}}),p1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},x1=t("path",{opacity:".3",d:"M3 12v2h9l-1.34 5.34L15 15V5H6z",fill:"currentColor"},null,-1),g1=t("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57l-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h4v12h-4z",fill:"currentColor"},null,-1),m1=[x1,g1],ye=o({name:"ThumbDownTwotone",render:function(s,l){return n(),e("svg",p1,m1)}}),v1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},$1=t("path",{d:"M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57l.03-.32c0-.41-.17-.79-.44-1.06L14.17 1L7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h4v12H1z",fill:"currentColor"},null,-1),f1=[$1],Ae=o({name:"ThumbUpOutlined",render:function(s,l){return n(),e("svg",v1,f1)}}),C1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},M1=t("path",{opacity:".3",d:"M21 12v-2h-9l1.34-5.34L9 9v10h9z",fill:"currentColor"},null,-1),j1=t("path",{d:"M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57l.03-.32c0-.41-.17-.79-.44-1.06L14.17 1L7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h4v12H1z",fill:"currentColor"},null,-1),O1=[M1,j1],be=o({name:"ThumbUpTwotone",render:function(s,l){return n(),e("svg",C1,O1)}});export{Z1 as $,L1 as A,A1 as B,T1 as C,He as D,W1 as E,N1 as F,F1 as G,K1 as H,Q1 as I,de as J,D1 as K,Y1 as L,re as M,ke as N,E1 as O,ie as P,I1 as Q,ce as R,we as S,Me as T,P1 as U,xe as V,me as W,S1 as X,se as Y,X1 as Z,B1 as _,ue as a,R1 as a0,ee as a1,fe as a2,ze as a3,je as a4,Be as a5,Oe as a6,Ce as b,ne as c,U1 as d,Ae as e,be as f,Ve as g,ye as h,$e as i,ve as j,Le as k,J1 as l,G1 as m,b1 as n,y1 as o,V1 as p,_e as q,le as r,ge as s,H1 as t,pe as u,te as v,oe as w,ae as x,q1 as y,he as z}; diff --git a/web/dist/assets/@vue-a481fc63.js b/web/dist/assets/@vue-a481fc63.js new file mode 100644 index 00000000..03fbd102 --- /dev/null +++ b/web/dist/assets/@vue-a481fc63.js @@ -0,0 +1 @@ +function Sn(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r!!n[r.toLowerCase()]:r=>!!n[r]}const Z={},mt=[],Ie=()=>{},bo=()=>!1,yo=/^on[^a-z]/,nn=e=>yo.test(e),As=e=>e.startsWith("onUpdate:"),se=Object.assign,Ps=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},xo=Object.prototype.hasOwnProperty,Q=(e,t)=>xo.call(e,t),M=Array.isArray,_t=e=>Ft(e)==="[object Map]",at=e=>Ft(e)==="[object Set]",nr=e=>Ft(e)==="[object Date]",Co=e=>Ft(e)==="[object RegExp]",V=e=>typeof e=="function",ie=e=>typeof e=="string",Jt=e=>typeof e=="symbol",G=e=>e!==null&&typeof e=="object",Os=e=>G(e)&&V(e.then)&&V(e.catch),Kr=Object.prototype.toString,Ft=e=>Kr.call(e),vo=e=>Ft(e).slice(8,-1),Vr=e=>Ft(e)==="[object Object]",Is=e=>ie(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,jt=Sn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Mn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Eo=/-(\w)/g,ve=Mn(e=>e.replace(Eo,(t,n)=>n?n.toUpperCase():"")),wo=/\B([A-Z])/g,we=Mn(e=>e.replace(wo,"-$1").toLowerCase()),Nn=Mn(e=>e.charAt(0).toUpperCase()+e.slice(1)),yn=Mn(e=>e?`on${Nn(e)}`:""),wt=(e,t)=>!Object.is(e,t),bt=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},wn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Tn=e=>{const t=ie(e)?Number(e):NaN;return isNaN(t)?e:t};let sr;const ls=()=>sr||(sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),To="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console",Ao=Sn(To);function Ln(e){if(M(e)){const t={};for(let n=0;n{if(n){const s=n.split(Oo);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function kn(e){let t="";if(ie(e))t=e;else if(M(e))for(let n=0;nQe(n,t))}const Cf=e=>ie(e)?e:e==null?"":M(e)||G(e)&&(e.toString===Kr||!V(e.toString))?JSON.stringify(e,qr,2):String(e),qr=(e,t)=>t&&t.__v_isRef?qr(e,t.value):_t(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:at(t)?{[`Set(${t.size})`]:[...t.values()]}:G(t)&&!M(t)&&!Vr(t)?String(t):t;let xe;class Jr{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=xe,!t&&xe&&(this.index=(xe.scopes||(xe.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=xe;try{return xe=this,t()}finally{xe=n}}}on(){xe=this}off(){xe=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},Qr=e=>(e.w&ze)>0,zr=e=>(e.n&ze)>0,Lo=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let s=0;s{(h==="length"||h>=c)&&l.push(u)})}else switch(n!==void 0&&l.push(o.get(n)),t){case"add":M(e)?Is(n)&&l.push(o.get("length")):(l.push(o.get(lt)),_t(e)&&l.push(o.get(fs)));break;case"delete":M(e)||(l.push(o.get(lt)),_t(e)&&l.push(o.get(fs)));break;case"set":_t(e)&&l.push(o.get(lt));break}if(l.length===1)l[0]&&us(l[0]);else{const c=[];for(const u of l)u&&c.push(...u);us(Fs(c))}}function us(e,t){const n=M(e)?e:[...e];for(const s of n)s.computed&&ir(s);for(const s of n)s.computed||ir(s)}function ir(e,t){(e!==Pe||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function Bo(e,t){var n;return(n=An.get(e))==null?void 0:n.get(t)}const Ho=Sn("__proto__,__v_isRef,__isVue"),Gr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Jt)),Do=Dn(),Uo=Dn(!1,!0),jo=Dn(!0),$o=Dn(!0,!0),or=Ko();function Ko(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=Y(this);for(let i=0,o=this.length;i{e[t]=function(...n){Rt();const s=Y(this)[t].apply(this,n);return St(),s}}),e}function Vo(e){const t=Y(this);return be(t,"has",e),t.hasOwnProperty(e)}function Dn(e=!1,t=!1){return function(s,r,i){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_isShallow")return t;if(r==="__v_raw"&&i===(e?t?oi:ii:t?ri:si).get(s))return s;const o=M(s);if(!e){if(o&&Q(or,r))return Reflect.get(or,r,i);if(r==="hasOwnProperty")return Vo}const l=Reflect.get(s,r,i);return(Jt(r)?Gr.has(r):Ho(r))||(e||be(s,"get",r),t)?l:ce(l)?o&&Is(r)?l:l.value:G(l)?e?li(l):Ss(l):l}}const Wo=ei(),qo=ei(!0);function ei(e=!1){return function(n,s,r,i){let o=n[s];if(Tt(o)&&ce(o)&&!ce(r))return!1;if(!e&&(!Pn(r)&&!Tt(r)&&(o=Y(o),r=Y(r)),!M(n)&&ce(o)&&!ce(r)))return o.value=r,!0;const l=M(n)&&Is(s)?Number(s)e,Un=e=>Reflect.getPrototypeOf(e);function cn(e,t,n=!1,s=!1){e=e.__v_raw;const r=Y(e),i=Y(t);n||(t!==i&&be(r,"get",t),be(r,"get",i));const{has:o}=Un(r),l=s?Rs:n?Ms:Yt;if(o.call(r,t))return l(e.get(t));if(o.call(r,i))return l(e.get(i));e!==r&&e.get(t)}function fn(e,t=!1){const n=this.__v_raw,s=Y(n),r=Y(e);return t||(e!==r&&be(s,"has",e),be(s,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function un(e,t=!1){return e=e.__v_raw,!t&&be(Y(e),"iterate",lt),Reflect.get(e,"size",e)}function lr(e){e=Y(e);const t=Y(this);return Un(t).has.call(t,e)||(t.add(e),He(t,"add",e,e)),this}function cr(e,t){t=Y(t);const n=Y(this),{has:s,get:r}=Un(n);let i=s.call(n,e);i||(e=Y(e),i=s.call(n,e));const o=r.call(n,e);return n.set(e,t),i?wt(t,o)&&He(n,"set",e,t):He(n,"add",e,t),this}function fr(e){const t=Y(this),{has:n,get:s}=Un(t);let r=n.call(t,e);r||(e=Y(e),r=n.call(t,e)),s&&s.call(t,e);const i=t.delete(e);return r&&He(t,"delete",e,void 0),i}function ur(){const e=Y(this),t=e.size!==0,n=e.clear();return t&&He(e,"clear",void 0,void 0),n}function an(e,t){return function(s,r){const i=this,o=i.__v_raw,l=Y(o),c=t?Rs:e?Ms:Yt;return!e&&be(l,"iterate",lt),o.forEach((u,h)=>s.call(r,c(u),c(h),i))}}function dn(e,t,n){return function(...s){const r=this.__v_raw,i=Y(r),o=_t(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,u=r[e](...s),h=n?Rs:t?Ms:Yt;return!t&&be(i,"iterate",c?fs:lt),{next(){const{value:d,done:m}=u.next();return m?{value:d,done:m}:{value:l?[h(d[0]),h(d[1])]:h(d),done:m}},[Symbol.iterator](){return this}}}}function je(e){return function(...t){return e==="delete"?!1:this}}function Zo(){const e={get(i){return cn(this,i)},get size(){return un(this)},has:fn,add:lr,set:cr,delete:fr,clear:ur,forEach:an(!1,!1)},t={get(i){return cn(this,i,!1,!0)},get size(){return un(this)},has:fn,add:lr,set:cr,delete:fr,clear:ur,forEach:an(!1,!0)},n={get(i){return cn(this,i,!0)},get size(){return un(this,!0)},has(i){return fn.call(this,i,!0)},add:je("add"),set:je("set"),delete:je("delete"),clear:je("clear"),forEach:an(!0,!1)},s={get(i){return cn(this,i,!0,!0)},get size(){return un(this,!0)},has(i){return fn.call(this,i,!0)},add:je("add"),set:je("set"),delete:je("delete"),clear:je("clear"),forEach:an(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=dn(i,!1,!1),n[i]=dn(i,!0,!1),t[i]=dn(i,!1,!0),s[i]=dn(i,!0,!0)}),[e,n,t,s]}const[Go,el,tl,nl]=Zo();function jn(e,t){const n=t?e?nl:tl:e?el:Go;return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Q(n,r)&&r in s?n:s,r,i)}const sl={get:jn(!1,!1)},rl={get:jn(!1,!0)},il={get:jn(!0,!1)},ol={get:jn(!0,!0)},si=new WeakMap,ri=new WeakMap,ii=new WeakMap,oi=new WeakMap;function ll(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function cl(e){return e.__v_skip||!Object.isExtensible(e)?0:ll(vo(e))}function Ss(e){return Tt(e)?e:$n(e,!1,ti,sl,si)}function fl(e){return $n(e,!1,zo,rl,ri)}function li(e){return $n(e,!0,ni,il,ii)}function Af(e){return $n(e,!0,Xo,ol,oi)}function $n(e,t,n,s,r){if(!G(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=cl(e);if(o===0)return e;const l=new Proxy(e,o===2?s:n);return r.set(e,l),l}function yt(e){return Tt(e)?yt(e.__v_raw):!!(e&&e.__v_isReactive)}function Tt(e){return!!(e&&e.__v_isReadonly)}function Pn(e){return!!(e&&e.__v_isShallow)}function ci(e){return yt(e)||Tt(e)}function Y(e){const t=e&&e.__v_raw;return t?Y(t):e}function fi(e){return En(e,"__v_skip",!0),e}const Yt=e=>G(e)?Ss(e):e,Ms=e=>G(e)?li(e):e;function Ns(e){qe&&Pe&&(e=Y(e),Zr(e.dep||(e.dep=Fs())))}function Kn(e,t){e=Y(e);const n=e.dep;n&&us(n)}function ce(e){return!!(e&&e.__v_isRef===!0)}function $t(e){return ui(e,!1)}function Pf(e){return ui(e,!0)}function ui(e,t){return ce(e)?e:new ul(e,t)}class ul{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:Y(t),this._value=n?t:Yt(t)}get value(){return Ns(this),this._value}set value(t){const n=this.__v_isShallow||Pn(t)||Tt(t);t=n?t:Y(t),wt(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:Yt(t),Kn(this))}}function Of(e){Kn(e)}function ai(e){return ce(e)?e.value:e}function If(e){return V(e)?e():ai(e)}const al={get:(e,t,n)=>ai(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return ce(r)&&!ce(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function di(e){return yt(e)?e:new Proxy(e,al)}class dl{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:s}=t(()=>Ns(this),()=>Kn(this));this._get=n,this._set=s}get value(){return this._get()}set value(t){this._set(t)}}function Ff(e){return new dl(e)}function Rf(e){const t=M(e)?new Array(e.length):{};for(const n in e)t[n]=hi(e,n);return t}class hl{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Bo(Y(this._object),this._key)}}class pl{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Sf(e,t,n){return ce(e)?e:V(e)?new pl(e):G(e)&&arguments.length>1?hi(e,t,n):$t(e)}function hi(e,t,n){const s=e[t];return ce(s)?s:new hl(e,t,n)}class gl{constructor(t,n,s,r){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new Hn(t,()=>{this._dirty||(this._dirty=!0,Kn(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=Y(this);return Ns(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function ml(e,t,n=!1){let s,r;const i=V(e);return i?(s=e,r=Ie):(s=e.get,r=e.set),new gl(s,r,i||!r,n)}function Mf(e,...t){}function Nf(e,t){}function Je(e,t,n,s){let r;try{r=s?e(...s):e()}catch(i){Mt(i,t,n)}return r}function Te(e,t,n,s){if(V(e)){const i=Je(e,t,n,s);return i&&Os(i)&&i.catch(o=>{Mt(o,t,n)}),i}const r=[];for(let i=0;i>>1;zt(he[s])Me&&he.splice(t,1)}function _i(e){M(e)?xt.push(...e):(!ke||!ke.includes(e,e.allowRecurse?rt+1:rt))&&xt.push(e),mi()}function ar(e,t=Qt?Me+1:0){for(;tzt(n)-zt(s)),rt=0;rte.id==null?1/0:e.id,xl=(e,t)=>{const n=zt(e)-zt(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function bi(e){as=!1,Qt=!0,he.sort(xl);const t=Ie;try{for(Me=0;MeLt.emit(r,...i)),hn=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{Cl(i,t)}),setTimeout(()=>{Lt||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,hn=[])},3e3)):hn=[]}function vl(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Z;let r=n;const i=t.startsWith("update:"),o=i&&t.slice(7);if(o&&o in s){const h=`${o==="modelValue"?"model":o}Modifiers`,{number:d,trim:m}=s[h]||Z;m&&(r=n.map(E=>ie(E)?E.trim():E)),d&&(r=n.map(wn))}let l,c=s[l=yn(t)]||s[l=yn(ve(t))];!c&&i&&(c=s[l=yn(we(t))]),c&&Te(c,e,6,r);const u=s[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Te(u,e,6,r)}}function yi(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!V(e)){const c=u=>{const h=yi(u,t,!0);h&&(l=!0,se(o,h))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(G(e)&&s.set(e,null),null):(M(i)?i.forEach(c=>o[c]=null):se(o,i),G(e)&&s.set(e,o),o)}function Wn(e,t){return!e||!nn(t)?!1:(t=t.slice(2).replace(/Once$/,""),Q(e,t[0].toLowerCase()+t.slice(1))||Q(e,we(t))||Q(e,t))}let fe=null,qn=null;function Xt(e){const t=fe;return fe=e,qn=e&&e.type.__scopeId||null,t}function Lf(e){qn=e}function kf(){qn=null}const Bf=e=>xi;function xi(e,t=fe,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&wr(-1);const i=Xt(t);let o;try{o=e(...r)}finally{Xt(i),s._d&&wr(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function xn(e){const{type:t,vnode:n,proxy:s,withProxy:r,props:i,propsOptions:[o],slots:l,attrs:c,emit:u,render:h,renderCache:d,data:m,setupState:E,ctx:O,inheritAttrs:F}=e;let K,b;const p=Xt(e);try{if(n.shapeFlag&4){const g=r||s;K=Ce(h.call(g,g,d,i,E,m,O)),b=c}else{const g=t;K=Ce(g.length>1?g(i,{attrs:c,slots:l,emit:u}):g(i,null)),b=t.props?c:wl(c)}}catch(g){Wt.length=0,Mt(g,e,1),K=re(ge)}let T=K;if(b&&F!==!1){const g=Object.keys(b),{shapeFlag:A}=T;g.length&&A&7&&(o&&g.some(As)&&(b=Tl(b,o)),T=De(T,b))}return n.dirs&&(T=De(T),T.dirs=T.dirs?T.dirs.concat(n.dirs):n.dirs),n.transition&&(T.transition=n.transition),K=T,Xt(p),K}function El(e){let t;for(let n=0;n{let t;for(const n in e)(n==="class"||n==="style"||nn(n))&&((t||(t={}))[n]=e[n]);return t},Tl=(e,t)=>{const n={};for(const s in e)(!As(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Al(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?dr(s,o,u):!!o;if(c&8){const h=t.dynamicProps;for(let d=0;de.__isSuspense,Pl={name:"Suspense",__isSuspense:!0,process(e,t,n,s,r,i,o,l,c,u){e==null?Ol(t,n,s,r,i,o,l,c,u):Il(e,t,n,s,r,o,l,c,u)},hydrate:Fl,create:Bs,normalize:Rl},Hf=Pl;function Zt(e,t){const n=e.props&&e.props[t];V(n)&&n()}function Ol(e,t,n,s,r,i,o,l,c){const{p:u,o:{createElement:h}}=c,d=h("div"),m=e.suspense=Bs(e,r,s,t,d,n,i,o,l,c);u(null,m.pendingBranch=e.ssContent,d,null,s,m,i,o),m.deps>0?(Zt(e,"onPending"),Zt(e,"onFallback"),u(null,e.ssFallback,t,n,s,null,i,o),Ct(m,e.ssFallback)):m.resolve(!1,!0)}function Il(e,t,n,s,r,i,o,l,{p:c,um:u,o:{createElement:h}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const m=t.ssContent,E=t.ssFallback,{activeBranch:O,pendingBranch:F,isInFallback:K,isHydrating:b}=d;if(F)d.pendingBranch=m,Oe(m,F)?(c(F,m,d.hiddenContainer,null,r,d,i,o,l),d.deps<=0?d.resolve():K&&(c(O,E,n,s,r,null,i,o,l),Ct(d,E))):(d.pendingId++,b?(d.isHydrating=!1,d.activeBranch=F):u(F,r,d),d.deps=0,d.effects.length=0,d.hiddenContainer=h("div"),K?(c(null,m,d.hiddenContainer,null,r,d,i,o,l),d.deps<=0?d.resolve():(c(O,E,n,s,r,null,i,o,l),Ct(d,E))):O&&Oe(m,O)?(c(O,m,n,s,r,d,i,o,l),d.resolve(!0)):(c(null,m,d.hiddenContainer,null,r,d,i,o,l),d.deps<=0&&d.resolve()));else if(O&&Oe(m,O))c(O,m,n,s,r,d,i,o,l),Ct(d,m);else if(Zt(t,"onPending"),d.pendingBranch=m,d.pendingId++,c(null,m,d.hiddenContainer,null,r,d,i,o,l),d.deps<=0)d.resolve();else{const{timeout:p,pendingId:T}=d;p>0?setTimeout(()=>{d.pendingId===T&&d.fallback(E)},p):p===0&&d.fallback(E)}}function Bs(e,t,n,s,r,i,o,l,c,u,h=!1){const{p:d,m,um:E,n:O,o:{parentNode:F,remove:K}}=u;let b;const p=Sl(e);p&&t!=null&&t.pendingBranch&&(b=t.pendingId,t.deps++);const T=e.props?Tn(e.props.timeout):void 0,g={vnode:e,parent:t,parentComponent:n,isSVG:o,container:s,hiddenContainer:r,anchor:i,deps:0,pendingId:0,timeout:typeof T=="number"?T:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:h,isUnmounted:!1,effects:[],resolve(A=!1,D=!1){const{vnode:N,activeBranch:C,pendingBranch:B,pendingId:H,effects:$,parentComponent:S,container:q}=g;if(g.isHydrating)g.isHydrating=!1;else if(!A){const z=C&&B.transition&&B.transition.mode==="out-in";z&&(C.transition.afterLeave=()=>{H===g.pendingId&&m(B,q,ee,0)});let{anchor:ee}=g;C&&(ee=O(C),E(C,S,g,!0)),z||m(B,q,ee,0)}Ct(g,B),g.pendingBranch=null,g.isInFallback=!1;let L=g.parent,ae=!1;for(;L;){if(L.pendingBranch){L.effects.push(...$),ae=!0;break}L=L.parent}ae||_i($),g.effects=[],p&&t&&t.pendingBranch&&b===t.pendingId&&(t.deps--,t.deps===0&&!D&&t.resolve()),Zt(N,"onResolve")},fallback(A){if(!g.pendingBranch)return;const{vnode:D,activeBranch:N,parentComponent:C,container:B,isSVG:H}=g;Zt(D,"onFallback");const $=O(N),S=()=>{g.isInFallback&&(d(null,A,B,$,C,null,H,l,c),Ct(g,A))},q=A.transition&&A.transition.mode==="out-in";q&&(N.transition.afterLeave=S),g.isInFallback=!0,E(N,C,null,!0),q||S()},move(A,D,N){g.activeBranch&&m(g.activeBranch,A,D,N),g.container=A},next(){return g.activeBranch&&O(g.activeBranch)},registerDep(A,D){const N=!!g.pendingBranch;N&&g.deps++;const C=A.vnode.el;A.asyncDep.catch(B=>{Mt(B,A,0)}).then(B=>{if(A.isUnmounted||g.isUnmounted||g.pendingId!==A.suspenseId)return;A.asyncResolved=!0;const{vnode:H}=A;bs(A,B,!1),C&&(H.el=C);const $=!C&&A.subTree.el;D(A,H,F(C||A.subTree.el),C?null:O(A.subTree),g,o,c),$&&K($),ks(A,H.el),N&&--g.deps===0&&g.resolve()})},unmount(A,D){g.isUnmounted=!0,g.activeBranch&&E(g.activeBranch,n,A,D),g.pendingBranch&&E(g.pendingBranch,n,A,D)}};return g}function Fl(e,t,n,s,r,i,o,l,c){const u=t.suspense=Bs(t,s,n,e.parentNode,document.createElement("div"),null,r,i,o,l,!0),h=c(e,u.pendingBranch=t.ssContent,n,u,i,o);return u.deps===0&&u.resolve(!1,!0),h}function Rl(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=hr(s?n.default:n),e.ssFallback=s?hr(n.fallback):re(ge)}function hr(e){let t;if(V(e)){const n=ft&&e._c;n&&(e._d=!1,Js()),e=e(),n&&(e._d=!0,t=_e,ji())}return M(e)&&(e=El(e)),e=Ce(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function vi(e,t){t&&t.pendingBranch?M(e)?t.effects.push(...e):t.effects.push(e):_i(e)}function Ct(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e,r=n.el=t.el;s&&s.subTree===n&&(s.vnode.el=r,ks(s,r))}function Sl(e){var t;return((t=e.props)==null?void 0:t.suspensible)!=null&&e.props.suspensible!==!1}function Df(e,t){return sn(e,null,t)}function Ml(e,t){return sn(e,null,{flush:"post"})}function Uf(e,t){return sn(e,null,{flush:"sync"})}const pn={};function vt(e,t,n){return sn(e,t,n)}function sn(e,t,{immediate:n,deep:s,flush:r,onTrack:i,onTrigger:o}=Z){var l;const c=No()===((l=le)==null?void 0:l.scope)?le:null;let u,h=!1,d=!1;if(ce(e)?(u=()=>e.value,h=Pn(e)):yt(e)?(u=()=>e,s=!0):M(e)?(d=!0,h=e.some(g=>yt(g)||Pn(g)),u=()=>e.map(g=>{if(ce(g))return g.value;if(yt(g))return ot(g);if(V(g))return Je(g,c,2)})):V(e)?t?u=()=>Je(e,c,2):u=()=>{if(!(c&&c.isUnmounted))return m&&m(),Te(e,c,3,[E])}:u=Ie,t&&s){const g=u;u=()=>ot(g())}let m,E=g=>{m=p.onStop=()=>{Je(g,c,4)}},O;if(Ot)if(E=Ie,t?n&&Te(t,c,3,[u(),d?[]:void 0,E]):u(),r==="sync"){const g=Ac();O=g.__watcherHandles||(g.__watcherHandles=[])}else return Ie;let F=d?new Array(e.length).fill(pn):pn;const K=()=>{if(p.active)if(t){const g=p.run();(s||h||(d?g.some((A,D)=>wt(A,F[D])):wt(g,F)))&&(m&&m(),Te(t,c,3,[g,F===pn?void 0:d&&F[0]===pn?[]:F,E]),F=g)}else p.run()};K.allowRecurse=!!t;let b;r==="sync"?b=K:r==="post"?b=()=>ue(K,c&&c.suspense):(K.pre=!0,c&&(K.id=c.uid),b=()=>Vn(K));const p=new Hn(u,b);t?n?K():F=p.run():r==="post"?ue(p.run.bind(p),c&&c.suspense):p.run();const T=()=>{p.stop(),c&&c.scope&&Ps(c.scope.effects,p)};return O&&O.push(T),T}function Nl(e,t,n){const s=this.proxy,r=ie(e)?e.includes(".")?Ei(s,e):()=>s[e]:e.bind(s,s);let i;V(t)?i=t:(i=t.handler,n=t);const o=le;Xe(this);const l=sn(r,i.bind(s),n);return o?Xe(o):Ye(),l}function Ei(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{ot(n,t)});else if(Vr(e))for(const n in e)ot(e[n],t);return e}function jf(e,t){const n=fe;if(n===null)return e;const s=zn(n)||n.proxy,r=e.dirs||(e.dirs=[]);for(let i=0;i{e.isMounted=!0}),Us(()=>{e.isUnmounting=!0}),e}const Ee=[Function,Array],Ti={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ee,onEnter:Ee,onAfterEnter:Ee,onEnterCancelled:Ee,onBeforeLeave:Ee,onLeave:Ee,onAfterLeave:Ee,onLeaveCancelled:Ee,onBeforeAppear:Ee,onAppear:Ee,onAfterAppear:Ee,onAppearCancelled:Ee},Ll={name:"BaseTransition",props:Ti,setup(e,{slots:t}){const n=Ge(),s=wi();let r;return()=>{const i=t.default&&Hs(t.default(),!0);if(!i||!i.length)return;let o=i[0];if(i.length>1){for(const F of i)if(F.type!==ge){o=F;break}}const l=Y(e),{mode:c}=l;if(s.isLeaving)return Gn(o);const u=pr(o);if(!u)return Gn(o);const h=Gt(u,l,s,n);At(u,h);const d=n.subTree,m=d&&pr(d);let E=!1;const{getTransitionKey:O}=u.type;if(O){const F=O();r===void 0?r=F:F!==r&&(r=F,E=!0)}if(m&&m.type!==ge&&(!Oe(u,m)||E)){const F=Gt(m,l,s,n);if(At(m,F),c==="out-in")return s.isLeaving=!0,F.afterLeave=()=>{s.isLeaving=!1,n.update.active!==!1&&n.update()},Gn(o);c==="in-out"&&u.type!==ge&&(F.delayLeave=(K,b,p)=>{const T=Ai(s,m);T[String(m.key)]=m,K._leaveCb=()=>{b(),K._leaveCb=void 0,delete h.delayedLeave},h.delayedLeave=p})}return o}}},kl=Ll;function Ai(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Gt(e,t,n,s){const{appear:r,mode:i,persisted:o=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:h,onBeforeLeave:d,onLeave:m,onAfterLeave:E,onLeaveCancelled:O,onBeforeAppear:F,onAppear:K,onAfterAppear:b,onAppearCancelled:p}=t,T=String(e.key),g=Ai(n,e),A=(C,B)=>{C&&Te(C,s,9,B)},D=(C,B)=>{const H=B[1];A(C,B),M(C)?C.every($=>$.length<=1)&&H():C.length<=1&&H()},N={mode:i,persisted:o,beforeEnter(C){let B=l;if(!n.isMounted)if(r)B=F||l;else return;C._leaveCb&&C._leaveCb(!0);const H=g[T];H&&Oe(e,H)&&H.el._leaveCb&&H.el._leaveCb(),A(B,[C])},enter(C){let B=c,H=u,$=h;if(!n.isMounted)if(r)B=K||c,H=b||u,$=p||h;else return;let S=!1;const q=C._enterCb=L=>{S||(S=!0,L?A($,[C]):A(H,[C]),N.delayedLeave&&N.delayedLeave(),C._enterCb=void 0)};B?D(B,[C,q]):q()},leave(C,B){const H=String(e.key);if(C._enterCb&&C._enterCb(!0),n.isUnmounting)return B();A(d,[C]);let $=!1;const S=C._leaveCb=q=>{$||($=!0,B(),q?A(O,[C]):A(E,[C]),C._leaveCb=void 0,g[H]===e&&delete g[H])};g[H]=e,m?D(m,[C,S]):S()},clone(C){return Gt(C,t,n,s)}};return N}function Gn(e){if(rn(e))return e=De(e),e.children=null,e}function pr(e){return rn(e)?e.children?e.children[0]:void 0:e}function At(e,t){e.shapeFlag&6&&e.component?At(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Hs(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;ise({name:e.name},t,{setup:e}))():e}const ct=e=>!!e.type.__asyncLoader;function $f(e){V(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:r=200,timeout:i,suspensible:o=!0,onError:l}=e;let c=null,u,h=0;const d=()=>(h++,c=null,m()),m=()=>{let E;return c||(E=c=t().catch(O=>{if(O=O instanceof Error?O:new Error(String(O)),l)return new Promise((F,K)=>{l(O,()=>F(d()),()=>K(O),h+1)});throw O}).then(O=>E!==c&&c?c:(O&&(O.__esModule||O[Symbol.toStringTag]==="Module")&&(O=O.default),u=O,O)))};return Pi({name:"AsyncComponentWrapper",__asyncLoader:m,get __asyncResolved(){return u},setup(){const E=le;if(u)return()=>es(u,E);const O=p=>{c=null,Mt(p,E,13,!s)};if(o&&E.suspense||Ot)return m().then(p=>()=>es(p,E)).catch(p=>(O(p),()=>s?re(s,{error:p}):null));const F=$t(!1),K=$t(),b=$t(!!r);return r&&setTimeout(()=>{b.value=!1},r),i!=null&&setTimeout(()=>{if(!F.value&&!K.value){const p=new Error(`Async component timed out after ${i}ms.`);O(p),K.value=p}},i),m().then(()=>{F.value=!0,E.parent&&rn(E.parent.vnode)&&Vn(E.parent.update)}).catch(p=>{O(p),K.value=p}),()=>{if(F.value&&u)return es(u,E);if(K.value&&s)return re(s,{error:K.value});if(n&&!b.value)return re(n)}}})}function es(e,t){const{ref:n,props:s,children:r,ce:i}=t.vnode,o=re(e,s,r);return o.ref=n,o.ce=i,delete t.vnode.ce,o}const rn=e=>e.type.__isKeepAlive,Bl={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Ge(),s=n.ctx;if(!s.renderer)return()=>{const p=t.default&&t.default();return p&&p.length===1?p[0]:p};const r=new Map,i=new Set;let o=null;const l=n.suspense,{renderer:{p:c,m:u,um:h,o:{createElement:d}}}=s,m=d("div");s.activate=(p,T,g,A,D)=>{const N=p.component;u(p,T,g,0,l),c(N.vnode,p,T,g,N,l,A,p.slotScopeIds,D),ue(()=>{N.isDeactivated=!1,N.a&&bt(N.a);const C=p.props&&p.props.onVnodeMounted;C&&me(C,N.parent,p)},l)},s.deactivate=p=>{const T=p.component;u(p,m,null,1,l),ue(()=>{T.da&&bt(T.da);const g=p.props&&p.props.onVnodeUnmounted;g&&me(g,T.parent,p),T.isDeactivated=!0},l)};function E(p){ts(p),h(p,n,l,!0)}function O(p){r.forEach((T,g)=>{const A=xs(T.type);A&&(!p||!p(A))&&F(g)})}function F(p){const T=r.get(p);!o||!Oe(T,o)?E(T):o&&ts(o),r.delete(p),i.delete(p)}vt(()=>[e.include,e.exclude],([p,T])=>{p&&O(g=>Dt(p,g)),T&&O(g=>!Dt(T,g))},{flush:"post",deep:!0});let K=null;const b=()=>{K!=null&&r.set(K,ns(n.subTree))};return Yn(b),Ds(b),Us(()=>{r.forEach(p=>{const{subTree:T,suspense:g}=n,A=ns(T);if(p.type===A.type&&p.key===A.key){ts(A);const D=A.component.da;D&&ue(D,g);return}E(p)})}),()=>{if(K=null,!t.default)return null;const p=t.default(),T=p[0];if(p.length>1)return o=null,p;if(!ut(T)||!(T.shapeFlag&4)&&!(T.shapeFlag&128))return o=null,T;let g=ns(T);const A=g.type,D=xs(ct(g)?g.type.__asyncResolved||{}:A),{include:N,exclude:C,max:B}=e;if(N&&(!D||!Dt(N,D))||C&&D&&Dt(C,D))return o=g,T;const H=g.key==null?A:g.key,$=r.get(H);return g.el&&(g=De(g),T.shapeFlag&128&&(T.ssContent=g)),K=H,$?(g.el=$.el,g.component=$.component,g.transition&&At(g,g.transition),g.shapeFlag|=512,i.delete(H),i.add(H)):(i.add(H),B&&i.size>parseInt(B,10)&&F(i.values().next().value)),g.shapeFlag|=256,o=g,Ci(T.type)?T:g}}},Kf=Bl;function Dt(e,t){return M(e)?e.some(n=>Dt(n,t)):ie(e)?e.split(",").includes(t):Co(e)?e.test(t):!1}function Hl(e,t){Oi(e,"a",t)}function Dl(e,t){Oi(e,"da",t)}function Oi(e,t,n=le){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Jn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)rn(r.parent.vnode)&&Ul(s,t,n,r),r=r.parent}}function Ul(e,t,n,s){const r=Jn(t,e,s,!0);js(()=>{Ps(s[t],r)},n)}function ts(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function ns(e){return e.shapeFlag&128?e.ssContent:e}function Jn(e,t,n=le,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;Rt(),Xe(n);const l=Te(t,n,e,o);return Ye(),St(),l});return s?r.unshift(i):r.push(i),i}}const Ue=e=>(t,n=le)=>(!Ot||e==="sp")&&Jn(e,(...s)=>t(...s),n),jl=Ue("bm"),Yn=Ue("m"),$l=Ue("bu"),Ds=Ue("u"),Us=Ue("bum"),js=Ue("um"),Kl=Ue("sp"),Vl=Ue("rtg"),Wl=Ue("rtc");function ql(e,t=le){Jn("ec",e,t)}const $s="components",Jl="directives";function Vf(e,t){return Ks($s,e,!0,t)||e}const Ii=Symbol.for("v-ndc");function Wf(e){return ie(e)?Ks($s,e,!1)||e:e||Ii}function qf(e){return Ks(Jl,e)}function Ks(e,t,n=!0,s=!1){const r=fe||le;if(r){const i=r.type;if(e===$s){const l=xs(i,!1);if(l&&(l===t||l===ve(t)||l===Nn(ve(t))))return i}const o=gr(r[e]||i[e],t)||gr(r.appContext[e],t);return!o&&s?i:o}}function gr(e,t){return e&&(e[t]||e[ve(t)]||e[Nn(ve(t))])}function Jf(e,t,n,s){let r;const i=n&&n[s];if(M(e)||ie(e)){r=new Array(e.length);for(let o=0,l=e.length;ot(o,l,void 0,i&&i[l]));else{const o=Object.keys(e);r=new Array(o.length);for(let l=0,c=o.length;l{const i=s.fn(...r);return i&&(i.key=s.key),i}:s.fn)}return e}function Qf(e,t,n={},s,r){if(fe.isCE||fe.parent&&ct(fe.parent)&&fe.parent.isCE)return t!=="default"&&(n.name=t),re("slot",n,s&&s());let i=e[t];i&&i._c&&(i._d=!1),Js();const o=i&&Fi(i(n)),l=Ki(de,{key:n.key||o&&o.key||`_${t}`},o||(s?s():[]),o&&e._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),i&&i._c&&(i._d=!0),l}function Fi(e){return e.some(t=>ut(t)?!(t.type===ge||t.type===de&&!Fi(t.children)):!0)?e:null}function zf(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:yn(s)]=e[s];return n}const ds=e=>e?Yi(e)?zn(e)||e.proxy:ds(e.parent):null,Kt=se(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ds(e.parent),$root:e=>ds(e.root),$emit:e=>e.emit,$options:e=>Vs(e),$forceUpdate:e=>e.f||(e.f=()=>Vn(e.update)),$nextTick:e=>e.n||(e.n=gi.bind(e.proxy)),$watch:e=>Nl.bind(e)}),ss=(e,t)=>e!==Z&&!e.__isScriptSetup&&Q(e,t),hs={get({_:e},t){const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;let u;if(t[0]!=="$"){const E=o[t];if(E!==void 0)switch(E){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(ss(s,t))return o[t]=1,s[t];if(r!==Z&&Q(r,t))return o[t]=2,r[t];if((u=e.propsOptions[0])&&Q(u,t))return o[t]=3,i[t];if(n!==Z&&Q(n,t))return o[t]=4,n[t];ps&&(o[t]=0)}}const h=Kt[t];let d,m;if(h)return t==="$attrs"&&be(e,"get",t),h(e);if((d=l.__cssModules)&&(d=d[t]))return d;if(n!==Z&&Q(n,t))return o[t]=4,n[t];if(m=c.config.globalProperties,Q(m,t))return m[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return ss(r,t)?(r[t]=n,!0):s!==Z&&Q(s,t)?(s[t]=n,!0):Q(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let l;return!!n[o]||e!==Z&&Q(e,o)||ss(t,o)||(l=i[0])&&Q(l,o)||Q(s,o)||Q(Kt,o)||Q(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Q(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},Yl=se({},hs,{get(e,t){if(t!==Symbol.unscopables)return hs.get(e,t,e)},has(e,t){return t[0]!=="_"&&!Ao(t)}});function Xf(){return null}function Zf(){return null}function Gf(e){}function eu(e){}function tu(){return null}function nu(){}function su(e,t){return null}function ru(){return Ri().slots}function iu(){return Ri().attrs}function ou(e,t,n){const s=Ge();if(n&&n.local){const r=$t(e[t]);return vt(()=>e[t],i=>r.value=i),vt(r,i=>{i!==e[t]&&s.emit(`update:${t}`,i)}),r}else return{__v_isRef:!0,get value(){return e[t]},set value(r){s.emit(`update:${t}`,r)}}}function Ri(){const e=Ge();return e.setupContext||(e.setupContext=Xi(e))}function en(e){return M(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function lu(e,t){const n=en(e);for(const s in t){if(s.startsWith("__skip"))continue;let r=n[s];r?M(r)||V(r)?r=n[s]={type:r,default:t[s]}:r.default=t[s]:r===null&&(r=n[s]={default:t[s]}),r&&t[`__skip_${s}`]&&(r.skipFactory=!0)}return n}function cu(e,t){return!e||!t?e||t:M(e)&&M(t)?e.concat(t):se({},en(e),en(t))}function fu(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function uu(e){const t=Ge();let n=e();return Ye(),Os(n)&&(n=n.catch(s=>{throw Xe(t),s})),[n,()=>Xe(t)]}let ps=!0;function Ql(e){const t=Vs(e),n=e.proxy,s=e.ctx;ps=!1,t.beforeCreate&&mr(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:u,created:h,beforeMount:d,mounted:m,beforeUpdate:E,updated:O,activated:F,deactivated:K,beforeDestroy:b,beforeUnmount:p,destroyed:T,unmounted:g,render:A,renderTracked:D,renderTriggered:N,errorCaptured:C,serverPrefetch:B,expose:H,inheritAttrs:$,components:S,directives:q,filters:L}=t;if(u&&zl(u,s,null),o)for(const ee in o){const te=o[ee];V(te)&&(s[ee]=te.bind(n))}if(r){const ee=r.call(n,n);G(ee)&&(e.data=Ss(ee))}if(ps=!0,i)for(const ee in i){const te=i[ee],et=V(te)?te.bind(n,n):V(te.get)?te.get.bind(n,n):Ie,on=!V(te)&&V(te.set)?te.set.bind(n):Ie,tt=Ec({get:et,set:on});Object.defineProperty(s,ee,{enumerable:!0,configurable:!0,get:()=>tt.value,set:Fe=>tt.value=Fe})}if(l)for(const ee in l)Si(l[ee],s,n,ee);if(c){const ee=V(c)?c.call(n):c;Reflect.ownKeys(ee).forEach(te=>{nc(te,ee[te])})}h&&mr(h,e,"c");function z(ee,te){M(te)?te.forEach(et=>ee(et.bind(n))):te&&ee(te.bind(n))}if(z(jl,d),z(Yn,m),z($l,E),z(Ds,O),z(Hl,F),z(Dl,K),z(ql,C),z(Wl,D),z(Vl,N),z(Us,p),z(js,g),z(Kl,B),M(H))if(H.length){const ee=e.exposed||(e.exposed={});H.forEach(te=>{Object.defineProperty(ee,te,{get:()=>n[te],set:et=>n[te]=et})})}else e.exposed||(e.exposed={});A&&e.render===Ie&&(e.render=A),$!=null&&(e.inheritAttrs=$),S&&(e.components=S),q&&(e.directives=q)}function zl(e,t,n=Ie){M(e)&&(e=gs(e));for(const s in e){const r=e[s];let i;G(r)?"default"in r?i=Cn(r.from||s,r.default,!0):i=Cn(r.from||s):i=Cn(r),ce(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function mr(e,t,n){Te(M(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Si(e,t,n,s){const r=s.includes(".")?Ei(n,s):()=>n[s];if(ie(e)){const i=t[e];V(i)&&vt(r,i)}else if(V(e))vt(r,e.bind(n));else if(G(e))if(M(e))e.forEach(i=>Si(i,t,n,s));else{const i=V(e.handler)?e.handler.bind(n):t[e.handler];V(i)&&vt(r,i,e)}}function Vs(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(u=>In(c,u,o,!0)),In(c,t,o)),G(t)&&i.set(t,c),c}function In(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&In(e,i,n,!0),r&&r.forEach(o=>In(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=Xl[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const Xl={data:_r,props:br,emits:br,methods:Ut,computed:Ut,beforeCreate:pe,created:pe,beforeMount:pe,mounted:pe,beforeUpdate:pe,updated:pe,beforeDestroy:pe,beforeUnmount:pe,destroyed:pe,unmounted:pe,activated:pe,deactivated:pe,errorCaptured:pe,serverPrefetch:pe,components:Ut,directives:Ut,watch:Gl,provide:_r,inject:Zl};function _r(e,t){return t?e?function(){return se(V(e)?e.call(this,this):e,V(t)?t.call(this,this):t)}:t:e}function Zl(e,t){return Ut(gs(e),gs(t))}function gs(e){if(M(e)){const t={};for(let n=0;n1)return n&&V(t)?t.call(s&&s.proxy):t}}function au(){return!!(le||fe||tn)}function sc(e,t,n,s=!1){const r={},i={};En(i,Qn,1),e.propsDefaults=Object.create(null),Ni(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:fl(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function rc(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=Y(r),[c]=e.propsOptions;let u=!1;if((s||o>0)&&!(o&16)){if(o&8){const h=e.vnode.dynamicProps;for(let d=0;d{c=!0;const[m,E]=Li(d,t,!0);se(o,m),E&&l.push(...E)};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!i&&!c)return G(e)&&s.set(e,mt),mt;if(M(i))for(let h=0;h-1,E[1]=F<0||O-1||Q(E,"default"))&&l.push(d)}}}const u=[o,l];return G(e)&&s.set(e,u),u}function yr(e){return e[0]!=="$"}function xr(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function Cr(e,t){return xr(e)===xr(t)}function vr(e,t){return M(t)?t.findIndex(n=>Cr(n,e)):V(t)&&Cr(t,e)?0:-1}const ki=e=>e[0]==="_"||e==="$stable",Ws=e=>M(e)?e.map(Ce):[Ce(e)],ic=(e,t,n)=>{if(t._n)return t;const s=xi((...r)=>Ws(t(...r)),n);return s._c=!1,s},Bi=(e,t,n)=>{const s=e._ctx;for(const r in e){if(ki(r))continue;const i=e[r];if(V(i))t[r]=ic(r,i,s);else if(i!=null){const o=Ws(i);t[r]=()=>o}}},Hi=(e,t)=>{const n=Ws(t);e.slots.default=()=>n},oc=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=Y(t),En(t,"_",n)):Bi(t,e.slots={})}else e.slots={},t&&Hi(e,t);En(e.slots,Qn,1)},lc=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=Z;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:(se(r,t),!n&&l===1&&delete r._):(i=!t.$stable,Bi(t,r)),o=t}else t&&(Hi(e,t),o={default:1});if(i)for(const l in r)!ki(l)&&!(l in o)&&delete r[l]};function Fn(e,t,n,s,r=!1){if(M(e)){e.forEach((m,E)=>Fn(m,t&&(M(t)?t[E]:t),n,s,r));return}if(ct(s)&&!r)return;const i=s.shapeFlag&4?zn(s.component)||s.component.proxy:s.el,o=r?null:i,{i:l,r:c}=e,u=t&&t.r,h=l.refs===Z?l.refs={}:l.refs,d=l.setupState;if(u!=null&&u!==c&&(ie(u)?(h[u]=null,Q(d,u)&&(d[u]=null)):ce(u)&&(u.value=null)),V(c))Je(c,l,12,[o,h]);else{const m=ie(c),E=ce(c);if(m||E){const O=()=>{if(e.f){const F=m?Q(d,c)?d[c]:h[c]:c.value;r?M(F)&&Ps(F,i):M(F)?F.includes(i)||F.push(i):m?(h[c]=[i],Q(d,c)&&(d[c]=h[c])):(c.value=[i],e.k&&(h[e.k]=c.value))}else m?(h[c]=o,Q(d,c)&&(d[c]=o)):E&&(c.value=o,e.k&&(h[e.k]=o))};o?(O.id=-1,ue(O,n)):O()}}}let $e=!1;const gn=e=>/svg/.test(e.namespaceURI)&&e.tagName!=="foreignObject",mn=e=>e.nodeType===8;function cc(e){const{mt:t,p:n,o:{patchProp:s,createText:r,nextSibling:i,parentNode:o,remove:l,insert:c,createComment:u}}=e,h=(b,p)=>{if(!p.hasChildNodes()){n(null,b,p),On(),p._vnode=b;return}$e=!1,d(p.firstChild,b,null,null,null),On(),p._vnode=b,$e&&console.error("Hydration completed but contains mismatches.")},d=(b,p,T,g,A,D=!1)=>{const N=mn(b)&&b.data==="[",C=()=>F(b,p,T,g,A,N),{type:B,ref:H,shapeFlag:$,patchFlag:S}=p;let q=b.nodeType;p.el=b,S===-2&&(D=!1,p.dynamicChildren=null);let L=null;switch(B){case Pt:q!==3?p.children===""?(c(p.el=r(""),o(b),b),L=b):L=C():(b.data!==p.children&&($e=!0,b.data=p.children),L=i(b));break;case ge:q!==8||N?L=C():L=i(b);break;case Et:if(N&&(b=i(b),q=b.nodeType),q===1||q===3){L=b;const ae=!p.children.length;for(let z=0;z{D=D||!!p.dynamicChildren;const{type:N,props:C,patchFlag:B,shapeFlag:H,dirs:$}=p,S=N==="input"&&$||N==="option";if(S||B!==-1){if($&&Se(p,null,T,"created"),C)if(S||!D||B&48)for(const L in C)(S&&L.endsWith("value")||nn(L)&&!jt(L))&&s(b,L,null,C[L],!1,void 0,T);else C.onClick&&s(b,"onClick",null,C.onClick,!1,void 0,T);let q;if((q=C&&C.onVnodeBeforeMount)&&me(q,T,p),$&&Se(p,null,T,"beforeMount"),((q=C&&C.onVnodeMounted)||$)&&vi(()=>{q&&me(q,T,p),$&&Se(p,null,T,"mounted")},g),H&16&&!(C&&(C.innerHTML||C.textContent))){let L=E(b.firstChild,p,b,T,g,A,D);for(;L;){$e=!0;const ae=L;L=L.nextSibling,l(ae)}}else H&8&&b.textContent!==p.children&&($e=!0,b.textContent=p.children)}return b.nextSibling},E=(b,p,T,g,A,D,N)=>{N=N||!!p.dynamicChildren;const C=p.children,B=C.length;for(let H=0;H{const{slotScopeIds:N}=p;N&&(A=A?A.concat(N):N);const C=o(b),B=E(i(b),p,C,T,g,A,D);return B&&mn(B)&&B.data==="]"?i(p.anchor=B):($e=!0,c(p.anchor=u("]"),C,B),B)},F=(b,p,T,g,A,D)=>{if($e=!0,p.el=null,D){const B=K(b);for(;;){const H=i(b);if(H&&H!==B)l(H);else break}}const N=i(b),C=o(b);return l(b),n(null,p,C,N,T,g,gn(C),A),N},K=b=>{let p=0;for(;b;)if(b=i(b),b&&mn(b)&&(b.data==="["&&p++,b.data==="]")){if(p===0)return i(b);p--}return b};return[h,d]}const ue=vi;function fc(e){return Di(e)}function uc(e){return Di(e,cc)}function Di(e,t){const n=ls();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:u,setElementText:h,parentNode:d,nextSibling:m,setScopeId:E=Ie,insertStaticContent:O}=e,F=(f,a,_,x=null,y=null,P=null,R=!1,w=null,I=!!a.dynamicChildren)=>{if(f===a)return;f&&!Oe(f,a)&&(x=ln(f),Fe(f,y,P,!0),f=null),a.patchFlag===-2&&(I=!1,a.dynamicChildren=null);const{type:v,ref:U,shapeFlag:k}=a;switch(v){case Pt:K(f,a,_,x);break;case ge:b(f,a,_,x);break;case Et:f==null&&p(a,_,x,R);break;case de:S(f,a,_,x,y,P,R,w,I);break;default:k&1?A(f,a,_,x,y,P,R,w,I):k&6?q(f,a,_,x,y,P,R,w,I):(k&64||k&128)&&v.process(f,a,_,x,y,P,R,w,I,dt)}U!=null&&y&&Fn(U,f&&f.ref,P,a||f,!a)},K=(f,a,_,x)=>{if(f==null)s(a.el=l(a.children),_,x);else{const y=a.el=f.el;a.children!==f.children&&u(y,a.children)}},b=(f,a,_,x)=>{f==null?s(a.el=c(a.children||""),_,x):a.el=f.el},p=(f,a,_,x)=>{[f.el,f.anchor]=O(f.children,a,_,x,f.el,f.anchor)},T=({el:f,anchor:a},_,x)=>{let y;for(;f&&f!==a;)y=m(f),s(f,_,x),f=y;s(a,_,x)},g=({el:f,anchor:a})=>{let _;for(;f&&f!==a;)_=m(f),r(f),f=_;r(a)},A=(f,a,_,x,y,P,R,w,I)=>{R=R||a.type==="svg",f==null?D(a,_,x,y,P,R,w,I):B(f,a,y,P,R,w,I)},D=(f,a,_,x,y,P,R,w)=>{let I,v;const{type:U,props:k,shapeFlag:j,transition:W,dirs:J}=f;if(I=f.el=o(f.type,P,k&&k.is,k),j&8?h(I,f.children):j&16&&C(f.children,I,null,x,y,P&&U!=="foreignObject",R,w),J&&Se(f,null,x,"created"),N(I,f,f.scopeId,R,x),k){for(const X in k)X!=="value"&&!jt(X)&&i(I,X,null,k[X],P,f.children,x,y,Ne);"value"in k&&i(I,"value",null,k.value),(v=k.onVnodeBeforeMount)&&me(v,x,f)}J&&Se(f,null,x,"beforeMount");const ne=(!y||y&&!y.pendingBranch)&&W&&!W.persisted;ne&&W.beforeEnter(I),s(I,a,_),((v=k&&k.onVnodeMounted)||ne||J)&&ue(()=>{v&&me(v,x,f),ne&&W.enter(I),J&&Se(f,null,x,"mounted")},y)},N=(f,a,_,x,y)=>{if(_&&E(f,_),x)for(let P=0;P{for(let v=I;v{const w=a.el=f.el;let{patchFlag:I,dynamicChildren:v,dirs:U}=a;I|=f.patchFlag&16;const k=f.props||Z,j=a.props||Z;let W;_&&nt(_,!1),(W=j.onVnodeBeforeUpdate)&&me(W,_,a,f),U&&Se(a,f,_,"beforeUpdate"),_&&nt(_,!0);const J=y&&a.type!=="foreignObject";if(v?H(f.dynamicChildren,v,w,_,x,J,P):R||te(f,a,w,null,_,x,J,P,!1),I>0){if(I&16)$(w,a,k,j,_,x,y);else if(I&2&&k.class!==j.class&&i(w,"class",null,j.class,y),I&4&&i(w,"style",k.style,j.style,y),I&8){const ne=a.dynamicProps;for(let X=0;X{W&&me(W,_,a,f),U&&Se(a,f,_,"updated")},x)},H=(f,a,_,x,y,P,R)=>{for(let w=0;w{if(_!==x){if(_!==Z)for(const w in _)!jt(w)&&!(w in x)&&i(f,w,_[w],null,R,a.children,y,P,Ne);for(const w in x){if(jt(w))continue;const I=x[w],v=_[w];I!==v&&w!=="value"&&i(f,w,v,I,R,a.children,y,P,Ne)}"value"in x&&i(f,"value",_.value,x.value)}},S=(f,a,_,x,y,P,R,w,I)=>{const v=a.el=f?f.el:l(""),U=a.anchor=f?f.anchor:l("");let{patchFlag:k,dynamicChildren:j,slotScopeIds:W}=a;W&&(w=w?w.concat(W):W),f==null?(s(v,_,x),s(U,_,x),C(a.children,_,U,y,P,R,w,I)):k>0&&k&64&&j&&f.dynamicChildren?(H(f.dynamicChildren,j,_,y,P,R,w),(a.key!=null||y&&a===y.subTree)&&qs(f,a,!0)):te(f,a,_,U,y,P,R,w,I)},q=(f,a,_,x,y,P,R,w,I)=>{a.slotScopeIds=w,f==null?a.shapeFlag&512?y.ctx.activate(a,_,x,R,I):L(a,_,x,y,P,R,I):ae(f,a,I)},L=(f,a,_,x,y,P,R)=>{const w=f.component=Ji(f,x,y);if(rn(f)&&(w.ctx.renderer=dt),Qi(w),w.asyncDep){if(y&&y.registerDep(w,z),!f.el){const I=w.subTree=re(ge);b(null,I,a,_)}return}z(w,f,a,_,y,P,R)},ae=(f,a,_)=>{const x=a.component=f.component;if(Al(f,a,_))if(x.asyncDep&&!x.asyncResolved){ee(x,a,_);return}else x.next=a,yl(x.update),x.update();else a.el=f.el,x.vnode=a},z=(f,a,_,x,y,P,R)=>{const w=()=>{if(f.isMounted){let{next:U,bu:k,u:j,parent:W,vnode:J}=f,ne=U,X;nt(f,!1),U?(U.el=J.el,ee(f,U,R)):U=J,k&&bt(k),(X=U.props&&U.props.onVnodeBeforeUpdate)&&me(X,W,U,J),nt(f,!0);const oe=xn(f),Ae=f.subTree;f.subTree=oe,F(Ae,oe,d(Ae.el),ln(Ae),f,y,P),U.el=oe.el,ne===null&&ks(f,oe.el),j&&ue(j,y),(X=U.props&&U.props.onVnodeUpdated)&&ue(()=>me(X,W,U,J),y)}else{let U;const{el:k,props:j}=a,{bm:W,m:J,parent:ne}=f,X=ct(a);if(nt(f,!1),W&&bt(W),!X&&(U=j&&j.onVnodeBeforeMount)&&me(U,ne,a),nt(f,!0),k&&Zn){const oe=()=>{f.subTree=xn(f),Zn(k,f.subTree,f,y,null)};X?a.type.__asyncLoader().then(()=>!f.isUnmounted&&oe()):oe()}else{const oe=f.subTree=xn(f);F(null,oe,_,x,f,y,P),a.el=oe.el}if(J&&ue(J,y),!X&&(U=j&&j.onVnodeMounted)){const oe=a;ue(()=>me(U,ne,oe),y)}(a.shapeFlag&256||ne&&ct(ne.vnode)&&ne.vnode.shapeFlag&256)&&f.a&&ue(f.a,y),f.isMounted=!0,a=_=x=null}},I=f.effect=new Hn(w,()=>Vn(v),f.scope),v=f.update=()=>I.run();v.id=f.uid,nt(f,!0),v()},ee=(f,a,_)=>{a.component=f;const x=f.vnode.props;f.vnode=a,f.next=null,rc(f,a.props,x,_),lc(f,a.children,_),Rt(),ar(),St()},te=(f,a,_,x,y,P,R,w,I=!1)=>{const v=f&&f.children,U=f?f.shapeFlag:0,k=a.children,{patchFlag:j,shapeFlag:W}=a;if(j>0){if(j&128){on(v,k,_,x,y,P,R,w,I);return}else if(j&256){et(v,k,_,x,y,P,R,w,I);return}}W&8?(U&16&&Ne(v,y,P),k!==v&&h(_,k)):U&16?W&16?on(v,k,_,x,y,P,R,w,I):Ne(v,y,P,!0):(U&8&&h(_,""),W&16&&C(k,_,x,y,P,R,w,I))},et=(f,a,_,x,y,P,R,w,I)=>{f=f||mt,a=a||mt;const v=f.length,U=a.length,k=Math.min(v,U);let j;for(j=0;jU?Ne(f,y,P,!0,!1,k):C(a,_,x,y,P,R,w,I,k)},on=(f,a,_,x,y,P,R,w,I)=>{let v=0;const U=a.length;let k=f.length-1,j=U-1;for(;v<=k&&v<=j;){const W=f[v],J=a[v]=I?We(a[v]):Ce(a[v]);if(Oe(W,J))F(W,J,_,null,y,P,R,w,I);else break;v++}for(;v<=k&&v<=j;){const W=f[k],J=a[j]=I?We(a[j]):Ce(a[j]);if(Oe(W,J))F(W,J,_,null,y,P,R,w,I);else break;k--,j--}if(v>k){if(v<=j){const W=j+1,J=Wj)for(;v<=k;)Fe(f[v],y,P,!0),v++;else{const W=v,J=v,ne=new Map;for(v=J;v<=j;v++){const ye=a[v]=I?We(a[v]):Ce(a[v]);ye.key!=null&&ne.set(ye.key,v)}let X,oe=0;const Ae=j-J+1;let ht=!1,Gs=0;const Nt=new Array(Ae);for(v=0;v=Ae){Fe(ye,y,P,!0);continue}let Re;if(ye.key!=null)Re=ne.get(ye.key);else for(X=J;X<=j;X++)if(Nt[X-J]===0&&Oe(ye,a[X])){Re=X;break}Re===void 0?Fe(ye,y,P,!0):(Nt[Re-J]=v+1,Re>=Gs?Gs=Re:ht=!0,F(ye,a[Re],_,null,y,P,R,w,I),oe++)}const er=ht?ac(Nt):mt;for(X=er.length-1,v=Ae-1;v>=0;v--){const ye=J+v,Re=a[ye],tr=ye+1{const{el:P,type:R,transition:w,children:I,shapeFlag:v}=f;if(v&6){tt(f.component.subTree,a,_,x);return}if(v&128){f.suspense.move(a,_,x);return}if(v&64){R.move(f,a,_,dt);return}if(R===de){s(P,a,_);for(let k=0;kw.enter(P),y);else{const{leave:k,delayLeave:j,afterLeave:W}=w,J=()=>s(P,a,_),ne=()=>{k(P,()=>{J(),W&&W()})};j?j(P,J,ne):ne()}else s(P,a,_)},Fe=(f,a,_,x=!1,y=!1)=>{const{type:P,props:R,ref:w,children:I,dynamicChildren:v,shapeFlag:U,patchFlag:k,dirs:j}=f;if(w!=null&&Fn(w,null,_,f,!0),U&256){a.ctx.deactivate(f);return}const W=U&1&&j,J=!ct(f);let ne;if(J&&(ne=R&&R.onVnodeBeforeUnmount)&&me(ne,a,f),U&6)_o(f.component,_,x);else{if(U&128){f.suspense.unmount(_,x);return}W&&Se(f,null,a,"beforeUnmount"),U&64?f.type.remove(f,a,_,y,dt,x):v&&(P!==de||k>0&&k&64)?Ne(v,a,_,!1,!0):(P===de&&k&384||!y&&U&16)&&Ne(I,a,_),x&&Xs(f)}(J&&(ne=R&&R.onVnodeUnmounted)||W)&&ue(()=>{ne&&me(ne,a,f),W&&Se(f,null,a,"unmounted")},_)},Xs=f=>{const{type:a,el:_,anchor:x,transition:y}=f;if(a===de){mo(_,x);return}if(a===Et){g(f);return}const P=()=>{r(_),y&&!y.persisted&&y.afterLeave&&y.afterLeave()};if(f.shapeFlag&1&&y&&!y.persisted){const{leave:R,delayLeave:w}=y,I=()=>R(_,P);w?w(f.el,P,I):I()}else P()},mo=(f,a)=>{let _;for(;f!==a;)_=m(f),r(f),f=_;r(a)},_o=(f,a,_)=>{const{bum:x,scope:y,update:P,subTree:R,um:w}=f;x&&bt(x),y.stop(),P&&(P.active=!1,Fe(R,f,a,_)),w&&ue(w,a),ue(()=>{f.isUnmounted=!0},a),a&&a.pendingBranch&&!a.isUnmounted&&f.asyncDep&&!f.asyncResolved&&f.suspenseId===a.pendingId&&(a.deps--,a.deps===0&&a.resolve())},Ne=(f,a,_,x=!1,y=!1,P=0)=>{for(let R=P;Rf.shapeFlag&6?ln(f.component.subTree):f.shapeFlag&128?f.suspense.next():m(f.anchor||f.el),Zs=(f,a,_)=>{f==null?a._vnode&&Fe(a._vnode,null,null,!0):F(a._vnode||null,f,a,null,null,null,_),ar(),On(),a._vnode=f},dt={p:F,um:Fe,m:tt,r:Xs,mt:L,mc:C,pc:te,pbc:H,n:ln,o:e};let Xn,Zn;return t&&([Xn,Zn]=t(dt)),{render:Zs,hydrate:Xn,createApp:tc(Zs,Xn)}}function nt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function qs(e,t,n=!1){const s=e.children,r=t.children;if(M(s)&&M(r))for(let i=0;i>1,e[n[l]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}const dc=e=>e.__isTeleport,Vt=e=>e&&(e.disabled||e.disabled===""),Er=e=>typeof SVGElement<"u"&&e instanceof SVGElement,_s=(e,t)=>{const n=e&&e.to;return ie(n)?t?t(n):null:n},hc={__isTeleport:!0,process(e,t,n,s,r,i,o,l,c,u){const{mc:h,pc:d,pbc:m,o:{insert:E,querySelector:O,createText:F,createComment:K}}=u,b=Vt(t.props);let{shapeFlag:p,children:T,dynamicChildren:g}=t;if(e==null){const A=t.el=F(""),D=t.anchor=F("");E(A,n,s),E(D,n,s);const N=t.target=_s(t.props,O),C=t.targetAnchor=F("");N&&(E(C,N),o=o||Er(N));const B=(H,$)=>{p&16&&h(T,H,$,r,i,o,l,c)};b?B(n,D):N&&B(N,C)}else{t.el=e.el;const A=t.anchor=e.anchor,D=t.target=e.target,N=t.targetAnchor=e.targetAnchor,C=Vt(e.props),B=C?n:D,H=C?A:N;if(o=o||Er(D),g?(m(e.dynamicChildren,g,B,r,i,o,l),qs(e,t,!0)):c||d(e,t,B,H,r,i,o,l,!1),b)C||_n(t,n,A,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const $=t.target=_s(t.props,O);$&&_n(t,$,null,u,0)}else C&&_n(t,D,N,u,1)}Ui(t)},remove(e,t,n,s,{um:r,o:{remove:i}},o){const{shapeFlag:l,children:c,anchor:u,targetAnchor:h,target:d,props:m}=e;if(d&&i(h),(o||!Vt(m))&&(i(u),l&16))for(let E=0;E0?_e||mt:null,ji(),ft>0&&_e&&_e.push(e),e}function hu(e,t,n,s,r,i){return $i(Wi(e,t,n,s,r,i,!0))}function Ki(e,t,n,s,r){return $i(re(e,t,n,s,r,!0))}function ut(e){return e?e.__v_isVNode===!0:!1}function Oe(e,t){return e.type===t.type&&e.key===t.key}function pu(e){}const Qn="__vInternal",Vi=({key:e})=>e??null,vn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ie(e)||ce(e)||V(e)?{i:fe,r:e,k:t,f:!!n}:e:null);function Wi(e,t=null,n=null,s=0,r=null,i=e===de?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Vi(t),ref:t&&vn(t),scopeId:qn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:fe};return l?(Ys(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=ie(n)?8:16),ft>0&&!o&&_e&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&_e.push(c),c}const re=gc;function gc(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Ii)&&(e=ge),ut(e)){const l=De(e,t,!0);return n&&Ys(l,n),ft>0&&!i&&_e&&(l.shapeFlag&6?_e[_e.indexOf(e)]=l:_e.push(l)),l.patchFlag|=-2,l}if(vc(e)&&(e=e.__vccOpts),t){t=mc(t);let{class:l,style:c}=t;l&&!ie(l)&&(t.class=kn(l)),G(c)&&(ci(c)&&!M(c)&&(c=se({},c)),t.style=Ln(c))}const o=ie(e)?1:Ci(e)?128:dc(e)?64:G(e)?4:V(e)?2:0;return Wi(e,t,n,s,r,o,i,!0)}function mc(e){return e?ci(e)||Qn in e?se({},e):e:null}function De(e,t,n=!1){const{props:s,ref:r,patchFlag:i,children:o}=e,l=t?_c(s||{},t):s;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Vi(l),ref:t&&t.ref?n&&r?M(r)?r.concat(vn(t)):[r,vn(t)]:vn(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==de?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&De(e.ssContent),ssFallback:e.ssFallback&&De(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function qi(e=" ",t=0){return re(Pt,null,e,t)}function gu(e,t){const n=re(Et,null,e);return n.staticCount=t,n}function mu(e="",t=!1){return t?(Js(),Ki(ge,null,e)):re(ge,null,e)}function Ce(e){return e==null||typeof e=="boolean"?re(ge):M(e)?re(de,null,e.slice()):typeof e=="object"?We(e):re(Pt,null,String(e))}function We(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:De(e)}function Ys(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(M(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Ys(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!(Qn in t)?t._ctx=fe:r===3&&fe&&(fe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else V(t)?(t={default:t,_ctx:fe},n=32):(t=String(t),s&64?(n=16,t=[qi(t)]):n=8);e.children=t,e.shapeFlag|=n}function _c(...e){const t={};for(let n=0;nle||fe;let Qs,pt,Tr="__VUE_INSTANCE_SETTERS__";(pt=ls()[Tr])||(pt=ls()[Tr]=[]),pt.push(e=>le=e),Qs=e=>{pt.length>1?pt.forEach(t=>t(e)):pt[0](e)};const Xe=e=>{Qs(e),e.scope.on()},Ye=()=>{le&&le.scope.off(),Qs(null)};function Yi(e){return e.vnode.shapeFlag&4}let Ot=!1;function Qi(e,t=!1){Ot=t;const{props:n,children:s}=e.vnode,r=Yi(e);sc(e,n,r,t),oc(e,s);const i=r?xc(e,t):void 0;return Ot=!1,i}function xc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=fi(new Proxy(e.ctx,hs));const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?Xi(e):null;Xe(e),Rt();const i=Je(s,e,0,[e.props,r]);if(St(),Ye(),Os(i)){if(i.then(Ye,Ye),t)return i.then(o=>{bs(e,o,t)}).catch(o=>{Mt(o,e,0)});e.asyncDep=i}else bs(e,i,t)}else zi(e,t)}function bs(e,t,n){V(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:G(t)&&(e.setupState=di(t)),zi(e,n)}let Rn,ys;function _u(e){Rn=e,ys=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,Yl))}}const bu=()=>!Rn;function zi(e,t,n){const s=e.type;if(!e.render){if(!t&&Rn&&!s.render){const r=s.template||Vs(e).template;if(r){const{isCustomElement:i,compilerOptions:o}=e.appContext.config,{delimiters:l,compilerOptions:c}=s,u=se(se({isCustomElement:i,delimiters:l},o),c);s.render=Rn(r,u)}}e.render=s.render||Ie,ys&&ys(e)}Xe(e),Rt(),Ql(e),St(),Ye()}function Cc(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return be(e,"get","$attrs"),t[n]}}))}function Xi(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return Cc(e)},slots:e.slots,emit:e.emit,expose:t}}function zn(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(di(fi(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Kt)return Kt[n](e)},has(t,n){return n in t||n in Kt}}))}function xs(e,t=!0){return V(e)?e.displayName||e.name:e.name||t&&e.__name}function vc(e){return V(e)&&"__vccOpts"in e}const Ec=(e,t)=>ml(e,t,Ot);function wc(e,t,n){const s=arguments.length;return s===2?G(t)&&!M(t)?ut(t)?re(e,null,[t]):re(e,t):re(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&ut(n)&&(n=[n]),re(e,t,n))}const Tc=Symbol.for("v-scx"),Ac=()=>Cn(Tc);function yu(){}function xu(e,t,n,s){const r=n[s];if(r&&Pc(r,e))return r;const i=t();return i.memo=e.slice(),n[s]=i}function Pc(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s0&&_e&&_e.push(e),!0}const Oc="3.3.4",Ic={createComponentInstance:Ji,setupComponent:Qi,renderComponentRoot:xn,setCurrentRenderingInstance:Xt,isVNode:ut,normalizeVNode:Ce},Cu=Ic,vu=null,Eu=null,Fc="http://www.w3.org/2000/svg",it=typeof document<"u"?document:null,Ar=it&&it.createElement("template"),Rc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t?it.createElementNS(Fc,e):it.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>it.createTextNode(e),createComment:e=>it.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>it.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{Ar.innerHTML=s?`${e}`:e;const l=Ar.content;if(s){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function Sc(e,t,n){const s=e._vtc;s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function Mc(e,t,n){const s=e.style,r=ie(n);if(n&&!r){if(t&&!ie(t))for(const i in t)n[i]==null&&Cs(s,i,"");for(const i in n)Cs(s,i,n[i])}else{const i=s.display;r?t!==n&&(s.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(s.display=i)}}const Pr=/\s*!important$/;function Cs(e,t,n){if(M(n))n.forEach(s=>Cs(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Nc(e,t);Pr.test(n)?e.setProperty(we(s),n.replace(Pr,""),"important"):e[s]=n}}const Or=["Webkit","Moz","ms"],rs={};function Nc(e,t){const n=rs[t];if(n)return n;let s=ve(t);if(s!=="filter"&&s in e)return rs[t]=s;s=Nn(s);for(let r=0;ris||(Uc.then(()=>is=0),is=Date.now());function $c(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Te(Kc(s,n.value),t,5,[s])};return n.value=e,n.attached=jc(),n}function Kc(e,t){if(M(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const Rr=/^on[a-z]/,Vc=(e,t,n,s,r=!1,i,o,l,c)=>{t==="class"?Sc(e,s,r):t==="style"?Mc(e,n,s):nn(t)?As(t)||Hc(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Wc(e,t,s,r))?kc(e,t,s,i,o,l,c):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Lc(e,t,s,r))};function Wc(e,t,n,s){return s?!!(t==="innerHTML"||t==="textContent"||t in e&&Rr.test(t)&&V(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||Rr.test(t)&&ie(n)?!1:t in e}function qc(e,t){const n=Pi(e);class s extends zs{constructor(i){super(n,i,t)}}return s.def=n,s}const wu=e=>qc(e,df),Jc=typeof HTMLElement<"u"?HTMLElement:class{};class zs extends Jc{constructor(t,n={},s){super(),this._def=t,this._props=n,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&s?s(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,gi(()=>{this._connected||(jr(null,this.shadowRoot),this._instance=null)})}_resolveDef(){this._resolved=!0;for(let s=0;s{for(const r of s)this._setAttr(r.attributeName)}).observe(this,{attributes:!0});const t=(s,r=!1)=>{const{props:i,styles:o}=s;let l;if(i&&!M(i))for(const c in i){const u=i[c];(u===Number||u&&u.type===Number)&&(c in this._props&&(this._props[c]=Tn(this._props[c])),(l||(l=Object.create(null)))[ve(c)]=!0)}this._numberProps=l,r&&this._resolveProps(s),this._applyStyles(o),this._update()},n=this._def.__asyncLoader;n?n().then(s=>t(s,!0)):t(this._def)}_resolveProps(t){const{props:n}=t,s=M(n)?n:Object.keys(n||{});for(const r of Object.keys(this))r[0]!=="_"&&s.includes(r)&&this._setProp(r,this[r],!0,!1);for(const r of s.map(ve))Object.defineProperty(this,r,{get(){return this._getProp(r)},set(i){this._setProp(r,i)}})}_setAttr(t){let n=this.getAttribute(t);const s=ve(t);this._numberProps&&this._numberProps[s]&&(n=Tn(n)),this._setProp(s,n,!1)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,r=!0){n!==this._props[t]&&(this._props[t]=n,r&&this._instance&&this._update(),s&&(n===!0?this.setAttribute(we(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(we(t),n+""):n||this.removeAttribute(we(t))))}_update(){jr(this._createVNode(),this.shadowRoot)}_createVNode(){const t=re(this._def,se({},this._props));return this._instance||(t.ce=n=>{this._instance=n,n.isCE=!0;const s=(i,o)=>{this.dispatchEvent(new CustomEvent(i,{detail:o}))};n.emit=(i,...o)=>{s(i,o),we(i)!==i&&s(we(i),o)};let r=this;for(;r=r&&(r.parentNode||r.host);)if(r instanceof zs){n.parent=r._instance,n.provides=r._instance.provides;break}}),t}_applyStyles(t){t&&t.forEach(n=>{const s=document.createElement("style");s.textContent=n,this.shadowRoot.appendChild(s)})}}function Tu(e="$style"){{const t=Ge();if(!t)return Z;const n=t.type.__cssModules;if(!n)return Z;const s=n[e];return s||Z}}function Au(e){const t=Ge();if(!t)return;const n=t.ut=(r=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Es(i,r))},s=()=>{const r=e(t.proxy);vs(t.subTree,r),n(r)};Ml(s),Yn(()=>{const r=new MutationObserver(s);r.observe(t.subTree.el.parentNode,{childList:!0}),js(()=>r.disconnect())})}function vs(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{vs(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Es(e.el,t);else if(e.type===de)e.children.forEach(n=>vs(n,t));else if(e.type===Et){let{el:n,anchor:s}=e;for(;n&&(Es(n,t),n!==s);)n=n.nextSibling}}function Es(e,t){if(e.nodeType===1){const n=e.style;for(const s in t)n.setProperty(`--${s}`,t[s])}}const Ke="transition",kt="animation",Zi=(e,{slots:t})=>wc(kl,eo(e),t);Zi.displayName="Transition";const Gi={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Yc=Zi.props=se({},Ti,Gi),st=(e,t=[])=>{M(e)?e.forEach(n=>n(...t)):e&&e(...t)},Sr=e=>e?M(e)?e.some(t=>t.length>1):e.length>1:!1;function eo(e){const t={};for(const S in e)S in Gi||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:u=o,appearToClass:h=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:E=`${n}-leave-to`}=e,O=Qc(r),F=O&&O[0],K=O&&O[1],{onBeforeEnter:b,onEnter:p,onEnterCancelled:T,onLeave:g,onLeaveCancelled:A,onBeforeAppear:D=b,onAppear:N=p,onAppearCancelled:C=T}=t,B=(S,q,L)=>{Ve(S,q?h:l),Ve(S,q?u:o),L&&L()},H=(S,q)=>{S._isLeaving=!1,Ve(S,d),Ve(S,E),Ve(S,m),q&&q()},$=S=>(q,L)=>{const ae=S?N:p,z=()=>B(q,S,L);st(ae,[q,z]),Mr(()=>{Ve(q,S?c:i),Le(q,S?h:l),Sr(ae)||Nr(q,s,F,z)})};return se(t,{onBeforeEnter(S){st(b,[S]),Le(S,i),Le(S,o)},onBeforeAppear(S){st(D,[S]),Le(S,c),Le(S,u)},onEnter:$(!1),onAppear:$(!0),onLeave(S,q){S._isLeaving=!0;const L=()=>H(S,q);Le(S,d),no(),Le(S,m),Mr(()=>{S._isLeaving&&(Ve(S,d),Le(S,E),Sr(g)||Nr(S,s,K,L))}),st(g,[S,L])},onEnterCancelled(S){B(S,!1),st(T,[S])},onAppearCancelled(S){B(S,!0),st(C,[S])},onLeaveCancelled(S){H(S),st(A,[S])}})}function Qc(e){if(e==null)return null;if(G(e))return[os(e.enter),os(e.leave)];{const t=os(e);return[t,t]}}function os(e){return Tn(e)}function Le(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function Ve(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function Mr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let zc=0;function Nr(e,t,n,s){const r=e._endId=++zc,i=()=>{r===e._endId&&s()};if(n)return setTimeout(i,n);const{type:o,timeout:l,propCount:c}=to(e,t);if(!o)return s();const u=o+"end";let h=0;const d=()=>{e.removeEventListener(u,m),i()},m=E=>{E.target===e&&++h>=c&&d()};setTimeout(()=>{h(n[O]||"").split(", "),r=s(`${Ke}Delay`),i=s(`${Ke}Duration`),o=Lr(r,i),l=s(`${kt}Delay`),c=s(`${kt}Duration`),u=Lr(l,c);let h=null,d=0,m=0;t===Ke?o>0&&(h=Ke,d=o,m=i.length):t===kt?u>0&&(h=kt,d=u,m=c.length):(d=Math.max(o,u),h=d>0?o>u?Ke:kt:null,m=h?h===Ke?i.length:c.length:0);const E=h===Ke&&/\b(transform|all)(,|$)/.test(s(`${Ke}Property`).toString());return{type:h,timeout:d,propCount:m,hasTransform:E}}function Lr(e,t){for(;e.lengthkr(n)+kr(e[s])))}function kr(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function no(){return document.body.offsetHeight}const so=new WeakMap,ro=new WeakMap,io={name:"TransitionGroup",props:se({},Yc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ge(),s=wi();let r,i;return Ds(()=>{if(!r.length)return;const o=e.moveClass||`${e.name||"v"}-move`;if(!tf(r[0].el,n.vnode.el,o))return;r.forEach(Zc),r.forEach(Gc);const l=r.filter(ef);no(),l.forEach(c=>{const u=c.el,h=u.style;Le(u,o),h.transform=h.webkitTransform=h.transitionDuration="";const d=u._moveCb=m=>{m&&m.target!==u||(!m||/transform$/.test(m.propertyName))&&(u.removeEventListener("transitionend",d),u._moveCb=null,Ve(u,o))};u.addEventListener("transitionend",d)})}),()=>{const o=Y(e),l=eo(o);let c=o.tag||de;r=i,i=t.default?Hs(t.default()):[];for(let u=0;udelete e.mode;io.props;const Pu=io;function Zc(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function Gc(e){ro.set(e,e.el.getBoundingClientRect())}function ef(e){const t=so.get(e),n=ro.get(e),s=t.left-n.left,r=t.top-n.top;if(s||r){const i=e.el.style;return i.transform=i.webkitTransform=`translate(${s}px,${r}px)`,i.transitionDuration="0s",e}}function tf(e,t,n){const s=e.cloneNode();e._vtc&&e._vtc.forEach(o=>{o.split(/\s+/).forEach(l=>l&&s.classList.remove(l))}),n.split(/\s+/).forEach(o=>o&&s.classList.add(o)),s.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(s);const{hasTransform:i}=to(s);return r.removeChild(s),i}const Ze=e=>{const t=e.props["onUpdate:modelValue"]||!1;return M(t)?n=>bt(t,n):t};function nf(e){e.target.composing=!0}function Br(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ws={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e._assign=Ze(r);const i=s||r.props&&r.props.type==="number";Be(e,t?"change":"input",o=>{if(o.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=wn(l)),e._assign(l)}),n&&Be(e,"change",()=>{e.value=e.value.trim()}),t||(Be(e,"compositionstart",nf),Be(e,"compositionend",Br),Be(e,"change",Br))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:s,number:r}},i){if(e._assign=Ze(i),e.composing||document.activeElement===e&&e.type!=="range"&&(n||s&&e.value.trim()===t||(r||e.type==="number")&&wn(e.value)===t))return;const o=t??"";e.value!==o&&(e.value=o)}},oo={deep:!0,created(e,t,n){e._assign=Ze(n),Be(e,"change",()=>{const s=e._modelValue,r=It(e),i=e.checked,o=e._assign;if(M(s)){const l=Bn(s,r),c=l!==-1;if(i&&!c)o(s.concat(r));else if(!i&&c){const u=[...s];u.splice(l,1),o(u)}}else if(at(s)){const l=new Set(s);i?l.add(r):l.delete(r),o(l)}else o(co(e,i))})},mounted:Hr,beforeUpdate(e,t,n){e._assign=Ze(n),Hr(e,t,n)}};function Hr(e,{value:t,oldValue:n},s){e._modelValue=t,M(t)?e.checked=Bn(t,s.props.value)>-1:at(t)?e.checked=t.has(s.props.value):t!==n&&(e.checked=Qe(t,co(e,!0)))}const lo={created(e,{value:t},n){e.checked=Qe(t,n.props.value),e._assign=Ze(n),Be(e,"change",()=>{e._assign(It(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e._assign=Ze(s),t!==n&&(e.checked=Qe(t,s.props.value))}},sf={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=at(t);Be(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?wn(It(o)):It(o));e._assign(e.multiple?r?new Set(i):i:i[0])}),e._assign=Ze(s)},mounted(e,{value:t}){Dr(e,t)},beforeUpdate(e,t,n){e._assign=Ze(n)},updated(e,{value:t}){Dr(e,t)}};function Dr(e,t){const n=e.multiple;if(!(n&&!M(t)&&!at(t))){for(let s=0,r=e.options.length;s-1:i.selected=t.has(o);else if(Qe(It(i),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function It(e){return"_value"in e?e._value:e.value}function co(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const rf={created(e,t,n){bn(e,t,n,null,"created")},mounted(e,t,n){bn(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){bn(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){bn(e,t,n,s,"updated")}};function fo(e,t){switch(e){case"SELECT":return sf;case"TEXTAREA":return ws;default:switch(t){case"checkbox":return oo;case"radio":return lo;default:return ws}}}function bn(e,t,n,s,r){const o=fo(e.tagName,n.props&&n.props.type)[r];o&&o(e,t,n,s)}function of(){ws.getSSRProps=({value:e})=>({value:e}),lo.getSSRProps=({value:e},t)=>{if(t.props&&Qe(t.props.value,e))return{checked:!0}},oo.getSSRProps=({value:e},t)=>{if(M(e)){if(t.props&&Bn(e,t.props.value)>-1)return{checked:!0}}else if(at(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},rf.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=fo(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const lf=["ctrl","shift","alt","meta"],cf={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>lf.some(n=>e[`${n}Key`]&&!t.includes(n))},Ou=(e,t)=>(n,...s)=>{for(let r=0;rn=>{if(!("key"in n))return;const s=we(n.key);if(t.some(r=>r===s||ff[r]===s))return e(n)},uf={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Bt(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Bt(e,!0),s.enter(e)):s.leave(e,()=>{Bt(e,!1)}):Bt(e,t))},beforeUnmount(e,{value:t}){Bt(e,t)}};function Bt(e,t){e.style.display=t?e._vod:"none"}function af(){uf.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const uo=se({patchProp:Vc},Rc);let qt,Ur=!1;function ao(){return qt||(qt=fc(uo))}function ho(){return qt=Ur?qt:uc(uo),Ur=!0,qt}const jr=(...e)=>{ao().render(...e)},df=(...e)=>{ho().hydrate(...e)},Fu=(...e)=>{const t=ao().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=po(s);if(!r)return;const i=t._component;!V(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.innerHTML="";const o=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t},Ru=(...e)=>{const t=ho().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=po(s);if(r)return n(r,!0,r instanceof SVGElement)},t};function po(e){return ie(e)?document.querySelector(e):e}let $r=!1;const Su=()=>{$r||($r=!0,of(),af())};function hf(){return go().__VUE_DEVTOOLS_GLOBAL_HOOK__}function go(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const pf=typeof Proxy=="function",gf="devtools-plugin:setup",mf="plugin:settings:set";let gt,Ts;function _f(){var e;return gt!==void 0||(typeof window<"u"&&window.performance?(gt=!0,Ts=window.performance):typeof global<"u"&&(!((e=global.perf_hooks)===null||e===void 0)&&e.performance)?(gt=!0,Ts=global.perf_hooks.performance):gt=!1),gt}function bf(){return _f()?Ts.now():Date.now()}class yf{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const s={};if(t.settings)for(const o in t.settings){const l=t.settings[o];s[o]=l.defaultValue}const r=`__vue-devtools-plugin-settings__${t.id}`;let i=Object.assign({},s);try{const o=localStorage.getItem(r),l=JSON.parse(o);Object.assign(i,l)}catch{}this.fallbacks={getSettings(){return i},setSettings(o){try{localStorage.setItem(r,JSON.stringify(o))}catch{}i=o},now(){return bf()}},n&&n.on(mf,(o,l)=>{o===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(o,l)=>this.target?this.target.on[l]:(...c)=>{this.onQueue.push({method:l,args:c})}}),this.proxiedTarget=new Proxy({},{get:(o,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...c)=>(this.targetQueue.push({method:l,args:c,resolve:()=>{}}),this.fallbacks[l](...c)):(...c)=>new Promise(u=>{this.targetQueue.push({method:l,args:c,resolve:u})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function Mu(e,t){const n=e,s=go(),r=hf(),i=pf&&n.enableEarlyProxy;if(r&&(s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))r.emit(gf,e,t);else{const o=i?new yf(n,r):null;(s.__VUE_DEVTOOLS_PLUGINS__=s.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:o}),o&&t(o.proxiedTarget)}}export{Lf as $,qi as A,ut as B,ge as C,uf as D,vt as E,de as F,Us as G,$t as H,Hl as I,Dl as J,Df as K,Pu as L,Sf as M,_c as N,jf as O,De as P,Pt as Q,Ss as R,ci as S,Zi as T,Y as U,js as V,du as W,ws as X,mu as Y,Iu as Z,Rf as _,$f as a,vu as a$,kf as a0,li as a1,kl as a2,Ti as a3,Jr as a4,Kf as a5,Hn as a6,Et as a7,Hf as a8,zs as a9,mc as aA,Mt as aB,au as aC,df as aD,yu as aE,Su as aF,Pc as aG,yt as aH,Tt as aI,ce as aJ,bu as aK,Pn as aL,lu as aM,cu as aN,xf as aO,$l as aP,ql as aQ,Wl as aR,Vl as aS,Ef as aT,Kl as aU,Ds as aV,di as aW,_i as aX,_u as aY,jr as aZ,qf as a_,Nf as aa,Te as ab,Je as ac,ve as ad,Nn as ae,Eu as af,Fu as ag,uc as ah,fu as ai,fc as aj,Ru as ak,Yf as al,Ff as am,qc as an,Zf as ao,Gf as ap,nu as aq,eu as ar,Xf as as,wu as at,tu as au,Lt as av,wf as aw,vf as ax,No as ay,Hs as az,Yn as b,Gt as b0,wr as b1,Cl as b2,At as b3,fl as b4,Af as b5,Pf as b6,Tc as b7,Cu as b8,Tf as b9,yn as ba,zf as bb,If as bc,pu as bd,Of as be,ai as bf,iu as bg,Tu as bh,Au as bi,ou as bj,Ac as bk,ru as bl,wi as bm,oo as bn,rf as bo,lo as bp,sf as bq,Oc as br,Mf as bs,Ml as bt,Uf as bu,uu as bv,su as bw,xu as bx,Bf as by,Mu as bz,Ec as c,Pi as d,Js as e,hu as f,Ge as g,wc as h,Cn as i,Wi as j,re as k,kn as l,fi as m,gi as n,jl as o,nc as p,Ki as q,Vf as r,Wf as s,Ln as t,Jf as u,Qf as v,xi as w,Cf as x,Ou as y,gu as z}; diff --git a/web/dist/assets/@vue-e0e89260.js b/web/dist/assets/@vue-e0e89260.js deleted file mode 100644 index f2c0ab85..00000000 --- a/web/dist/assets/@vue-e0e89260.js +++ /dev/null @@ -1 +0,0 @@ -function Un(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r!!n[r.toLowerCase()]:r=>!!n[r]}const Z={},it=[],Te=()=>{},yo=()=>!1,vo=/^on[^a-z]/,nn=e=>vo.test(e),Kn=e=>e.startsWith("onUpdate:"),ne=Object.assign,kn=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},xo=Object.prototype.hasOwnProperty,U=(e,t)=>xo.call(e,t),N=Array.isArray,lt=e=>Lt(e)==="[object Map]",ir=e=>Lt(e)==="[object Set]",Co=e=>Lt(e)==="[object RegExp]",L=e=>typeof e=="function",ee=e=>typeof e=="string",Vn=e=>typeof e=="symbol",Y=e=>e!==null&&typeof e=="object",lr=e=>Y(e)&&L(e.then)&&L(e.catch),cr=Object.prototype.toString,Lt=e=>cr.call(e),Eo=e=>Lt(e).slice(8,-1),fr=e=>Lt(e)==="[object Object]",Wn=e=>ee(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Wt=Un(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),sn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},To=/-(\w)/g,Pe=sn(e=>e.replace(To,(t,n)=>n?n.toUpperCase():"")),wo=/\B([A-Z])/g,et=sn(e=>e.replace(wo,"-$1").toLowerCase()),rn=sn(e=>e.charAt(0).toUpperCase()+e.slice(1)),_n=sn(e=>e?`on${rn(e)}`:""),Ot=(e,t)=>!Object.is(e,t),ct=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},An=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ao=e=>{const t=ee(e)?Number(e):NaN;return isNaN(t)?e:t};let xs;const On=()=>xs||(xs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zn(e){if(N(e)){const t={};for(let n=0;n{if(n){const s=n.split(Io);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function qn(e){let t="";if(ee(e))t=e;else if(N(e))for(let n=0;nee(e)?e:e==null?"":N(e)||Y(e)&&(e.toString===cr||!L(e.toString))?JSON.stringify(e,ar,2):String(e),ar=(e,t)=>t&&t.__v_isRef?ar(e,t.value):lt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:ir(t)?{[`Set(${t.size})`]:[...t.values()]}:Y(t)&&!N(t)&&!fr(t)?String(t):t;let xe;class dr{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=xe,!t&&xe&&(this.index=(xe.scopes||(xe.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=xe;try{return xe=this,t()}finally{xe=n}}}on(){xe=this}off(){xe=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},hr=e=>(e.w&ke)>0,pr=e=>(e.n&ke)>0,Lo=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let s=0;s{(d==="length"||d>=f)&&l.push(u)})}else switch(n!==void 0&&l.push(i.get(n)),t){case"add":N(e)?Wn(n)&&l.push(i.get("length")):(l.push(i.get(Ze)),lt(e)&&l.push(i.get(Pn)));break;case"delete":N(e)||(l.push(i.get(Ze)),lt(e)&&l.push(i.get(Pn)));break;case"set":lt(e)&&l.push(i.get(Ze));break}if(l.length===1)l[0]&&Fn(l[0]);else{const f=[];for(const u of l)u&&f.push(...u);Fn(Jn(f))}}function Fn(e,t){const n=N(e)?e:[...e];for(const s of n)s.computed&&Es(s);for(const s of n)s.computed||Es(s)}function Es(e,t){(e!==Ce||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function Ho(e,t){var n;return(n=Xt.get(e))==null?void 0:n.get(t)}const Bo=Un("__proto__,__v_isRef,__isVue"),_r=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Vn)),$o=Yn(),jo=Yn(!1,!0),Uo=Yn(!0),Ts=Ko();function Ko(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=j(this);for(let o=0,i=this.length;o{e[t]=function(...n){gt();const s=j(this)[t].apply(this,n);return mt(),s}}),e}function ko(e){const t=j(this);return de(t,"has",e),t.hasOwnProperty(e)}function Yn(e=!1,t=!1){return function(s,r,o){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_isShallow")return t;if(r==="__v_raw"&&o===(e?t?oi:Cr:t?xr:vr).get(s))return s;const i=N(s);if(!e){if(i&&U(Ts,r))return Reflect.get(Ts,r,o);if(r==="hasOwnProperty")return ko}const l=Reflect.get(s,r,o);return(Vn(r)?_r.has(r):Bo(r))||(e||de(s,"get",r),t)?l:ie(l)?i&&Wn(r)?l:l.value:Y(l)?e?Er(l):Gn(l):l}}const Vo=br(),Wo=br(!0);function br(e=!1){return function(n,s,r,o){let i=n[s];if(dt(i)&&ie(i)&&!ie(r))return!1;if(!e&&(!Zt(r)&&!dt(r)&&(i=j(i),r=j(r)),!N(n)&&ie(i)&&!ie(r)))return i.value=r,!0;const l=N(n)&&Wn(s)?Number(s)e,on=e=>Reflect.getPrototypeOf(e);function Bt(e,t,n=!1,s=!1){e=e.__v_raw;const r=j(e),o=j(t);n||(t!==o&&de(r,"get",t),de(r,"get",o));const{has:i}=on(r),l=s?Xn:n?ts:It;if(i.call(r,t))return l(e.get(t));if(i.call(r,o))return l(e.get(o));e!==r&&e.get(t)}function $t(e,t=!1){const n=this.__v_raw,s=j(n),r=j(e);return t||(e!==r&&de(s,"has",e),de(s,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function jt(e,t=!1){return e=e.__v_raw,!t&&de(j(e),"iterate",Ze),Reflect.get(e,"size",e)}function ws(e){e=j(e);const t=j(this);return on(t).has.call(t,e)||(t.add(e),Ne(t,"add",e,e)),this}function As(e,t){t=j(t);const n=j(this),{has:s,get:r}=on(n);let o=s.call(n,e);o||(e=j(e),o=s.call(n,e));const i=r.call(n,e);return n.set(e,t),o?Ot(t,i)&&Ne(n,"set",e,t):Ne(n,"add",e,t),this}function Os(e){const t=j(this),{has:n,get:s}=on(t);let r=n.call(t,e);r||(e=j(e),r=n.call(t,e)),s&&s.call(t,e);const o=t.delete(e);return r&&Ne(t,"delete",e,void 0),o}function Is(){const e=j(this),t=e.size!==0,n=e.clear();return t&&Ne(e,"clear",void 0,void 0),n}function Ut(e,t){return function(s,r){const o=this,i=o.__v_raw,l=j(i),f=t?Xn:e?ts:It;return!e&&de(l,"iterate",Ze),i.forEach((u,d)=>s.call(r,f(u),f(d),o))}}function Kt(e,t,n){return function(...s){const r=this.__v_raw,o=j(r),i=lt(o),l=e==="entries"||e===Symbol.iterator&&i,f=e==="keys"&&i,u=r[e](...s),d=n?Xn:t?ts:It;return!t&&de(o,"iterate",f?Pn:Ze),{next(){const{value:p,done:g}=u.next();return g?{value:p,done:g}:{value:l?[d(p[0]),d(p[1])]:d(p),done:g}},[Symbol.iterator](){return this}}}}function De(e){return function(...t){return e==="delete"?!1:this}}function Xo(){const e={get(o){return Bt(this,o)},get size(){return jt(this)},has:$t,add:ws,set:As,delete:Os,clear:Is,forEach:Ut(!1,!1)},t={get(o){return Bt(this,o,!1,!0)},get size(){return jt(this)},has:$t,add:ws,set:As,delete:Os,clear:Is,forEach:Ut(!1,!0)},n={get(o){return Bt(this,o,!0)},get size(){return jt(this,!0)},has(o){return $t.call(this,o,!0)},add:De("add"),set:De("set"),delete:De("delete"),clear:De("clear"),forEach:Ut(!0,!1)},s={get(o){return Bt(this,o,!0,!0)},get size(){return jt(this,!0)},has(o){return $t.call(this,o,!0)},add:De("add"),set:De("set"),delete:De("delete"),clear:De("clear"),forEach:Ut(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=Kt(o,!1,!1),n[o]=Kt(o,!0,!1),t[o]=Kt(o,!1,!0),s[o]=Kt(o,!0,!0)}),[e,n,t,s]}const[Zo,Go,ei,ti]=Xo();function Zn(e,t){const n=t?e?ti:ei:e?Go:Zo;return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(U(n,r)&&r in s?n:s,r,o)}const ni={get:Zn(!1,!1)},si={get:Zn(!1,!0)},ri={get:Zn(!0,!1)},vr=new WeakMap,xr=new WeakMap,Cr=new WeakMap,oi=new WeakMap;function ii(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function li(e){return e.__v_skip||!Object.isExtensible(e)?0:ii(Eo(e))}function Gn(e){return dt(e)?e:es(e,!1,yr,ni,vr)}function ci(e){return es(e,!1,Yo,si,xr)}function Er(e){return es(e,!0,Qo,ri,Cr)}function es(e,t,n,s,r){if(!Y(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=r.get(e);if(o)return o;const i=li(e);if(i===0)return e;const l=new Proxy(e,i===2?s:n);return r.set(e,l),l}function ft(e){return dt(e)?ft(e.__v_raw):!!(e&&e.__v_isReactive)}function dt(e){return!!(e&&e.__v_isReadonly)}function Zt(e){return!!(e&&e.__v_isShallow)}function Tr(e){return ft(e)||dt(e)}function j(e){const t=e&&e.__v_raw;return t?j(t):e}function wr(e){return Yt(e,"__v_skip",!0),e}const It=e=>Y(e)?Gn(e):e,ts=e=>Y(e)?Er(e):e;function Ar(e){Ue&&Ce&&(e=j(e),mr(e.dep||(e.dep=Jn())))}function Or(e,t){e=j(e);const n=e.dep;n&&Fn(n)}function ie(e){return!!(e&&e.__v_isRef===!0)}function fi(e){return Ir(e,!1)}function hc(e){return Ir(e,!0)}function Ir(e,t){return ie(e)?e:new ui(e,t)}class ui{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:j(t),this._value=n?t:It(t)}get value(){return Ar(this),this._value}set value(t){const n=this.__v_isShallow||Zt(t)||dt(t);t=n?t:j(t),Ot(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:It(t),Or(this))}}function ai(e){return ie(e)?e.value:e}const di={get:(e,t,n)=>ai(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return ie(r)&&!ie(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Pr(e){return ft(e)?e:new Proxy(e,di)}function pc(e){const t=N(e)?new Array(e.length):{};for(const n in e)t[n]=Fr(e,n);return t}class hi{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Ho(j(this._object),this._key)}}class pi{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function gc(e,t,n){return ie(e)?e:L(e)?new pi(e):Y(e)&&arguments.length>1?Fr(e,t,n):fi(e)}function Fr(e,t,n){const s=e[t];return ie(s)?s:new hi(e,t,n)}class gi{constructor(t,n,s,r){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new Qn(t,()=>{this._dirty||(this._dirty=!0,Or(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=j(this);return Ar(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function mi(e,t,n=!1){let s,r;const o=L(e);return o?(s=e,r=Te):(s=e.get,r=e.set),new gi(s,r,o||!r,n)}function Ke(e,t,n,s){let r;try{r=s?e(...s):e()}catch(o){ln(o,t,n)}return r}function be(e,t,n,s){if(L(e)){const o=Ke(e,t,n,s);return o&&lr(o)&&o.catch(i=>{ln(i,t,n)}),o}const r=[];for(let o=0;o>>1;Ft(fe[s])Ie&&fe.splice(t,1)}function xi(e){N(e)?ut.push(...e):(!Se||!Se.includes(e,e.allowRecurse?Qe+1:Qe))&&ut.push(e),Sr()}function Ps(e,t=Pt?Ie+1:0){for(;tFt(n)-Ft(s)),Qe=0;Qee.id==null?1/0:e.id,Ci=(e,t)=>{const n=Ft(e)-Ft(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Rr(e){Mn=!1,Pt=!0,fe.sort(Ci);const t=Te;try{for(Ie=0;Ieee(w)?w.trim():w)),p&&(r=n.map(An))}let l,f=s[l=_n(t)]||s[l=_n(Pe(t))];!f&&o&&(f=s[l=_n(et(t))]),f&&be(f,e,6,r);const u=s[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,be(u,e,6,r)}}function Lr(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const o=e.emits;let i={},l=!1;if(!L(e)){const f=u=>{const d=Lr(u,t,!0);d&&(l=!0,ne(i,d))};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}return!o&&!l?(Y(e)&&s.set(e,null),null):(N(o)?o.forEach(f=>i[f]=null):ne(i,o),Y(e)&&s.set(e,i),i)}function cn(e,t){return!e||!nn(t)?!1:(t=t.slice(2).replace(/Once$/,""),U(e,t[0].toLowerCase()+t.slice(1))||U(e,et(t))||U(e,t))}let ce=null,fn=null;function Gt(e){const t=ce;return ce=e,fn=e&&e.type.__scopeId||null,t}function mc(e){fn=e}function _c(){fn=null}function Ti(e,t=ce,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Ks(-1);const o=Gt(t);let i;try{i=e(...r)}finally{Gt(o),s._d&&Ks(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function bn(e){const{type:t,vnode:n,proxy:s,withProxy:r,props:o,propsOptions:[i],slots:l,attrs:f,emit:u,render:d,renderCache:p,data:g,setupState:w,ctx:D,inheritAttrs:O}=e;let K,V;const T=Gt(e);try{if(n.shapeFlag&4){const v=r||s;K=Oe(d.call(v,v,p,o,w,g,D)),V=f}else{const v=t;K=Oe(v.length>1?v(o,{attrs:f,slots:l,emit:u}):v(o,null)),V=t.props?f:wi(f)}}catch(v){At.length=0,ln(v,e,1),K=ue(ye)}let I=K;if(V&&O!==!1){const v=Object.keys(V),{shapeFlag:H}=I;v.length&&H&7&&(i&&v.some(Kn)&&(V=Ai(V,i)),I=Re(I,V))}return n.dirs&&(I=Re(I),I.dirs=I.dirs?I.dirs.concat(n.dirs):n.dirs),n.transition&&(I.transition=n.transition),K=I,Gt(T),K}const wi=e=>{let t;for(const n in e)(n==="class"||n==="style"||nn(n))&&((t||(t={}))[n]=e[n]);return t},Ai=(e,t)=>{const n={};for(const s in e)(!Kn(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Oi(e,t,n){const{props:s,children:r,component:o}=e,{props:i,children:l,patchFlag:f}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&f>=0){if(f&1024)return!0;if(f&16)return s?Fs(s,i,u):!!i;if(f&8){const d=t.dynamicProps;for(let p=0;pe.__isSuspense;function Pi(e,t){t&&t.pendingBranch?N(e)?t.effects.push(...e):t.effects.push(e):xi(e)}function bc(e,t){return rs(e,null,t)}const kt={};function zt(e,t,n){return rs(e,t,n)}function rs(e,t,{immediate:n,deep:s,flush:r,onTrack:o,onTrigger:i}=Z){var l;const f=Ro()===((l=oe)==null?void 0:l.scope)?oe:null;let u,d=!1,p=!1;if(ie(e)?(u=()=>e.value,d=Zt(e)):ft(e)?(u=()=>e,s=!0):N(e)?(p=!0,d=e.some(v=>ft(v)||Zt(v)),u=()=>e.map(v=>{if(ie(v))return v.value;if(ft(v))return Xe(v);if(L(v))return Ke(v,f,2)})):L(e)?t?u=()=>Ke(e,f,2):u=()=>{if(!(f&&f.isUnmounted))return g&&g(),be(e,f,3,[w])}:u=Te,t&&s){const v=u;u=()=>Xe(v())}let g,w=v=>{g=T.onStop=()=>{Ke(v,f,4)}},D;if(Rt)if(w=Te,t?n&&be(t,f,3,[u(),p?[]:void 0,w]):u(),r==="sync"){const v=wl();D=v.__watcherHandles||(v.__watcherHandles=[])}else return Te;let O=p?new Array(e.length).fill(kt):kt;const K=()=>{if(T.active)if(t){const v=T.run();(s||d||(p?v.some((H,q)=>Ot(H,O[q])):Ot(v,O)))&&(g&&g(),be(t,f,3,[v,O===kt?void 0:p&&O[0]===kt?[]:O,w]),O=v)}else T.run()};K.allowRecurse=!!t;let V;r==="sync"?V=K:r==="post"?V=()=>le(K,f&&f.suspense):(K.pre=!0,f&&(K.id=f.uid),V=()=>ss(K));const T=new Qn(u,V);t?n?K():O=T.run():r==="post"?le(T.run.bind(T),f&&f.suspense):T.run();const I=()=>{T.stop(),f&&f.scope&&kn(f.scope.effects,T)};return D&&D.push(I),I}function Fi(e,t,n){const s=this.proxy,r=ee(e)?e.includes(".")?Hr(s,e):()=>s[e]:e.bind(s,s);let o;L(t)?o=t:(o=t.handler,n=t);const i=oe;pt(this);const l=rs(r,o.bind(s),n);return i?pt(i):Ge(),l}function Hr(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{Xe(n,t)});else if(fr(e))for(const n in e)Xe(e[n],t);return e}function yc(e,t){const n=ce;if(n===null)return e;const s=pn(n)||n.proxy,r=e.dirs||(e.dirs=[]);for(let o=0;o{e.isMounted=!0}),cs(()=>{e.isUnmounting=!0}),e}const me=[Function,Array],$r={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:me,onEnter:me,onAfterEnter:me,onEnterCancelled:me,onBeforeLeave:me,onLeave:me,onAfterLeave:me,onLeaveCancelled:me,onBeforeAppear:me,onAppear:me,onAfterAppear:me,onAppearCancelled:me},Mi={name:"BaseTransition",props:$r,setup(e,{slots:t}){const n=ps(),s=Br();let r;return()=>{const o=t.default&&os(t.default(),!0);if(!o||!o.length)return;let i=o[0];if(o.length>1){for(const O of o)if(O.type!==ye){i=O;break}}const l=j(e),{mode:f}=l;if(s.isLeaving)return yn(i);const u=Ms(i);if(!u)return yn(i);const d=Mt(u,l,s,n);ht(u,d);const p=n.subTree,g=p&&Ms(p);let w=!1;const{getTransitionKey:D}=u.type;if(D){const O=D();r===void 0?r=O:O!==r&&(r=O,w=!0)}if(g&&g.type!==ye&&(!je(u,g)||w)){const O=Mt(g,l,s,n);if(ht(g,O),f==="out-in")return s.isLeaving=!0,O.afterLeave=()=>{s.isLeaving=!1,n.update.active!==!1&&n.update()},yn(i);f==="in-out"&&u.type!==ye&&(O.delayLeave=(K,V,T)=>{const I=jr(s,g);I[String(g.key)]=g,K._leaveCb=()=>{V(),K._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=T})}return i}}},Si=Mi;function jr(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Mt(e,t,n,s){const{appear:r,mode:o,persisted:i=!1,onBeforeEnter:l,onEnter:f,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:g,onAfterLeave:w,onLeaveCancelled:D,onBeforeAppear:O,onAppear:K,onAfterAppear:V,onAppearCancelled:T}=t,I=String(e.key),v=jr(n,e),H=(S,k)=>{S&&be(S,s,9,k)},q=(S,k)=>{const $=k[1];H(S,k),N(S)?S.every(X=>X.length<=1)&&$():S.length<=1&&$()},W={mode:o,persisted:i,beforeEnter(S){let k=l;if(!n.isMounted)if(r)k=O||l;else return;S._leaveCb&&S._leaveCb(!0);const $=v[I];$&&je(e,$)&&$.el._leaveCb&&$.el._leaveCb(),H(k,[S])},enter(S){let k=f,$=u,X=d;if(!n.isMounted)if(r)k=K||f,$=V||u,X=T||d;else return;let P=!1;const G=S._enterCb=he=>{P||(P=!0,he?H(X,[S]):H($,[S]),W.delayedLeave&&W.delayedLeave(),S._enterCb=void 0)};k?q(k,[S,G]):G()},leave(S,k){const $=String(e.key);if(S._enterCb&&S._enterCb(!0),n.isUnmounting)return k();H(p,[S]);let X=!1;const P=S._leaveCb=G=>{X||(X=!0,k(),G?H(D,[S]):H(w,[S]),S._leaveCb=void 0,v[$]===e&&delete v[$])};v[$]=e,g?q(g,[S,P]):P()},clone(S){return Mt(S,t,n,s)}};return W}function yn(e){if(un(e))return e=Re(e),e.children=null,e}function Ms(e){return un(e)?e.children?e.children[0]:void 0:e}function ht(e,t){e.shapeFlag&6&&e.component?ht(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function os(e,t=!1,n){let s=[],r=0;for(let o=0;o1)for(let o=0;one({name:e.name},t,{setup:e}))():e}const at=e=>!!e.type.__asyncLoader,un=e=>e.type.__isKeepAlive,Ni={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=ps(),s=n.ctx;if(!s.renderer)return()=>{const T=t.default&&t.default();return T&&T.length===1?T[0]:T};const r=new Map,o=new Set;let i=null;const l=n.suspense,{renderer:{p:f,m:u,um:d,o:{createElement:p}}}=s,g=p("div");s.activate=(T,I,v,H,q)=>{const W=T.component;u(T,I,v,0,l),f(W.vnode,T,I,v,W,l,H,T.slotScopeIds,q),le(()=>{W.isDeactivated=!1,W.a&&ct(W.a);const S=T.props&&T.props.onVnodeMounted;S&&_e(S,W.parent,T)},l)},s.deactivate=T=>{const I=T.component;u(T,g,null,1,l),le(()=>{I.da&&ct(I.da);const v=T.props&&T.props.onVnodeUnmounted;v&&_e(v,I.parent,T),I.isDeactivated=!0},l)};function w(T){vn(T),d(T,n,l,!0)}function D(T){r.forEach((I,v)=>{const H=Bn(I.type);H&&(!T||!T(H))&&O(v)})}function O(T){const I=r.get(T);!i||!je(I,i)?w(I):i&&vn(i),r.delete(T),o.delete(T)}zt(()=>[e.include,e.exclude],([T,I])=>{T&&D(v=>Ct(T,v)),I&&D(v=>!Ct(I,v))},{flush:"post",deep:!0});let K=null;const V=()=>{K!=null&&r.set(K,xn(n.subTree))};return is(V),ls(V),cs(()=>{r.forEach(T=>{const{subTree:I,suspense:v}=n,H=xn(I);if(T.type===H.type&&T.key===H.key){vn(H);const q=H.component.da;q&&le(q,v);return}w(T)})}),()=>{if(K=null,!t.default)return null;const T=t.default(),I=T[0];if(T.length>1)return i=null,T;if(!Nt(I)||!(I.shapeFlag&4)&&!(I.shapeFlag&128))return i=null,I;let v=xn(I);const H=v.type,q=Bn(at(v)?v.type.__asyncResolved||{}:H),{include:W,exclude:S,max:k}=e;if(W&&(!q||!Ct(W,q))||S&&q&&Ct(S,q))return i=v,I;const $=v.key==null?H:v.key,X=r.get($);return v.el&&(v=Re(v),I.shapeFlag&128&&(I.ssContent=v)),K=$,X?(v.el=X.el,v.component=X.component,v.transition&&ht(v,v.transition),v.shapeFlag|=512,o.delete($),o.add($)):(o.add($),k&&o.size>parseInt(k,10)&&O(o.values().next().value)),v.shapeFlag|=256,i=v,Dr(I.type)?I:v}}},xc=Ni;function Ct(e,t){return N(e)?e.some(n=>Ct(n,t)):ee(e)?e.split(",").includes(t):Co(e)?e.test(t):!1}function Ri(e,t){Ur(e,"a",t)}function Li(e,t){Ur(e,"da",t)}function Ur(e,t,n=oe){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(an(t,s,n),n){let r=n.parent;for(;r&&r.parent;)un(r.parent.vnode)&&Di(s,t,n,r),r=r.parent}}function Di(e,t,n,s){const r=an(t,e,s,!0);Kr(()=>{kn(s[t],r)},n)}function vn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function xn(e){return e.shapeFlag&128?e.ssContent:e}function an(e,t,n=oe,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{if(n.isUnmounted)return;gt(),pt(n);const l=be(t,n,e,i);return Ge(),mt(),l});return s?r.unshift(o):r.push(o),o}}const Le=e=>(t,n=oe)=>(!Rt||e==="sp")&&an(e,(...s)=>t(...s),n),Hi=Le("bm"),is=Le("m"),Bi=Le("bu"),ls=Le("u"),cs=Le("bum"),Kr=Le("um"),$i=Le("sp"),ji=Le("rtg"),Ui=Le("rtc");function Ki(e,t=oe){an("ec",e,t)}const fs="components";function Cc(e,t){return Vr(fs,e,!0,t)||e}const kr=Symbol.for("v-ndc");function Ec(e){return ee(e)?Vr(fs,e,!1)||e:e||kr}function Vr(e,t,n=!0,s=!1){const r=ce||oe;if(r){const o=r.type;if(e===fs){const l=Bn(o,!1);if(l&&(l===t||l===Pe(t)||l===rn(Pe(t))))return o}const i=Ss(r[e]||o[e],t)||Ss(r.appContext[e],t);return!i&&s?o:i}}function Ss(e,t){return e&&(e[t]||e[Pe(t)]||e[rn(Pe(t))])}function Tc(e,t,n,s){let r;const o=n&&n[s];if(N(e)||ee(e)){r=new Array(e.length);for(let i=0,l=e.length;it(i,l,void 0,o&&o[l]));else{const i=Object.keys(e);r=new Array(i.length);for(let l=0,f=i.length;l{const o=s.fn(...r);return o&&(o.key=s.key),o}:s.fn)}return e}function Ac(e,t,n={},s,r){if(ce.isCE||ce.parent&&at(ce.parent)&&ce.parent.isCE)return t!=="default"&&(n.name=t),ue("slot",n,s&&s());let o=e[t];o&&o._c&&(o._d=!1),eo();const i=o&&Wr(o(n)),l=no(ge,{key:n.key||i&&i.key||`_${t}`},i||(s?s():[]),i&&e._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function Wr(e){return e.some(t=>Nt(t)?!(t.type===ye||t.type===ge&&!Wr(t.children)):!0)?e:null}const Sn=e=>e?oo(e)?pn(e)||e.proxy:Sn(e.parent):null,Tt=ne(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Sn(e.parent),$root:e=>Sn(e.root),$emit:e=>e.emit,$options:e=>us(e),$forceUpdate:e=>e.f||(e.f=()=>ss(e.update)),$nextTick:e=>e.n||(e.n=bi.bind(e.proxy)),$watch:e=>Fi.bind(e)}),Cn=(e,t)=>e!==Z&&!e.__isScriptSetup&&U(e,t),ki={get({_:e},t){const{ctx:n,setupState:s,data:r,props:o,accessCache:i,type:l,appContext:f}=e;let u;if(t[0]!=="$"){const w=i[t];if(w!==void 0)switch(w){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return o[t]}else{if(Cn(s,t))return i[t]=1,s[t];if(r!==Z&&U(r,t))return i[t]=2,r[t];if((u=e.propsOptions[0])&&U(u,t))return i[t]=3,o[t];if(n!==Z&&U(n,t))return i[t]=4,n[t];Nn&&(i[t]=0)}}const d=Tt[t];let p,g;if(d)return t==="$attrs"&&de(e,"get",t),d(e);if((p=l.__cssModules)&&(p=p[t]))return p;if(n!==Z&&U(n,t))return i[t]=4,n[t];if(g=f.config.globalProperties,U(g,t))return g[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:o}=e;return Cn(r,t)?(r[t]=n,!0):s!==Z&&U(s,t)?(s[t]=n,!0):U(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:o}},i){let l;return!!n[i]||e!==Z&&U(e,i)||Cn(t,i)||(l=o[0])&&U(l,i)||U(s,i)||U(Tt,i)||U(r.config.globalProperties,i)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:U(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ns(e){return N(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Nn=!0;function Vi(e){const t=us(e),n=e.proxy,s=e.ctx;Nn=!1,t.beforeCreate&&Rs(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:i,watch:l,provide:f,inject:u,created:d,beforeMount:p,mounted:g,beforeUpdate:w,updated:D,activated:O,deactivated:K,beforeDestroy:V,beforeUnmount:T,destroyed:I,unmounted:v,render:H,renderTracked:q,renderTriggered:W,errorCaptured:S,serverPrefetch:k,expose:$,inheritAttrs:X,components:P,directives:G,filters:he}=t;if(u&&Wi(u,s,null),i)for(const te in i){const J=i[te];L(J)&&(s[te]=J.bind(n))}if(r){const te=r.call(n,n);Y(te)&&(e.data=Gn(te))}if(Nn=!0,o)for(const te in o){const J=o[te],Ve=L(J)?J.bind(n,n):L(J.get)?J.get.bind(n,n):Te,Dt=!L(J)&&L(J.set)?J.set.bind(n):Te,We=Cl({get:Ve,set:Dt});Object.defineProperty(s,te,{enumerable:!0,configurable:!0,get:()=>We.value,set:we=>We.value=we})}if(l)for(const te in l)zr(l[te],s,n,te);if(f){const te=L(f)?f.call(n):f;Reflect.ownKeys(te).forEach(J=>{Xi(J,te[J])})}d&&Rs(d,e,"c");function re(te,J){N(J)?J.forEach(Ve=>te(Ve.bind(n))):J&&te(J.bind(n))}if(re(Hi,p),re(is,g),re(Bi,w),re(ls,D),re(Ri,O),re(Li,K),re(Ki,S),re(Ui,q),re(ji,W),re(cs,T),re(Kr,v),re($i,k),N($))if($.length){const te=e.exposed||(e.exposed={});$.forEach(J=>{Object.defineProperty(te,J,{get:()=>n[J],set:Ve=>n[J]=Ve})})}else e.exposed||(e.exposed={});H&&e.render===Te&&(e.render=H),X!=null&&(e.inheritAttrs=X),P&&(e.components=P),G&&(e.directives=G)}function Wi(e,t,n=Te){N(e)&&(e=Rn(e));for(const s in e){const r=e[s];let o;Y(r)?"default"in r?o=qt(r.from||s,r.default,!0):o=qt(r.from||s):o=qt(r),ie(o)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[s]=o}}function Rs(e,t,n){be(N(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function zr(e,t,n,s){const r=s.includes(".")?Hr(n,s):()=>n[s];if(ee(e)){const o=t[e];L(o)&&zt(r,o)}else if(L(e))zt(r,e.bind(n));else if(Y(e))if(N(e))e.forEach(o=>zr(o,t,n,s));else{const o=L(e.handler)?e.handler.bind(n):t[e.handler];L(o)&&zt(r,o,e)}}function us(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let f;return l?f=l:!r.length&&!n&&!s?f=t:(f={},r.length&&r.forEach(u=>en(f,u,i,!0)),en(f,t,i)),Y(t)&&o.set(t,f),f}function en(e,t,n,s=!1){const{mixins:r,extends:o}=t;o&&en(e,o,n,!0),r&&r.forEach(i=>en(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=zi[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const zi={data:Ls,props:Ds,emits:Ds,methods:Et,computed:Et,beforeCreate:ae,created:ae,beforeMount:ae,mounted:ae,beforeUpdate:ae,updated:ae,beforeDestroy:ae,beforeUnmount:ae,destroyed:ae,unmounted:ae,activated:ae,deactivated:ae,errorCaptured:ae,serverPrefetch:ae,components:Et,directives:Et,watch:Ji,provide:Ls,inject:qi};function Ls(e,t){return t?e?function(){return ne(L(e)?e.call(this,this):e,L(t)?t.call(this,this):t)}:t:e}function qi(e,t){return Et(Rn(e),Rn(t))}function Rn(e){if(N(e)){const t={};for(let n=0;n1)return n&&L(t)?t.call(s&&s.proxy):t}}function Zi(e,t,n,s=!1){const r={},o={};Yt(o,hn,1),e.propsDefaults=Object.create(null),Jr(e,t,r,o);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);n?e.props=s?r:ci(r):e.type.props?e.props=r:e.props=o,e.attrs=o}function Gi(e,t,n,s){const{props:r,attrs:o,vnode:{patchFlag:i}}=e,l=j(r),[f]=e.propsOptions;let u=!1;if((s||i>0)&&!(i&16)){if(i&8){const d=e.vnode.dynamicProps;for(let p=0;p{f=!0;const[g,w]=Qr(p,t,!0);ne(i,g),w&&l.push(...w)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!o&&!f)return Y(e)&&s.set(e,it),it;if(N(o))for(let d=0;d-1,w[1]=O<0||D-1||U(w,"default"))&&l.push(p)}}}const u=[i,l];return Y(e)&&s.set(e,u),u}function Hs(e){return e[0]!=="$"}function Bs(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function $s(e,t){return Bs(e)===Bs(t)}function js(e,t){return N(t)?t.findIndex(n=>$s(n,e)):L(t)&&$s(t,e)?0:-1}const Yr=e=>e[0]==="_"||e==="$stable",as=e=>N(e)?e.map(Oe):[Oe(e)],el=(e,t,n)=>{if(t._n)return t;const s=Ti((...r)=>as(t(...r)),n);return s._c=!1,s},Xr=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Yr(r))continue;const o=e[r];if(L(o))t[r]=el(r,o,s);else if(o!=null){const i=as(o);t[r]=()=>i}}},Zr=(e,t)=>{const n=as(t);e.slots.default=()=>n},tl=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=j(t),Yt(t,"_",n)):Xr(t,e.slots={})}else e.slots={},t&&Zr(e,t);Yt(e.slots,hn,1)},nl=(e,t,n)=>{const{vnode:s,slots:r}=e;let o=!0,i=Z;if(s.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:(ne(r,t),!n&&l===1&&delete r._):(o=!t.$stable,Xr(t,r)),i=t}else t&&(Zr(e,t),i={default:1});if(o)for(const l in r)!Yr(l)&&!(l in i)&&delete r[l]};function Dn(e,t,n,s,r=!1){if(N(e)){e.forEach((g,w)=>Dn(g,t&&(N(t)?t[w]:t),n,s,r));return}if(at(s)&&!r)return;const o=s.shapeFlag&4?pn(s.component)||s.component.proxy:s.el,i=r?null:o,{i:l,r:f}=e,u=t&&t.r,d=l.refs===Z?l.refs={}:l.refs,p=l.setupState;if(u!=null&&u!==f&&(ee(u)?(d[u]=null,U(p,u)&&(p[u]=null)):ie(u)&&(u.value=null)),L(f))Ke(f,l,12,[i,d]);else{const g=ee(f),w=ie(f);if(g||w){const D=()=>{if(e.f){const O=g?U(p,f)?p[f]:d[f]:f.value;r?N(O)&&kn(O,o):N(O)?O.includes(o)||O.push(o):g?(d[f]=[o],U(p,f)&&(p[f]=d[f])):(f.value=[o],e.k&&(d[e.k]=f.value))}else g?(d[f]=i,U(p,f)&&(p[f]=i)):w&&(f.value=i,e.k&&(d[e.k]=i))};i?(D.id=-1,le(D,n)):D()}}}const le=Pi;function sl(e){return rl(e)}function rl(e,t){const n=On();n.__VUE__=!0;const{insert:s,remove:r,patchProp:o,createElement:i,createText:l,createComment:f,setText:u,setElementText:d,parentNode:p,nextSibling:g,setScopeId:w=Te,insertStaticContent:D}=e,O=(c,a,h,_=null,m=null,x=null,E=!1,y=null,C=!!a.dynamicChildren)=>{if(c===a)return;c&&!je(c,a)&&(_=Ht(c),we(c,m,x,!0),c=null),a.patchFlag===-2&&(C=!1,a.dynamicChildren=null);const{type:b,ref:F,shapeFlag:A}=a;switch(b){case dn:K(c,a,h,_);break;case ye:V(c,a,h,_);break;case Jt:c==null&&T(a,h,_,E);break;case ge:P(c,a,h,_,m,x,E,y,C);break;default:A&1?H(c,a,h,_,m,x,E,y,C):A&6?G(c,a,h,_,m,x,E,y,C):(A&64||A&128)&&b.process(c,a,h,_,m,x,E,y,C,tt)}F!=null&&m&&Dn(F,c&&c.ref,x,a||c,!a)},K=(c,a,h,_)=>{if(c==null)s(a.el=l(a.children),h,_);else{const m=a.el=c.el;a.children!==c.children&&u(m,a.children)}},V=(c,a,h,_)=>{c==null?s(a.el=f(a.children||""),h,_):a.el=c.el},T=(c,a,h,_)=>{[c.el,c.anchor]=D(c.children,a,h,_,c.el,c.anchor)},I=({el:c,anchor:a},h,_)=>{let m;for(;c&&c!==a;)m=g(c),s(c,h,_),c=m;s(a,h,_)},v=({el:c,anchor:a})=>{let h;for(;c&&c!==a;)h=g(c),r(c),c=h;r(a)},H=(c,a,h,_,m,x,E,y,C)=>{E=E||a.type==="svg",c==null?q(a,h,_,m,x,E,y,C):k(c,a,m,x,E,y,C)},q=(c,a,h,_,m,x,E,y)=>{let C,b;const{type:F,props:A,shapeFlag:M,transition:R,dirs:B}=c;if(C=c.el=i(c.type,x,A&&A.is,A),M&8?d(C,c.children):M&16&&S(c.children,C,null,_,m,x&&F!=="foreignObject",E,y),B&&ze(c,null,_,"created"),W(C,c,c.scopeId,E,_),A){for(const z in A)z!=="value"&&!Wt(z)&&o(C,z,null,A[z],x,c.children,_,m,Fe);"value"in A&&o(C,"value",null,A.value),(b=A.onVnodeBeforeMount)&&_e(b,_,c)}B&&ze(c,null,_,"beforeMount");const Q=(!m||m&&!m.pendingBranch)&&R&&!R.persisted;Q&&R.beforeEnter(C),s(C,a,h),((b=A&&A.onVnodeMounted)||Q||B)&&le(()=>{b&&_e(b,_,c),Q&&R.enter(C),B&&ze(c,null,_,"mounted")},m)},W=(c,a,h,_,m)=>{if(h&&w(c,h),_)for(let x=0;x<_.length;x++)w(c,_[x]);if(m){let x=m.subTree;if(a===x){const E=m.vnode;W(c,E,E.scopeId,E.slotScopeIds,m.parent)}}},S=(c,a,h,_,m,x,E,y,C=0)=>{for(let b=C;b{const y=a.el=c.el;let{patchFlag:C,dynamicChildren:b,dirs:F}=a;C|=c.patchFlag&16;const A=c.props||Z,M=a.props||Z;let R;h&&qe(h,!1),(R=M.onVnodeBeforeUpdate)&&_e(R,h,a,c),F&&ze(a,c,h,"beforeUpdate"),h&&qe(h,!0);const B=m&&a.type!=="foreignObject";if(b?$(c.dynamicChildren,b,y,h,_,B,x):E||J(c,a,y,null,h,_,B,x,!1),C>0){if(C&16)X(y,a,A,M,h,_,m);else if(C&2&&A.class!==M.class&&o(y,"class",null,M.class,m),C&4&&o(y,"style",A.style,M.style,m),C&8){const Q=a.dynamicProps;for(let z=0;z{R&&_e(R,h,a,c),F&&ze(a,c,h,"updated")},_)},$=(c,a,h,_,m,x,E)=>{for(let y=0;y{if(h!==_){if(h!==Z)for(const y in h)!Wt(y)&&!(y in _)&&o(c,y,h[y],null,E,a.children,m,x,Fe);for(const y in _){if(Wt(y))continue;const C=_[y],b=h[y];C!==b&&y!=="value"&&o(c,y,b,C,E,a.children,m,x,Fe)}"value"in _&&o(c,"value",h.value,_.value)}},P=(c,a,h,_,m,x,E,y,C)=>{const b=a.el=c?c.el:l(""),F=a.anchor=c?c.anchor:l("");let{patchFlag:A,dynamicChildren:M,slotScopeIds:R}=a;R&&(y=y?y.concat(R):R),c==null?(s(b,h,_),s(F,h,_),S(a.children,h,F,m,x,E,y,C)):A>0&&A&64&&M&&c.dynamicChildren?($(c.dynamicChildren,M,h,m,x,E,y),(a.key!=null||m&&a===m.subTree)&&ds(c,a,!0)):J(c,a,h,F,m,x,E,y,C)},G=(c,a,h,_,m,x,E,y,C)=>{a.slotScopeIds=y,c==null?a.shapeFlag&512?m.ctx.activate(a,h,_,E,C):he(a,h,_,m,x,E,C):_t(c,a,C)},he=(c,a,h,_,m,x,E)=>{const y=c.component=ml(c,_,m);if(un(c)&&(y.ctx.renderer=tt),_l(y),y.asyncDep){if(m&&m.registerDep(y,re),!c.el){const C=y.subTree=ue(ye);V(null,C,a,h)}return}re(y,c,a,h,m,x,E)},_t=(c,a,h)=>{const _=a.component=c.component;if(Oi(c,a,h))if(_.asyncDep&&!_.asyncResolved){te(_,a,h);return}else _.next=a,vi(_.update),_.update();else a.el=c.el,_.vnode=a},re=(c,a,h,_,m,x,E)=>{const y=()=>{if(c.isMounted){let{next:F,bu:A,u:M,parent:R,vnode:B}=c,Q=F,z;qe(c,!1),F?(F.el=B.el,te(c,F,E)):F=B,A&&ct(A),(z=F.props&&F.props.onVnodeBeforeUpdate)&&_e(z,R,F,B),qe(c,!0);const se=bn(c),ve=c.subTree;c.subTree=se,O(ve,se,p(ve.el),Ht(ve),c,m,x),F.el=se.el,Q===null&&Ii(c,se.el),M&&le(M,m),(z=F.props&&F.props.onVnodeUpdated)&&le(()=>_e(z,R,F,B),m)}else{let F;const{el:A,props:M}=a,{bm:R,m:B,parent:Q}=c,z=at(a);if(qe(c,!1),R&&ct(R),!z&&(F=M&&M.onVnodeBeforeMount)&&_e(F,Q,a),qe(c,!0),A&&mn){const se=()=>{c.subTree=bn(c),mn(A,c.subTree,c,m,null)};z?a.type.__asyncLoader().then(()=>!c.isUnmounted&&se()):se()}else{const se=c.subTree=bn(c);O(null,se,h,_,c,m,x),a.el=se.el}if(B&&le(B,m),!z&&(F=M&&M.onVnodeMounted)){const se=a;le(()=>_e(F,Q,se),m)}(a.shapeFlag&256||Q&&at(Q.vnode)&&Q.vnode.shapeFlag&256)&&c.a&&le(c.a,m),c.isMounted=!0,a=h=_=null}},C=c.effect=new Qn(y,()=>ss(b),c.scope),b=c.update=()=>C.run();b.id=c.uid,qe(c,!0),b()},te=(c,a,h)=>{a.component=c;const _=c.vnode.props;c.vnode=a,c.next=null,Gi(c,a.props,_,h),nl(c,a.children,h),gt(),Ps(),mt()},J=(c,a,h,_,m,x,E,y,C=!1)=>{const b=c&&c.children,F=c?c.shapeFlag:0,A=a.children,{patchFlag:M,shapeFlag:R}=a;if(M>0){if(M&128){Dt(b,A,h,_,m,x,E,y,C);return}else if(M&256){Ve(b,A,h,_,m,x,E,y,C);return}}R&8?(F&16&&Fe(b,m,x),A!==b&&d(h,A)):F&16?R&16?Dt(b,A,h,_,m,x,E,y,C):Fe(b,m,x,!0):(F&8&&d(h,""),R&16&&S(A,h,_,m,x,E,y,C))},Ve=(c,a,h,_,m,x,E,y,C)=>{c=c||it,a=a||it;const b=c.length,F=a.length,A=Math.min(b,F);let M;for(M=0;MF?Fe(c,m,x,!0,!1,A):S(a,h,_,m,x,E,y,C,A)},Dt=(c,a,h,_,m,x,E,y,C)=>{let b=0;const F=a.length;let A=c.length-1,M=F-1;for(;b<=A&&b<=M;){const R=c[b],B=a[b]=C?$e(a[b]):Oe(a[b]);if(je(R,B))O(R,B,h,null,m,x,E,y,C);else break;b++}for(;b<=A&&b<=M;){const R=c[A],B=a[M]=C?$e(a[M]):Oe(a[M]);if(je(R,B))O(R,B,h,null,m,x,E,y,C);else break;A--,M--}if(b>A){if(b<=M){const R=M+1,B=RM)for(;b<=A;)we(c[b],m,x,!0),b++;else{const R=b,B=b,Q=new Map;for(b=B;b<=M;b++){const pe=a[b]=C?$e(a[b]):Oe(a[b]);pe.key!=null&&Q.set(pe.key,b)}let z,se=0;const ve=M-B+1;let nt=!1,bs=0;const bt=new Array(ve);for(b=0;b=ve){we(pe,m,x,!0);continue}let Ae;if(pe.key!=null)Ae=Q.get(pe.key);else for(z=B;z<=M;z++)if(bt[z-B]===0&&je(pe,a[z])){Ae=z;break}Ae===void 0?we(pe,m,x,!0):(bt[Ae-B]=b+1,Ae>=bs?bs=Ae:nt=!0,O(pe,a[Ae],h,null,m,x,E,y,C),se++)}const ys=nt?ol(bt):it;for(z=ys.length-1,b=ve-1;b>=0;b--){const pe=B+b,Ae=a[pe],vs=pe+1{const{el:x,type:E,transition:y,children:C,shapeFlag:b}=c;if(b&6){We(c.component.subTree,a,h,_);return}if(b&128){c.suspense.move(a,h,_);return}if(b&64){E.move(c,a,h,tt);return}if(E===ge){s(x,a,h);for(let A=0;Ay.enter(x),m);else{const{leave:A,delayLeave:M,afterLeave:R}=y,B=()=>s(x,a,h),Q=()=>{A(x,()=>{B(),R&&R()})};M?M(x,B,Q):Q()}else s(x,a,h)},we=(c,a,h,_=!1,m=!1)=>{const{type:x,props:E,ref:y,children:C,dynamicChildren:b,shapeFlag:F,patchFlag:A,dirs:M}=c;if(y!=null&&Dn(y,null,h,c,!0),F&256){a.ctx.deactivate(c);return}const R=F&1&&M,B=!at(c);let Q;if(B&&(Q=E&&E.onVnodeBeforeUnmount)&&_e(Q,a,c),F&6)bo(c.component,h,_);else{if(F&128){c.suspense.unmount(h,_);return}R&&ze(c,null,a,"beforeUnmount"),F&64?c.type.remove(c,a,h,m,tt,_):b&&(x!==ge||A>0&&A&64)?Fe(b,a,h,!1,!0):(x===ge&&A&384||!m&&F&16)&&Fe(C,a,h),_&&ms(c)}(B&&(Q=E&&E.onVnodeUnmounted)||R)&&le(()=>{Q&&_e(Q,a,c),R&&ze(c,null,a,"unmounted")},h)},ms=c=>{const{type:a,el:h,anchor:_,transition:m}=c;if(a===ge){_o(h,_);return}if(a===Jt){v(c);return}const x=()=>{r(h),m&&!m.persisted&&m.afterLeave&&m.afterLeave()};if(c.shapeFlag&1&&m&&!m.persisted){const{leave:E,delayLeave:y}=m,C=()=>E(h,x);y?y(c.el,x,C):C()}else x()},_o=(c,a)=>{let h;for(;c!==a;)h=g(c),r(c),c=h;r(a)},bo=(c,a,h)=>{const{bum:_,scope:m,update:x,subTree:E,um:y}=c;_&&ct(_),m.stop(),x&&(x.active=!1,we(E,c,a,h)),y&&le(y,a),le(()=>{c.isUnmounted=!0},a),a&&a.pendingBranch&&!a.isUnmounted&&c.asyncDep&&!c.asyncResolved&&c.suspenseId===a.pendingId&&(a.deps--,a.deps===0&&a.resolve())},Fe=(c,a,h,_=!1,m=!1,x=0)=>{for(let E=x;Ec.shapeFlag&6?Ht(c.component.subTree):c.shapeFlag&128?c.suspense.next():g(c.anchor||c.el),_s=(c,a,h)=>{c==null?a._vnode&&we(a._vnode,null,null,!0):O(a._vnode||null,c,a,null,null,null,h),Ps(),Nr(),a._vnode=c},tt={p:O,um:we,m:We,r:ms,mt:he,mc:S,pc:J,pbc:$,n:Ht,o:e};let gn,mn;return t&&([gn,mn]=t(tt)),{render:_s,hydrate:gn,createApp:Yi(_s,gn)}}function qe({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function ds(e,t,n=!1){const s=e.children,r=t.children;if(N(s)&&N(r))for(let o=0;o>1,e[n[l]]0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}const il=e=>e.__isTeleport,wt=e=>e&&(e.disabled||e.disabled===""),Us=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Hn=(e,t)=>{const n=e&&e.to;return ee(n)?t?t(n):null:n},ll={__isTeleport:!0,process(e,t,n,s,r,o,i,l,f,u){const{mc:d,pc:p,pbc:g,o:{insert:w,querySelector:D,createText:O,createComment:K}}=u,V=wt(t.props);let{shapeFlag:T,children:I,dynamicChildren:v}=t;if(e==null){const H=t.el=O(""),q=t.anchor=O("");w(H,n,s),w(q,n,s);const W=t.target=Hn(t.props,D),S=t.targetAnchor=O("");W&&(w(S,W),i=i||Us(W));const k=($,X)=>{T&16&&d(I,$,X,r,o,i,l,f)};V?k(n,q):W&&k(W,S)}else{t.el=e.el;const H=t.anchor=e.anchor,q=t.target=e.target,W=t.targetAnchor=e.targetAnchor,S=wt(e.props),k=S?n:q,$=S?H:W;if(i=i||Us(q),v?(g(e.dynamicChildren,v,k,r,o,i,l),ds(e,t,!0)):f||p(e,t,k,$,r,o,i,l,!1),V)S||Vt(t,n,H,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const X=t.target=Hn(t.props,D);X&&Vt(t,X,null,u,0)}else S&&Vt(t,q,W,u,1)}Gr(t)},remove(e,t,n,s,{um:r,o:{remove:o}},i){const{shapeFlag:l,children:f,anchor:u,targetAnchor:d,target:p,props:g}=e;if(p&&o(d),(i||!wt(g))&&(o(u),l&16))for(let w=0;w0?Ee||it:null,fl(),St>0&&Ee&&Ee.push(e),e}function Ic(e,t,n,s,r,o){return to(ro(e,t,n,s,r,o,!0))}function no(e,t,n,s,r){return to(ue(e,t,n,s,r,!0))}function Nt(e){return e?e.__v_isVNode===!0:!1}function je(e,t){return e.type===t.type&&e.key===t.key}const hn="__vInternal",so=({key:e})=>e??null,Qt=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ee(e)||ie(e)||L(e)?{i:ce,r:e,k:t,f:!!n}:e:null);function ro(e,t=null,n=null,s=0,r=null,o=e===ge?0:1,i=!1,l=!1){const f={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&so(t),ref:t&&Qt(t),scopeId:fn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ce};return l?(hs(f,n),o&128&&e.normalize(f)):n&&(f.shapeFlag|=ee(n)?8:16),St>0&&!i&&Ee&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&Ee.push(f),f}const ue=ul;function ul(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===kr)&&(e=ye),Nt(e)){const l=Re(e,t,!0);return n&&hs(l,n),St>0&&!o&&Ee&&(l.shapeFlag&6?Ee[Ee.indexOf(e)]=l:Ee.push(l)),l.patchFlag|=-2,l}if(xl(e)&&(e=e.__vccOpts),t){t=al(t);let{class:l,style:f}=t;l&&!ee(l)&&(t.class=qn(l)),Y(f)&&(Tr(f)&&!N(f)&&(f=ne({},f)),t.style=zn(f))}const i=ee(e)?1:Dr(e)?128:il(e)?64:Y(e)?4:L(e)?2:0;return ro(e,t,n,s,r,i,o,!0)}function al(e){return e?Tr(e)||hn in e?ne({},e):e:null}function Re(e,t,n=!1){const{props:s,ref:r,patchFlag:o,children:i}=e,l=t?hl(s||{},t):s;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&so(l),ref:t&&t.ref?n&&r?N(r)?r.concat(Qt(t)):[r,Qt(t)]:Qt(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ge?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Re(e.ssContent),ssFallback:e.ssFallback&&Re(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function dl(e=" ",t=0){return ue(dn,null,e,t)}function Pc(e,t){const n=ue(Jt,null,e);return n.staticCount=t,n}function Fc(e="",t=!1){return t?(eo(),no(ye,null,e)):ue(ye,null,e)}function Oe(e){return e==null||typeof e=="boolean"?ue(ye):N(e)?ue(ge,null,e.slice()):typeof e=="object"?$e(e):ue(dn,null,String(e))}function $e(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Re(e)}function hs(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(N(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),hs(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!(hn in t)?t._ctx=ce:r===3&&ce&&(ce.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else L(t)?(t={default:t,_ctx:ce},n=32):(t=String(t),s&64?(n=16,t=[dl(t)]):n=8);e.children=t,e.shapeFlag|=n}function hl(...e){const t={};for(let n=0;noe||ce;let gs,st,ks="__VUE_INSTANCE_SETTERS__";(st=On()[ks])||(st=On()[ks]=[]),st.push(e=>oe=e),gs=e=>{st.length>1?st.forEach(t=>t(e)):st[0](e)};const pt=e=>{gs(e),e.scope.on()},Ge=()=>{oe&&oe.scope.off(),gs(null)};function oo(e){return e.vnode.shapeFlag&4}let Rt=!1;function _l(e,t=!1){Rt=t;const{props:n,children:s}=e.vnode,r=oo(e);Zi(e,n,r,t),tl(e,s);const o=r?bl(e,t):void 0;return Rt=!1,o}function bl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=wr(new Proxy(e.ctx,ki));const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?vl(e):null;pt(e),gt();const o=Ke(s,e,0,[e.props,r]);if(mt(),Ge(),lr(o)){if(o.then(Ge,Ge),t)return o.then(i=>{Vs(e,i,t)}).catch(i=>{ln(i,e,0)});e.asyncDep=o}else Vs(e,o,t)}else io(e,t)}function Vs(e,t,n){L(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Y(t)&&(e.setupState=Pr(t)),io(e,n)}let Ws;function io(e,t,n){const s=e.type;if(!e.render){if(!t&&Ws&&!s.render){const r=s.template||us(e).template;if(r){const{isCustomElement:o,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:f}=s,u=ne(ne({isCustomElement:o,delimiters:l},i),f);s.render=Ws(r,u)}}e.render=s.render||Te}pt(e),gt(),Vi(e),mt(),Ge()}function yl(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return de(e,"get","$attrs"),t[n]}}))}function vl(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return yl(e)},slots:e.slots,emit:e.emit,expose:t}}function pn(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Pr(wr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Tt)return Tt[n](e)},has(t,n){return n in t||n in Tt}}))}function Bn(e,t=!0){return L(e)?e.displayName||e.name:e.name||t&&e.__name}function xl(e){return L(e)&&"__vccOpts"in e}const Cl=(e,t)=>mi(e,t,Rt);function El(e,t,n){const s=arguments.length;return s===2?Y(t)&&!N(t)?Nt(t)?ue(e,null,[t]):ue(e,t):ue(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Nt(n)&&(n=[n]),ue(e,t,n))}const Tl=Symbol.for("v-scx"),wl=()=>qt(Tl),Al="3.3.4",Ol="http://www.w3.org/2000/svg",Ye=typeof document<"u"?document:null,zs=Ye&&Ye.createElement("template"),Il={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t?Ye.createElementNS(Ol,e):Ye.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ye.createTextNode(e),createComment:e=>Ye.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ye.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{zs.innerHTML=s?`${e}`:e;const l=zs.content;if(s){const f=l.firstChild;for(;f.firstChild;)l.appendChild(f.firstChild);l.removeChild(f)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function Pl(e,t,n){const s=e._vtc;s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function Fl(e,t,n){const s=e.style,r=ee(n);if(n&&!r){if(t&&!ee(t))for(const o in t)n[o]==null&&$n(s,o,"");for(const o in n)$n(s,o,n[o])}else{const o=s.display;r?t!==n&&(s.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(s.display=o)}}const qs=/\s*!important$/;function $n(e,t,n){if(N(n))n.forEach(s=>$n(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ml(e,t);qs.test(n)?e.setProperty(et(s),n.replace(qs,""),"important"):e[s]=n}}const Js=["Webkit","Moz","ms"],En={};function Ml(e,t){const n=En[t];if(n)return n;let s=Pe(t);if(s!=="filter"&&s in e)return En[t]=s;s=rn(s);for(let r=0;rTn||(Hl.then(()=>Tn=0),Tn=Date.now());function $l(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;be(jl(s,n.value),t,5,[s])};return n.value=e,n.attached=Bl(),n}function jl(e,t){if(N(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const Xs=/^on[a-z]/,Ul=(e,t,n,s,r=!1,o,i,l,f)=>{t==="class"?Pl(e,s,r):t==="style"?Fl(e,n,s):nn(t)?Kn(t)||Ll(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Kl(e,t,s,r))?Nl(e,t,s,o,i,l,f):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Sl(e,t,s,r))};function Kl(e,t,n,s){return s?!!(t==="innerHTML"||t==="textContent"||t in e&&Xs.test(t)&&L(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||Xs.test(t)&&ee(n)?!1:t in e}const He="transition",yt="animation",lo=(e,{slots:t})=>El(Si,fo(e),t);lo.displayName="Transition";const co={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},kl=lo.props=ne({},$r,co),Je=(e,t=[])=>{N(e)?e.forEach(n=>n(...t)):e&&e(...t)},Zs=e=>e?N(e)?e.some(t=>t.length>1):e.length>1:!1;function fo(e){const t={};for(const P in e)P in co||(t[P]=e[P]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:f=o,appearActiveClass:u=i,appearToClass:d=l,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,D=Vl(r),O=D&&D[0],K=D&&D[1],{onBeforeEnter:V,onEnter:T,onEnterCancelled:I,onLeave:v,onLeaveCancelled:H,onBeforeAppear:q=V,onAppear:W=T,onAppearCancelled:S=I}=t,k=(P,G,he)=>{Be(P,G?d:l),Be(P,G?u:i),he&&he()},$=(P,G)=>{P._isLeaving=!1,Be(P,p),Be(P,w),Be(P,g),G&&G()},X=P=>(G,he)=>{const _t=P?W:T,re=()=>k(G,P,he);Je(_t,[G,re]),Gs(()=>{Be(G,P?f:o),Me(G,P?d:l),Zs(_t)||er(G,s,O,re)})};return ne(t,{onBeforeEnter(P){Je(V,[P]),Me(P,o),Me(P,i)},onBeforeAppear(P){Je(q,[P]),Me(P,f),Me(P,u)},onEnter:X(!1),onAppear:X(!0),onLeave(P,G){P._isLeaving=!0;const he=()=>$(P,G);Me(P,p),ao(),Me(P,g),Gs(()=>{P._isLeaving&&(Be(P,p),Me(P,w),Zs(v)||er(P,s,K,he))}),Je(v,[P,he])},onEnterCancelled(P){k(P,!1),Je(I,[P])},onAppearCancelled(P){k(P,!0),Je(S,[P])},onLeaveCancelled(P){$(P),Je(H,[P])}})}function Vl(e){if(e==null)return null;if(Y(e))return[wn(e.enter),wn(e.leave)];{const t=wn(e);return[t,t]}}function wn(e){return Ao(e)}function Me(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function Be(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function Gs(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Wl=0;function er(e,t,n,s){const r=e._endId=++Wl,o=()=>{r===e._endId&&s()};if(n)return setTimeout(o,n);const{type:i,timeout:l,propCount:f}=uo(e,t);if(!i)return s();const u=i+"end";let d=0;const p=()=>{e.removeEventListener(u,g),o()},g=w=>{w.target===e&&++d>=f&&p()};setTimeout(()=>{d(n[D]||"").split(", "),r=s(`${He}Delay`),o=s(`${He}Duration`),i=tr(r,o),l=s(`${yt}Delay`),f=s(`${yt}Duration`),u=tr(l,f);let d=null,p=0,g=0;t===He?i>0&&(d=He,p=i,g=o.length):t===yt?u>0&&(d=yt,p=u,g=f.length):(p=Math.max(i,u),d=p>0?i>u?He:yt:null,g=d?d===He?o.length:f.length:0);const w=d===He&&/\b(transform|all)(,|$)/.test(s(`${He}Property`).toString());return{type:d,timeout:p,propCount:g,hasTransform:w}}function tr(e,t){for(;e.lengthnr(n)+nr(e[s])))}function nr(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function ao(){return document.body.offsetHeight}const ho=new WeakMap,po=new WeakMap,go={name:"TransitionGroup",props:ne({},kl,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ps(),s=Br();let r,o;return ls(()=>{if(!r.length)return;const i=e.moveClass||`${e.name||"v"}-move`;if(!Yl(r[0].el,n.vnode.el,i))return;r.forEach(ql),r.forEach(Jl);const l=r.filter(Ql);ao(),l.forEach(f=>{const u=f.el,d=u.style;Me(u,i),d.transform=d.webkitTransform=d.transitionDuration="";const p=u._moveCb=g=>{g&&g.target!==u||(!g||/transform$/.test(g.propertyName))&&(u.removeEventListener("transitionend",p),u._moveCb=null,Be(u,i))};u.addEventListener("transitionend",p)})}),()=>{const i=j(e),l=fo(i);let f=i.tag||ge;r=o,o=t.default?os(t.default()):[];for(let u=0;udelete e.mode;go.props;const Mc=go;function ql(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function Jl(e){po.set(e,e.el.getBoundingClientRect())}function Ql(e){const t=ho.get(e),n=po.get(e),s=t.left-n.left,r=t.top-n.top;if(s||r){const o=e.el.style;return o.transform=o.webkitTransform=`translate(${s}px,${r}px)`,o.transitionDuration="0s",e}}function Yl(e,t,n){const s=e.cloneNode();e._vtc&&e._vtc.forEach(i=>{i.split(/\s+/).forEach(l=>l&&s.classList.remove(l))}),n.split(/\s+/).forEach(i=>i&&s.classList.add(i)),s.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(s);const{hasTransform:o}=uo(s);return r.removeChild(s),o}const sr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return N(t)?n=>ct(t,n):t};function Xl(e){e.target.composing=!0}function rr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Sc={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e._assign=sr(r);const o=s||r.props&&r.props.type==="number";ot(e,t?"change":"input",i=>{if(i.target.composing)return;let l=e.value;n&&(l=l.trim()),o&&(l=An(l)),e._assign(l)}),n&&ot(e,"change",()=>{e.value=e.value.trim()}),t||(ot(e,"compositionstart",Xl),ot(e,"compositionend",rr),ot(e,"change",rr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:s,number:r}},o){if(e._assign=sr(o),e.composing||document.activeElement===e&&e.type!=="range"&&(n||s&&e.value.trim()===t||(r||e.type==="number")&&An(e.value)===t))return;const i=t??"";e.value!==i&&(e.value=i)}},Zl=["ctrl","shift","alt","meta"],Gl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Zl.some(n=>e[`${n}Key`]&&!t.includes(n))},Nc=(e,t)=>(n,...s)=>{for(let r=0;rn=>{if(!("key"in n))return;const s=et(n.key);if(t.some(r=>r===s||ec[r]===s))return e(n)},Lc={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):vt(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),vt(e,!0),s.enter(e)):s.leave(e,()=>{vt(e,!1)}):vt(e,t))},beforeUnmount(e,{value:t}){vt(e,t)}};function vt(e,t){e.style.display=t?e._vod:"none"}const tc=ne({patchProp:Ul},Il);let or;function nc(){return or||(or=sl(tc))}const Dc=(...e)=>{const t=nc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=sc(s);if(!r)return;const o=t._component;!L(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.innerHTML="";const i=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function sc(e){return ee(e)?document.querySelector(e):e}function rc(){return mo().__VUE_DEVTOOLS_GLOBAL_HOOK__}function mo(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const oc=typeof Proxy=="function",ic="devtools-plugin:setup",lc="plugin:settings:set";let rt,jn;function cc(){var e;return rt!==void 0||(typeof window<"u"&&window.performance?(rt=!0,jn=window.performance):typeof global<"u"&&(!((e=global.perf_hooks)===null||e===void 0)&&e.performance)?(rt=!0,jn=global.perf_hooks.performance):rt=!1),rt}function fc(){return cc()?jn.now():Date.now()}class uc{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const s={};if(t.settings)for(const i in t.settings){const l=t.settings[i];s[i]=l.defaultValue}const r=`__vue-devtools-plugin-settings__${t.id}`;let o=Object.assign({},s);try{const i=localStorage.getItem(r),l=JSON.parse(i);Object.assign(o,l)}catch{}this.fallbacks={getSettings(){return o},setSettings(i){try{localStorage.setItem(r,JSON.stringify(i))}catch{}o=i},now(){return fc()}},n&&n.on(lc,(i,l)=>{i===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(i,l)=>this.target?this.target.on[l]:(...f)=>{this.onQueue.push({method:l,args:f})}}),this.proxiedTarget=new Proxy({},{get:(i,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...f)=>(this.targetQueue.push({method:l,args:f,resolve:()=>{}}),this.fallbacks[l](...f)):(...f)=>new Promise(u=>{this.targetQueue.push({method:l,args:f,resolve:u})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function Hc(e,t){const n=e,s=mo(),r=rc(),o=oc&&n.enableEarlyProxy;if(r&&(s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))r.emit(ic,e,t);else{const i=o?new uc(n,r):null;(s.__VUE_DEVTOOLS_PLUGINS__=s.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}export{dc as $,Re as A,dn as B,ye as C,wr as D,Gn as E,ge as F,Tr as G,j as H,Kr as I,zn as J,Oc as K,qn as L,ac as M,Sc as N,Fc as O,Rc as P,no as Q,Ec as R,pc as S,lo as T,Ac as U,ue as V,mc as W,_c as X,Er as Y,hc as Z,ai as _,ro as a,Hc as a0,Ti as a1,Nc as a2,Cc as a3,Tc as a4,xc as a5,Dc as a6,wc as a7,Pc as b,Ic as c,vc as d,dl as e,Nt as f,ps as g,cs as h,qt as i,is as j,Hi as k,Ri as l,Li as m,Cl as n,eo as o,Xi as p,bc as q,fi as r,El as s,Mc as t,gc as u,Lc as v,zt as w,hl as x,bi as y,yc as z}; diff --git a/web/dist/assets/Anouncement-40c2492f.js b/web/dist/assets/Anouncement-40c2492f.js deleted file mode 100644 index 878c6d03..00000000 --- a/web/dist/assets/Anouncement-40c2492f.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as F}from"./post-skeleton-f095ca4e.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{u as V}from"./vuex-473b3783.js";import{b as z}from"./vue-router-b8e3382f.js";import{a as A}from"./formatTime-4210fcd1.js";import{F as R,Q as S,H as L,G as M}from"./naive-ui-e703c4e6.js";import{d as O,r as n,j as P,c as o,V as a,a1 as p,o as e,_ as u,O as l,F as Q,a4 as j,Q as q,a as s,M as _,L as D}from"./@vue-e0e89260.js";import{_ as E}from"./index-26a2b065.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-0524c43e.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const G={key:0,class:"pagination-wrap"},H={key:0,class:"skeleton-wrap"},I={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},$=O({__name:"Anouncement",setup(J){const d=V(),g=z(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return P(()=>{}),(m,K)=>{const y=N,k=S,x=F,w=L,B=M,C=R;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",G,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",H,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",I,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(Q,null,j(r.value,t=>(e(),q(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:D({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(A)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=E($,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; diff --git a/web/dist/assets/Anouncement-9ddf3e18.js b/web/dist/assets/Anouncement-9ddf3e18.js new file mode 100644 index 00000000..1c1f3255 --- /dev/null +++ b/web/dist/assets/Anouncement-9ddf3e18.js @@ -0,0 +1 @@ +import{_ as N}from"./post-skeleton-df8e8b0e.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{J as F,_ as S}from"./index-3489d7cc.js";import{G as V,R as q,J as H,H as J}from"./naive-ui-eecf2ec3.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e as t,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as I}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const L={key:0,class:"pagination-wrap"},M={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),i=n([]),r=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{r.value=m};return j(()=>{}),(m,K)=>{const k=R,y=q,x=N,w=H,B=J,C=V;return t(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(t(),o("div",L,[a(y,{page:r.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(t(),o("div",M,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",O,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,E(i.value,e=>(t(),G(B,{key:e.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:I({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(u(F)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; diff --git a/web/dist/assets/Collection-5728cb22.js b/web/dist/assets/Collection-5728cb22.js deleted file mode 100644 index dcef7201..00000000 --- a/web/dist/assets/Collection-5728cb22.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as N,a as P}from"./post-item.vue_vue_type_style_index_0_lang-18e150bb.js";import{_ as S}from"./post-skeleton-f095ca4e.js";import{_ as V}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{u as $}from"./vuex-473b3783.js";import{b as Q}from"./vue-router-b8e3382f.js";import{N as R,_ as j}from"./index-26a2b065.js";import{d as q,r as s,j as E,c as o,V as e,a1 as c,_ as g,O as v,o as t,F as f,a4 as h,Q as k}from"./@vue-e0e89260.js";import{F as G,Q as H,H as I,G as L}from"./naive-ui-e703c4e6.js";import"./content-772a5dad.js";import"./@vicons-0524c43e.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const O={key:0,class:"skeleton-wrap"},T={key:1},U={key:0,class:"empty-wrap"},A={key:1},D={key:2},J={key:0,class:"pagination-wrap"},K=q({__name:"Collection",setup(W){const m=$(),y=Q(),_=s(!1),i=s([]),p=s(+y.query.p||1),l=s(20),r=s(0),u=()=>{_.value=!0,R({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return E(()=>{u()}),(n,X)=>{const C=V,b=S,x=I,z=N,d=L,B=P,F=G,M=H;return t(),o("div",null,[e(C,{title:"收藏"}),e(F,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",O,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",U,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",A,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(z,{post:a},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",D,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(B,{post:a},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",J,[e(M,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Mt=j(K,[["__scopeId","data-v-a5302c9b"]]);export{Mt as default}; diff --git a/web/dist/assets/Collection-b97b3cf7.css b/web/dist/assets/Collection-b97b3cf7.css deleted file mode 100644 index 82f9e2e5..00000000 --- a/web/dist/assets/Collection-b97b3cf7.css +++ /dev/null @@ -1 +0,0 @@ -.pagination-wrap[data-v-a5302c9b]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-a5302c9b],.dark .empty-wrap[data-v-a5302c9b],.dark .skeleton-wrap[data-v-a5302c9b]{background-color:#101014bf} diff --git a/web/dist/assets/Collection-c6b44d8b.js b/web/dist/assets/Collection-c6b44d8b.js new file mode 100644 index 00000000..e33e1bf1 --- /dev/null +++ b/web/dist/assets/Collection-c6b44d8b.js @@ -0,0 +1 @@ +import{_ as q}from"./whisper-473502c7.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-bce56e3e.js";import{_ as U}from"./post-skeleton-df8e8b0e.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{u as G}from"./vuex-44de225f.js";import{b as J}from"./vue-router-e5a2430e.js";import{W as L}from"./v3-infinite-loading-2c58ec2f.js";import{T as Y,u as K,f as Q,_ as X}from"./index-3489d7cc.js";import{d as Z,H as t,b as ee,f as n,k as a,w as u,q as d,Y as h,e as o,bf as f,F as S,u as $,j as z,x as oe}from"./@vue-a481fc63.js";import{F as se,G as te,a as ne,J as ae,k as ie,H as le}from"./naive-ui-eecf2ec3.js";import"./content-23ae3d74.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},pe={key:2},me={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Z({__name:"Collection",setup(ve){const v=G(),A=J(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),p=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let m in s.value)s.value[m].user_id==e&&(s.value[m].user.is_following=r)}const b=()=>{c.value=!0,Y({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),p.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value{b()}),(e,r)=>{const m=E,O=U,P=ae,T=D,F=le,H=R,N=q,V=te,W=ie,j=ne;return o(),n("div",null,[a(m,{title:"收藏"}),a(V,{class:"main-content-wrap",bordered:""},{default:u(()=>[c.value&&s.value.length===0?(o(),n("div",re,[a(O,{num:w.value},null,8,["num"])])):(o(),n("div",_e,[s.value.length===0?(o(),n("div",ue,[a(P,{size:"large",description:"暂无数据"})])):h("",!0),f(v).state.desktopModelShow?(o(),n("div",ce,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(T,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),n("div",pe,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(H,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),a(N,{show:g.value,user:k.value,onSuccess:I},null,8,["show","user"])]),_:1}),p.value>0?(o(),d(j,{key:0,justify:"center"},{default:u(()=>[a(f(L),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:M},{spinner:u(()=>[z("div",me,[_.value?h("",!0):(o(),d(W,{key:0,size:14})),z("span",de,oe(_.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):h("",!0)])}}});const Ye=X(fe,[["__scopeId","data-v-735372fb"]]);export{Ye as default}; diff --git a/web/dist/assets/Collection-e605040f.css b/web/dist/assets/Collection-e605040f.css new file mode 100644 index 00000000..60789b07 --- /dev/null +++ b/web/dist/assets/Collection-e605040f.css @@ -0,0 +1 @@ +.load-more[data-v-735372fb]{margin:20px}.load-more .load-more-wrap[data-v-735372fb]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-735372fb]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-735372fb],.dark .empty-wrap[data-v-735372fb],.dark .skeleton-wrap[data-v-735372fb]{background-color:#101014bf} diff --git a/web/dist/assets/Contacts-89bcf6d7.js b/web/dist/assets/Contacts-89bcf6d7.js new file mode 100644 index 00000000..9323ed50 --- /dev/null +++ b/web/dist/assets/Contacts-89bcf6d7.js @@ -0,0 +1 @@ +import{_ as W}from"./whisper-473502c7.js";import{d as N,c as A,r as R,e as c,f as p,k as t,w as n,j as _,y as E,A as G,x as d,bf as h,h as x,H as l,b as J,q as $,Y as C,F as S,u as K}from"./@vue-a481fc63.js";import{K as L,_ as P,X as U}from"./index-3489d7cc.js";import{k as X,r as Y}from"./@vicons-f0266f88.js";import{j as M,o as Q,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-df8e8b0e.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=Q,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(X))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value{z()});const z=(v=!1)=>{s.value.length===0&&(o.value=!0),U({page:i.value,page_size:e.value}).then(u=>{o.value=!1,u.list.length===0&&(r.value=!0),i.value>1?s.value=s.value.concat(u.list):(s.value=u.list,v&&setTimeout(()=>{window.scrollTo(0,99999)},50)),a.value=Math.ceil(u.pager.total_rows/e.value)}).catch(u=>{o.value=!1,i.value>1&&i.value--})};return(v,u)=>{const q=ie,B=_e,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return c(),p(S,null,[_("div",null,[t(q,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[o.value&&s.value.length===0?(c(),p("div",ke,[t(B,{num:e.value},null,8,["num"])])):(c(),p("div",ye,[s.value.length===0?(c(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):C("",!0),(c(!0),p(S,null,K(s.value,I=>(c(),$(D,{class:"list-item",key:I.user_id},{default:n(()=>[t(j,{contact:I,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:m.value,user:f.value,onSuccess:k},null,8,["show","user"])]),_:1})]),a.value>0?(c(),$(T,{key:0,justify:"center"},{default:n(()=>[t(h(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:y},{spinner:n(()=>[_("div",Ce,[r.value?C("",!0):(c(),$(O,{key:0,size:14})),_("span",be,d(r.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):C("",!0)],64)}}});const Qe=P(ze,[["__scopeId","data-v-69277f0c"]]);export{Qe as default}; diff --git a/web/dist/assets/Contacts-8c50ea43.js b/web/dist/assets/Contacts-8c50ea43.js deleted file mode 100644 index 09bb1ceb..00000000 --- a/web/dist/assets/Contacts-8c50ea43.js +++ /dev/null @@ -1 +0,0 @@ -import{u as N,b as P}from"./vue-router-b8e3382f.js";import{b as Q}from"./formatTime-4210fcd1.js";import{d as k,o,c as s,a as e,V as a,M as l,_ as C,r as c,j as R,a1 as f,O as h,F as y,a4 as S,Q as U}from"./@vue-e0e89260.js";import{o as q,F as T,Q as j,H as x,G as E}from"./naive-ui-e703c4e6.js";import{_ as b,Q as G}from"./index-26a2b065.js";import{_ as H}from"./post-skeleton-f095ca4e.js";import{_ as L}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{u as O}from"./vuex-473b3783.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./@vicons-0524c43e.js";/* empty css */const A={class:"avatar"},J={class:"base-info"},K={class:"username"},W={class:"user-info"},X={class:"info-item"},Y={class:"info-item"},Z=k({__name:"contact-item",props:{contact:{}},setup(w){const u=N(),m=t=>{u.push({name:"user",query:{s:t}})};return(t,n)=>{const _=q;return o(),s("div",{class:"contact-item",onClick:n[0]||(n[0]=i=>m(t.contact.username))},[e("div",A,[a(_,{size:54,src:t.contact.avatar},null,8,["src"])]),e("div",J,[e("div",K,[e("strong",null,l(t.contact.nickname),1),e("span",null," @"+l(t.contact.username),1)]),e("div",W,[e("span",X,"UID. "+l(t.contact.user_id),1),e("span",Y,l(C(Q)(t.contact.created_on))+" 加入",1)])])])}}});const tt=b(Z,[["__scopeId","data-v-644d2c15"]]),et={key:0,class:"skeleton-wrap"},ot={key:1},nt={key:0,class:"empty-wrap"},st={key:0,class:"pagination-wrap"},at=k({__name:"Contacts",setup(w){const u=O(),m=P(),t=c(!1),n=c([]),_=c(+m.query.p||1),i=c(20),d=c(0),$=r=>{_.value=r,v()};R(()=>{v()});const v=(r=!1)=>{n.value.length===0&&(t.value=!0),G({page:_.value,page_size:i.value}).then(p=>{t.value=!1,n.value=p.list,d.value=Math.ceil(p.pager.total_rows/i.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(p=>{t.value=!1})};return(r,p)=>{const z=L,B=H,I=x,V=tt,D=E,F=T,M=j;return o(),s(y,null,[e("div",null,[a(z,{title:"好友"}),a(F,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(o(),s("div",et,[a(B,{num:i.value},null,8,["num"])])):(o(),s("div",ot,[n.value.length===0?(o(),s("div",nt,[a(I,{size:"large",description:"暂无数据"})])):h("",!0),(o(!0),s(y,null,S(n.value,g=>(o(),U(D,{key:g.user_id},{default:f(()=>[a(V,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(o(),s("div",st,[a(M,{page:_.value,"onUpdate:page":$,"page-slot":C(u).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const Mt=b(at,[["__scopeId","data-v-3b2bf978"]]);export{Mt as default}; diff --git a/web/dist/assets/Contacts-baa2e9bb.css b/web/dist/assets/Contacts-baa2e9bb.css deleted file mode 100644 index 6b7ec561..00000000 --- a/web/dist/assets/Contacts-baa2e9bb.css +++ /dev/null @@ -1 +0,0 @@ -.contact-item[data-v-644d2c15]{display:flex;width:100%;padding:12px 16px}.contact-item[data-v-644d2c15]:hover{background:#f7f9f9;cursor:pointer}.contact-item .avatar[data-v-644d2c15]{width:54px}.contact-item .base-info[data-v-644d2c15]{position:relative;margin-left:12px;padding-top:2px;width:calc(100% - 66px)}.contact-item .base-info .username[data-v-644d2c15]{line-height:16px;font-size:16px}.contact-item .base-info .user-info[data-v-644d2c15]{margin-top:6px}.contact-item .base-info .user-info .info-item[data-v-644d2c15]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.dark .contact-item[data-v-644d2c15]{background-color:#101014bf}.dark .contact-item[data-v-644d2c15]:hover{background:#18181c}.pagination-wrap[data-v-3b2bf978]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-3b2bf978],.dark .empty-wrap[data-v-3b2bf978],.dark .skeleton-wrap[data-v-3b2bf978]{background-color:#101014bf} diff --git a/web/dist/assets/Contacts-c993e2de.css b/web/dist/assets/Contacts-c993e2de.css new file mode 100644 index 00000000..9d004484 --- /dev/null +++ b/web/dist/assets/Contacts-c993e2de.css @@ -0,0 +1 @@ +.contact-item[data-v-d62f19da]{width:100%;box-sizing:border-box;padding:12px 16px}.contact-item[data-v-d62f19da]:hover{background:#f7f9f9}.contact-item .nickname-wrap[data-v-d62f19da],.contact-item .username-wrap[data-v-d62f19da]{line-height:16px;font-size:16px}.contact-item .top-tag[data-v-d62f19da]{transform:scale(.75)}.contact-item .user-info .info-item[data-v-d62f19da]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.contact-item .item-header-extra[data-v-d62f19da]{display:flex;align-items:center;opacity:.75}.dark .contact-item[data-v-d62f19da]{background-color:#101014bf}.dark .contact-item[data-v-d62f19da]:hover{background:#18181c}.load-more[data-v-69277f0c]{margin:20px}.load-more .load-more-wrap[data-v-69277f0c]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-69277f0c]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-69277f0c],.dark .empty-wrap[data-v-69277f0c],.dark .skeleton-wrap[data-v-69277f0c]{background-color:#101014bf} diff --git a/web/dist/assets/Following-31b77f3b.css b/web/dist/assets/Following-31b77f3b.css deleted file mode 100644 index 2096523b..00000000 --- a/web/dist/assets/Following-31b77f3b.css +++ /dev/null @@ -1 +0,0 @@ -.follow-item[data-v-64f1874c]{display:border-box;width:100%;padding:12px 16px}.follow-item[data-v-64f1874c]:hover{background:#f7f9f9}.follow-item .nickname-wrap[data-v-64f1874c],.follow-item .username-wrap[data-v-64f1874c]{line-height:16px;font-size:16px}.follow-item .top-tag[data-v-64f1874c]{transform:scale(.75)}.follow-item .user-info .info-item[data-v-64f1874c]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.follow-item .item-header-extra[data-v-64f1874c]{display:flex;align-items:center;opacity:.75}.dark .follow-item[data-v-64f1874c]{background-color:#101014bf}.dark .follow-item[data-v-64f1874c]:hover{background:#18181c}.main-content-wrap[data-v-1f0f223d]{padding:20px}.pagination-wrap[data-v-1f0f223d]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-1f0f223d],.dark .empty-wrap[data-v-1f0f223d],.dark .skeleton-wrap[data-v-1f0f223d]{background-color:#101014bf} diff --git a/web/dist/assets/Following-5d4d08db.js b/web/dist/assets/Following-5d4d08db.js deleted file mode 100644 index 607f4905..00000000 --- a/web/dist/assets/Following-5d4d08db.js +++ /dev/null @@ -1 +0,0 @@ -import{d as B,n as L,a3 as Q,o as l,c as r,V as o,a1 as t,a as p,a2 as A,e as q,M as k,Q as N,O as z,_ as v,s as C,r as f,j as E,F as I,a4 as W}from"./@vue-e0e89260.js";import{u as J,b as K}from"./vue-router-b8e3382f.js";import{G as X,H as Y,_ as O,R as Z,S as ee}from"./index-26a2b065.js";import{b as oe}from"./formatTime-4210fcd1.js";import{i as te,y as ne,z as se}from"./@vicons-0524c43e.js";import{T as ae,j as x,o as le,M as ce,e as _e,O as ie,L as ue,F as re,Q as pe,f as me,g as de,H as fe,G as ge}from"./naive-ui-e703c4e6.js";import{_ as ve}from"./post-skeleton-f095ca4e.js";import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{u as he}from"./vuex-473b3783.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const ke={class:"follow-item"},ye={class:"nickname-wrap"},be={class:"username-wrap"},Fe={class:"user-info"},$e={class:"info-item"},ze={class:"info-item"},Te={class:"item-header-extra"},Ue=B({__name:"follow-item",props:{contact:{}},setup(T){const s=T,m=ae();J();const n=e=>()=>C(x,null,{default:()=>C(e)}),c=()=>{m.success({title:"提示",content:"确定"+(s.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.contact.is_following?X({user_id:s.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),s.contact.is_following=!1}).catch(e=>{console.log(e)}):Y({user_id:s.contact.user_id}).then(e=>{window.$message.success("关注成功"),s.contact.is_following=!0}).catch(e=>{console.log(e)})}})},y=e=>{switch(e){case"follow":case"unfollow":c();break}},w=L(()=>{let e=[];return s.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:n(ne)}):e.push({label:"关注",key:"follow",icon:n(se)}),e});return(e,i)=>{const u=le,d=Q("router-link"),b=ce,F=_e,g=ie,$=ue;return l(),r("div",ke,[o($,{"content-indented":""},{avatar:t(()=>[o(u,{size:54,src:e.contact.avatar},null,8,["src"])]),header:t(()=>[p("span",ye,[o(d,{onClick:i[0]||(i[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[q(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",be," @"+k(e.contact.username),1),e.contact.is_following?(l(),N(b,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[q(" 已关注 ")]),_:1})):z("",!0),p("div",Fe,[p("span",$e," UID. "+k(e.contact.user_id),1),p("span",ze,k(v(oe)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Te,[o(g,{placement:"bottom-end",trigger:"click",size:"small",options:w.value,onSelect:y},{default:t(()=>[o(F,{quaternary:"",circle:""},{icon:t(()=>[o(v(x),null,{default:t(()=>[o(v(te))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Me=O(Ue,[["__scopeId","data-v-64f1874c"]]),qe={key:0,class:"skeleton-wrap"},Ce={key:1},Ie={key:0,class:"empty-wrap"},xe={key:0,class:"pagination-wrap"},Be=B({__name:"Following",setup(T){const s=he(),m=K(),n=f(!1),c=f([]),y=m.query.n||"粉丝详情",w=m.query.s||"",e=f(m.query.t||"follows"),i=f(+m.query.p||1),u=f(20),d=f(0),b=_=>{i.value=_,g()},F=_=>{e.value=_,g()},g=()=>{e.value==="follows"?$(w):e.value==="followings"&&S(w)},$=(_,h=!1)=>{c.value.length===0&&(n.value=!0),Z({username:_,page:i.value,page_size:u.value}).then(a=>{n.value=!1,c.value=a.list||[],d.value=Math.ceil(a.pager.total_rows/u.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(a=>{n.value=!1})},S=(_,h=!1)=>{c.value.length===0&&(n.value=!0),ee({username:_,page:i.value,page_size:u.value}).then(a=>{n.value=!1,c.value=a.list||[],d.value=Math.ceil(a.pager.total_rows/u.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(a=>{n.value=!1})};return E(()=>{g()}),(_,h)=>{const a=we,U=me,V=de,D=ve,P=fe,R=Me,H=ge,j=re,G=pe;return l(),r(I,null,[p("div",null,[o(a,{title:v(y),back:!0},null,8,["title"]),o(j,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(V,{type:"line",animated:"","default-value":e.value,"onUpdate:value":F},{default:t(()=>[o(U,{name:"follows",tab:"正在关注"}),o(U,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),n.value?(l(),r("div",qe,[o(D,{num:u.value},null,8,["num"])])):(l(),r("div",Ce,[c.value.length===0?(l(),r("div",Ie,[o(P,{size:"large",description:"暂无数据"})])):z("",!0),(l(!0),r(I,null,W(c.value,M=>(l(),N(H,{key:M.user_id},{default:t(()=>[o(R,{contact:M},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(l(),r("div",xe,[o(G,{page:i.value,"onUpdate:page":b,"page-slot":v(s).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):z("",!0)],64)}}});const ao=O(Be,[["__scopeId","data-v-1f0f223d"]]);export{ao as default}; diff --git a/web/dist/assets/Following-c2ff25f8.css b/web/dist/assets/Following-c2ff25f8.css new file mode 100644 index 00000000..6e52aad0 --- /dev/null +++ b/web/dist/assets/Following-c2ff25f8.css @@ -0,0 +1 @@ +.follow-item[data-v-1fb7364a]{display:border-box;width:100%;padding:12px 16px}.follow-item[data-v-1fb7364a]:hover{background:#f7f9f9}.follow-item .nickname-wrap[data-v-1fb7364a],.follow-item .username-wrap[data-v-1fb7364a]{line-height:16px;font-size:16px}.follow-item .top-tag[data-v-1fb7364a]{transform:scale(.75)}.follow-item .user-info .info-item[data-v-1fb7364a]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.follow-item .item-header-extra[data-v-1fb7364a]{display:flex;align-items:center;opacity:.75}.dark .follow-item[data-v-1fb7364a]{background-color:#101014bf}.dark .follow-item[data-v-1fb7364a]:hover{background:#18181c}.main-content-wrap[data-v-598cf32e]{padding:20px}.load-more[data-v-598cf32e]{margin:20px}.load-more .load-more-wrap[data-v-598cf32e]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-598cf32e]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-598cf32e],.dark .empty-wrap[data-v-598cf32e],.dark .skeleton-wrap[data-v-598cf32e]{background-color:#101014bf} diff --git a/web/dist/assets/Following-eaa8214c.js b/web/dist/assets/Following-eaa8214c.js new file mode 100644 index 00000000..9f65ba75 --- /dev/null +++ b/web/dist/assets/Following-eaa8214c.js @@ -0,0 +1 @@ +import{_ as Q}from"./whisper-473502c7.js";import{d as N,c as O,r as X,e as c,f as d,k as n,w as a,j as _,y as ee,A as S,x as g,q as $,Y as F,bf as w,h as U,H as i,b as oe,F as C,u as ne}from"./@vue-a481fc63.js";import{u as te,b as se}from"./vue-router-e5a2430e.js";import{K as ae,u as le,f as ce,_ as D,Y as ie,Z as _e}from"./index-3489d7cc.js";import{k as ue,r as re,s as pe,t as me}from"./@vicons-f0266f88.js";import{F as fe,j as B,o as de,M as ve,e as ge,P as we,O as he,G as ke,a as ye,f as be,g as $e,J as Fe,k as ze,H as Te}from"./naive-ui-eecf2ec3.js";import{_ as qe}from"./post-skeleton-df8e8b0e.js";import{_ as xe}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{W as Ie}from"./v3-infinite-loading-2c58ec2f.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Me={class:"follow-item"},Pe={class:"nickname-wrap"},Se={class:"username-wrap"},Ue={class:"user-info"},Ce={class:"info-item"},Be={class:"info-item"},Ne={class:"item-header-extra"},Oe=N({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(I,{emit:f}){const o=I,u=fe();te();const t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?le({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):ce({user_id:o.contact.user_id}).then(e=>{window.$message.success("关注成功"),o.contact.is_following=!0}).catch(e=>{console.log(e)})}})},h=O(()=>{let e=[{label:"私信",key:"whisper",icon:t(re)}];return o.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:t(pe)}):e.push({label:"关注",key:"follow",icon:t(me)}),e}),p=e=>{switch(e){case"follow":case"unfollow":z();break;case"whisper":const l={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};f("send-whisper",l);break}};return(e,l)=>{const m=de,v=X("router-link"),k=ve,y=ge,T=we,q=he;return c(),d("div",Me,[n(q,{"content-indented":""},{avatar:a(()=>[n(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[_("span",Pe,[n(v,{onClick:l[0]||(l[0]=ee(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:a(()=>[S(g(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",Se," @"+g(e.contact.username),1),e.contact.is_following?(c(),$(k,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[S(" 已关注 ")]),_:1})):F("",!0),_("div",Ue,[_("span",Ce," UID. "+g(e.contact.user_id),1),_("span",Be,g(w(ae)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[_("div",Ne,[n(T,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:p},{default:a(()=>[n(y,{quaternary:"",circle:""},{icon:a(()=>[n(w(B),null,{default:a(()=>[n(w(ue))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const De=D(Oe,[["__scopeId","data-v-1fb7364a"]]),Ve={key:0,class:"skeleton-wrap"},We={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Re={class:"load-more-spinner"},Ae=N({__name:"Following",setup(I){const f=se(),o=i(!1),u=i(!1),t=i([]),z=f.query.n||"粉丝详情",h=f.query.s||"",p=i(f.query.t||"follows"),e=i(+f.query.p||1),l=i(20),m=i(0),v=i(!1),k=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=O(()=>p.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=r=>{k.value=r,v.value=!0},q=()=>{v.value=!1},V=()=>{e.value{p.value=r,x()},x=()=>{p.value==="follows"?j(h):p.value==="followings"&&H(h)},j=(r,b=!1)=>{t.value.length===0&&(o.value=!0),ie({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})},H=(r,b=!1)=>{t.value.length===0&&(o.value=!0),_e({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})};return oe(()=>{x()}),(r,b)=>{const s=xe,M=be,R=$e,A=qe,Y=Fe,E=De,G=Te,J=Q,K=ke,L=ze,Z=ye;return c(),d(C,null,[_("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(K,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(R,{type:"line",animated:"","default-value":p.value,"onUpdate:value":W},{default:a(()=>[n(M,{name:"follows",tab:"正在关注"}),n(M,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),o.value&&t.value.length===0?(c(),d("div",Ve,[n(A,{num:l.value},null,8,["num"])])):(c(),d("div",We,[t.value.length===0?(c(),d("div",je,[n(Y,{size:"large",description:"暂无数据"})])):F("",!0),(c(!0),d(C,null,ne(t.value,P=>(c(),$(G,{key:P.user_id},{default:a(()=>[n(E,{contact:P,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(J,{show:v.value,user:k.value,onSuccess:q},null,8,["show","user"])]),_:1})]),m.value>0?(c(),$(Z,{key:0,justify:"center"},{default:a(()=>[n(w(Ie),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:V},{spinner:a(()=>[_("div",He,[u.value?F("",!0):(c(),$(L,{key:0,size:14})),_("span",Re,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const wo=D(Ae,[["__scopeId","data-v-598cf32e"]]);export{wo as default}; diff --git a/web/dist/assets/Home-416cfd1e.js b/web/dist/assets/Home-416cfd1e.js deleted file mode 100644 index 65b8ae36..00000000 --- a/web/dist/assets/Home-416cfd1e.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as xe,a as ze}from"./post-item.vue_vue_type_style_index_0_lang-18e150bb.js";import{_ as Ie}from"./post-skeleton-f095ca4e.js";import{d as te,r as l,j as ae,o as u,c as h,_ as z,a as T,V as a,a1 as s,Q as R,O as C,a2 as Y,e as L,M as Q,F as Z,a4 as W,n as qe,w as Ue}from"./@vue-e0e89260.js";import{u as oe}from"./vuex-473b3783.js";import{l as ee}from"./lodash-94eb5868.js";import{g as Ae,a as Ee,c as Re,b as Pe,_ as Se}from"./index-26a2b065.js";import{p as Le}from"./content-772a5dad.js";import{V as E,P as V}from"./IEnum-a180d93e.js";import{I as Ve,V as Ne,A as Fe,d as Be,E as Me}from"./@vicons-0524c43e.js";import{o as Oe,v as je,j as De,e as He,w as Ge,x as Ke,y as Je,z as Qe,A as Ze,B as We,C as Xe,a as ne,D as Ye,E as et,F as tt,G as at,H as ot,k as nt}from"./naive-ui-e703c4e6.js";import{_ as st}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{b as lt,u as it}from"./vue-router-b8e3382f.js";import{W as rt}from"./v3-infinite-loading-e5c2e8bf.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-aa5e8b3f.js";const ut=N=>{const q=new FileReader,c=_=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(_),P=()=>{const _=new Uint8Array(q.result).subarray(0,4);let m="";for(let i=0;i<_.length;i++)m+=_[i].toString(16);switch(m){case"504b0304":case"504b0506":case"504b0708":return c("application/zip");case"504b030414":return c("application/x-zip-compressed");case"504b0508":return c("application/x-zip");case"504b5370":return c("application/octet-stream");default:return!1}};return new Promise((_,m)=>{q.onloadend=()=>{const i=N.type;_(i===""||i==="application/octet-stream"?P():c(i))},q.readAsArrayBuffer(N.slice(0,4))})},ct={key:0,class:"compose-wrap"},pt={class:"compose-line"},_t={class:"compose-user"},dt={class:"compose-line compose-options"},mt={class:"attachment"},vt={class:"submit-wrap"},ft={class:"attachment-list-wrap"},gt={key:0,class:"attachment-price-wrap"},yt=T("span",null," 附件价格¥",-1),ht={key:0,class:"eye-wrap"},wt={key:1,class:"link-wrap"},bt={key:1,class:"compose-wrap"},kt=T("div",{class:"login-wrap"},[T("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ct={key:0,class:"login-only-wrap"},$t={key:1,class:"login-wrap"},Tt=te({__name:"compose",emits:["post-success"],setup(N,{emit:q}){const c=oe(),P=l([]),_=l(!1),m=l(!1),i=l(!1),v=l(!1),w=l(""),I=l([]),F=l(),U=l(0),g=l("public/image"),x=l([]),p=l([]),y=l([]),k=l([]),b=l(E.FRIEND),$=l(E.FRIEND),M=[{value:E.PUBLIC,label:"公开"},{value:E.PRIVATE,label:"私密"},{value:E.FRIEND,label:"好友可见"}],S=+"400",B=l("true".toLowerCase()==="true"),O=l("true".toLowerCase()==="true"),j=l("true".toLowerCase()==="true"),D=l("false".toLowerCase()==="true"),H=l("true".toLowerCase()==="true"),A="/v1/attachment",X=l(),se=()=>{i.value=!i.value,i.value&&v.value&&(v.value=!1)},le=()=>{v.value=!v.value,v.value&&i.value&&(i.value=!1)},ie=ee.debounce(t=>{Ae({k:t}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),P.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),re=ee.debounce(t=>{Ee({k:t}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),P.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),ue=(t,e)=>{_.value||(_.value=!0,e==="@"?ie(t):re(t))},ce=t=>{t.length>S?w.value=t.substring(0,S):w.value=t},G=t=>{g.value=t},pe=t=>{for(let r=0;r30&&(t[r].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+o)}x.value=t},_e=async t=>{var e,n,o,r,f;return g.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=t.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):g.value==="image"&&((n=t.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):g.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=t.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):g.value==="public/video"&&((r=t.file.file)==null?void 0:r.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):g.value==="attachment"&&!await ut(t.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):g.value==="attachment"&&((f=t.file.file)==null?void 0:f.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},de=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(g.value==="public/image"&&p.value.push({id:t.id,content:o.data.content}),g.value==="public/video"&&y.value.push({id:t.id,content:o.data.content}),g.value==="attachment"&&k.value.push({id:t.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},me=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let r=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(f=>{r+=":"+f}),window.$message.error(r)}}catch{window.$message.error("上传失败")}},ve=({file:t})=>{let e=p.value.findIndex(n=>n.id===t.id);e>-1&&p.value.splice(e,1),e=y.value.findIndex(n=>n.id===t.id),e>-1&&y.value.splice(e,1),e=k.value.findIndex(n=>n.id===t.id),e>-1&&k.value.splice(e,1)},fe=()=>{if(w.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:t,users:e}=Le(w.value);const n=[];let o=100;n.push({content:w.value,type:V.TEXT,sort:o}),p.value.map(r=>{o++,n.push({content:r.content,type:V.IMAGEURL,sort:o})}),y.value.map(r=>{o++,n.push({content:r.content,type:V.VIDEOURL,sort:o})}),k.value.map(r=>{o++,n.push({content:r.content,type:V.ATTACHMENT,sort:o})}),I.value.length>0&&I.value.map(r=>{o++,n.push({content:r,type:V.LINKURL,sort:o})}),m.value=!0,Re({contents:n,tags:Array.from(new Set(t)),users:Array.from(new Set(e)),attachment_price:+U.value*100,visibility:b.value}).then(r=>{var f;window.$message.success("发布成功"),m.value=!1,q("post-success",r),i.value=!1,v.value=!1,(f=F.value)==null||f.clear(),x.value=[],w.value="",I.value=[],p.value=[],y.value=[],k.value=[],b.value=$.value}).catch(r=>{m.value=!1})},K=t=>{c.commit("triggerAuth",!0),c.commit("triggerAuthKey",t)};return ae(()=>{"friend".toLowerCase()==="friend"?$.value=E.FRIEND:"friend".toLowerCase()==="public"?$.value=E.PUBLIC:$.value=E.PRIVATE,b.value=$.value,X.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(t,e)=>{const n=Oe,o=je,r=De,f=He,J=Ge,ge=Ke,ye=Je,he=Qe,we=Ze,be=We,ke=Xe,Ce=ne,$e=Ye,Te=et;return u(),h("div",null,[z(c).state.userInfo.id>0?(u(),h("div",ct,[T("div",pt,[T("div",_t,[a(n,{round:"",size:30,src:z(c).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:w.value,prefix:["@","#"],options:P.value,onSearch:ue,"onUpdate:value":ce,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(be,{ref_key:"uploadRef",ref:F,abstract:"","list-type":"image",multiple:!0,max:9,action:A,headers:{Authorization:X.value},data:{type:g.value},"file-list":x.value,onBeforeUpload:_e,onFinish:de,onError:me,onRemove:ve,"onUpdate:fileList":pe},{default:s(()=>[T("div",dt,[T("div",mt,[a(J,{abstract:""},{default:s(({handleClick:d})=>[a(f,{disabled:x.value.length>0&&g.value==="public/video"||x.value.length===9,onClick:()=>{G("public/image"),d()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a(z(Ve))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),O.value?(u(),R(J,{key:0,abstract:""},{default:s(({handleClick:d})=>[a(f,{disabled:x.value.length>0&&g.value!=="public/video"||x.value.length===9,onClick:()=>{G("public/video"),d()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a(z(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):C("",!0),j.value?(u(),R(J,{key:1,abstract:""},{default:s(({handleClick:d})=>[a(f,{disabled:x.value.length>0&&g.value==="public/video"||x.value.length===9,onClick:()=>{G("attachment"),d()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a(z(Fe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):C("",!0),a(f,{quaternary:"",circle:"",type:"primary",onClick:Y(se,["stop"])},{icon:s(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a(z(Be))]),_:1})]),_:1},8,["onClick"]),H.value?(u(),R(f,{key:2,quaternary:"",circle:"",type:"primary",onClick:Y(le,["stop"])},{icon:s(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a(z(Me))]),_:1})]),_:1},8,["onClick"])):C("",!0)]),T("div",vt,[a(ye,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[a(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:w.value.length/z(S)*100},null,8,["percentage"])]),default:s(()=>[L(" "+Q(w.value.length)+" / "+Q(z(S)),1)]),_:1}),a(f,{loading:m.value,onClick:fe,type:"primary",secondary:"",round:""},{default:s(()=>[L(" 发布 ")]),_:1},8,["loading"])])]),T("div",ft,[a(he),k.value.length>0?(u(),h("div",gt,[D.value?(u(),R(we,{key:0,value:U.value,"onUpdate:value":e[0]||(e[0]=d=>U.value=d),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[yt]),_:1},8,["value"])):C("",!0)])):C("",!0)])]),_:1},8,["headers","data","file-list"]),v.value?(u(),h("div",ht,[a($e,{value:b.value,"onUpdate:value":e[1]||(e[1]=d=>b.value=d),name:"radiogroup"},{default:s(()=>[a(Ce,null,{default:s(()=>[(u(),h(Z,null,W(M,d=>a(ke,{key:d.value,value:d.value,label:d.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):C("",!0),i.value?(u(),h("div",wt,[a(Te,{value:I.value,"onUpdate:value":e[2]||(e[2]=d=>I.value=d),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[L(" 创建链接 ")]),_:1},8,["value"])])):C("",!0)])):(u(),h("div",bt,[kt,B.value?C("",!0):(u(),h("div",Ct,[a(f,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=d=>K("signin"))},{default:s(()=>[L(" 登录 ")]),_:1})])),B.value?(u(),h("div",$t,[a(f,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=d=>K("signin"))},{default:s(()=>[L(" 登录 ")]),_:1}),a(f,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=d=>K("signup"))},{default:s(()=>[L(" 注册 ")]),_:1})])):C("",!0)]))])}}});const xt={key:0,class:"skeleton-wrap"},zt={key:0,class:"empty-wrap"},It={key:1},qt={key:2},Ut={class:"load-more-wrap"},At={class:"load-more-spinner"},Et=te({__name:"Home",setup(N){const q=oe(),c=lt(),P=it(),_=l(!1),m=l(!1),i=l([]),v=l(1),w=l(20),I=l(0),F=qe(()=>{let p="泡泡广场";return c.query&&c.query.q&&(c.query.t&&c.query.t==="tag"?p="#"+decodeURIComponent(c.query.q):p="搜索: "+decodeURIComponent(c.query.q)),p}),U=()=>{_.value=!0,Pe({query:c.query.q?decodeURIComponent(c.query.q):null,type:c.query.t,page:v.value,page_size:w.value}).then(p=>{_.value=!1,p.list.length===0&&(m.value=!0),v.value>1?i.value=i.value.concat(p.list):(i.value=p.list,window.scrollTo(0,0)),I.value=Math.ceil(p.pager.total_rows/w.value)}).catch(p=>{_.value=!1,v.value>1&&v.value--})},g=p=>{if(v.value!=1){P.push({name:"post",query:{id:p.id}});return}let y=[],k=i.value.length;k==w.value&&k--;for(var b=0;b{v.value{U()}),Ue(()=>({path:c.path,query:c.query,refresh:q.state.refresh}),(p,y)=>{if(p.refresh!==y.refresh){m.value=!1,v.value=1,setTimeout(()=>{U()},0);return}y.path!=="/post"&&p.path==="/"&&(m.value=!1,v.value=1,setTimeout(()=>{U()},0))}),(p,y)=>{const k=st,b=Tt,$=at,M=Ie,S=ot,B=xe,O=ze,j=tt,D=nt,H=ne;return u(),h("div",null,[a(k,{title:F.value},null,8,["title"]),a(j,{class:"main-content-wrap",bordered:""},{default:s(()=>[a($,null,{default:s(()=>[a(b,{onPostSuccess:g})]),_:1}),_.value&&i.value.length===0?(u(),h("div",xt,[a(M,{num:w.value},null,8,["num"])])):C("",!0),T("div",null,[i.value.length===0?(u(),h("div",zt,[a(S,{size:"large",description:"暂无数据"})])):C("",!0),z(q).state.desktopModelShow?(u(),h("div",It,[(u(!0),h(Z,null,W(i.value,A=>(u(),R($,{key:A.id},{default:s(()=>[a(B,{post:A},null,8,["post"])]),_:2},1024))),128))])):(u(),h("div",qt,[(u(!0),h(Z,null,W(i.value,A=>(u(),R($,{key:A.id},{default:s(()=>[a(O,{post:A},null,8,["post"])]),_:2},1024))),128))]))])]),_:1}),I.value>0?(u(),R(H,{key:0,justify:"center"},{default:s(()=>[a(z(rt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:y[0]||(y[0]=A=>x())},{spinner:s(()=>[T("div",Ut,[m.value?C("",!0):(u(),R(D,{key:0,size:14})),T("span",At,Q(m.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):C("",!0)])}}});const _a=Se(Et,[["__scopeId","data-v-8f151fd6"]]);export{_a as default}; diff --git a/web/dist/assets/Home-ba528c43.js b/web/dist/assets/Home-ba528c43.js new file mode 100644 index 00000000..da3fbb0f --- /dev/null +++ b/web/dist/assets/Home-ba528c43.js @@ -0,0 +1 @@ +import{W as Te}from"./whisper-add-friend-9521d988.js";import{_ as De}from"./whisper-473502c7.js";import{_ as Ue,a as Be}from"./post-item.vue_vue_type_style_index_0_lang-bce56e3e.js";import{_ as xe}from"./post-skeleton-df8e8b0e.js";import{d as we,H as r,c as ve,b as ye,e as u,f as w,bf as f,j as I,k as n,w as i,q as E,Y as b,y as ge,A as O,x as me,F as _e,u as fe,R as Ve,E as Ee}from"./@vue-a481fc63.js";import{u as Ae}from"./vuex-44de225f.js";import{l as he}from"./lodash-e0b37ac3.js";import{g as Fe,a as Ne,c as Re,b as qe,d as Ge,e as Oe,u as Pe,f as Se,h as Ye,_ as Me}from"./index-3489d7cc.js";import{p as Le}from"./content-23ae3d74.js";import{V,P as K}from"./IEnum-5453a777.js";import{I as We,V as Ke,A as je,d as Qe,E as He}from"./@vicons-f0266f88.js";import{o as ke,v as Ze,j as Je,e as Xe,w as $e,x as et,y as tt,z as st,A as at,B as nt,C as ot,a as be,D as lt,E as it,F as rt,G as ut,H as ct,l as pt,I as dt,J as vt,k as mt}from"./naive-ui-eecf2ec3.js";import{_ as _t}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{b as ft,u as gt}from"./vue-router-e5a2430e.js";import{W as ht}from"./v3-infinite-loading-2c58ec2f.js";import{S as wt}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const yt=j=>{const g=new FileReader,o=m=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(m),q=()=>{const m=new Uint8Array(g.result).subarray(0,4);let D="";for(let h=0;h{g.onloadend=()=>{const h=j.type;m(h===""||h==="application/octet-stream"?q():o(h))},g.readAsArrayBuffer(j.slice(0,4))})},At={key:0,class:"compose-wrap"},kt={class:"compose-line"},bt={class:"compose-user"},It={class:"compose-line compose-options"},zt={class:"attachment"},Ct={class:"submit-wrap"},Tt={class:"attachment-list-wrap"},Dt={key:0,class:"attachment-price-wrap"},Ut=I("span",null," 附件价格¥",-1),Bt={key:0,class:"eye-wrap"},xt={key:1,class:"link-wrap"},Vt={key:1,class:"compose-wrap"},Et=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ft={key:0,class:"login-only-wrap"},Nt={key:1,class:"login-wrap"},Rt=we({__name:"compose",emits:["post-success"],setup(j,{emit:g}){const o=Ae(),q=r([]),m=r(!1),D=r(!1),h=r(!1),y=r(!1),A=r(""),N=r([]),G=r(),C=r(0),p=r("public/image"),T=r([]),R=r([]),d=r([]),_=r([]),U=r(V.PUBLIC),z=r(V.PUBLIC),M=r("true".toLowerCase()==="true"),L="/v1/attachment",Q=ve(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),H=ve(()=>{let s=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return o.state.profile.useFriendship&&s.push({value:V.FRIEND,label:"好友可见"}),s}),$=()=>{h.value=!h.value,h.value&&y.value&&(y.value=!1)},ee=()=>{y.value=!y.value,y.value&&h.value&&(h.value=!1)},te=he.debounce(s=>{Fe({k:s}).then(a=>{let l=[];a.suggest.map(e=>{l.push({label:e,value:e})}),q.value=l,m.value=!1}).catch(a=>{m.value=!1})},200),se=he.debounce(s=>{Ne({k:s}).then(a=>{let l=[];a.suggest.map(e=>{l.push({label:e,value:e})}),q.value=l,m.value=!1}).catch(a=>{m.value=!1})},200),Z=(s,a)=>{m.value||(m.value=!0,a==="@"?te(s):se(s))},J=s=>{s.length>o.state.profile.defaultTweetMaxLength?A.value=s.substring(0,o.state.profile.defaultTweetMaxLength):A.value=s},P=s=>{p.value=s},X=s=>{for(let t=0;t30&&(s[t].name=l.substring(0,18)+"..."+l.substring(l.length-9)+"."+e)}T.value=s},ae=async s=>{var a,l,e,t,c;return p.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((a=s.file.file)==null?void 0:a.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):p.value==="image"&&((l=s.file.file)==null?void 0:l.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):p.value==="public/video"&&!["video/mp4","video/quicktime"].includes((e=s.file.file)==null?void 0:e.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):p.value==="public/video"&&((t=s.file.file)==null?void 0:t.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):p.value==="attachment"&&!await yt(s.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):p.value==="attachment"&&((c=s.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},S=({file:s,event:a})=>{var l;try{let e=JSON.parse((l=a.target)==null?void 0:l.response);e.code===0&&(p.value==="public/image"&&R.value.push({id:s.id,content:e.data.content}),p.value==="public/video"&&d.value.push({id:s.id,content:e.data.content}),p.value==="attachment"&&_.value.push({id:s.id,content:e.data.content}))}catch{window.$message.error("上传失败")}},ne=({file:s,event:a})=>{var l;try{let e=JSON.parse((l=a.target)==null?void 0:l.response);if(e.code!==0){let t=e.msg||"上传失败";e.details&&e.details.length>0&&e.details.map(c=>{t+=":"+c}),window.$message.error(t)}}catch{window.$message.error("上传失败")}},W=({file:s})=>{let a=R.value.findIndex(l=>l.id===s.id);a>-1&&R.value.splice(a,1),a=d.value.findIndex(l=>l.id===s.id),a>-1&&d.value.splice(a,1),a=_.value.findIndex(l=>l.id===s.id),a>-1&&_.value.splice(a,1)},x=()=>{if(A.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:s,users:a}=Le(A.value);const l=[];let e=100;l.push({content:A.value,type:K.TEXT,sort:e}),R.value.map(t=>{e++,l.push({content:t.content,type:K.IMAGEURL,sort:e})}),d.value.map(t=>{e++,l.push({content:t.content,type:K.VIDEOURL,sort:e})}),_.value.map(t=>{e++,l.push({content:t.content,type:K.ATTACHMENT,sort:e})}),N.value.length>0&&N.value.map(t=>{e++,l.push({content:t,type:K.LINKURL,sort:e})}),D.value=!0,Re({contents:l,tags:Array.from(new Set(s)),users:Array.from(new Set(a)),attachment_price:+C.value*100,visibility:U.value}).then(t=>{var c;window.$message.success("发布成功"),D.value=!1,g("post-success",t),h.value=!1,y.value=!1,(c=G.value)==null||c.clear(),T.value=[],A.value="",N.value=[],R.value=[],d.value=[],_.value=[],U.value=z.value}).catch(t=>{D.value=!1})},Y=s=>{o.commit("triggerAuth",!0),o.commit("triggerAuthKey",s)};return ye(()=>{const s=o.state.profile.defaultTweetVisibility;o.state.profile.useFriendship&&s==="friend"?z.value=V.FRIEND:s==="following"?z.value=V.Following:s==="public"?z.value=V.PUBLIC:z.value=V.PRIVATE,U.value=z.value}),(s,a)=>{const l=ke,e=Ze,t=Je,c=Xe,F=$e,B=et,oe=tt,le=st,ie=at,re=nt,ue=ot,ce=be,pe=lt,de=it;return u(),w("div",null,[f(o).state.userInfo.id>0?(u(),w("div",At,[I("div",kt,[I("div",bt,[n(l,{round:"",size:30,src:f(o).state.userInfo.avatar},null,8,["src"])]),n(e,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:m.value,value:A.value,prefix:["@","#"],options:q.value,onSearch:Z,"onUpdate:value":J,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),n(re,{ref_key:"uploadRef",ref:G,abstract:"","list-type":"image",multiple:!0,max:9,action:L,headers:{Authorization:Q.value},data:{type:p.value},"file-list":T.value,onBeforeUpload:ae,onFinish:S,onError:ne,onRemove:W,"onUpdate:fileList":X},{default:i(()=>[I("div",It,[I("div",zt,[n(F,{abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value==="public/video"||T.value.length===9,onClick:()=>{P("public/image"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(We))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),f(o).state.profile.allowTweetVideo?(u(),E(F,{key:0,abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value!=="public/video"||T.value.length===9,onClick:()=>{P("public/video"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(Ke))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),f(o).state.profile.allowTweetAttachment?(u(),E(F,{key:1,abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value==="public/video"||T.value.length===9,onClick:()=>{P("attachment"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),n(c,{quaternary:"",circle:"",type:"primary",onClick:ge($,["stop"])},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(Qe))]),_:1})]),_:1},8,["onClick"]),M.value?(u(),E(c,{key:2,quaternary:"",circle:"",type:"primary",onClick:ge(ee,["stop"])},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(He))]),_:1})]),_:1},8,["onClick"])):b("",!0)]),I("div",Ct,[n(oe,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[n(B,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:A.value.length/f(o).state.profile.defaultTweetMaxLength*100},null,8,["percentage"])]),default:i(()=>[O(" 已输入"+me(A.value.length)+"字 ",1)]),_:1}),n(c,{loading:D.value,onClick:x,type:"primary",secondary:"",round:""},{default:i(()=>[O(" 发布 ")]),_:1},8,["loading"])])]),I("div",Tt,[n(le),_.value.length>0?(u(),w("div",Dt,[f(o).state.profile.allowTweetAttachmentPrice?(u(),E(ie,{key:0,value:C.value,"onUpdate:value":a[0]||(a[0]=v=>C.value=v),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[Ut]),_:1},8,["value"])):b("",!0)])):b("",!0)])]),_:1},8,["headers","data","file-list"]),y.value?(u(),w("div",Bt,[n(pe,{value:U.value,"onUpdate:value":a[1]||(a[1]=v=>U.value=v),name:"radiogroup"},{default:i(()=>[n(ce,null,{default:i(()=>[(u(!0),w(_e,null,fe(H.value,v=>(u(),E(ue,{key:v.value,value:v.value,label:v.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):b("",!0),h.value?(u(),w("div",xt,[n(de,{value:N.value,"onUpdate:value":a[2]||(a[2]=v=>N.value=v),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[O(" 创建链接 ")]),_:1},8,["value"])])):b("",!0)])):(u(),w("div",Vt,[Et,f(o).state.profile.allowUserRegister?b("",!0):(u(),w("div",Ft,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[3]||(a[3]=v=>Y("signin"))},{default:i(()=>[O(" 登录 ")]),_:1})])),f(o).state.profile.allowUserRegister?(u(),w("div",Nt,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[4]||(a[4]=v=>Y("signin"))},{default:i(()=>[O(" 登录 ")]),_:1}),n(c,{strong:"",secondary:"",round:"",type:"info",onClick:a[5]||(a[5]=v=>Y("signup"))},{default:i(()=>[O(" 注册 ")]),_:1})])):b("",!0)]))])}}});const qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",Gt="/assets/discover-tweets-ab101944.jpeg",Ot="/assets/following-tweets-e36b4410.jpeg",Pt={class:"slide-bar-item"},St={class:"slide-bar-item-title slide-bar-user-link"},Yt={key:1,class:"skeleton-wrap"},Mt={key:0,class:"empty-wrap"},Lt={key:1},Wt={key:2},Kt={class:"load-more-wrap"},jt={class:"load-more-spinner"},Qt=we({__name:"Home",setup(j){const g=Ae(),o=ft(),q=gt(),m=rt(),D=r(9),h=r(8),y=r([{title:"最新动态",style:1,username:"",avatar:qt,show:!0},{title:"热门推荐",style:2,username:"",avatar:Gt,show:!1},{title:"正在关注",style:3,username:"",avatar:Ot,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),A=Ve({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),N=r(null),G=r("泡泡广场"),C=r(!1),p=r(!1),T=r(1),R=r(""),d=r([]),_=r(1),U=r(20),z=r(0),M=r(!1),L=r(!1),Q=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),H=e=>{Q.value=e,M.value=!0},$=()=>{M.value=!1},ee=()=>{L.value=!0},te=e=>{m.warning({title:"删除好友",content:"将好友 “"+e.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{Ye({user_id:A.id}).then(t=>{window.$message.success("操作成功"),e.user.is_friend=!1}).catch(t=>{})}})},se=()=>{L.value=!1,N.value=null},Z=e=>{N.value=e,A.id=e.user.id,A.username=e.user.username,A.nickname=e.user.nickname,e.user.is_friend?te(e):ee()},J=e=>{m.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?Pe({user_id:e.user.id}).then(t=>{window.$message.success("操作成功"),P(e.user_id,!1)}).catch(t=>{}):Se({user_id:e.user.id}).then(t=>{window.$message.success("关注成功"),P(e.user_id,!0)}).catch(t=>{})}})};function P(e,t){for(let c in d.value)d.value[c].user_id==e&&(d.value[c].user.is_following=t)}const X=()=>{G.value="泡泡广场",o.query&&o.query.q&&(o.query.t&&o.query.t==="tag"?G.value="#"+decodeURIComponent(o.query.q):G.value="搜索: "+decodeURIComponent(o.query.q))},ae=ve(()=>g.state.profile.useFriendship&&g.state.profile.enableTrendsBar&&g.state.desktopModelShow&&g.state.userInfo.id>0),S=()=>{C.value=!1,p.value=!1,d.value=[],_.value=1,z.value=0},ne=(e,t)=>{switch(S(),T.value=e.style,o.query.q&&(o.query.q=null,X()),e.style){case 1:x("newest");break;case 2:x("hots");break;case 3:o.query.q=null,x("following");break;case 21:R.value=e.username,Y();break}y.value[t].show=!1},W=()=>{y.value=y.value.slice(0,3),!(!g.state.profile.useFriendship||!g.state.profile.enableTrendsBar||g.state.userInfo.id===0)&&qe({page:1,page_size:50}).then(e=>{var t=0;const c=e.list||[];let F=[];for(;t0&&(y.value=y.value.concat(F))}).catch(e=>{console.log(e)})},x=e=>{C.value=!0,Ge({query:o.query.q?decodeURIComponent(o.query.q):null,type:o.query.t,style:e,page:_.value,page_size:U.value}).then(t=>{C.value=!1,t.list.length===0&&(p.value=!0),_.value>1?d.value=d.value.concat(t.list):(d.value=t.list,window.scrollTo(0,0)),z.value=Math.ceil(t.pager.total_rows/U.value)}).catch(t=>{C.value=!1,_.value>1&&_.value--})},Y=()=>{C.value=!0,Oe({username:R.value,style:"post",page:_.value,page_size:U.value}).then(e=>{C.value=!1,e.list.length===0&&(p.value=!0),_.value>1?d.value=d.value.concat(e.list):(d.value=e.list||[],window.scrollTo(0,0)),z.value=Math.ceil(e.pager.total_rows/U.value)}).catch(e=>{d.value=[],_.value>1&&_.value--,C.value=!1})},s=e=>{q.push({name:"post",query:{id:e.id}})},a=()=>{switch(T.value){case 1:x("newest");break;case 2:x("hots");break;case 3:x("following");break;case 21:o.query.q?x("search"):Y();break}},l=()=>{_.value{S(),W(),x("newest")}),Ee(()=>({path:o.path,query:o.query,refresh:g.state.refresh}),(e,t)=>{if(X(),e.refresh!==t.refresh){S(),setTimeout(()=>{W(),a()},0);return}t.path!=="/post"&&e.path==="/"&&(S(),setTimeout(()=>{W(),a()},0))}),(e,t)=>{const c=_t,F=Rt,B=ct,oe=ke,le=pt,ie=dt,re=xe,ue=vt,ce=Ue,pe=Be,de=De,v=Te,Ie=ut,ze=mt,Ce=be;return u(),w("div",null,[n(c,{title:G.value},null,8,["title"]),n(Ie,{class:"main-content-wrap",bordered:""},{default:i(()=>[n(B,null,{default:i(()=>[n(F,{onPostSuccess:s})]),_:1}),ae.value?(u(),E(B,{key:0},{default:i(()=>[n(f(wt),{modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=k=>y.value=k),"wheel-blocks":h.value,"init-blocks":D.value,onClick:ne,tag:"div","sub-tag":"div"},{default:i(k=>[I("div",Pt,[n(le,{value:"1",offset:[-4,48],dot:"",show:k.slotData.show},{default:i(()=>[n(oe,{round:"",size:48,src:k.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),I("div",St,[n(ie,{"line-clamp":2},{default:i(()=>[O(me(k.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):b("",!0),C.value&&d.value.length===0?(u(),w("div",Yt,[n(re,{num:U.value},null,8,["num"])])):b("",!0),I("div",null,[d.value.length===0?(u(),w("div",Mt,[n(ue,{size:"large",description:"暂无数据"})])):b("",!0),f(g).state.desktopModelShow?(u(),w("div",Lt,[(u(!0),w(_e,null,fe(d.value,k=>(u(),E(B,{key:k.id},{default:i(()=>[n(ce,{post:k,isOwner:f(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:H,onHandleFollowAction:J,onHandleFriendAction:Z},null,8,["post","isOwner"])]),_:2},1024))),128))])):(u(),w("div",Wt,[(u(!0),w(_e,null,fe(d.value,k=>(u(),E(B,{key:k.id},{default:i(()=>[n(pe,{post:k,isOwner:f(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:H,onHandleFollowAction:J,onHandleFriendAction:Z},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),n(de,{show:M.value,user:Q.value,onSuccess:$},null,8,["show","user"]),n(v,{show:L.value,user:A,onSuccess:se},null,8,["show","user"])]),_:1}),z.value>0?(u(),E(Ce,{key:0,justify:"center"},{default:i(()=>[n(f(ht),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:t[1]||(t[1]=k=>l())},{spinner:i(()=>[I("div",Kt,[p.value?b("",!0):(u(),E(ze,{key:0,size:14})),I("span",jt,me(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)])}}});const Fs=Me(Qt,[["__scopeId","data-v-040841fc"]]);export{Fs as default}; diff --git a/web/dist/assets/Home-dbebb66e.css b/web/dist/assets/Home-dbebb66e.css deleted file mode 100644 index 7cbe4e46..00000000 --- a/web/dist/assets/Home-dbebb66e.css +++ /dev/null @@ -1 +0,0 @@ -.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.load-more[data-v-8f151fd6]{margin:20px}.load-more .load-more-wrap[data-v-8f151fd6]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-8f151fd6]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-8f151fd6],.dark .pagination-wrap[data-v-8f151fd6],.dark .empty-wrap[data-v-8f151fd6],.dark .skeleton-wrap[data-v-8f151fd6]{background-color:#101014bf} diff --git a/web/dist/assets/Home-e6b13f04.css b/web/dist/assets/Home-e6b13f04.css new file mode 100644 index 00000000..12e408f4 --- /dev/null +++ b/web/dist/assets/Home-e6b13f04.css @@ -0,0 +1 @@ +.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-040841fc]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item[data-v-040841fc]{cursor:pointer}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-avatar[data-v-040841fc]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-040841fc]{color:#18a058;opacity:.8}.tiny-slide-bar[data-v-040841fc]{margin-top:-30px;margin-bottom:-30px}.tiny-slide-bar .slide-bar-item[data-v-040841fc]{min-height:170px;width:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:8px}.tiny-slide-bar .slide-bar-item .slide-bar-item-title[data-v-040841fc]{justify-content:center;font-size:12px;margin-top:4px;height:40px}.load-more[data-v-040841fc]{margin:20px}.load-more .load-more-wrap[data-v-040841fc]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-040841fc]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-040841fc],.dark .pagination-wrap[data-v-040841fc],.dark .empty-wrap[data-v-040841fc],.dark .skeleton-wrap[data-v-040841fc]{background-color:#101014bf}.dark .tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-040841fc]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-040841fc]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar[data-v-040841fc]{--ti-slider-progress-box-arrow-hover-text-color: #f2f2f2;--ti-slider-progress-box-arrow-normal-text-color: #808080} diff --git a/web/dist/assets/IEnum-a180d93e.js b/web/dist/assets/IEnum-5453a777.js similarity index 72% rename from web/dist/assets/IEnum-a180d93e.js rename to web/dist/assets/IEnum-5453a777.js index 3364db40..0777a4dc 100644 --- a/web/dist/assets/IEnum-a180d93e.js +++ b/web/dist/assets/IEnum-5453a777.js @@ -1 +1 @@ -var L=(A=>(A[A.TITLE=1]="TITLE",A[A.TEXT=2]="TEXT",A[A.IMAGEURL=3]="IMAGEURL",A[A.VIDEOURL=4]="VIDEOURL",A[A.AUDIOURL=5]="AUDIOURL",A[A.LINKURL=6]="LINKURL",A[A.ATTACHMENT=7]="ATTACHMENT",A[A.CHARGEATTACHMENT=8]="CHARGEATTACHMENT",A))(L||{}),R=(A=>(A[A.PUBLIC=0]="PUBLIC",A[A.PRIVATE=1]="PRIVATE",A[A.FRIEND=2]="FRIEND",A))(R||{}),U=(A=>(A[A.NO=0]="NO",A[A.YES=1]="YES",A))(U||{});export{L as P,R as V,U as Y}; +var L=(A=>(A[A.TITLE=1]="TITLE",A[A.TEXT=2]="TEXT",A[A.IMAGEURL=3]="IMAGEURL",A[A.VIDEOURL=4]="VIDEOURL",A[A.AUDIOURL=5]="AUDIOURL",A[A.LINKURL=6]="LINKURL",A[A.ATTACHMENT=7]="ATTACHMENT",A[A.CHARGEATTACHMENT=8]="CHARGEATTACHMENT",A))(L||{}),R=(A=>(A[A.PUBLIC=0]="PUBLIC",A[A.PRIVATE=1]="PRIVATE",A[A.FRIEND=2]="FRIEND",A[A.Following=3]="Following",A))(R||{}),U=(A=>(A[A.NO=0]="NO",A[A.YES=1]="YES",A))(U||{});export{L as P,R as V,U as Y}; diff --git a/web/dist/assets/Messages-4d0b5577.js b/web/dist/assets/Messages-4d0b5577.js new file mode 100644 index 00000000..4afb6613 --- /dev/null +++ b/web/dist/assets/Messages-4d0b5577.js @@ -0,0 +1 @@ +import{d as K,c as T,r as me,e as a,f as i,k as s,w as t,bf as o,j as b,y as A,A as d,x as g,Y as _,q,l as ge,h as H,u as se,F as ne,H as f,b as fe}from"./@vue-a481fc63.js";import{u as te}from"./vuex-44de225f.js";import{u as ve,b as ke}from"./vue-router-e5a2430e.js";import{J as ye,O as he,P as we,Q as be,u as $e,f as Ie,_ as L,R as Ce,S as Me}from"./index-3489d7cc.js";import{K as x,k as Se,N as qe,O as ze,Q as ee,U as Oe,r as N,s as Re,t as Ae,X as F,Y as Fe,Z as B,_ as V,R as D}from"./@vicons-f0266f88.js";import{F as Te,j as m,o as Ne,M as Pe,l as Ue,e as ae,P as oe,T as We,O as je,U as Be,a as Ve,G as De,Q as He,J as Qe,k as Je,H as Ye}from"./naive-ui-eecf2ec3.js";import{_ as Ee}from"./whisper-473502c7.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{W as Ke}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Le={class:"sender-wrap"},Xe={key:0,class:"nickname"},Ze={key:0,class:"username"},xe={key:1,class:"nickname"},es={key:0,class:"username"},ss={key:2,class:"nickname"},ns={class:"timestamp"},ts={class:"timestamp-txt"},as={key:0,class:"brief-content"},os={key:1,class:"whisper-content-wrap"},ls={key:2,class:"requesting-friend-wrap"},rs={key:2,class:"status-info"},is={key:3,class:"status-info"},us="https://assets.paopao.info/public/avatar/default/admin.png",cs=K({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(Q,{emit:v}){const c=Q,k=ve(),u=te(),y=Te(),$=e=>()=>H(m,null,{default:()=>H(e)}),I=T(()=>{let e=[{label:"私信",key:"whisper",icon:$(N)}],n=c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id?c.message.receiver_user:c.message.sender_user;return u.state.userInfo.id!=n.id&&(n.is_following?e.push({label:"取消关注",key:"unfollow",icon:$(Re)}):e.push({label:"关注",key:"follow",icon:$(Ae)})),e}),p=e=>{let n=e.type==4&&e.sender_user_id==u.state.userInfo.id?e.receiver_user:e.sender_user;y.success({title:"提示",content:"确定"+(n.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.is_following?$e({user_id:n.id}).then(w=>{window.$message.success("操作成功"),n.is_following=!1,setTimeout(()=>{v("reload")},50)}).catch(w=>{}):Ie({user_id:n.id}).then(w=>{window.$message.success("关注成功"),n.is_following=!0,setTimeout(()=>{v("reload")},50)}).catch(w=>{})}})},h=e=>{switch(e){case"whisper":const n=c.message;if(n.type!=99){let w=n.type==4&&n.sender_user_id==u.state.userInfo.id?n.receiver_user:n.sender_user;v("send-whisper",w)}break;case"follow":case"unfollow":p(c.message);break}},C=T(()=>c.message.type!==4||c.message.sender_user_id!==u.state.userInfo.id),z=T(()=>c.message.type==4&&c.message.receiver_user_id==u.state.userInfo.id),O=T(()=>c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id),P=e=>{M(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?k.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},r=e=>{M(e),he({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},J=e=>{M(e),we({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},M=e=>{c.message.receiver_user_id==u.state.userInfo.id&&e.is_read===0&&be({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const w=Ne,U=me("router-link"),W=Pe,S=Ue,Y=ae,l=oe,j=We,E=je;return a(),i("div",{class:ge(["message-item",{unread:C.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=R=>M(e.message))},[s(E,{"content-indented":""},{avatar:t(()=>[s(w,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(u).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:us},null,8,["src"])]),header:t(()=>[b("div",Le,[e.message.type!=4&&e.message.sender_user.id>0||z.value?(a(),i("span",Xe,[s(U,{onClick:n[0]||(n[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:t(()=>[d(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",Ze," @"+g(e.message.sender_user.username),1)):_("",!0)])):O.value?(a(),i("span",xe,[s(U,{onClick:n[1]||(n[1]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:t(()=>[d(g(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",es," @"+g(e.message.receiver_user.username),1)):_("",!0)])):(a(),i("span",ss," 系统 ")),O.value?(a(),q(W,{key:3,class:"top-tag",type:"info",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已发送 ")]),_:1})):_("",!0),e.message.type==4&&e.message.receiver_user_id==o(u).state.userInfo.id?(a(),q(W,{key:4,class:"top-tag",type:"warning",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已接收 ")]),_:1})):_("",!0)])]),"header-extra":t(()=>[b("span",ns,[C.value&&e.message.is_read===0?(a(),q(S,{key:0,dot:"",processing:""})):_("",!0),b("span",ts,g(o(ye)(e.message.created_on)),1),s(l,{placement:"bottom-end",trigger:"click",size:"small",options:I.value,onSelect:h},{default:t(()=>[s(Y,{quaternary:"",circle:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Se))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[s(j,{"show-icon":!1,class:"brief-wrap",type:!C.value||e.message.is_read>0?"default":"success"},{default:t(()=>[e.message.type!=4?(a(),i("div",as,[d(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),i("span",{key:0,onClick:n[2]||(n[2]=A(R=>P(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(qe))]),_:1}),d(" 查看详情 ")])):_("",!0)])):_("",!0),e.message.type===4?(a(),i("div",os,g(e.message.content),1)):_("",!0),e.message.type===5?(a(),i("div",ls,[d(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),i("span",{key:0,onClick:n[3]||(n[3]=A(R=>r(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ze))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),i("span",{key:1,onClick:n[4]||(n[4]=A(R=>J(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),i("span",rs,[s(o(m),null,{default:t(()=>[s(o(Oe))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),i("span",is,[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const _s=L(cs,[["__scopeId","data-v-d6e1bf7b"]]),ds={class:"content"},ps=K({__name:"message-skeleton",props:{num:{default:1}},setup(Q){return(v,c)=>{const k=Be;return a(!0),i(ne,null,se(new Array(v.num),u=>(a(),i("div",{class:"skeleton-item",key:u},[b("div",ds,[s(k,{text:"",repeat:2}),s(k,{text:"",style:{width:"60%"}})])]))),128)}}});const ms=L(ps,[["__scopeId","data-v-01d2e871"]]),gs={class:"title title-action"},fs={class:"title title-filter"},vs={key:0,class:"skeleton-wrap"},ks={key:1},ys={key:0,class:"empty-wrap"},hs={key:1},ws={class:"load-more-wrap"},bs={class:"load-more-spinner"},$s=K({__name:"Messages",setup(Q){const v=te(),c=ke(),k=f(!1),u=f(!1),y=f(+c.query.p||1),$=f(20),I=f(0),p=f([]),h=f("所有消息"),C=f("all"),z=f(!1),O=f({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),P=()=>{u.value=!1,y.value=1,I.value=0,p.value=[]},r=l=>()=>H(m,null,{default:()=>H(l)}),J=T(()=>{let l;switch(h.value){case"所有消息":l=[{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"系统消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"我的私信":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"好友申请":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"未读消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)}];break;default:l=[];break}return l}),M=l=>{switch(l){case"all":h.value="所有消息";break;case"system":h.value="系统消息";break;case"whisper":h.value="我的私信";break;case"requesting":h.value="好友申请";break;case"unread":h.value="未读消息";break}C.value=l,P(),S()},e=()=>{M("unread")},n=()=>{v.state.unreadMsgCount>0&&p.value.length>0&&Me().then(l=>{if(C.value!="unread")for(let j in p.value)p.value[j].is_read=1;else p.value=[];v.commit("updateUnreadMsgCount",0)}).catch(l=>{console.log(l)})},w=l=>{O.value=l,z.value=!0},U=()=>{z.value=!1},W=()=>{P(),S()},S=()=>{k.value=!0,Ce({style:C.value,page:y.value,page_size:$.value}).then(l=>{k.value=!1,l.list.length===0&&(u.value=!0),y.value>1?p.value=p.value.concat(l.list):(p.value=l.list,window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/$.value)}).catch(l=>{k.value=!1,y.value>1&&y.value--})},Y=()=>{y.value{S()}),(l,j)=>{const E=Ge,R=Ee,G=ae,le=He,re=oe,X=Ve,ie=ms,ue=Qe,ce=_s,_e=Ye,de=De,pe=Je;return a(),i("div",null,[s(E,{title:"消息"}),s(de,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[s(R,{show:z.value,user:O.value,onSuccess:U},null,8,["show","user"]),s(X,{justify:"space-between"},{default:t(()=>[b("div",gs,[s(G,{text:"",size:"small",focusable:!1,onClick:e},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(F))]),_:1})]),default:t(()=>[d(" "+g(o(v).state.unreadMsgCount)+" 条未读 ",1)]),_:1}),s(le,{vertical:""}),s(G,{text:"",size:"small",focusable:!1,onClick:n},{default:t(()=>[d("全标已读")]),_:1})]),b("div",fs,[s(re,{placement:"bottom-end",trigger:"click",size:"small",options:J.value,onSelect:M},{default:t(()=>[s(G,{text:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Fe))]),_:1})]),default:t(()=>[d(" "+g(h.value),1)]),_:1})]),_:1},8,["options"])])]),_:1}),k.value&&p.value.length===0?(a(),i("div",vs,[s(ie,{num:$.value},null,8,["num"])])):(a(),i("div",ks,[p.value.length===0?(a(),i("div",ys,[s(ue,{size:"large",description:"暂无数据"})])):(a(),i("div",hs,[(a(!0),i(ne,null,se(p.value,Z=>(a(),q(_e,{key:Z.id},{default:t(()=>[s(ce,{message:Z,onSendWhisper:w,onReload:W},null,8,["message"])]),_:2},1024))),128))]))]))]),_:1}),I.value>0?(a(),q(X,{key:0,justify:"center"},{default:t(()=>[s(o(Ke),{class:"load-more",slots:{complete:"没有更多消息了",error:"加载出错"},onInfinite:Y},{spinner:t(()=>[b("div",ws,[u.value?_("",!0):(a(),q(pe,{key:0,size:14})),b("span",bs,g(u.value?"没有更多消息了":"加载更多"),1)])]),_:1})]),_:1})):_("",!0)])}}});const Ks=L($s,[["__scopeId","data-v-a2e6a3be"]]);export{Ks as default}; diff --git a/web/dist/assets/Messages-7a898af3.css b/web/dist/assets/Messages-7a898af3.css deleted file mode 100644 index fe6c85f3..00000000 --- a/web/dist/assets/Messages-7a898af3.css +++ /dev/null @@ -1 +0,0 @@ -.message-item[data-v-07fc447f]{padding:16px}.message-item.unread[data-v-07fc447f]{background:#fcfffc}.message-item .sender-wrap[data-v-07fc447f]{display:flex;align-items:center}.message-item .sender-wrap .username[data-v-07fc447f]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-07fc447f]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-07fc447f]{margin-left:6px}.message-item .brief-wrap[data-v-07fc447f]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-07fc447f],.message-item .brief-wrap .whisper-content-wrap[data-v-07fc447f],.message-item .brief-wrap .requesting-friend-wrap[data-v-07fc447f]{display:flex;width:100%}.message-item .view-link[data-v-07fc447f]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-07fc447f]{margin-left:8px;align-items:center}.dark .message-item[data-v-07fc447f]{background-color:#101014bf}.dark .message-item.unread[data-v-07fc447f]{background:#0f180b}.dark .message-item .brief-wrap[data-v-07fc447f]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.pagination-wrap[data-v-4e7b1342]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .empty-wrap[data-v-4e7b1342],.dark .messages-wrap[data-v-4e7b1342],.dark .pagination-wrap[data-v-4e7b1342]{background-color:#101014bf} diff --git a/web/dist/assets/Messages-9543d2b3.css b/web/dist/assets/Messages-9543d2b3.css new file mode 100644 index 00000000..b61cf381 --- /dev/null +++ b/web/dist/assets/Messages-9543d2b3.css @@ -0,0 +1 @@ +.message-item[data-v-d6e1bf7b]{padding:16px}.message-item.unread[data-v-d6e1bf7b]{background:#fcfffc}.message-item .sender-wrap[data-v-d6e1bf7b]{display:flex;align-items:center}.message-item .sender-wrap .top-tag[data-v-d6e1bf7b]{transform:scale(.75)}.message-item .sender-wrap .username[data-v-d6e1bf7b]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-d6e1bf7b]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-d6e1bf7b]{margin-left:6px}.message-item .brief-wrap[data-v-d6e1bf7b]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-d6e1bf7b],.message-item .brief-wrap .whisper-content-wrap[data-v-d6e1bf7b],.message-item .brief-wrap .requesting-friend-wrap[data-v-d6e1bf7b]{display:flex;width:100%}.message-item .view-link[data-v-d6e1bf7b]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-d6e1bf7b]{margin-left:8px;align-items:center}.dark .message-item[data-v-d6e1bf7b]{background-color:#101014bf}.dark .message-item.unread[data-v-d6e1bf7b]{background:#0f180b}.dark .message-item .brief-wrap[data-v-d6e1bf7b]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.load-more[data-v-a2e6a3be]{margin:20px}.load-more .load-more-wrap[data-v-a2e6a3be]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-a2e6a3be]{font-size:14px;opacity:.65}.title[data-v-a2e6a3be]{padding-top:4px;opacity:.9}.title-action[data-v-a2e6a3be]{display:flex;align-items:center;margin-left:20px}.title-filter[data-v-a2e6a3be]{margin-right:20px}.dark .empty-wrap[data-v-a2e6a3be],.dark .messages-wrap[data-v-a2e6a3be],.dark .pagination-wrap[data-v-a2e6a3be]{background-color:#101014bf} diff --git a/web/dist/assets/Messages-d2d903ee.js b/web/dist/assets/Messages-d2d903ee.js deleted file mode 100644 index 1269d61b..00000000 --- a/web/dist/assets/Messages-d2d903ee.js +++ /dev/null @@ -1 +0,0 @@ -import{d as b,a3 as L,o as t,c as a,V as n,a1 as o,a as y,a2 as w,e as p,M as m,Q as z,O as r,_ as c,L as A,a4 as I,F as R,r as f,j as D}from"./@vue-e0e89260.js";import{u as J,b as K}from"./vue-router-b8e3382f.js";import{J as P,K as Q,L as T,_ as F,M as U}from"./index-26a2b065.js";import{a as E}from"./formatTime-4210fcd1.js";import{J as G,K as H,N as S,O as W}from"./@vicons-0524c43e.js";import{o as X,l as Y,j as Z,S as x,L as ee,U as se,F as ne,Q as te,H as ae,G as oe}from"./naive-ui-e703c4e6.js";import{_ as re}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{u as ie}from"./vuex-473b3783.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const _e={class:"sender-wrap"},le={key:0,class:"nickname"},pe={class:"username"},ue={key:1,class:"nickname"},ce={class:"timestamp"},de={class:"timestamp-txt"},me={key:0,class:"brief-content"},ge={key:1,class:"whisper-content-wrap"},ve={key:2,class:"requesting-friend-wrap"},fe={key:2,class:"status-info"},ye={key:3,class:"status-info"},ke="https://assets.paopao.info/public/avatar/default/admin.png",he=b({__name:"message-item",props:{message:{}},setup(N){const g=J(),k=e=>{_(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?g.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},i=e=>{_(e),P({user_id:e.sender_user_id}).then(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},u=e=>{_(e),Q({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},_=e=>{e.is_read===0&&T({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{const h=X,$=L("router-link"),l=Y,d=Z,C=x,M=ee;return t(),a("div",{class:A(["message-item",{unread:e.message.is_read===0}]),onClick:s[4]||(s[4]=v=>_(e.message))},[n(M,{"content-indented":""},{avatar:o(()=>[n(h,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:ke},null,8,["src"])]),header:o(()=>[y("div",_e,[e.message.sender_user.id>0?(t(),a("span",le,[n($,{onClick:s[0]||(s[0]=w(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:o(()=>[p(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),y("span",pe," @"+m(e.message.sender_user.username),1)])):(t(),a("span",ue," 系统 "))])]),"header-extra":o(()=>[y("span",ce,[e.message.is_read===0?(t(),z(l,{key:0,dot:"",processing:""})):r("",!0),y("span",de,m(c(E)(e.message.created_on)),1)])]),description:o(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:o(()=>[e.message.type!=4?(t(),a("div",me,[p(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),a("span",{key:0,onClick:s[1]||(s[1]=w(v=>k(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(G))]),_:1}),p(" 查看详情 ")])):r("",!0)])):r("",!0),e.message.type===4?(t(),a("div",ge,m(e.message.content),1)):r("",!0),e.message.type===5?(t(),a("div",ve,[p(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),a("span",{key:0,onClick:s[2]||(s[2]=w(v=>i(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(H))]),_:1}),p(" 同意 ")])):r("",!0),e.message.reply_id===1?(t(),a("span",{key:1,onClick:s[3]||(s[3]=w(v=>u(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(S))]),_:1}),p(" 拒绝 ")])):r("",!0),e.message.reply_id===2?(t(),a("span",fe,[n(d,null,{default:o(()=>[n(c(W))]),_:1}),p(" 已同意 ")])):r("",!0),e.message.reply_id===3?(t(),a("span",ye,[n(d,null,{default:o(()=>[n(c(S))]),_:1}),p(" 已拒绝 ")])):r("",!0)])):r("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const we=F(he,[["__scopeId","data-v-07fc447f"]]),$e={class:"content"},Ce=b({__name:"message-skeleton",props:{num:{default:1}},setup(N){return(g,k)=>{const i=se;return t(!0),a(R,null,I(new Array(g.num),u=>(t(),a("div",{class:"skeleton-item",key:u},[y("div",$e,[n(i,{text:"",repeat:2}),n(i,{text:"",style:{width:"60%"}})])]))),128)}}});const Me=F(Ce,[["__scopeId","data-v-01d2e871"]]),be={key:0,class:"skeleton-wrap"},Fe={key:1},Ne={key:0,class:"empty-wrap"},Oe={key:0,class:"pagination-wrap"},Se=b({__name:"Messages",setup(N){const g=K(),k=ie(),i=f(!1),u=f(+g.query.p||1),_=f(10),e=f(0),s=f([]),h=()=>{i.value=!0,U({page:u.value,page_size:_.value}).then(l=>{i.value=!1,s.value=l.list,e.value=Math.ceil(l.pager.total_rows/_.value)}).catch(l=>{i.value=!1})},$=l=>{u.value=l,h()};return D(()=>{h()}),(l,d)=>{const C=re,M=Me,v=ae,V=we,j=oe,q=ne,B=te;return t(),a("div",null,[n(C,{title:"消息"}),n(q,{class:"main-content-wrap messages-wrap",bordered:""},{default:o(()=>[i.value?(t(),a("div",be,[n(M,{num:_.value},null,8,["num"])])):(t(),a("div",Fe,[s.value.length===0?(t(),a("div",Ne,[n(v,{size:"large",description:"暂无数据"})])):r("",!0),(t(!0),a(R,null,I(s.value,O=>(t(),z(j,{key:O.id},{default:o(()=>[n(V,{message:O},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),e.value>0?(t(),a("div",Oe,[n(B,{page:u.value,"onUpdate:page":$,"page-slot":c(k).state.collapsedRight?5:8,"page-count":e.value},null,8,["page","page-slot","page-count"])])):r("",!0)])}}});const es=F(Se,[["__scopeId","data-v-4e7b1342"]]);export{es as default}; diff --git a/web/dist/assets/Post-39447b75.css b/web/dist/assets/Post-39447b75.css new file mode 100644 index 00000000..f39d07ec --- /dev/null +++ b/web/dist/assets/Post-39447b75.css @@ -0,0 +1 @@ +.reply-item[data-v-eccdbbd8]{display:flex;flex-direction:column;font-size:12px;padding:8px;border-bottom:1px solid #f3f3f3}.reply-item .header-wrap[data-v-eccdbbd8]{display:flex;align-items:center;justify-content:space-between}.reply-item .header-wrap .username[data-v-eccdbbd8]{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .header-wrap .username .reply-name[data-v-eccdbbd8]{margin:0 3px;opacity:.75}.reply-item .header-wrap .timestamp[data-v-eccdbbd8]{opacity:.75;text-align:right;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .base-wrap[data-v-eccdbbd8]{display:block}.reply-item .base-wrap .content[data-v-eccdbbd8]{width:100%;margin-top:4px;font-size:12px;text-align:justify;line-height:2}.reply-item .base-wrap .reply-switch[data-v-eccdbbd8]{display:flex;align-items:center;justify-content:space-between;font-size:12px}.reply-item .base-wrap .reply-switch .actions[data-v-eccdbbd8]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-item .base-wrap .reply-switch .time-item[data-v-eccdbbd8]{font-size:12px;opacity:.75;margin-right:18px}.reply-item .base-wrap .reply-switch .action-item[data-v-eccdbbd8]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-item .base-wrap .reply-switch .action-item .upvote-count[data-v-eccdbbd8]{margin-left:4px;font-size:12px}.reply-item .base-wrap .reply-switch .action-item.hover[data-v-eccdbbd8]{cursor:pointer}.reply-item .base-wrap .reply-switch .opacity-item[data-v-eccdbbd8]{opacity:.75}.reply-item .base-wrap .reply-switch .reply-btn[data-v-eccdbbd8]{margin-left:18px}.reply-item .base-wrap .reply-switch .show[data-v-eccdbbd8]{color:#18a058;cursor:pointer}.reply-item .base-wrap .reply-switch .hide[data-v-eccdbbd8]{opacity:.75;cursor:pointer}.dark .reply-item[data-v-eccdbbd8]{border-bottom:1px solid #262628;background-color:#101014bf}.dark .reply-item .base-wrap .reply-switch .show[data-v-eccdbbd8]{color:#63e2b7}.reply-compose-wrap .reply-switch[data-v-f9af7a93]{display:flex;align-items:center;justify-content:space-between;text-align:right;font-size:12px}.reply-compose-wrap .reply-switch .actions[data-v-f9af7a93]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-compose-wrap .reply-switch .time-item[data-v-f9af7a93]{font-size:12px;opacity:.65;margin-right:18px}.reply-compose-wrap .reply-switch .action-item[data-v-f9af7a93]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-compose-wrap .reply-switch .action-item .upvote-count[data-v-f9af7a93]{margin-left:4px;font-size:12px}.reply-compose-wrap .reply-switch .action-item.hover[data-v-f9af7a93]{cursor:pointer}.reply-compose-wrap .reply-switch .reply-btn[data-v-f9af7a93]{margin-left:18px}.reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#18a058;cursor:pointer;opacity:.75}.reply-compose-wrap .reply-switch .hide[data-v-f9af7a93]{opacity:.75;cursor:pointer}.dark .reply-compose-wrap[data-v-f9af7a93]{background-color:#101014bf}.dark .reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#63e2b7}.comment-item[data-v-e1f04c6b]{width:100%;padding:16px;box-sizing:border-box}.comment-item .nickname-wrap[data-v-e1f04c6b]{font-size:14px}.comment-item .username-wrap[data-v-e1f04c6b]{font-size:14px;opacity:.75}.comment-item .top-tag[data-v-e1f04c6b]{transform:scale(.75)}.comment-item .opt-wrap[data-v-e1f04c6b]{display:flex;align-items:center}.comment-item .opt-wrap .timestamp[data-v-e1f04c6b]{opacity:.75;font-size:12px}.comment-item .opt-wrap .action-btn[data-v-e1f04c6b]{margin-left:4px}.comment-item .comment-text[data-v-e1f04c6b]{display:block;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.comment-item .opt-item[data-v-e1f04c6b]{display:flex;align-items:center;opacity:.7}.comment-item .opt-item .opt-item-icon[data-v-e1f04c6b]{margin-right:10px}.reply-wrap[data-v-e1f04c6b]{margin-top:10px;border-radius:5px;background:#fafafc}.reply-wrap .reply-item[data-v-e1f04c6b]:last-child{border-bottom:none}.dark .reply-wrap[data-v-e1f04c6b]{background:#18181c}.dark .comment-item[data-v-e1f04c6b]{background-color:#101014bf}.compose-wrap[data-v-d9073453]{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line[data-v-d9073453]{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user[data-v-d9073453]{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options[data-v-d9073453]{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap[data-v-d9073453]{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .cancel-btn[data-v-d9073453]{margin-right:8px}.compose-wrap .login-only-wrap[data-v-d9073453]{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button[data-v-d9073453]{margin:0 4px;width:50%}.compose-wrap .login-wrap[data-v-d9073453]{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner[data-v-d9073453]{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button[data-v-d9073453]{margin:0 4px}.attachment[data-v-d9073453]{display:flex;align-items:center}.attachment .text-statistic[data-v-d9073453]{margin-left:8px;width:18px;height:18px;transform:rotate(180deg)}.attachment-list-wrap[data-v-d9073453]{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail[data-v-d9073453]{overflow:hidden}.dark .compose-mention[data-v-d9073453],.dark .compose-wrap[data-v-d9073453]{background-color:#101014bf}.detail-item{width:100%;padding:16px;box-sizing:border-box;background:#f7f9f9}.detail-item .nickname-wrap{font-size:14px}.detail-item .username-wrap{font-size:14px;opacity:.75}.detail-item .top-tag{transform:scale(.75)}.detail-item .options{opacity:.75}.detail-item .post-text{font-size:16px;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.detail-item .opts-wrap{margin-top:20px}.detail-item .opts-wrap .opt-item{display:flex;align-items:center;opacity:.7}.detail-item .opts-wrap .opt-item .opt-item-icon{margin-right:10px}.detail-item .opts-wrap .opt-item.hover{cursor:pointer}.detail-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.detail-item .timestamp{opacity:.75;font-size:12px;margin-top:10px}.dark .detail-item{background:#18181c}.detail-wrap[data-v-edac44ef]{min-height:100px}.comment-opts-wrap[data-v-edac44ef]{padding-top:6px;padding-left:16px;padding-right:16px;opacity:.75}.comment-opts-wrap .comment-title-item[data-v-edac44ef]{padding-top:4px;font-size:16px;text-align:center}.main-content-wrap .load-more[data-v-edac44ef]{margin-bottom:8px}.main-content-wrap .load-more .load-more-spinner[data-v-edac44ef]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-edac44ef],.dark .skeleton-wrap[data-v-edac44ef]{background-color:#101014bf} diff --git a/web/dist/assets/Post-7441e88a.js b/web/dist/assets/Post-7441e88a.js deleted file mode 100644 index 6493cbf7..00000000 --- a/web/dist/assets/Post-7441e88a.js +++ /dev/null @@ -1 +0,0 @@ -import{d as X,r as c,a3 as ge,o,c as u,a as v,V as t,a1 as n,e as x,M as I,Q as P,O as i,_ as a,a2 as H,n as ae,a7 as qe,F as le,a4 as ie,j as ye,W as Ie,X as Te,s as be,w as Ee}from"./@vue-e0e89260.js";import{u as te}from"./vuex-473b3783.js";import{f as ue}from"./formatTime-4210fcd1.js";import{t as Ne,d as je,e as Be,_ as se,f as He,h as Fe,i as Ve,j as Ye,g as Je,k as Ke,l as Ge,m as Qe,n as We,o as Xe,s as Ze,p as et,v as tt,q as st,r as ot,u as nt,w as $e}from"./index-26a2b065.js";import{Y as ce,V as Z}from"./IEnum-a180d93e.js";import{T as Pe,e as re,f as ze,g as _e,h as Ue,I as at,i as lt,j as it,k as ut,l as ct,m as rt,n as _t,o as pt,p as dt,q as mt,r as vt,s as Ce,F as xe,E as ve,t as he,u as fe}from"./@vicons-0524c43e.js";import{j as Y,e as oe,I as Re,J as ht,b as ft,K as gt,o as ke,L as Se,v as yt,w as kt,x as wt,y as bt,z as $t,B as Ct,M as xt,O as It,i as Tt,P as Pt,a as Le,F as zt,H as Ut,k as Rt,G as St,f as Lt,g as Ot}from"./naive-ui-e703c4e6.js";import{p as we,_ as Oe,a as Mt,b as At,c as Dt}from"./content-772a5dad.js";import{u as Me,b as qt}from"./vue-router-b8e3382f.js";import{_ as Et}from"./post-skeleton-f095ca4e.js";import{l as Nt}from"./lodash-94eb5868.js";import{a as jt}from"./copy-to-clipboard-1dd3075d.js";import{_ as Bt}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{W as Ht}from"./v3-infinite-loading-e5c2e8bf.js";import"./moment-2ab8298d.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-aa5e8b3f.js";import"./toggle-selection-93f4ad84.js";const Ft={class:"reply-item"},Vt={class:"header-wrap"},Yt={class:"username"},Jt={class:"reply-name"},Kt={class:"timestamp"},Gt={class:"base-wrap"},Qt={class:"content"},Wt={class:"reply-switch"},Xt={class:"time-item"},Zt={class:"actions"},es={class:"upvote-count"},ts=["onClick"],ss={class:"upvote-count"},os={key:2,class:"action-item"},ns=["onClick"],as=X({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(A,{emit:q}){const l=A,p=te(),f=c(l.reply.is_thumbs_up==ce.YES),y=c(l.reply.is_thumbs_down==ce.YES),k=c(l.reply.thumbs_up_count),L=()=>{Ne({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(h=>{f.value=!f.value,f.value?(k.value++,y.value=!1):k.value--}).catch(h=>{console.log(h)})},r=()=>{je({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(h=>{y.value=!y.value,y.value&&f.value&&(k.value--,f.value=!1)}).catch(h=>{console.log(h)})},U=()=>{q("focusReply",l.reply)},T=()=>{Be({id:l.reply.id}).then(h=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(h=>{console.log(h)})};return(h,$)=>{const R=ge("router-link"),e=Y,_=oe,O=Re,w=ht;return o(),u("div",Ft,[v("div",Vt,[v("div",Yt,[t(R,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[x(I(l.reply.user.username),1)]),_:1},8,["to"]),v("span",Jt,I(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),P(R,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[x(I(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),v("div",Kt,[x(I(l.reply.ip_loc)+" ",1),a(p).state.userInfo.is_admin||a(p).state.userInfo.id===l.reply.user.id?(o(),P(O,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:T},{trigger:n(()=>[t(_,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(e,null,{default:n(()=>[t(a(Pe))]),_:1})]),_:1})]),default:n(()=>[x(" 是否确认删除? ")]),_:1})):i("",!0)])]),v("div",Gt,[v("div",Qt,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[x(I(l.reply.content),1)]),_:1})]),v("div",Wt,[v("span",Xt,I(a(ue)(l.reply.created_on)),1),v("div",Zt,[a(p).state.userLogined?i("",!0):(o(),u("div",{key:0,class:"action-item",onClick:$[0]||($[0]=H(()=>{},["stop"]))},[t(e,{size:"medium"},{default:n(()=>[t(a(re))]),_:1}),v("span",es,I(k.value),1)])),a(p).state.userLogined?(o(),u("div",{key:1,class:"action-item hover",onClick:H(L,["stop"])},[t(e,{size:"medium"},{default:n(()=>[f.value?i("",!0):(o(),P(a(re),{key:0})),f.value?(o(),P(a(ze),{key:1,class:"show"})):i("",!0)]),_:1}),v("span",ss,I(k.value>0?k.value:"赞"),1)],8,ts)):i("",!0),a(p).state.userLogined?i("",!0):(o(),u("div",os,[t(e,{size:"medium"},{default:n(()=>[t(a(_e))]),_:1})])),a(p).state.userLogined?(o(),u("div",{key:3,class:"action-item hover",onClick:H(r,["stop"])},[t(e,{size:"medium"},{default:n(()=>[y.value?i("",!0):(o(),P(a(_e),{key:0})),y.value?(o(),P(a(Ue),{key:1,class:"show"})):i("",!0)]),_:1})],8,ns)):i("",!0),a(p).state.userLogined?(o(),u("span",{key:4,class:"show opacity-item reply-btn",onClick:U}," 回复 ")):i("",!0)])])])])}}});const ls=se(as,[["__scopeId","data-v-187a4ed3"]]),is={class:"reply-compose-wrap"},us={class:"reply-switch"},cs={class:"time-item"},rs={class:"actions"},_s={key:0,class:"action-item"},ps={class:"upvote-count"},ds=["onClick"],ms={class:"upvote-count"},vs={key:2,class:"action-item"},hs=["onClick"],fs={key:0,class:"reply-input-wrap"},gs=X({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(A,{expose:q,emit:l}){const p=A,f=te(),y=c(),k=c(!1),L=c(""),r=c(!1),U=+"300",T=c(p.comment.is_thumbs_up==ce.YES),h=c(p.comment.is_thumbs_down==ce.YES),$=c(p.comment.thumbs_up_count),R=()=>{He({tweet_id:p.comment.post_id,comment_id:p.comment.id}).then(w=>{T.value=!T.value,T.value?($.value++,h.value=!1):$.value--}).catch(w=>{console.log(w)})},e=()=>{Fe({tweet_id:p.comment.post_id,comment_id:p.comment.id}).then(w=>{h.value=!h.value,h.value&&T.value&&($.value--,T.value=!1)}).catch(w=>{console.log(w)})},_=w=>{k.value=w,w?setTimeout(()=>{var M;(M=y.value)==null||M.focus()},10):(r.value=!1,L.value="",l("reset"))},O=()=>{r.value=!0,Ve({comment_id:p.comment.id,at_user_id:p.atUserid,content:L.value}).then(w=>{_(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{r.value=!1})};return q({switchReply:_}),(w,M)=>{const j=Y,B=ft,V=oe,z=gt;return o(),u("div",is,[v("div",us,[v("span",cs,I(a(ue)(w.comment.created_on)),1),v("div",rs,[a(f).state.userLogined?i("",!0):(o(),u("div",_s,[t(j,{size:"medium"},{default:n(()=>[t(a(re))]),_:1}),v("span",ps,I($.value),1)])),a(f).state.userLogined?(o(),u("div",{key:1,class:"action-item hover",onClick:H(R,["stop"])},[t(j,{size:"medium"},{default:n(()=>[T.value?i("",!0):(o(),P(a(re),{key:0})),T.value?(o(),P(a(ze),{key:1,class:"show"})):i("",!0)]),_:1}),v("span",ms,I($.value>0?$.value:"赞"),1)],8,ds)):i("",!0),a(f).state.userLogined?i("",!0):(o(),u("div",vs,[t(j,{size:"medium"},{default:n(()=>[t(a(_e))]),_:1})])),a(f).state.userLogined?(o(),u("div",{key:3,class:"action-item hover",onClick:H(e,["stop"])},[t(j,{size:"medium"},{default:n(()=>[h.value?i("",!0):(o(),P(a(_e),{key:0})),h.value?(o(),P(a(Ue),{key:1,class:"show"})):i("",!0)]),_:1})],8,hs)):i("",!0),a(f).state.userLogined&&!k.value?(o(),u("span",{key:4,class:"show reply-btn",onClick:M[0]||(M[0]=S=>_(!0))}," 回复 ")):i("",!0),a(f).state.userLogined&&k.value?(o(),u("span",{key:5,class:"hide reply-btn",onClick:M[1]||(M[1]=S=>_(!1))}," 取消 ")):i("",!0)])]),k.value?(o(),u("div",fs,[t(z,null,{default:n(()=>[t(B,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:p.atUsername?"@"+p.atUsername:"请输入回复内容..",maxlength:a(U),value:L.value,"onUpdate:value":M[2]||(M[2]=S=>L.value=S),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(V,{type:"primary",size:"small",ghost:"",loading:r.value,onClick:O},{default:n(()=>[x(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const ys=se(gs,[["__scopeId","data-v-f9af7a93"]]),ks={class:"comment-item"},ws={class:"nickname-wrap"},bs={class:"username-wrap"},$s={class:"opt-wrap"},Cs={class:"timestamp"},xs=["innerHTML"],Is={class:"reply-wrap"},Ts=X({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(A,{emit:q}){const l=A,p=te(),f=Me(),y=c(0),k=c(""),L=c(),r=ae(()=>{let e=Object.assign({texts:[],imgs:[]},l.comment);return e.contents.map(_=>{(+_.type==1||+_.type==2)&&e.texts.push(_),+_.type==3&&e.imgs.push(_)}),e}),U=(e,_)=>{let O=e.target;if(O.dataset.detail){const w=O.dataset.detail.split(":");w.length===2&&(p.commit("refresh"),w[0]==="tag"?window.$message.warning("评论内的无效话题"):f.push({name:"user",query:{s:w[1]}}))}},T=e=>{var _,O;y.value=e.user_id,k.value=((_=e.user)==null?void 0:_.username)||"",(O=L.value)==null||O.switchReply(!0)},h=()=>{q("reload")},$=()=>{y.value=0,k.value=""},R=()=>{Ye({id:r.value.id}).then(e=>{window.$message.success("删除成功"),setTimeout(()=>{h()},50)}).catch(e=>{})};return(e,_)=>{const O=ke,w=ge("router-link"),M=Y,j=oe,B=Re,V=Oe,z=ys,S=ls,K=Se;return o(),u("div",ks,[t(K,{"content-indented":""},qe({avatar:n(()=>[t(O,{round:"",size:30,src:r.value.user.avatar},null,8,["src"])]),header:n(()=>[v("span",ws,[t(w,{onClick:_[0]||(_[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:r.value.user.username}}},{default:n(()=>[x(I(r.value.user.nickname),1)]),_:1},8,["to"])]),v("span",bs," @"+I(r.value.user.username),1)]),"header-extra":n(()=>[v("div",$s,[v("span",Cs,I(r.value.ip_loc),1),a(p).state.userInfo.is_admin||a(p).state.userInfo.id===r.value.user.id?(o(),P(B,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:R},{trigger:n(()=>[t(j,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(M,null,{default:n(()=>[t(a(Pe))]),_:1})]),_:1})]),default:n(()=>[x(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:n(()=>[r.value.imgs.length>0?(o(),P(V,{key:0,imgs:r.value.imgs},null,8,["imgs"])):i("",!0),t(z,{ref_key:"replyComposeRef",ref:L,comment:r.value,"at-userid":y.value,"at-username":k.value,onReload:h,onReset:$},null,8,["comment","at-userid","at-username"]),v("div",Is,[(o(!0),u(le,null,ie(r.value.replies,F=>(o(),P(S,{key:F.id,reply:F,"tweet-id":r.value.post_id,onFocusReply:T,onReload:h},null,8,["reply","tweet-id"]))),128))])]),_:2},[r.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),u(le,null,ie(r.value.texts,F=>(o(),u("span",{key:F.id,class:"comment-text",onClick:_[1]||(_[1]=H(J=>U(J,r.value.id),["stop"])),innerHTML:a(we)(F.content).content},null,8,xs))),128))]),key:"0"}:void 0]),1024)])}}});const Ps=se(Ts,[["__scopeId","data-v-36dac8c8"]]),zs=A=>(Ie("data-v-634e6bfd"),A=A(),Te(),A),Us={key:0,class:"compose-wrap"},Rs={class:"compose-line"},Ss={class:"compose-user"},Ls={class:"compose-line compose-options"},Os={class:"attachment"},Ms={class:"submit-wrap"},As={class:"attachment-list-wrap"},Ds={key:1,class:"compose-wrap"},qs=zs(()=>v("div",{class:"login-wrap"},[v("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Es={key:0,class:"login-only-wrap"},Ns={key:1,class:"login-wrap"},js=X({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(A,{emit:q}){const l=A,p=te(),f=c([]),y=c(!1),k=c(!1),L=c(!1),r=c(""),U=c(),T=c("public/image"),h=c([]),$=c([]),R=c("true".toLowerCase()==="true"),e=+"300",_="/v1/attachment",O=c(),w=Nt.debounce(m=>{Je({k:m}).then(g=>{let b=[];g.suggest.map(C=>{b.push({label:C,value:C})}),f.value=b,k.value=!1}).catch(g=>{k.value=!1})},200),M=(m,g)=>{k.value||(k.value=!0,g==="@"&&w(m))},j=m=>{m.length>e?r.value=m.substring(0,e):r.value=m},B=m=>{T.value=m},V=m=>{for(let E=0;E30&&(m[E].name=b.substring(0,18)+"..."+b.substring(b.length-9)+"."+C)}h.value=m},z=async m=>{var g,b;return T.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((g=m.file.file)==null?void 0:g.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):T.value==="image"&&((b=m.file.file)==null?void 0:b.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},S=({file:m,event:g})=>{var b;try{let C=JSON.parse((b=g.target)==null?void 0:b.response);C.code===0&&T.value==="public/image"&&$.value.push({id:m.id,content:C.data.content})}catch{window.$message.error("上传失败")}},K=({file:m,event:g})=>{var b;try{let C=JSON.parse((b=g.target)==null?void 0:b.response);if(C.code!==0){let E=C.msg||"上传失败";C.details&&C.details.length>0&&C.details.map(D=>{E+=":"+D}),window.$message.error(E)}}catch{window.$message.error("上传失败")}},F=({file:m})=>{let g=$.value.findIndex(b=>b.id===m.id);g>-1&&$.value.splice(g,1)},J=()=>{y.value=!0},Q=()=>{var m;y.value=!1,(m=U.value)==null||m.clear(),h.value=[],r.value="",$.value=[]},s=()=>{if(r.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:m}=we(r.value);const g=[];let b=100;g.push({content:r.value,type:2,sort:b}),$.value.map(C=>{b++,g.push({content:C.content,type:3,sort:b})}),L.value=!0,Ke({contents:g,post_id:l.postId,users:Array.from(new Set(m))}).then(C=>{window.$message.success("发布成功"),L.value=!1,q("post-success"),Q()}).catch(C=>{L.value=!1})},d=m=>{p.commit("triggerAuth",!0),p.commit("triggerAuthKey",m)};return ye(()=>{O.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(m,g)=>{const b=ke,C=yt,E=Y,D=oe,G=kt,pe=wt,de=bt,me=$t,ne=Ct;return o(),u("div",null,[a(p).state.userInfo.id>0?(o(),u("div",Us,[v("div",Rs,[v("div",Ss,[t(b,{round:"",size:30,src:a(p).state.userInfo.avatar},null,8,["src"])]),t(C,{type:"textarea",size:"large",autosize:"",bordered:!1,options:f.value,prefix:["@"],loading:k.value,value:r.value,disabled:l.lock===1,"onUpdate:value":j,onSearch:M,onFocus:J,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(o(),P(ne,{key:0,ref_key:"uploadRef",ref:U,abstract:"","list-type":"image",multiple:!0,max:9,action:_,headers:{Authorization:O.value},data:{type:T.value},"file-list":h.value,onBeforeUpload:z,onFinish:S,onError:K,onRemove:F,"onUpdate:fileList":V},{default:n(()=>[v("div",Ls,[v("div",Os,[t(G,{abstract:""},{default:n(({handleClick:W})=>[t(D,{disabled:h.value.length>0&&T.value==="public/video"||h.value.length===9,onClick:()=>{B("public/image"),W()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(E,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(at))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(de,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(pe,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:r.value.length/a(e)*100},null,8,["percentage"])]),default:n(()=>[x(" "+I(r.value.length)+" / "+I(a(e)),1)]),_:1})]),v("div",Ms,[t(D,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:Q},{default:n(()=>[x(" 取消 ")]),_:1}),t(D,{loading:L.value,onClick:s,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[x(" 发布 ")]),_:1},8,["loading"])])]),v("div",As,[t(me)])]),_:1},8,["headers","data","file-list"])):i("",!0)])):(o(),u("div",Ds,[qs,R.value?i("",!0):(o(),u("div",Es,[t(D,{strong:"",secondary:"",round:"",type:"primary",onClick:g[0]||(g[0]=W=>d("signin"))},{default:n(()=>[x(" 登录 ")]),_:1})])),R.value?(o(),u("div",Ns,[t(D,{strong:"",secondary:"",round:"",type:"primary",onClick:g[1]||(g[1]=W=>d("signin"))},{default:n(()=>[x(" 登录 ")]),_:1}),t(D,{strong:"",secondary:"",round:"",type:"info",onClick:g[2]||(g[2]=W=>d("signup"))},{default:n(()=>[x(" 注册 ")]),_:1})])):i("",!0)]))])}}});const Bs=se(js,[["__scopeId","data-v-634e6bfd"]]),Hs={class:"username-wrap"},Fs={key:0,class:"options"},Vs={key:0},Ys=["innerHTML"],Js={class:"timestamp"},Ks={key:0},Gs={key:1},Qs={class:"opts-wrap"},Ws=["onClick"],Xs={class:"opt-item"},Zs=["onClick"],eo=["onClick"],to=X({__name:"post-detail",props:{post:{}},emits:["reload"],setup(A,{emit:q}){const l=A,p=te(),f=Me(),y=c(!1),k=c(!1),L=c(!1),r=c(!1),U=c(!1),T=c(!1),h=c(!1),$=c(!1),R=c(Z.PUBLIC),e=ae({get:()=>{let s=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return s.contents.map(d=>{(+d.type==1||+d.type==2)&&s.texts.push(d),+d.type==3&&s.imgs.push(d),+d.type==4&&s.videos.push(d),+d.type==6&&s.links.push(d),+d.type==7&&s.attachments.push(d),+d.type==8&&s.charge_attachments.push(d)}),s},set:s=>{l.post.upvote_count=s.upvote_count,l.post.comment_count=s.comment_count,l.post.collection_count=s.collection_count,l.post.is_essence=s.is_essence}}),_=s=>()=>be(Y,null,{default:()=>be(s)}),O=ae(()=>{let s=[{label:"删除",key:"delete",icon:_(dt)}];return e.value.is_lock===0?s.push({label:"锁定",key:"lock",icon:_(mt)}):s.push({label:"解锁",key:"unlock",icon:_(vt)}),p.state.userInfo.is_admin&&(e.value.is_top===0?s.push({label:"置顶",key:"stick",icon:_(Ce)}):s.push({label:"取消置顶",key:"unstick",icon:_(Ce)})),e.value.is_essence===0?s.push({label:"设为亮点",key:"highlight",icon:_(xe)}):s.push({label:"取消亮点",key:"unhighlight",icon:_(xe)}),e.value.visibility===Z.PUBLIC?s.push({label:"公开",key:"vpublic",icon:_(ve),children:[{label:"私密",key:"vprivate",icon:_(he)},{label:"好友可见",key:"vfriend",icon:_(fe)}]}):e.value.visibility===Z.PRIVATE?s.push({label:"私密",key:"vprivate",icon:_(he),children:[{label:"公开",key:"vpublic",icon:_(ve)},{label:"好友可见",key:"vfriend",icon:_(fe)}]}):s.push({label:"好友可见",key:"vfriend",icon:_(fe),children:[{label:"公开",key:"vpublic",icon:_(ve)},{label:"私密",key:"vprivate",icon:_(he)}]}),s}),w=s=>{f.push({name:"post",query:{id:s}})},M=(s,d)=>{if(s.target.dataset.detail){const m=s.target.dataset.detail.split(":");if(m.length===2){p.commit("refresh"),m[0]==="tag"?f.push({name:"home",query:{q:m[1],t:"tag"}}):f.push({name:"user",query:{s:m[1]}});return}}w(d)},j=s=>{switch(s){case"delete":L.value=!0;break;case"lock":case"unlock":r.value=!0;break;case"stick":case"unstick":U.value=!0;break;case"highlight":case"unhighlight":T.value=!0;break;case"vpublic":R.value=0,h.value=!0;break;case"vprivate":R.value=1,h.value=!0;break;case"vfriend":R.value=2,h.value=!0;break}},B=()=>{We({id:e.value.id}).then(s=>{window.$message.success("删除成功"),f.replace("/"),setTimeout(()=>{p.commit("refresh")},50)}).catch(s=>{$.value=!1})},V=()=>{Xe({id:e.value.id}).then(s=>{q("reload"),s.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(s=>{$.value=!1})},z=()=>{Ze({id:e.value.id}).then(s=>{q("reload"),s.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(s=>{$.value=!1})},S=()=>{et({id:e.value.id}).then(s=>{e.value={...e.value,is_essence:s.highlight_status},s.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(s=>{$.value=!1})},K=()=>{tt({id:e.value.id,visibility:R.value}).then(s=>{q("reload"),window.$message.success("修改可见性成功")}).catch(s=>{$.value=!1})},F=()=>{st({id:e.value.id}).then(s=>{y.value=s.status,s.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count-1}}).catch(s=>{console.log(s)})},J=()=>{ot({id:e.value.id}).then(s=>{k.value=s.status,s.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count-1}}).catch(s=>{console.log(s)})},Q=()=>{jt(`${window.location.origin}/#/post?id=${e.value.id}`),window.$message.success("链接已复制到剪贴板")};return ye(()=>{p.state.userInfo.id>0&&(Ge({id:e.value.id}).then(s=>{y.value=s.status}).catch(s=>{console.log(s)}),Qe({id:e.value.id}).then(s=>{k.value=s.status}).catch(s=>{console.log(s)}))}),(s,d)=>{const m=ke,g=ge("router-link"),b=xt,C=oe,E=It,D=Tt,G=Mt,pe=Oe,de=At,me=Dt,ne=Pt,W=Le,Ae=Se;return o(),u("div",{class:"detail-item",onClick:d[7]||(d[7]=N=>w(e.value.id))},[t(Ae,null,{avatar:n(()=>[t(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:n(()=>[t(g,{onClick:d[0]||(d[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:n(()=>[x(I(e.value.user.nickname),1)]),_:1},8,["to"]),v("span",Hs," @"+I(e.value.user.username),1),e.value.is_top?(o(),P(b,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[x(" 置顶 ")]),_:1})):i("",!0),e.value.visibility==a(Z).PRIVATE?(o(),P(b,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[x(" 私密 ")]),_:1})):i("",!0),e.value.visibility==a(Z).FRIEND?(o(),P(b,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[x(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":n(()=>[a(p).state.userInfo.is_admin||a(p).state.userInfo.id===e.value.user.id?(o(),u("div",Fs,[t(E,{placement:"bottom-end",trigger:"click",size:"small",options:O.value,onSelect:j},{default:n(()=>[t(C,{quaternary:"",circle:""},{icon:n(()=>[t(a(Y),null,{default:n(()=>[t(a(lt))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),t(D,{show:L.value,"onUpdate:show":d[1]||(d[1]=N=>L.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:B},null,8,["show"]),t(D,{show:r.value,"onUpdate:show":d[2]||(d[2]=N=>r.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:V},null,8,["show","content"]),t(D,{show:U.value,"onUpdate:show":d[3]||(d[3]=N=>U.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:z},null,8,["show","content"]),t(D,{show:T.value,"onUpdate:show":d[4]||(d[4]=N=>T.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(e.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:S},null,8,["show","content"]),t(D,{show:h.value,"onUpdate:show":d[5]||(d[5]=N=>h.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(R.value==0?"公开":R.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show","content"])]),footer:n(()=>[t(G,{attachments:e.value.attachments},null,8,["attachments"]),t(G,{attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"]),t(pe,{imgs:e.value.imgs},null,8,["imgs"]),t(de,{videos:e.value.videos,full:!0},null,8,["videos"]),t(me,{links:e.value.links},null,8,["links"]),v("div",Js,[x(" 发布于 "+I(a(ue)(e.value.created_on))+" ",1),e.value.ip_loc?(o(),u("span",Ks,[t(ne,{vertical:""}),x(" "+I(e.value.ip_loc),1)])):i("",!0),!a(p).state.collapsedLeft&&e.value.created_on!=e.value.latest_replied_on?(o(),u("span",Gs,[t(ne,{vertical:""}),x(" 最后回复 "+I(a(ue)(e.value.latest_replied_on)),1)])):i("",!0)])]),action:n(()=>[v("div",Qs,[t(W,{justify:"space-between"},{default:n(()=>[v("div",{class:"opt-item hover",onClick:H(F,["stop"])},[t(a(Y),{size:"20",class:"opt-item-icon"},{default:n(()=>[y.value?i("",!0):(o(),P(a(it),{key:0})),y.value?(o(),P(a(ut),{key:1,color:"red"})):i("",!0)]),_:1}),x(" "+I(e.value.upvote_count),1)],8,Ws),v("div",Xs,[t(a(Y),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(ct))]),_:1}),x(" "+I(e.value.comment_count),1)]),v("div",{class:"opt-item hover",onClick:H(J,["stop"])},[t(a(Y),{size:"20",class:"opt-item-icon"},{default:n(()=>[k.value?i("",!0):(o(),P(a(rt),{key:0})),k.value?(o(),P(a(_t),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),x(" "+I(e.value.collection_count),1)],8,Zs),v("div",{class:"opt-item hover",onClick:H(Q,["stop"])},[t(a(Y),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(pt))]),_:1}),x(" "+I(e.value.share_count),1)],8,eo)]),_:1})])]),default:n(()=>[e.value.texts.length>0?(o(),u("div",Vs,[(o(!0),u(le,null,ie(e.value.texts,N=>(o(),u("span",{key:N.id,class:"post-text",onClick:d[6]||(d[6]=H(De=>M(De,e.value.id),["stop"])),innerHTML:a(we)(N.content).content},null,8,Ys))),128))])):i("",!0)]),_:1})])}}});const so=A=>(Ie("data-v-0d01659f"),A=A(),Te(),A),oo={key:0,class:"detail-wrap"},no={key:1,class:"empty-wrap"},ao={key:0,class:"comment-opts-wrap"},lo=so(()=>v("span",{class:"comment-title-item"},"评论",-1)),io={key:2},uo={key:0,class:"skeleton-wrap"},co={key:1},ro={key:0,class:"empty-wrap"},_o={key:0,class:"load-more-spinner"},po={key:1,class:"load-more-spinner"},mo={key:2,class:"load-more-spinner"},vo={key:3,class:"load-more-spinner"},ee=20,ho=X({__name:"Post",setup(A){const q=qt(),l=c({}),p=c(!1),f=c(!1),y=c([]),k=ae(()=>+q.query.id),L=c("default"),r=c(!0);let U={loading(){},loaded(){},complete(){},error(){}};const T=z=>{L.value=z,z==="default"&&(r.value=!0),B(U)},h=()=>{l.value={id:0},p.value=!0,nt({id:k.value}).then(z=>{p.value=!1,l.value=z,B(U)}).catch(z=>{p.value=!1})};let $=1;const R=c(!1),e=c([]),_=z=>{R.value||$e({id:l.value.id,sort_strategy:"default",page:$,page_size:ee}).then(S=>{z!==null&&(U=z),S.list.length0&&($===1?e.value=S.list:e.value.push(...S.list),y.value=e.value),U.loaded(),f.value=!1}).catch(S=>{f.value=!1,U.error()})};let O=1,w=c(!1);const M=c([]),j=z=>{w.value||$e({id:l.value.id,sort_strategy:"newest",page:O,page_size:ee}).then(S=>{z!==null&&(U=z),S.list.length0&&(O===1?M.value=S.list:M.value.push(...S.list),y.value=M.value),U.loaded(),f.value=!1}).catch(S=>{f.value=!1,U.error()})},B=z=>{k.value<1||(y.value.length===0&&(f.value=!0),L.value==="default"?(y.value=e.value,_(z)):(y.value=M.value,j(z)),f.value=!1)},V=()=>{$=1,R.value=!1,e.value=[],O=1,w.value=!1,M.value=[],B(U)};return ye(()=>{h()}),Ee(k,()=>{k.value>0&&q.name==="post"&&h()}),(z,S)=>{const K=Bt,F=to,J=Ut,Q=Rt,s=St,d=Lt,m=Ot,g=Bs,b=Et,C=Ps,E=Le,D=zt;return o(),u("div",null,[t(K,{title:"泡泡详情",back:!0}),t(D,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(s,null,{default:n(()=>[t(Q,{show:p.value},{default:n(()=>[l.value.id>1?(o(),u("div",oo,[t(F,{post:l.value,onReload:h},null,8,["post"])])):(o(),u("div",no,[t(J,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),u("div",ao,[t(m,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":T},{prefix:n(()=>[lo]),default:n(()=>[t(d,{name:"default",tab:"默认"}),t(d,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(o(),P(s,{key:1},{default:n(()=>[t(g,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:V},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(o(),u("div",io,[f.value?(o(),u("div",uo,[t(b,{num:5})])):(o(),u("div",co,[y.value.length===0?(o(),u("div",ro,[t(J,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(o(!0),u(le,null,ie(y.value,G=>(o(),P(s,{key:G.id},{default:n(()=>[t(C,{comment:G,onReload:V},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),y.value.length>=ee?(o(),P(E,{key:3,justify:"center"},{default:n(()=>[t(a(Ht),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:B},{spinner:n(()=>[r.value&&R.value?(o(),u("span",_o)):i("",!0),!r.value&&a(w)?(o(),u("span",po)):i("",!0),r.value&&!R.value?(o(),u("span",mo,"加载评论")):i("",!0),!r.value&&!a(w)?(o(),u("span",vo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const Go=se(ho,[["__scopeId","data-v-0d01659f"]]);export{Go as default}; diff --git a/web/dist/assets/Post-8afc7bcc.js b/web/dist/assets/Post-8afc7bcc.js new file mode 100644 index 00000000..8d5c666d --- /dev/null +++ b/web/dist/assets/Post-8afc7bcc.js @@ -0,0 +1 @@ +import{d as oe,H as r,r as ke,e as o,f as _,j as d,k as t,w as n,A as T,x as R,q as x,Y as u,bf as a,y as Y,c as ue,al as Ke,F as me,u as ve,$ as ze,a0 as Re,b as Se,h as xe,E as Ge}from"./@vue-a481fc63.js";import{u as ce}from"./vuex-44de225f.js";import{i as he,t as Qe,j as Xe,k as Ze,_ as re,l as et,m as tt,n as st,o as ot,p as nt,g as at,q as lt,r as it,s as ut,v as ct,w as rt,x as _t,y as pt,z as dt,A as mt,B as vt,u as ht,f as ft,C as Ie,D as ye}from"./index-3489d7cc.js";import{Y as se,V as ee}from"./IEnum-5453a777.js";import{T as Oe,e as fe,f as Le,g as ge,h as Ae,i as gt,j as yt,I as kt,k as wt,l as bt,m as $t,n as Ct,o as xt,p as It,q as Pt,r as Tt,s as Ut,t as ie,u as zt,v as Rt,w as St,x as Pe,F as Te,E as pe,y as de,z as Ue}from"./@vicons-f0266f88.js";import{j as J,e as _e,K as De,I as Ot,b as Lt,L as At,o as we,M as Me,O as Ee,v as Dt,w as Mt,x as Et,y as Nt,z as qt,B as Bt,F as Ht,P as Ft,i as jt,Q as Vt,a as Ne,G as Yt,J as Wt,k as Jt,H as Kt,f as Gt,g as Qt}from"./naive-ui-eecf2ec3.js";import{p as be,_ as qe,a as Xt,b as Zt,c as es}from"./content-23ae3d74.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-df8e8b0e.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-473502c7.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{W as is}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const us={class:"reply-item"},cs={class:"header-wrap"},rs={class:"username"},_s={class:"reply-name"},ps={class:"timestamp"},ds={class:"base-wrap"},ms={class:"content"},vs={class:"reply-switch"},hs={class:"time-item"},fs={class:"actions"},gs={class:"upvote-count"},ys=["onClick"],ks={class:"upvote-count"},ws={key:2,class:"action-item"},bs=["onClick"],$s=oe({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,m=ce(),v=r(l.reply.is_thumbs_up==se.YES),g=r(l.reply.is_thumbs_down==se.YES),$=r(l.reply.thumbs_up_count),D=()=>{Qe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{v.value=!v.value,v.value?($.value++,g.value=!1):$.value--}).catch(y=>{console.log(y)})},i=()=>{Xe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{g.value=!g.value,g.value&&v.value&&($.value--,v.value=!1)}).catch(y=>{console.log(y)})},S=()=>{q("focusReply",l.reply)},L=()=>{Ze({id:l.reply.id}).then(y=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(y=>{console.log(y)})};return(y,A)=>{const M=ke("router-link"),U=J,p=_e,z=De,w=Ot;return o(),_("div",us,[d("div",cs,[d("div",rs,[t(M,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(R(l.reply.user.username),1)]),_:1},8,["to"]),d("span",_s,R(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),x(M,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(R(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",ps,[T(R(l.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===l.reply.user.id?(o(),x(z,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:L},{trigger:n(()=>[t(p,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(U,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),d("div",ds,[d("div",ms,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(R(l.reply.content),1)]),_:1})]),d("div",vs,[d("span",hs,R(a(he)(l.reply.created_on)),1),d("div",fs,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:A[0]||(A[0]=Y(()=>{},["stop"]))},[t(U,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",gs,R($.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(D,["stop"])},[t(U,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),x(a(fe),{key:0})),v.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",ks,R($.value>0?$.value:"赞"),1)],8,ys)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ws,[t(U,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(i,["stop"])},[t(U,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),x(a(ge),{key:0})),g.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,bs)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const Cs=re($s,[["__scopeId","data-v-eccdbbd8"]]),xs={class:"reply-compose-wrap"},Is={class:"reply-switch"},Ps={class:"time-item"},Ts={class:"actions"},Us={key:0,class:"action-item"},zs={class:"upvote-count"},Rs=["onClick"],Ss={class:"upvote-count"},Os={key:2,class:"action-item"},Ls=["onClick"],As={key:0,class:"reply-input-wrap"},Ds=oe({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const m=E,v=ce(),g=r(),$=r(!1),D=r(""),i=r(!1),S=+"300",L=r(m.comment.is_thumbs_up==se.YES),y=r(m.comment.is_thumbs_down==se.YES),A=r(m.comment.thumbs_up_count),M=()=>{et({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{L.value=!L.value,L.value?(A.value++,y.value=!1):A.value--}).catch(w=>{console.log(w)})},U=()=>{tt({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{y.value=!y.value,y.value&&L.value&&(A.value--,L.value=!1)}).catch(w=>{console.log(w)})},p=w=>{$.value=w,w?setTimeout(()=>{var O;(O=g.value)==null||O.focus()},10):(i.value=!1,D.value="",l("reset"))},z=()=>{i.value=!0,st({comment_id:m.comment.id,at_user_id:m.atUserid,content:D.value}).then(w=>{p(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{i.value=!1})};return q({switchReply:p}),(w,O)=>{const N=J,s=Lt,h=_e,F=At;return o(),_("div",xs,[d("div",Is,[d("span",Ps,R(a(he)(w.comment.created_on)),1),d("div",Ts,[a(v).state.userLogined?u("",!0):(o(),_("div",Us,[t(N,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",zs,R(A.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(M,["stop"])},[t(N,{size:"medium"},{default:n(()=>[L.value?u("",!0):(o(),x(a(fe),{key:0})),L.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",Ss,R(A.value>0?A.value:"赞"),1)],8,Rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Os,[t(N,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(U,["stop"])},[t(N,{size:"medium"},{default:n(()=>[y.value?u("",!0):(o(),x(a(ge),{key:0})),y.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ls)):u("",!0),a(v).state.userLogined&&!$.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:O[0]||(O[0]=B=>p(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&$.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:O[1]||(O[1]=B=>p(!1))}," 取消 ")):u("",!0)])]),$.value?(o(),_("div",As,[t(F,null,{default:n(()=>[t(s,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:D.value,"onUpdate:value":O[2]||(O[2]=B=>D.value=B),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(h,{type:"primary",size:"small",ghost:"",loading:i.value,onClick:z},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ms=re(Ds,[["__scopeId","data-v-f9af7a93"]]),Es={class:"comment-item"},Ns={class:"nickname-wrap"},qs={class:"username-wrap"},Bs={class:"opt-wrap"},Hs={class:"timestamp"},Fs=["innerHTML"],js={class:"reply-wrap"},Vs=oe({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m=ce(),v=Be(),g=r(0),$=r(""),D=r(),i=ue(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(z=>{(+z.type==1||+z.type==2)&&p.texts.push(z),+z.type==3&&p.imgs.push(z)}),p}),S=(p,z)=>{let w=p.target;if(w.dataset.detail){const O=w.dataset.detail.split(":");O.length===2&&(m.commit("refresh"),O[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:O[1]}}))}},L=p=>{var z,w;g.value=p.user_id,$.value=((z=p.user)==null?void 0:z.username)||"",(w=D.value)==null||w.switchReply(!0)},y=()=>{q("reload")},A=()=>{g.value=0,$.value=""},M=()=>{ot({id:i.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{y()},50)}).catch(p=>{})},U=()=>{nt({id:i.value.id}).then(p=>{i.value.is_essence=p.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{y()},50)}).catch(p=>{})};return(p,z)=>{const w=we,O=ke("router-link"),N=Me,s=J,h=_e,F=De,B=qe,G=Ms,W=Cs,Q=Ee;return o(),_("div",Es,[t(Q,{"content-indented":""},Ke({avatar:n(()=>[t(w,{round:"",size:30,src:i.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Ns,[t(O,{onClick:z[0]||(z[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:i.value.user.username}}},{default:n(()=>[T(R(i.value.user.nickname),1)]),_:1},8,["to"])]),d("span",qs," @"+R(i.value.user.username),1),i.value.is_essence==a(se).YES?(o(),x(N,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Bs,[d("span",Hs,R(i.value.ip_loc),1),a(m).state.userInfo.id===p.postUserId?(o(),x(F,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:U},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[i.value.is_essence==a(se).NO?(o(),x(s,{key:0},{default:n(()=>[t(a(gt))]),_:1})):(o(),x(s,{key:1},{default:n(()=>[t(a(yt))]),_:1}))]),_:1})]),default:n(()=>[T(" "+R(i.value.is_essence==a(se).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.value.user.id?(o(),x(F,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:M},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(s,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[i.value.imgs.length>0?(o(),x(B,{key:0,imgs:i.value.imgs},null,8,["imgs"])):u("",!0),t(G,{ref_key:"replyComposeRef",ref:D,comment:i.value,"at-userid":g.value,"at-username":$.value,onReload:y,onReset:A},null,8,["comment","at-userid","at-username"]),d("div",js,[(o(!0),_(me,null,ve(i.value.replies,b=>(o(),x(W,{key:b.id,reply:b,"tweet-id":i.value.post_id,onFocusReply:L,onReload:y},null,8,["reply","tweet-id"]))),128))])]),_:2},[i.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(me,null,ve(i.value.texts,b=>(o(),_("span",{key:b.id,class:"comment-text",onClick:z[1]||(z[1]=Y(I=>S(I,i.value.id),["stop"])),innerHTML:a(be)(b.content).content},null,8,Fs))),128))]),key:"0"}:void 0]),1024)])}}});const Ys=re(Vs,[["__scopeId","data-v-e1f04c6b"]]),Ws=E=>(ze("data-v-d9073453"),E=E(),Re(),E),Js={key:0,class:"compose-wrap"},Ks={class:"compose-line"},Gs={class:"compose-user"},Qs={class:"compose-line compose-options"},Xs={class:"attachment"},Zs={class:"submit-wrap"},eo={class:"attachment-list-wrap"},to={key:1,class:"compose-wrap"},so=Ws(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),oo={key:0,class:"login-only-wrap"},no={key:1,class:"login-wrap"},ao=oe({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,m=ce(),v=r([]),g=r(!1),$=r(!1),D=r(!1),i=r(""),S=r(),L=r("public/image"),y=r([]),A=r([]),M=r("true".toLowerCase()==="true"),U=+"300",p="/v1/attachment",z=ue(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),w=os.debounce(f=>{at({k:f}).then(k=>{let C=[];k.suggest.map(P=>{C.push({label:P,value:P})}),v.value=C,$.value=!1}).catch(k=>{$.value=!1})},200),O=(f,k)=>{$.value||($.value=!0,k==="@"&&w(f))},N=f=>{f.length>U?i.value=f.substring(0,U):i.value=f},s=f=>{L.value=f},h=f=>{for(let H=0;H30&&(f[H].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+P)}y.value=f},F=async f=>{var k,C;return L.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=f.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):L.value==="image"&&((C=f.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},B=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);P.code===0&&L.value==="public/image"&&A.value.push({id:f.id,content:P.data.content})}catch{window.$message.error("上传失败")}},G=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);if(P.code!==0){let H=P.msg||"上传失败";P.details&&P.details.length>0&&P.details.map(e=>{H+=":"+e}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},W=({file:f})=>{let k=A.value.findIndex(C=>C.id===f.id);k>-1&&A.value.splice(k,1)},Q=()=>{g.value=!0},b=()=>{var f;g.value=!1,(f=S.value)==null||f.clear(),y.value=[],i.value="",A.value=[]},I=()=>{if(i.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=be(i.value);const k=[];let C=100;k.push({content:i.value,type:2,sort:C}),A.value.map(P=>{C++,k.push({content:P.content,type:3,sort:C})}),D.value=!0,lt({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(P=>{window.$message.success("发布成功"),D.value=!1,q("post-success"),b()}).catch(P=>{D.value=!1})},X=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,k)=>{const C=we,P=Dt,H=J,e=_e,c=Mt,j=Et,ne=Nt,Z=qt,ae=Bt;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",Js,[d("div",Ks,[d("div",Gs,[t(C,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:$.value,value:i.value,disabled:l.lock===1,"onUpdate:value":N,onSearch:O,onFocus:Q,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),x(ae,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:p,headers:{Authorization:z.value},data:{type:L.value},"file-list":y.value,onBeforeUpload:F,onFinish:B,onError:G,onRemove:W,"onUpdate:fileList":h},{default:n(()=>[d("div",Qs,[d("div",Xs,[t(c,{abstract:""},{default:n(({handleClick:K})=>[t(e,{disabled:y.value.length>0&&L.value==="public/video"||y.value.length===9,onClick:()=>{s("public/image"),K()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(kt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(j,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:i.value.length/a(U)*100},null,8,["percentage"])]),default:n(()=>[T(" "+R(i.value.length)+" / "+R(a(U)),1)]),_:1})]),d("div",Zs,[t(e,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:b},{default:n(()=>[T(" 取消 ")]),_:1}),t(e,{loading:D.value,onClick:I,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",eo,[t(Z)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",to,[so,M.value?u("",!0):(o(),_("div",oo,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),M.value?(o(),_("div",no,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(e,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=K=>X("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const lo=re(ao,[["__scopeId","data-v-d9073453"]]),io={class:"username-wrap"},uo={class:"options"},co={key:0},ro=["innerHTML"],_o={class:"timestamp"},po={key:0},mo={key:1},vo={class:"opts-wrap"},ho=["onClick"],fo={class:"opt-item"},go=["onClick"],yo=["onClick"],ko=oe({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m="true".toLowerCase()==="true",v=ce(),g=Be(),$=Ht(),D=r(!1),i=r(!1),S=r(!1),L=r(!1),y=r(!1),A=r(!1),M=r(!1),U=r(!1),p=r(ee.PUBLIC),z=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=e=>{w.value=e,z.value=!0},N=()=>{z.value=!1},s=ue({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(c=>{(+c.type==1||+c.type==2)&&e.texts.push(c),+c.type==3&&e.imgs.push(c),+c.type==4&&e.videos.push(c),+c.type==6&&e.links.push(c),+c.type==7&&e.attachments.push(c),+c.type==8&&e.charge_attachments.push(c)}),e},set:e=>{l.post.upvote_count=e.upvote_count,l.post.comment_count=e.comment_count,l.post.collection_count=e.collection_count,l.post.is_essence=e.is_essence}}),h=e=>()=>xe(J,null,{default:()=>xe(e)}),F=ue(()=>{var j;let e=[];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注",key:"unfollow",icon:h(Ut)}):e.push({label:"关注",key:"follow",icon:h(ie)}),e;e.push({label:"删除",key:"delete",icon:h(zt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(Rt)}):e.push({label:"解锁",key:"unlock",icon:h(St)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(Pe)}):e.push({label:"取消置顶",key:"unstick",icon:h(Pe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Te)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Te)});let c;return s.value.visibility===ee.PUBLIC?c={label:"公开",key:"vpublic",icon:h(pe),children:[{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:s.value.visibility===ee.PRIVATE?c={label:"私密",key:"vprivate",icon:h(de),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:m&&s.value.visibility===ee.FRIEND?c={label:"好友可见",key:"vfriend",icon:h(Ue),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:c={label:"关注可见",key:"vfollowing",icon:h(ie),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)}]},m&&s.value.visibility!==ee.FRIEND&&((j=c.children)==null||j.push({label:"好友可见",key:"vfriend",icon:h(Ue)})),e.push(c),e}),B=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?ht({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(c=>{}):ft({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(c=>{})}})},G=e=>{g.push({name:"post",query:{id:e}})},W=(e,c)=>{if(e.target.dataset.detail){const j=e.target.dataset.detail.split(":");if(j.length===2){v.commit("refresh"),j[0]==="tag"?g.push({name:"home",query:{q:j[1],t:"tag"}}):g.push({name:"user",query:{s:j[1]}});return}}G(c)},Q=e=>{switch(e){case"whisper":O(l.post.user);break;case"follow":case"unfollow":B(l.post);break;case"delete":S.value=!0;break;case"lock":case"unlock":L.value=!0;break;case"stick":case"unstick":y.value=!0;break;case"highlight":case"unhighlight":A.value=!0;break;case"vpublic":p.value=0,M.value=!0;break;case"vprivate":p.value=1,M.value=!0;break;case"vfriend":p.value=2,M.value=!0;break;case"vfollowing":p.value=3,M.value=!0;break}},b=()=>{ct({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{U.value=!1})},I=()=>{rt({id:s.value.id}).then(e=>{q("reload",s.value.id),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{U.value=!1})},X=()=>{_t({id:s.value.id}).then(e=>{q("reload",s.value.id),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{U.value=!1})},f=()=>{pt({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{U.value=!1})},k=()=>{dt({id:s.value.id,visibility:p.value}).then(e=>{q("reload",s.value.id),window.$message.success("修改可见性成功")}).catch(e=>{U.value=!1})},C=()=>{mt({id:s.value.id}).then(e=>{D.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},P=()=>{vt({id:s.value.id}).then(e=>{i.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},H=()=>{as(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Se(()=>{v.state.userInfo.id>0&&(it({id:s.value.id}).then(e=>{D.value=e.status}).catch(e=>{console.log(e)}),ut({id:s.value.id}).then(e=>{i.value=e.status}).catch(e=>{console.log(e)}))}),(e,c)=>{const j=we,ne=ke("router-link"),Z=Me,ae=_e,K=Ft,le=jt,He=ns,$e=Xt,Fe=qe,je=Zt,Ve=es,Ce=Vt,Ye=Ne,We=Ee;return o(),_("div",{class:"detail-item",onClick:c[7]||(c[7]=V=>G(s.value.id))},[t(We,null,{avatar:n(()=>[t(j,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(ne,{onClick:c[0]||(c[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(R(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",io," @"+R(s.value.user.username),1),s.value.is_top?(o(),x(Z,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(ee).PRIVATE?(o(),x(Z,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(ee).FRIEND?(o(),x(Z,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",uo,[t(K,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:Q},{default:n(()=>[t(ae,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(wt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(le,{show:S.value,"onUpdate:show":c[1]||(c[1]=V=>S.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:b},null,8,["show"]),t(le,{show:L.value,"onUpdate:show":c[2]||(c[2]=V=>L.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(le,{show:y.value,"onUpdate:show":c[3]||(c[3]=V=>y.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:X},null,8,["show","content"]),t(le,{show:A.value,"onUpdate:show":c[4]||(c[4]=V=>A.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:f},null,8,["show","content"]),t(le,{show:M.value,"onUpdate:show":c[5]||(c[5]=V=>M.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null,8,["show","content"]),t(He,{show:z.value,user:w.value,onSuccess:N},null,8,["show","user"])]),footer:n(()=>[t($e,{attachments:s.value.attachments},null,8,["attachments"]),t($e,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(Fe,{imgs:s.value.imgs},null,8,["imgs"]),t(je,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Ve,{links:s.value.links},null,8,["links"]),d("div",_o,[T(" 发布于 "+R(a(he)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",po,[t(Ce,{vertical:""}),T(" "+R(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",mo,[t(Ce,{vertical:""}),T(" 最后回复 "+R(a(he)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",vo,[t(Ye,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:Y(C,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[D.value?u("",!0):(o(),x(a(bt),{key:0})),D.value?(o(),x(a($t),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+R(s.value.upvote_count),1)],8,ho),d("div",fo,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Ct))]),_:1}),T(" "+R(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:Y(P,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[i.value?u("",!0):(o(),x(a(xt),{key:0})),i.value?(o(),x(a(It),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+R(s.value.collection_count),1)],8,go),d("div",{class:"opt-item hover",onClick:Y(H,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Pt))]),_:1}),T(" "+R(s.value.share_count),1)],8,yo)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",co,[(o(!0),_(me,null,ve(s.value.texts,V=>(o(),_("span",{key:V.id,class:"post-text",onClick:c[6]||(c[6]=Y(Je=>W(Je,s.value.id),["stop"])),innerHTML:a(be)(V.content).content},null,8,ro))),128))])):u("",!0)]),_:1})])}}});const wo=E=>(ze("data-v-edac44ef"),E=E(),Re(),E),bo={key:0,class:"detail-wrap"},$o={key:1,class:"empty-wrap"},Co={key:0,class:"comment-opts-wrap"},xo=wo(()=>d("span",{class:"comment-title-item"},"评论",-1)),Io={key:2},Po={key:0,class:"skeleton-wrap"},To={key:1},Uo={key:0,class:"empty-wrap"},zo={key:0,class:"load-more-spinner"},Ro={key:1,class:"load-more-spinner"},So={key:2,class:"load-more-spinner"},Oo={key:3,class:"load-more-spinner"},Lo={key:4,class:"load-more-spinner"},Ao={key:5,class:"load-more-spinner"},te=20,Do=oe({__name:"Post",setup(E){const q=ts(),l=r({}),m=r(!1),v=r(!1),g=r([]),$=ue(()=>+q.query.id),D=r("default"),i=r(!0);let S={loading(){},loaded(){},complete(){},error(){}};const L=b=>{D.value=b,b==="default"&&(i.value=!0),W(S)},y=b=>{Ie({id:b}).then(I=>{l.value=I}).catch(I=>{})},A=()=>{l.value={id:0},m.value=!0,Ie({id:$.value}).then(b=>{m.value=!1,l.value=b,W(S)}).catch(b=>{m.value=!1})};let M=1;const U=r(!1),p=r([]),z=b=>{U.value||ye({id:l.value.id,style:"default",page:M,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(M===1?p.value=I.list:p.value.push(...I.list),g.value=p.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let w=1,O=r(!1);const N=r([]),s=b=>{O.value||ye({id:l.value.id,style:"hots",page:w,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(w===1?N.value=I.list:N.value.push(...I.list),g.value=N.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let h=1,F=r(!1);const B=r([]),G=b=>{F.value||ye({id:l.value.id,style:"newest",page:h,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(h===1?B.value=I.list:B.value.push(...I.list),g.value=B.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})},W=b=>{$.value<1||(g.value.length===0&&(v.value=!0),D.value==="default"?(g.value=p.value,z(b)):D.value==="hots"?(g.value=N.value,s(b)):(g.value=B.value,G(b)),v.value=!1)},Q=()=>{M=1,U.value=!1,p.value=[],w=1,O.value=!1,N.value=[],h=1,F.value=!1,B.value=[],W(S)};return Se(()=>{A()}),Ge($,()=>{$.value>0&&q.name==="post"&&A()}),(b,I)=>{const X=ls,f=ko,k=Wt,C=Jt,P=Kt,H=Gt,e=Qt,c=lo,j=ss,ne=Ys,Z=Ne,ae=Yt;return o(),_("div",null,[t(X,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(P,null,{default:n(()=>[t(C,{show:m.value},{default:n(()=>[l.value.id>1?(o(),_("div",bo,[t(f,{post:l.value,onReload:y},null,8,["post"])])):(o(),_("div",$o,[t(k,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",Co,[t(e,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":L},{prefix:n(()=>[xo]),default:n(()=>[t(H,{name:"default",tab:"推荐"}),t(H,{name:"hots",tab:"热门"}),t(H,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),x(P,{key:1},{default:n(()=>[t(c,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Q},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",Io,[v.value?(o(),_("div",Po,[t(j,{num:5})])):(o(),_("div",To,[g.value.length===0?(o(),_("div",Uo,[t(k,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(me,null,ve(g.value,K=>(o(),x(P,{key:K.id},{default:n(()=>[t(ne,{comment:K,postUserId:l.value.user_id,onReload:Q},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=te?(o(),x(Z,{key:3,justify:"center"},{default:n(()=>[t(a(is),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:W},{spinner:n(()=>[i.value&&U.value?(o(),_("span",zo)):u("",!0),!i.value&&a(O)?(o(),_("span",Ro)):u("",!0),!i.value&&a(F)?(o(),_("span",So)):u("",!0),i.value&&!U.value?(o(),_("span",Oo,"加载评论")):u("",!0),!i.value&&!a(O)?(o(),_("span",Lo,"加载评论")):u("",!0),!i.value&&!a(F)?(o(),_("span",Ao,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const fn=re(Do,[["__scopeId","data-v-edac44ef"]]);export{fn as default}; diff --git a/web/dist/assets/Post-b5b6aab2.css b/web/dist/assets/Post-b5b6aab2.css deleted file mode 100644 index c68a0321..00000000 --- a/web/dist/assets/Post-b5b6aab2.css +++ /dev/null @@ -1 +0,0 @@ -.reply-item[data-v-187a4ed3]{display:flex;flex-direction:column;font-size:12px;padding:8px;border-bottom:1px solid #f3f3f3}.reply-item .header-wrap[data-v-187a4ed3]{display:flex;align-items:center;justify-content:space-between}.reply-item .header-wrap .username[data-v-187a4ed3]{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .header-wrap .username .reply-name[data-v-187a4ed3]{margin:0 3px;opacity:.75}.reply-item .header-wrap .timestamp[data-v-187a4ed3]{opacity:.75;text-align:right;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .base-wrap[data-v-187a4ed3]{display:block}.reply-item .base-wrap .content[data-v-187a4ed3]{width:100%;margin-top:4px;font-size:12px;text-align:justify;line-height:2}.reply-item .base-wrap .reply-switch[data-v-187a4ed3]{display:flex;align-items:center;justify-content:space-between;font-size:12px}.reply-item .base-wrap .reply-switch .actions[data-v-187a4ed3]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-item .base-wrap .reply-switch .time-item[data-v-187a4ed3]{font-size:12px;opacity:.75;margin-right:18px}.reply-item .base-wrap .reply-switch .action-item[data-v-187a4ed3]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-item .base-wrap .reply-switch .action-item .upvote-count[data-v-187a4ed3]{margin-left:4px;font-size:12px}.reply-item .base-wrap .reply-switch .action-item.hover[data-v-187a4ed3]{cursor:pointer}.reply-item .base-wrap .reply-switch .opacity-item[data-v-187a4ed3]{opacity:.75}.reply-item .base-wrap .reply-switch .reply-btn[data-v-187a4ed3]{margin-left:18px}.reply-item .base-wrap .reply-switch .show[data-v-187a4ed3]{color:#18a058;cursor:pointer}.reply-item .base-wrap .reply-switch .hide[data-v-187a4ed3]{opacity:.75;cursor:pointer}.dark .reply-item[data-v-187a4ed3]{border-bottom:1px solid #262628;background-color:#101014bf}.dark .reply-item .base-wrap .reply-switch .show[data-v-187a4ed3]{color:#63e2b7}.reply-compose-wrap .reply-switch[data-v-f9af7a93]{display:flex;align-items:center;justify-content:space-between;text-align:right;font-size:12px}.reply-compose-wrap .reply-switch .actions[data-v-f9af7a93]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-compose-wrap .reply-switch .time-item[data-v-f9af7a93]{font-size:12px;opacity:.65;margin-right:18px}.reply-compose-wrap .reply-switch .action-item[data-v-f9af7a93]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-compose-wrap .reply-switch .action-item .upvote-count[data-v-f9af7a93]{margin-left:4px;font-size:12px}.reply-compose-wrap .reply-switch .action-item.hover[data-v-f9af7a93]{cursor:pointer}.reply-compose-wrap .reply-switch .reply-btn[data-v-f9af7a93]{margin-left:18px}.reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#18a058;cursor:pointer;opacity:.75}.reply-compose-wrap .reply-switch .hide[data-v-f9af7a93]{opacity:.75;cursor:pointer}.dark .reply-compose-wrap[data-v-f9af7a93]{background-color:#101014bf}.dark .reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#63e2b7}.comment-item[data-v-36dac8c8]{width:100%;padding:16px;box-sizing:border-box}.comment-item .nickname-wrap[data-v-36dac8c8]{font-size:14px}.comment-item .username-wrap[data-v-36dac8c8]{font-size:14px;opacity:.75}.comment-item .opt-wrap[data-v-36dac8c8]{display:flex;align-items:center}.comment-item .opt-wrap .timestamp[data-v-36dac8c8]{opacity:.75;font-size:12px}.comment-item .opt-wrap .del-btn[data-v-36dac8c8]{margin-left:4px}.comment-item .comment-text[data-v-36dac8c8]{display:block;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.comment-item .opt-item[data-v-36dac8c8]{display:flex;align-items:center;opacity:.7}.comment-item .opt-item .opt-item-icon[data-v-36dac8c8]{margin-right:10px}.reply-wrap[data-v-36dac8c8]{margin-top:10px;border-radius:5px;background:#fafafc}.reply-wrap .reply-item[data-v-36dac8c8]:last-child{border-bottom:none}.dark .reply-wrap[data-v-36dac8c8]{background:#18181c}.dark .comment-item[data-v-36dac8c8]{background-color:#101014bf}.compose-wrap[data-v-634e6bfd]{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line[data-v-634e6bfd]{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user[data-v-634e6bfd]{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options[data-v-634e6bfd]{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap[data-v-634e6bfd]{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .cancel-btn[data-v-634e6bfd]{margin-right:8px}.compose-wrap .login-only-wrap[data-v-634e6bfd]{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button[data-v-634e6bfd]{margin:0 4px;width:50%}.compose-wrap .login-wrap[data-v-634e6bfd]{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner[data-v-634e6bfd]{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button[data-v-634e6bfd]{margin:0 4px}.attachment[data-v-634e6bfd]{display:flex;align-items:center}.attachment .text-statistic[data-v-634e6bfd]{margin-left:8px;width:18px;height:18px;transform:rotate(180deg)}.attachment-list-wrap[data-v-634e6bfd]{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail[data-v-634e6bfd]{overflow:hidden}.dark .compose-mention[data-v-634e6bfd],.dark .compose-wrap[data-v-634e6bfd]{background-color:#101014bf}.detail-item{width:100%;padding:16px;box-sizing:border-box;background:#f7f9f9}.detail-item .nickname-wrap{font-size:14px}.detail-item .username-wrap{font-size:14px;opacity:.75}.detail-item .top-tag{transform:scale(.75)}.detail-item .options{opacity:.75}.detail-item .post-text{font-size:16px;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.detail-item .opts-wrap{margin-top:20px}.detail-item .opts-wrap .opt-item{display:flex;align-items:center;opacity:.7}.detail-item .opts-wrap .opt-item .opt-item-icon{margin-right:10px}.detail-item .opts-wrap .opt-item.hover{cursor:pointer}.detail-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.detail-item .timestamp{opacity:.75;font-size:12px;margin-top:10px}.dark .detail-item{background:#18181c}.detail-wrap[data-v-0d01659f]{min-height:100px}.comment-opts-wrap[data-v-0d01659f]{padding-top:6px;padding-left:16px;padding-right:16px;opacity:.75}.comment-opts-wrap .comment-title-item[data-v-0d01659f]{padding-top:4px;font-size:16px;text-align:center}.main-content-wrap .load-more[data-v-0d01659f]{margin-bottom:8px}.main-content-wrap .load-more .load-more-spinner[data-v-0d01659f]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-0d01659f],.dark .skeleton-wrap[data-v-0d01659f]{background-color:#101014bf} diff --git a/web/dist/assets/Profile-0cbf435e.css b/web/dist/assets/Profile-0cbf435e.css deleted file mode 100644 index 151fde27..00000000 --- a/web/dist/assets/Profile-0cbf435e.css +++ /dev/null @@ -1 +0,0 @@ -.profile-baseinfo[data-v-b38691fd]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-b38691fd]{width:72px}.profile-baseinfo .base-info[data-v-b38691fd]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-b38691fd]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-b38691fd]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-b38691fd]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-b38691fd]{transform:scale(.75)}.profile-tabs-wrap[data-v-b38691fd]{padding:0 16px}.load-more[data-v-b38691fd]{margin:20px}.load-more .load-more-wrap[data-v-b38691fd]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-b38691fd]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-b38691fd],.dark .pagination-wrap[data-v-b38691fd]{background-color:#101014bf} diff --git a/web/dist/assets/Profile-471fcf6c.js b/web/dist/assets/Profile-471fcf6c.js new file mode 100644 index 00000000..6b02ecf3 --- /dev/null +++ b/web/dist/assets/Profile-471fcf6c.js @@ -0,0 +1 @@ +import{_ as ye}from"./whisper-473502c7.js";import{_ as be,a as Ie}from"./post-item.vue_vue_type_style_index_0_lang-bce56e3e.js";import{_ as Pe}from"./post-skeleton-df8e8b0e.js";import{_ as Oe}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{d as Te,H as i,b as Ae,E as Fe,r as xe,f as u,k as r,bf as n,q as h,w as v,Y as m,e as a,j as f,x as O,A as R,y as ue,F as b,u as I}from"./@vue-a481fc63.js";import{u as Me}from"./vuex-44de225f.js";import{b as ze}from"./vue-router-e5a2430e.js";import{e as L,K as qe,u as $e,f as Ce,_ as Se}from"./index-3489d7cc.js";import{p as G}from"./count-e2caa1c1.js";import{W as Le}from"./v3-infinite-loading-2c58ec2f.js";import{F as Ne,G as Ue,a as Be,o as De,M as He,f as Ve,g as We,J as je,k as Ee,H as Re}from"./naive-ui-eecf2ec3.js";import"./content-23ae3d74.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ge={class:"profile-baseinfo"},Je={class:"avatar"},Ke={class:"base-info"},Qe={class:"username"},Ye={class:"userinfo"},Xe={class:"info-item"},Ze={class:"info-item"},et={class:"userinfo"},tt={class:"info-item"},at={class:"info-item"},st={class:"info-item"},lt={key:0,class:"skeleton-wrap"},ot={key:1},nt={key:0,class:"empty-wrap"},ut={key:1},it={key:0},rt={key:1},ct={key:2},_t={key:3},vt={key:4},dt={key:2},mt={key:0},ft={key:1},pt={key:2},ht={key:3},gt={key:4},wt={class:"load-more-wrap"},kt={class:"load-more-spinner"},yt=Te({__name:"Profile",setup(bt){const o=Me(),T=ze(),ie=Ne(),d=i(!1),P=i(!1),l=i([]),A=i([]),F=i([]),x=i([]),M=i([]),z=i([]),p=i("post"),J=i(+T.query.p||1),K=i(1),Q=i(1),Y=i(1),X=i(1),s=i(+T.query.p||1),g=i(20),_=i(0),Z=i(0),ee=i(0),te=i(0),ae=i(0),se=i(0),U=i(!1),le=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{le.value=e,U.value=!0},re=()=>{U.value=!1},k=e=>{ie.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?$e({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),oe(e.user_id,!1)}).catch(c=>{}):Ce({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),oe(e.user_id,!0)}).catch(c=>{})}})};function oe(e,c){q(A.value,e,c),q(F.value,e,c),q(x.value,e,c),q(M.value,e,c),q(z.value,e,c)}function q(e,c,E){if(e&&e.length>0)for(let N in e)e[N].user_id==c&&(e[N].user.is_following=E)}const B=()=>{switch(p.value){case"post":D();break;case"comment":H();break;case"highlight":V();break;case"media":W();break;case"star":j();break}},D=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},H=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,ee.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),x.value=l.value,te.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},W=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,ae.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,se.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},ce=e=>{switch(p.value=e,p.value){case"post":l.value=A.value,s.value=J.value,_.value=Z.value,D();break;case"comment":l.value=F.value,s.value=K.value,_.value=ee.value,H();break;case"highlight":l.value=x.value,s.value=Q.value,_.value=te.value,V();break;case"media":l.value=M.value,s.value=Y.value,_.value=ae.value,W();break;case"star":l.value=z.value,s.value=X.value,_.value=se.value,j();break}},_e=()=>{switch(p.value){case"post":J.value=s.value,D();break;case"comment":K.value=s.value,H();break;case"highlight":Q.value=s.value,V();break;case"media":Y.value=s.value,W();break;case"star":X.value=s.value,j();break}},ve=()=>{s.value<_.value||_.value==0?(P.value=!1,s.value++,_e()):P.value=!0};return Ae(()=>{B()}),Fe(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,c)=>{if(e.refresh!==c.refresh){s.value=+T.query.p||1,setTimeout(()=>{B()},0);return}c.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{B()},0))}),(e,c)=>{const E=Oe,N=De,de=He,ne=xe("router-link"),$=Ve,me=We,fe=Pe,pe=je,C=be,y=Re,S=Ie,he=ye,ge=Ue,we=Ee,ke=Be;return a(),u("div",null,[r(E,{title:"主页"}),n(o).state.userInfo.id>0?(a(),h(ge,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:v(()=>[f("div",Ge,[f("div",Je,[r(N,{size:72,src:n(o).state.userInfo.avatar},null,8,["src"])]),f("div",Ke,[f("div",Qe,[f("strong",null,O(n(o).state.userInfo.nickname),1),f("span",null," @"+O(n(o).state.userInfo.username),1),n(o).state.userInfo.is_admin?(a(),h(de,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:v(()=>[R(" 管理员 ")]),_:1})):m("",!0)]),f("div",Ye,[f("span",Xe,"UID. "+O(n(o).state.userInfo.id),1),f("span",Ze,O(n(qe)(n(o).state.userInfo.created_on))+" 加入",1)]),f("div",et,[f("span",tt,[r(ne,{onClick:c[0]||(c[0]=ue(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"follows"}}},{default:v(()=>[R(" 关注  "+O(n(G)(n(o).state.userInfo.follows)),1)]),_:1},8,["to"])]),f("span",at,[r(ne,{onClick:c[1]||(c[1]=ue(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"followings"}}},{default:v(()=>[R(" 粉丝  "+O(n(G)(n(o).state.userInfo.followings)),1)]),_:1},8,["to"])]),f("span",st," 泡泡  "+O(n(G)(n(o).state.userInfo.tweets_count)),1)])])]),r(me,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":ce},{default:v(()=>[r($,{name:"post",tab:"泡泡"}),r($,{name:"comment",tab:"评论"}),r($,{name:"highlight",tab:"亮点"}),r($,{name:"media",tab:"图文"}),r($,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(a(),u("div",lt,[r(fe,{num:g.value},null,8,["num"])])):(a(),u("div",ot,[l.value.length===0?(a(),u("div",nt,[r(pe,{size:"large",description:"暂无数据"})])):m("",!0),n(o).state.desktopModelShow?(a(),u("div",ut,[p.value==="post"?(a(),u("div",it,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",rt,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",ct,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",_t,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",vt,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(a(),u("div",dt,[p.value==="post"?(a(),u("div",mt,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",ft,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",pt,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",ht,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",gt,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))])),r(he,{show:U.value,user:le.value,onSuccess:re},null,8,["show","user"])]),_:1})):m("",!0),_.value>0?(a(),h(ke,{key:1,justify:"center"},{default:v(()=>[r(n(Le),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=t=>ve())},{spinner:v(()=>[f("div",wt,[P.value?m("",!0):(a(),h(we,{key:0,size:14})),f("span",kt,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const aa=Se(yt,[["__scopeId","data-v-50f96858"]]);export{aa as default}; diff --git a/web/dist/assets/Profile-5f074a97.js b/web/dist/assets/Profile-5f074a97.js deleted file mode 100644 index 218ef03a..00000000 --- a/web/dist/assets/Profile-5f074a97.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as ve,a as _e}from"./post-item.vue_vue_type_style_index_0_lang-18e150bb.js";import{_ as me}from"./post-skeleton-f095ca4e.js";import{_ as pe}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{d as fe,r as s,j as de,w as ge,a3 as he,c as f,V as i,_ as u,Q as k,a1 as p,O as y,o as r,a as c,M as d,e as C,a2 as A,F as J,a4 as K}from"./@vue-e0e89260.js";import{u as ke}from"./vuex-473b3783.js";import{b as we}from"./vue-router-b8e3382f.js";import{B as b,_ as ye}from"./index-26a2b065.js";import{b as be}from"./formatTime-4210fcd1.js";import{W as Pe}from"./v3-infinite-loading-e5c2e8bf.js";import{F as Ie,a as Te,o as Me,M as ze,f as qe,g as xe,H as Ce,k as $e,G as Le}from"./naive-ui-e703c4e6.js";import"./content-772a5dad.js";import"./@vicons-0524c43e.js";import"./paopao-video-player-aa5e8b3f.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const Be={class:"profile-baseinfo"},Se={class:"avatar"},Ve={class:"base-info"},Ne={class:"username"},De={class:"userinfo"},Fe={class:"info-item"},Ue={class:"info-item"},je={class:"userinfo"},He={class:"info-item"},Ee={class:"info-item"},Ge={key:0,class:"skeleton-wrap"},Oe={key:1},Qe={key:0,class:"empty-wrap"},Re={key:1},We={key:2},Ae={class:"load-more-wrap"},Je={class:"load-more-spinner"},Ke=fe({__name:"Profile",setup(Xe){const o=ke(),g=we(),n=s(!1),_=s(!1),t=s([]),$=s([]),L=s([]),B=s([]),S=s([]),V=s([]),P=s("post"),N=s(+g.query.p||1),D=s(1),F=s(1),U=s(1),j=s(1),a=s(+g.query.p||1),v=s(20),l=s(0),H=s(0),E=s(0),G=s(0),O=s(0),Q=s(0),I=()=>{switch(P.value){case"post":T();break;case"comment":M();break;case"highlight":z();break;case"media":q();break;case"star":x();break}},T=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"post",page:a.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),a.value>1?t.value=t.value.concat(e.list):(t.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),$.value=t.value,H.value=l.value}).catch(e=>{t.value=[],a.value>1&&a.value--,n.value=!1})},M=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"comment",page:a.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),a.value>1?t.value=t.value.concat(e.list):(t.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),L.value=t.value,E.value=l.value}).catch(e=>{t.value=[],a.value>1&&a.value--,n.value=!1})},z=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"highlight",page:a.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),a.value>1?t.value=t.value.concat(e.list):(t.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),B.value=t.value,G.value=l.value}).catch(e=>{t.value=[],a.value>1&&a.value--,n.value=!1})},q=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"media",page:a.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),a.value>1?t.value=t.value.concat(e.list):(t.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),S.value=t.value,O.value=l.value}).catch(e=>{t.value=[],a.value>1&&a.value--,n.value=!1})},x=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"star",page:a.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),a.value>1?t.value=t.value.concat(e.list):(t.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),V.value=t.value,Q.value=l.value}).catch(e=>{t.value=[],a.value>1&&a.value--,n.value=!1})},X=e=>{switch(P.value=e,P.value){case"post":t.value=$.value,a.value=N.value,l.value=H.value,T();break;case"comment":t.value=L.value,a.value=D.value,l.value=E.value,M();break;case"highlight":t.value=B.value,a.value=F.value,l.value=G.value,z();break;case"media":t.value=S.value,a.value=U.value,l.value=O.value,q();break;case"star":t.value=V.value,a.value=j.value,l.value=Q.value,x();break}},Y=()=>{switch(P.value){case"post":N.value=a.value,T();break;case"comment":D.value=a.value,M();break;case"highlight":F.value=a.value,z();break;case"media":U.value=a.value,q();break;case"star":j.value=a.value,x();break}},Z=()=>{a.value{I()}),ge(()=>({path:g.path,query:g.query,refresh:o.state.refresh}),(e,m)=>{if(e.refresh!==m.refresh){a.value=+g.query.p||1,setTimeout(()=>{I()},0);return}m.path!=="/post"&&e.path==="/profile"&&(a.value=+g.query.p||1,setTimeout(()=>{I()},0))}),(e,m)=>{const ee=pe,ae=Me,te=ze,R=he("router-link"),w=qe,se=xe,oe=me,le=Ce,ne=ve,W=Le,ue=_e,ie=Ie,re=$e,ce=Te;return r(),f("div",null,[i(ee,{title:"主页"}),u(o).state.userInfo.id>0?(r(),k(ie,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:p(()=>[c("div",Be,[c("div",Se,[i(ae,{size:72,src:u(o).state.userInfo.avatar},null,8,["src"])]),c("div",Ve,[c("div",Ne,[c("strong",null,d(u(o).state.userInfo.nickname),1),c("span",null," @"+d(u(o).state.userInfo.username),1),u(o).state.userInfo.is_admin?(r(),k(te,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:p(()=>[C(" 管理员 ")]),_:1})):y("",!0)]),c("div",De,[c("span",Fe,"UID. "+d(u(o).state.userInfo.id),1),c("span",Ue,d(u(be)(u(o).state.userInfo.created_on))+" 加入",1)]),c("div",je,[c("span",He,[i(R,{onClick:m[0]||(m[0]=A(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"follows"}}},{default:p(()=>[C(" 关注  "+d(u(o).state.userInfo.follows),1)]),_:1},8,["to"])]),c("span",Ee,[i(R,{onClick:m[1]||(m[1]=A(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"followings"}}},{default:p(()=>[C(" 粉丝  "+d(u(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),i(se,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":X},{default:p(()=>[i(w,{name:"post",tab:"泡泡"}),i(w,{name:"comment",tab:"评论"}),i(w,{name:"highlight",tab:"亮点"}),i(w,{name:"media",tab:"图文"}),i(w,{name:"star",tab:"喜欢"})]),_:1}),n.value?(r(),f("div",Ge,[i(oe,{num:v.value},null,8,["num"])])):(r(),f("div",Oe,[t.value.length===0?(r(),f("div",Qe,[i(le,{size:"large",description:"暂无数据"})])):y("",!0),u(o).state.desktopModelShow?(r(),f("div",Re,[(r(!0),f(J,null,K(t.value,h=>(r(),k(W,{key:h.id},{default:p(()=>[i(ne,{post:h},null,8,["post"])]),_:2},1024))),128))])):(r(),f("div",We,[(r(!0),f(J,null,K(t.value,h=>(r(),k(W,{key:h.id},{default:p(()=>[i(ue,{post:h},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):y("",!0),l.value>0?(r(),k(ce,{key:1,justify:"center"},{default:p(()=>[i(u(Pe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:m[2]||(m[2]=h=>Z())},{spinner:p(()=>[c("div",Ae,[_.value?y("",!0):(r(),k(re,{key:0,size:14})),c("span",Je,d(_.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const xa=ye(Ke,[["__scopeId","data-v-b38691fd"]]);export{xa as default}; diff --git a/web/dist/assets/Profile-912dd7e3.css b/web/dist/assets/Profile-912dd7e3.css new file mode 100644 index 00000000..ba483fee --- /dev/null +++ b/web/dist/assets/Profile-912dd7e3.css @@ -0,0 +1 @@ +.profile-baseinfo[data-v-50f96858]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-50f96858]{width:72px}.profile-baseinfo .base-info[data-v-50f96858]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-50f96858]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-50f96858]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-50f96858]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-50f96858]{transform:scale(.75)}.profile-tabs-wrap[data-v-50f96858]{padding:0 16px}.load-more[data-v-50f96858]{margin:20px}.load-more .load-more-wrap[data-v-50f96858]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-50f96858]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-50f96858],.dark .pagination-wrap[data-v-50f96858]{background-color:#101014bf} diff --git a/web/dist/assets/Setting-94ec4c57.css b/web/dist/assets/Setting-94ec4c57.css new file mode 100644 index 00000000..89d15e5a --- /dev/null +++ b/web/dist/assets/Setting-94ec4c57.css @@ -0,0 +1 @@ +.setting-card[data-v-7bb19e7f]{margin-top:-1px;border-radius:0}.setting-card .form-submit-wrap[data-v-7bb19e7f]{display:flex;justify-content:flex-end}.setting-card .base-line[data-v-7bb19e7f]{line-height:2;display:flex;align-items:center}.setting-card .base-line .base-label[data-v-7bb19e7f]{opacity:.75;margin-right:12px}.setting-card .base-line .nickname-input[data-v-7bb19e7f]{margin-right:10px;width:120px}.setting-card .avatar[data-v-7bb19e7f]{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:20px}.setting-card .avatar .avatar-img[data-v-7bb19e7f]{margin-bottom:10px}.setting-card .hash-link[data-v-7bb19e7f]{margin-left:12px}.setting-card .phone-bind-wrap[data-v-7bb19e7f]{margin-top:20px}.setting-card .phone-bind-wrap .captcha-img-wrap[data-v-7bb19e7f]{width:100%;display:flex;align-items:center}.setting-card .phone-bind-wrap .captcha-img[data-v-7bb19e7f]{width:125px;height:34px;border-radius:3px;margin-left:10px;overflow:hidden;cursor:pointer}.setting-card .phone-bind-wrap .captcha-img img[data-v-7bb19e7f]{width:100%;height:100%}.dark .setting-card[data-v-7bb19e7f]{background-color:#101014bf} diff --git a/web/dist/assets/Setting-bef151cc.js b/web/dist/assets/Setting-bef151cc.js new file mode 100644 index 00000000..4198019a --- /dev/null +++ b/web/dist/assets/Setting-bef151cc.js @@ -0,0 +1 @@ +import{_ as he}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{d as we,H as d,R as Z,b as ye,f as g,k as t,w as s,bf as r,q as k,Y as _,e as i,j as m,A as p,x as U,O as be,D as ke,Z as R,y as S,$ as Ce,a0 as Ie}from"./@vue-a481fc63.js";import{u as $e}from"./vuex-44de225f.js";import{a4 as Q,a5 as Pe,a6 as Be,a7 as Ue,a8 as Re,a9 as Se,aa as qe,_ as Ae}from"./index-3489d7cc.js";import{a2 as Ne}from"./@vicons-f0266f88.js";import{h as ze,o as xe,e as De,B as Ke,b as Fe,j as Te,T as je,$ as Oe,L as Ve,a0 as Ee,a1 as Le,d as Me}from"./naive-ui-eecf2ec3.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const F=q=>(Ce("data-v-7bb19e7f"),q=q(),Ie(),q),We={class:"base-line avatar"},Ge={class:"base-line"},He=F(()=>m("span",{class:"base-label"},"昵称",-1)),Je={key:0},Ye={class:"base-line"},Ze=F(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={key:0},Xe={key:1},et=F(()=>m("br",null,null,-1)),tt={key:2,class:"phone-bind-wrap"},at={class:"captcha-img-wrap"},st={class:"captcha-img"},nt=["src"],ot={class:"form-submit-wrap"},lt={key:0},rt={key:1},it=F(()=>m("br",null,null,-1)),ut={key:2,class:"phone-bind-wrap"},dt={class:"captcha-img-wrap"},pt={class:"captcha-img"},ct=["src"],_t={class:"form-submit-wrap"},mt={key:1,class:"phone-bind-wrap"},vt={class:"form-submit-wrap"},ft=we({__name:"Setting",setup(q){const X="/v1/attachment",ee="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),A=d("public/avatar"),te="false".toLowerCase()==="true",o=$e(),$=d(!1),N=d(!1),z=d(!1),L=d(),M=d(),C=d(!1),x=d(!1),P=d(!1),B=d(!1),I=d(60),y=d(!1),b=d(!1),W=d(),G=d(),H=d(),J=d(),a=Z({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),u=Z({id:"",b64s:"",imgCaptcha:"",activate_code:""}),ae=async n=>{var e,v;return A.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):A.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},se=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&A.value==="public/avatar"&&Pe({avatar:f.data.content}).then(c=>{var D;window.$message.success("头像更新成功"),(D=L.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},ne=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,oe=(n,e)=>e===a.password,le=()=>{var n;a.reenteredPassword&&((n=J.value)==null||n.validate({trigger:"password-input"}))},re=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{v||(x.value=!0,Be({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,P.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ie=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(N.value=!0,Ue({phone:a.phone,captcha:a.phone_captcha}).then(f=>{N.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{N.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(u.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}$.value=!0,v||(z.value=!0,Re({activate_code:u.activate_code,captcha_id:u.id,imgCaptcha:u.imgCaptcha}).then(f=>{z.value=!1,b.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:u.activate_code}),u.id="",u.b64s="",u.imgCaptcha="",u.activate_code=""}).catch(f=>{z.value=!1,f.code===20012&&j()}))})},T=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Q().then(n=>{u.id=n.id,u.b64s=n.b64s}).catch(n=>{console.log(n)})},de=()=>{Se({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&B.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}$.value=!0,qe({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{B.value=!0,$.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,B.value=!1)},1e3)}).catch(n=>{$.value=!1,n.code===20012&&T(),console.log(n)})}},ce={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},_e={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},me={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:ne,message:"两次密码输入不一致",trigger:"input"},{validator:oe,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},ve=()=>{C.value=!0,setTimeout(()=>{var n;(n=M.value)==null||n.focus()},30)};return ye(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=he,f=xe,c=De,D=Ke,h=Fe,fe=Te,K=ze,Y=je,w=Oe,ge=Ve,O=Ee,V=Le,E=Me;return i(),g("div",null,[t(v,{title:"设置",theme:""}),t(K,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[t(f,{class:"avatar-img",size:80,src:r(o).state.userInfo.avatar},null,8,["src"]),!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),k(D,{key:0,ref_key:"avatarRef",ref:L,action:X,headers:{Authorization:ee},data:{type:A.value},onBeforeUpload:ae,onFinish:se},{default:s(()=>[t(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[He,C.value?_("",!0):(i(),g("div",Je,U(r(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:M,class:"nickname-input",value:r(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>r(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:de,maxlength:16},null,8,["value"]),[[ke,C.value]]),!C.value&&(!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0&&r(o).state.userInfo.status==1)?(i(),k(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:ve},{icon:s(()=>[t(fe,null,{default:s(()=>[t(r(Ne))]),_:1})]),_:1})):_("",!0)]),m("div",Ye,[Ze,p(" @"+U(r(o).state.userInfo.username),1)])]),_:1}),r(o).state.profile.allowPhoneBind?(i(),k(K,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),g("div",Qe,[p(U(r(o).state.userInfo.phone)+" ",1),!y.value&&r(o).state.userInfo.status==1?(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(i(),g("div",Xe,[t(Y,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),et,y.value?_("",!0):(i(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(i(),g("div",tt,[t(E,{ref_key:"phoneFormRef",ref:W,model:a,rules:ce},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",at,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",st,[a.b64s?(i(),g("img",{key:0,src:a.b64s,onClick:T},null,8,nt)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(ge,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(c,{type:"primary",ghost:"",disabled:B.value,loading:$.value,onClick:pe},{default:s(()=>[p(U(I.value>0&&B.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ot,[t(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ie},{default:s(()=>[p(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),te?(i(),k(K,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.activation&&r(o).state.userInfo.activation.length>0?(i(),g("div",lt,[p(U(r(o).state.userInfo.activation)+" ",1),b.value?_("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>b.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(i(),g("div",rt,[t(Y,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),it,b.value?_("",!0):(i(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>b.value=!0)}," 立即激活 "))]),_:1})])),b.value?(i(),g("div",ut,[t(E,{ref_key:"activateFormRef",ref:G,model:u,rules:_e},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:u.activate_code,"onUpdate:value":e[10]||(e[10]=l=>u.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",dt,[t(h,{value:u.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>u.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[u.b64s?(i(),g("img",{key:0,src:u.b64s,onClick:j},null,8,ct)):_("",!0)])])]),_:1}),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",_t,[t(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>b.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(K,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),P.value?_("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>P.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),P.value?(i(),g("div",mt,[t(E,{ref_key:"formRef",ref:H,model:a,rules:me},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:le,onKeydown:e[18]||(e[18]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:J,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",vt,[t(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>P.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:re},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const jt=Ae(ft,[["__scopeId","data-v-7bb19e7f"]]);export{jt as default}; diff --git a/web/dist/assets/Setting-bfd24152.css b/web/dist/assets/Setting-bfd24152.css deleted file mode 100644 index 04dbe4f6..00000000 --- a/web/dist/assets/Setting-bfd24152.css +++ /dev/null @@ -1 +0,0 @@ -.setting-card[data-v-a681720e]{margin-top:-1px;border-radius:0}.setting-card .form-submit-wrap[data-v-a681720e]{display:flex;justify-content:flex-end}.setting-card .base-line[data-v-a681720e]{line-height:2;display:flex;align-items:center}.setting-card .base-line .base-label[data-v-a681720e]{opacity:.75;margin-right:12px}.setting-card .base-line .nickname-input[data-v-a681720e]{margin-right:10px;width:120px}.setting-card .avatar[data-v-a681720e]{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:20px}.setting-card .avatar .avatar-img[data-v-a681720e]{margin-bottom:10px}.setting-card .hash-link[data-v-a681720e]{margin-left:12px}.setting-card .phone-bind-wrap[data-v-a681720e]{margin-top:20px}.setting-card .phone-bind-wrap .captcha-img-wrap[data-v-a681720e]{width:100%;display:flex;align-items:center}.setting-card .phone-bind-wrap .captcha-img[data-v-a681720e]{width:125px;height:34px;border-radius:3px;margin-left:10px;overflow:hidden;cursor:pointer}.setting-card .phone-bind-wrap .captcha-img img[data-v-a681720e]{width:100%;height:100%}.dark .setting-card[data-v-a681720e]{background-color:#101014bf} diff --git a/web/dist/assets/Setting-ec5ecd29.js b/web/dist/assets/Setting-ec5ecd29.js deleted file mode 100644 index 2cffd5ff..00000000 --- a/web/dist/assets/Setting-ec5ecd29.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{d as ye,r as d,E as Z,j as ke,c as g,V as t,a1 as s,Q as b,O as _,o as r,a as m,_ as u,e as c,M as R,z as be,v as Ce,P as q,a2 as B,W as Ie,X as $e}from"./@vue-e0e89260.js";import{u as Pe}from"./vuex-473b3783.js";import{X as H,Y as Se,Z as Ue,$ as Re,a0 as qe,a1 as Be,a2 as Ae,_ as ze}from"./index-26a2b065.js";import{X as Ne}from"./@vicons-0524c43e.js";import{h as Ke,o as xe,e as De,B as Fe,b as Ve,j as je,S as Ee,$ as Oe,K as Te,a0 as Me,a1 as Le,d as We}from"./naive-ui-e703c4e6.js";import"./vue-router-b8e3382f.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const V=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),Xe={class:"base-line avatar"},Ge={class:"base-line"},Je=V(()=>m("span",{class:"base-label"},"昵称",-1)),Qe={key:0},Ye={class:"base-line"},Ze=V(()=>m("span",{class:"base-label"},"用户名",-1)),He={key:0},et={key:1},tt=V(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=V(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(A){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),z=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),N=d(!1),K=d(!1),L=d(),W=d(),C=d(!1),x=d(!1),S=d(!1),U=d(!1),I=d(60),y=d(!1),k=d(!1),X=d(),G=d(),J=d(),Q=d(),a=Z({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Z({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return z.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):z.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&z.value==="public/avatar"&&Se({avatar:f.data.content}).then(p=>{var D;window.$message.success("头像更新成功"),(D=L.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=Q.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(x.value=!0,Ue({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,S.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=X.value)==null||e.validate(v=>{v||(N.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{N.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{N.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{K.value=!1,f.code===20012&&E()}))})},j=()=>{H().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},E=()=>{H().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Be({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&U.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Ae({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{U.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,U.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&j(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),j(),E()}),(n,e)=>{const v=we,f=xe,p=De,D=Fe,h=Ve,ge=je,F=Ke,Y=Ee,w=Oe,he=Te,O=Me,T=Le,M=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Xe,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(D,{key:0,ref_key:"avatarRef",ref:L,action:ee,headers:{Authorization:te},data:{type:z.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[Je,C.value?_("",!0):(r(),g("div",Qe,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:ce,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(p,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(Ne))]),_:1})]),_:1})):_("",!0)]),m("div",Ye,[Ze,c(" @"+R(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",He,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(Y,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(M,{ref_key:"phoneFormRef",ref:X,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:j},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(p,{type:"primary",ghost:"",disabled:U.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&U.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(T,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(Y,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(M,{ref_key:"activateFormRef",ref:G,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:E},null,8,_t)):_("",!0)])])]),_:1}),t(T,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),S.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>S.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),S.value?(r(),g("div",vt,[t(M,{ref_key:"formRef",ref:J,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:Q,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(T,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>S.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const jt=ze(gt,[["__scopeId","data-v-a681720e"]]);export{jt as default}; diff --git a/web/dist/assets/Topic-437d36d5.js b/web/dist/assets/Topic-437d36d5.js new file mode 100644 index 00000000..9f825b7e --- /dev/null +++ b/web/dist/assets/Topic-437d36d5.js @@ -0,0 +1 @@ +import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-3489d7cc.js";import{D}from"./@vicons-f0266f88.js";import{d as q,H as _,c as T,b as B,r as G,e as c,f as u,k as n,w as s,q as $,A as C,x as h,Y as r,bf as w,E as H,al as j,F as P,u as Y}from"./@vue-a481fc63.js";import{o as J,M as V,j as K,e as Q,P as R,O as W,G as X,f as Z,g as ee,a as oe,k as te}from"./naive-ui-eecf2ec3.js";import{_ as ne}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{u as se}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ae={key:0,class:"tag-item"},ce={key:0,class:"tag-quote"},le={key:1,class:"tag-quote tag-follow"},ie={key:0,class:"options"},_e=q({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(F){const o=F,m=_(!1),g=T(()=>o.tag.user?o.tag.user.avatar:U),i=T(()=>{let e=[];return o.tag.is_following===0?e.push({label:"关注",key:"follow"}):(o.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":O({topic_id:o.tag.id}).then(t=>{o.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":M({topic_id:o.tag.id}).then(t=>{o.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return B(()=>{m.value=!1}),(e,t)=>{const d=G("router-link"),k=J,a=V,f=K,v=Q,p=R,y=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),u("div",ae,[n(y,null,{header:s(()=>[(c(),$(a,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(k,{src:g.value},null,8,["src"])]),default:s(()=>[n(d,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[C(" #"+h(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?r("",!0):(c(),u("span",ce,"("+h(e.tag.quote_num)+")",1)),e.showAction?(c(),u("span",le,"("+h(e.tag.quote_num)+")",1)):r("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),u("div",ie,[n(p,{placement:"bottom-end",trigger:"click",size:"small",options:i.value,onSelect:l},{default:s(()=>[n(v,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(f,null,{default:s(()=>[n(w(D))]),_:1})]),_:1})]),_:1},8,["options"])])):r("",!0)]),_:1})])):r("",!0)}}});const ue=q({__name:"Topic",setup(F){const o=se(),m=_([]),g=_("hot"),i=_(!1),l=_(!1),e=_(!1);H(l,()=>{l.value||(window.$message.success("保存成功"),o.commit("refreshTopicFollow"))});const t=T({get:()=>{let a="编辑";return l.value&&(a="保存"),a},set:a=>{}}),d=()=>{i.value=!0,x({type:g.value,num:50}).then(a=>{m.value=a.topics,i.value=!1}).catch(a=>{console.log(a),i.value=!1})},k=a=>{g.value=a,a=="follow"?e.value=!0:e.value=!1,d()};return B(()=>{d()}),(a,f)=>{const v=ne,p=Z,y=V,E=ee,I=_e,L=oe,N=te,S=X;return c(),u("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},j({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),w(o).state.userLogined?(c(),$(p,{key:0,name:"follow",tab:"关注"})):r("",!0)]),_:2},[w(o).state.userLogined?{name:"suffix",fn:s(()=>[n(y,{checked:l.value,"onUpdate:checked":f[0]||(f[0]=b=>l.value=b),checkable:""},{default:s(()=>[C(h(t.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:s(()=>[n(L,null,{default:s(()=>[(c(!0),u(P,null,Y(m.value,b=>(c(),$(I,{tag:b,showAction:w(o).state.userLogined&&l.value,checkFollowing:e.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=z(ue,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; diff --git a/web/dist/assets/Topic-45ef2f4a.js b/web/dist/assets/Topic-45ef2f4a.js deleted file mode 100644 index ab47f383..00000000 --- a/web/dist/assets/Topic-45ef2f4a.js +++ /dev/null @@ -1 +0,0 @@ -import{x as $,y as z,z as I,A as j,_ as E}from"./index-26a2b065.js";import{v as U}from"./@vicons-0524c43e.js";import{d as F,r as i,n as A,j as q,a3 as x,o as c,c as _,V as n,a1 as s,Q as b,e as V,M as f,O as u,_ as h,w as D,a7 as Q,F as G,a4 as H}from"./@vue-e0e89260.js";import{o as J,M as B,j as K,e as P,O as R,L as W,F as X,f as Y,g as Z,a as ee,k as oe}from"./naive-ui-e703c4e6.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{u as ne}from"./vuex-473b3783.js";import"./vue-router-b8e3382f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=A(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":z({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return q(()=>{r.value=!1}),(e,o)=>{const w=x("router-link"),g=J,k=B,a=K,d=P,v=R,p=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[V(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(U))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,j({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return q(()=>{g()}),(a,d)=>{const v=te,p=Y,C=B,L=Z,M=ie,N=ee,O=oe,S=X;return c(),_("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(L,{type:"line",animated:"","onUpdate:value":k},Q({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(C,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[V(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(O,{show:l.value},{default:s(()=>[n(N,null,{default:s(()=>[(c(!0),_(G,null,H(r.value,y=>(c(),b(M,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Me=E(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Me as default}; diff --git a/web/dist/assets/User-0168cc80.css b/web/dist/assets/User-0168cc80.css new file mode 100644 index 00000000..d3b85144 --- /dev/null +++ b/web/dist/assets/User-0168cc80.css @@ -0,0 +1 @@ +.profile-tabs-wrap[data-v-76a940db]{padding:0 16px}.profile-baseinfo[data-v-76a940db]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-76a940db]{width:72px}.profile-baseinfo .base-info[data-v-76a940db]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-76a940db]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-76a940db]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-76a940db]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-76a940db]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-76a940db]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-76a940db]{margin:20px}.load-more .load-more-wrap[data-v-76a940db]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-76a940db]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-76a940db],.dark .pagination-wrap[data-v-76a940db]{background-color:#101014bf} diff --git a/web/dist/assets/User-3ea93752.js b/web/dist/assets/User-3ea93752.js new file mode 100644 index 00000000..67e6890f --- /dev/null +++ b/web/dist/assets/User-3ea93752.js @@ -0,0 +1 @@ +import{_ as He,a as Re}from"./post-item.vue_vue_type_style_index_0_lang-bce56e3e.js";import{_ as Ve}from"./post-skeleton-df8e8b0e.js";import{_ as je}from"./whisper-473502c7.js";import{_ as Ee}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{d as Ge,H as i,R as Je,c as Ke,b as Qe,E as Ye,r as Xe,f as u,k as o,w as c,q as g,Y as m,e as s,j as w,x as I,bf as r,A as D,y as me,F,u as T,h as fe}from"./@vue-a481fc63.js";import{u as Ze}from"./vuex-44de225f.js";import{b as ea}from"./vue-router-e5a2430e.js";import{L as aa,K as sa,e as H,h as ta,u as pe,f as he,M as la,_ as na}from"./index-3489d7cc.js";import{W as oa}from"./whisper-add-friend-9521d988.js";import{p as ce}from"./count-e2caa1c1.js";import{W as ua}from"./v3-infinite-loading-2c58ec2f.js";import{k as ia,r as ra,G as ge,s as ca,t as va,J as _a,R as da}from"./@vicons-f0266f88.js";import{F as ma,G as fa,a as pa,j as we,o as ha,M as ga,e as wa,P as ka,k as ya,f as ba,g as Pa,J as Oa,H as Fa}from"./naive-ui-eecf2ec3.js";import"./content-23ae3d74.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ta={key:0,class:"profile-baseinfo"},Ia={class:"avatar"},xa={class:"base-info"},Aa={class:"username"},$a={class:"userinfo"},za={class:"info-item"},Ua={class:"info-item"},qa={class:"userinfo"},Ma={class:"info-item"},Ca={class:"info-item"},Sa={class:"info-item"},Wa={key:0,class:"user-opts"},La={key:0,class:"skeleton-wrap"},Na={key:1},Ba={key:0,class:"empty-wrap"},Da={key:1},Ha={key:0},Ra={key:1},Va={key:2},ja={key:3},Ea={key:4},Ga={key:2},Ja={key:0},Ka={key:1},Qa={key:2},Ya={key:3},Xa={key:4},Za={class:"load-more-wrap"},es={class:"load-more-spinner"},as=Ge({__name:"User",setup(ss){const R=ma(),v=Ze(),$=ea(),f=i(!1),y=i(!1),a=Je({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,tweets_count:0,status:1}),h=i(!1),V=i(!1),G=i(!1),l=i([]),z=i([]),U=i([]),q=i([]),M=i([]),C=i([]),x=i($.query.s||""),n=i(+$.query.p||1),p=i("post"),J=i(+$.query.p||1),K=i(1),Q=i(1),Y=i(1),X=i(1),k=i(20),d=i(0),Z=i(0),ee=i(0),ae=i(0),se=i(0),te=i(0),b=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,V.value=!0},P=e=>{R.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?pe({user_id:e.user.id}).then(_=>{window.$message.success("操作成功"),ve(e.user_id,!1)}).catch(_=>{}):he({user_id:e.user.id}).then(_=>{window.$message.success("关注成功"),ve(e.user_id,!0)}).catch(_=>{})}})};function ve(e,_){S(z,e,_),S(U,e,_),S(q,e,_),S(M,e,_),S(C,e,_)}function S(e,_,ie){if(e.value&&e.value.length>0)for(let E in e.value)e.value[E].user_id==_&&(e.value[E].user.is_following=ie)}const ke=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],q.value=[],M.value=[],C.value=[],p.value="post",n.value=1,J.value=1,K.value=1,Q.value=1,Y.value=1,X.value=1,d.value=0,Z.value=0,ee.value=0,ae.value=0,se.value=0,te.value=0},ye=()=>{switch(p.value){case"post":j();break;case"comment":le();break;case"highlight":ne();break;case"media":oe();break;case"star":ue();break}},j=()=>{f.value=!0,H({username:x.value,style:"post",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Z.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,H({username:x.value,style:"comment",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,ee.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ne=()=>{f.value=!0,H({username:x.value,style:"highlight",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,ae.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},oe=()=>{f.value=!0,H({username:x.value,style:"media",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,se.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ue=()=>{f.value=!0,H({username:x.value,style:"star",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),C.value=l.value,te.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},be=e=>{switch(p.value=e,p.value){case"post":l.value=z.value,n.value=J.value,d.value=Z.value,j();break;case"comment":l.value=U.value,n.value=K.value,d.value=ee.value,le();break;case"highlight":l.value=q.value,n.value=Q.value,d.value=ae.value,ne();break;case"media":l.value=M.value,n.value=Y.value,d.value=se.value,oe();break;case"star":l.value=C.value,n.value=X.value,d.value=te.value,ue();break}},W=()=>{h.value=!0,aa({username:x.value}).then(e=>{h.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,e.tweets_count&&(a.tweets_count=e.tweets_count),ye()}).catch(e=>{h.value=!1,console.log(e)})},Pe=()=>{switch(p.value){case"post":J.value=n.value,j();break;case"comment":K.value=n.value,le();break;case"highlight":Q.value=n.value,ne();break;case"media":Y.value=n.value,oe();break;case"star":X.value=n.value,ue();break}},Oe=()=>{V.value=!0},Fe=()=>{G.value=!0},Te=()=>{V.value=!1},Ie=()=>{G.value=!1},A=e=>()=>fe(we,null,{default:()=>fe(e)}),xe=Ke(()=>{let e=[{label:"私信",key:"whisper",icon:A(ra)}];return v.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:A(ge)}):e.push({label:"解封",key:"deblocking",icon:A(ge)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:A(ca)}):e.push({label:"关注",key:"follow",icon:A(va)}),v.state.profile.useFriendship&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:A(_a)}):e.push({label:"添加朋友",key:"requesting",icon:A(da)})),e}),Ae=e=>{switch(e){case"whisper":Oe();break;case"delete":$e();break;case"requesting":Fe();break;case"follow":case"unfollow":ze();break;case"banned":case"deblocking":Ue();break}},$e=()=>{R.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,ta({user_id:a.id}).then(e=>{h.value=!1,a.is_friend=!1,j()}).catch(e=>{h.value=!1,console.log(e)})}})},ze=()=>{R.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,a.is_following?pe({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)}):he({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},Ue=()=>{R.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,la({id:a.id,status:a.status===1?2:1}).then(e=>{h.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},qe=()=>{n.value{W()}),Ye(()=>({path:$.path,query:$.query}),(e,_)=>{_.path==="/u"&&e.path==="/u"&&(x.value=$.query.s||"",ke(),W())}),(e,_)=>{const ie=Ee,E=ha,re=ga,_e=Xe("router-link"),Me=wa,Ce=ka,Se=je,de=ya,L=ba,We=Pa,Le=Ve,Ne=Oa,N=He,O=Fa,B=Re,Be=fa,De=pa;return s(),u("div",null,[o(ie,{title:"用户详情"}),o(Be,{class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[o(de,{show:h.value},{default:c(()=>[a.id>0?(s(),u("div",Ta,[w("div",Ia,[o(E,{size:72,src:a.avatar},null,8,["src"])]),w("div",xa,[w("div",Aa,[w("strong",null,I(a.nickname),1),w("span",null," @"+I(a.username),1),r(v).state.profile.useFriendship&&r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username&&a.is_friend?(s(),g(re,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:c(()=>[D(" 好友 ")]),_:1})):m("",!0),r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username&&a.is_following?(s(),g(re,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:c(()=>[D(" 已关注 ")]),_:1})):m("",!0),a.is_admin?(s(),g(re,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:c(()=>[D(" 管理员 ")]),_:1})):m("",!0)]),w("div",$a,[w("span",za,"UID. "+I(a.id),1),w("span",Ua,I(r(sa)(a.created_on))+" 加入",1)]),w("div",qa,[w("span",Ma,[o(_e,{onClick:_[0]||(_[0]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:c(()=>[D(" 关注  "+I(r(ce)(a.follows)),1)]),_:1},8,["to"])]),w("span",Ca,[o(_e,{onClick:_[1]||(_[1]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:c(()=>[D(" 粉丝  "+I(r(ce)(a.followings)),1)]),_:1},8,["to"])]),w("span",Sa," 泡泡  "+I(r(ce)(a.tweets_count||0)),1)])]),r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username?(s(),u("div",Wa,[o(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:xe.value,onSelect:Ae},{default:c(()=>[o(Me,{quaternary:"",circle:""},{icon:c(()=>[o(r(we),null,{default:c(()=>[o(r(ia))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)])):m("",!0),o(Se,{show:V.value,user:a,onSuccess:Te},null,8,["show","user"]),o(oa,{show:G.value,user:a,onSuccess:Ie},null,8,["show","user"])]),_:1},8,["show"]),o(We,{class:"profile-tabs-wrap",type:"line",animated:"",value:p.value,"onUpdate:value":be},{default:c(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),f.value&&l.value.length===0?(s(),u("div",La,[o(Le,{num:k.value},null,8,["num"])])):(s(),u("div",Na,[l.value.length===0?(s(),u("div",Ba,[o(Ne,{size:"large",description:"暂无数据"})])):m("",!0),r(v).state.desktopModelShow?(s(),u("div",Da,[p.value==="post"?(s(),u("div",Ha,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(N,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Ra,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(N,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Va,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(N,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",ja,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(N,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",Ea,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(N,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(s(),u("div",Ga,[p.value==="post"?(s(),u("div",Ja,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(B,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Ka,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(B,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Qa,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(B,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",Ya,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(B,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",Xa,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:c(()=>[o(B,{post:t,isOwner:r(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))]))]),_:1}),d.value>0?(s(),g(De,{key:0,justify:"center"},{default:c(()=>[o(r(ua),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:_[2]||(_[2]=t=>qe())},{spinner:c(()=>[w("div",Za,[y.value?m("",!0):(s(),g(de,{key:0,size:14})),w("span",es,I(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Ws=na(as,[["__scopeId","data-v-76a940db"]]);export{Ws as default}; diff --git a/web/dist/assets/User-5fd22f4b.js b/web/dist/assets/User-5fd22f4b.js deleted file mode 100644 index 0efc5bea..00000000 --- a/web/dist/assets/User-5fd22f4b.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as He,a as je}from"./post-item.vue_vue_type_style_index_0_lang-18e150bb.js";import{_ as Ee}from"./post-skeleton-f095ca4e.js";import{C as Ge,_ as se,D as Je,E as Qe,B,F as Ke,G as Xe,H as Ye,I as Ze}from"./index-26a2b065.js";import{R as pe,J as de,S as me,b as fe,e as ae,i as he,T as es,F as ss,a as as,j as ue,o as ts,M as ls,O as os,k as ns,f as us,g as is,H as cs,G as rs}from"./naive-ui-e703c4e6.js";import{d as te,r as o,o as r,Q as y,a1 as i,a as _,V as l,e as g,M as h,E as _s,n as vs,j as ps,w as ds,a3 as ms,c as w,O as P,_ as f,a2 as ie,F as ce,a4 as re,s as _e}from"./@vue-e0e89260.js";import{_ as fs}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{u as hs}from"./vuex-473b3783.js";import{b as gs}from"./vue-router-b8e3382f.js";import{b as ws}from"./formatTime-4210fcd1.js";import{W as ks}from"./v3-infinite-loading-e5c2e8bf.js";import{i as ys,w as bs,x as ve,y as Ps,z as $s,D as xs,G as Ts}from"./@vicons-0524c43e.js";import"./content-772a5dad.js";import"./paopao-video-player-aa5e8b3f.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const zs={class:"whisper-wrap"},Us={class:"whisper-line"},Is={class:"whisper-line send-wrap"},Ms=te({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(D,{emit:$}){const d=D,v=o(""),u=o(!1),p=()=>{$("success")},s=()=>{u.value=!0,Ge({user_id:d.user.id,content:v.value}).then(n=>{window.$message.success("发送成功"),u.value=!1,v.value="",p()}).catch(n=>{u.value=!1})};return(n,k)=>{const x=pe,a=de,T=me,z=fe,U=ae,I=he;return r(),y(I,{show:n.show,"onUpdate:show":p,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:i(()=>[_("div",zs,[l(T,{"show-icon":!1},{default:i(()=>[g(" 即将发送私信给: "),l(a,{style:{"max-width":"100%"}},{default:i(()=>[l(x,{type:"success"},{default:i(()=>[g(h(n.user.nickname)+"@"+h(n.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Us,[l(z,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:v.value,"onUpdate:value":k[0]||(k[0]=M=>v.value=M),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Is,[l(U,{strong:"",secondary:"",type:"primary",loading:u.value,onClick:s},{default:i(()=>[g(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Cs=se(Ms,[["__scopeId","data-v-0cbfe47c"]]),Fs={class:"whisper-wrap"},qs={class:"whisper-line"},Ss={class:"whisper-line send-wrap"},Ws=te({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(D,{emit:$}){const d=D,v=o(""),u=o(!1),p=()=>{$("success")},s=()=>{u.value=!0,Je({user_id:d.user.id,greetings:v.value}).then(n=>{window.$message.success("发送成功"),u.value=!1,v.value="",p()}).catch(n=>{u.value=!1})};return(n,k)=>{const x=pe,a=de,T=me,z=fe,U=ae,I=he;return r(),y(I,{show:n.show,"onUpdate:show":p,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:i(()=>[_("div",Fs,[l(T,{"show-icon":!1},{default:i(()=>[g(" 发送添加朋友申请给: "),l(a,{style:{"max-width":"100%"}},{default:i(()=>[l(x,{type:"success"},{default:i(()=>[g(h(n.user.nickname)+"@"+h(n.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",qs,[l(z,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:v.value,"onUpdate:value":k[0]||(k[0]=M=>v.value=M),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ss,[l(U,{strong:"",secondary:"",type:"primary",loading:u.value,onClick:s},{default:i(()=>[g(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Os=se(Ws,[["__scopeId","data-v-60be56a2"]]),Bs={key:0,class:"profile-baseinfo"},Ds={class:"avatar"},Ls={class:"base-info"},Rs={class:"username"},As={class:"userinfo"},Ns={class:"info-item"},Vs={class:"info-item"},Hs={class:"userinfo"},js={class:"info-item"},Es={class:"info-item"},Gs={key:0,class:"user-opts"},Js={key:0,class:"skeleton-wrap"},Qs={key:1},Ks={key:0,class:"empty-wrap"},Xs={key:1},Ys={key:2},Zs={class:"load-more-wrap"},ea={class:"load-more-spinner"},sa=te({__name:"User",setup(D){const $=es(),d=hs(),v=gs(),u=o(!1),p=o(!1),s=_s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),n=o(!1),k=o(!1),x=o(!1),a=o([]),T=o([]),z=o([]),U=o([]),I=o([]),M=o([]),C=o(v.query.s||""),t=o(+v.query.p||1),q=o("post"),R=o(+v.query.p||1),A=o(1),N=o(1),V=o(1),H=o(1),m=o(20),c=o(0),j=o(0),E=o(0),G=o(0),J=o(0),Q=o(0),ge=()=>{p.value=!1,a.value=[],T.value=[],z.value=[],U.value=[],I.value=[],M.value=[],q.value="post",t.value=1,R.value=1,A.value=1,N.value=1,V.value=1,H.value=1,c.value=0,j.value=0,E.value=0,G.value=0,J.value=0,Q.value=0},we=()=>{switch(q.value){case"post":L();break;case"comment":K();break;case"highlight":X();break;case"media":Y();break;case"star":Z();break}},L=()=>{u.value=!0,B({username:C.value,style:"post",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),T.value=a.value,j.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},K=()=>{u.value=!0,B({username:C.value,style:"comment",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),z.value=a.value,E.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},X=()=>{u.value=!0,B({username:C.value,style:"highlight",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),U.value=a.value,G.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},Y=()=>{u.value=!0,B({username:C.value,style:"media",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),I.value=a.value,J.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},Z=()=>{u.value=!0,B({username:C.value,style:"star",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),M.value=a.value,Q.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},ke=e=>{switch(q.value=e,q.value){case"post":a.value=T.value,t.value=R.value,c.value=j.value,L();break;case"comment":a.value=z.value,t.value=A.value,c.value=E.value,K();break;case"highlight":a.value=U.value,t.value=N.value,c.value=G.value,X();break;case"media":a.value=I.value,t.value=V.value,c.value=J.value,Y();break;case"star":a.value=M.value,t.value=H.value,c.value=Q.value,Z();break}},W=()=>{n.value=!0,Qe({username:C.value}).then(e=>{n.value=!1,s.id=e.id,s.avatar=e.avatar,s.username=e.username,s.nickname=e.nickname,s.is_admin=e.is_admin,s.is_friend=e.is_friend,s.created_on=e.created_on,s.is_following=e.is_following,s.follows=e.follows,s.followings=e.followings,s.status=e.status,we()}).catch(e=>{n.value=!1,console.log(e)})},ye=()=>{switch(q.value){case"post":R.value=t.value,L();break;case"comment":A.value=t.value,K();break;case"highlight":N.value=t.value,X();break;case"media":V.value=t.value,Y();break;case"star":H.value=t.value,Z();break}},be=()=>{k.value=!0},Pe=()=>{x.value=!0},$e=()=>{k.value=!1},xe=()=>{x.value=!1},F=e=>()=>_e(ue,null,{default:()=>_e(e)}),Te=vs(()=>{let e=[{label:"私信",key:"whisper",icon:F(bs)}];return d.state.userInfo.is_admin&&(s.status===1?e.push({label:"禁言",key:"banned",icon:F(ve)}):e.push({label:"解封",key:"deblocking",icon:F(ve)})),s.is_following?e.push({label:"取消关注",key:"unfollow",icon:F(Ps)}):e.push({label:"关注",key:"follow",icon:F($s)}),s.is_friend?e.push({label:"删除好友",key:"delete",icon:F(xs)}):e.push({label:"添加朋友",key:"requesting",icon:F(Ts)}),e}),ze=e=>{switch(e){case"whisper":be();break;case"delete":Ue();break;case"requesting":Pe();break;case"follow":case"unfollow":Ie();break;case"banned":case"deblocking":Me();break}},Ue=()=>{$.warning({title:"删除好友",content:"将好友 “"+s.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,Ke({user_id:s.id}).then(e=>{n.value=!1,s.is_friend=!1,L()}).catch(e=>{n.value=!1,console.log(e)})}})},Ie=()=>{$.success({title:"提示",content:"确定"+(s.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,s.is_following?Xe({user_id:s.id}).then(e=>{n.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{n.value=!1,console.log(e)}):Ye({user_id:s.id}).then(e=>{n.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{n.value=!1,console.log(e)})}})},Me=()=>{$.warning({title:"警告",content:"确定对该用户进行"+(s.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,Ze({id:s.id,status:s.status===1?2:1}).then(e=>{n.value=!1,s.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{n.value=!1,console.log(e)})}})},Ce=()=>{t.value{W()}),ds(()=>({path:v.path,query:v.query}),(e,b)=>{b.path==="/u"&&e.path==="/u"&&(C.value=v.query.s||"",ge(),W())}),(e,b)=>{const Fe=fs,qe=ts,ee=ls,le=ms("router-link"),Se=ae,We=os,Oe=Cs,oe=ns,O=us,Be=is,De=Ee,Le=cs,Re=He,ne=rs,Ae=je,Ne=ss,Ve=as;return r(),w("div",null,[l(Fe,{title:"用户详情"}),l(Ne,{class:"main-content-wrap profile-wrap",bordered:""},{default:i(()=>[l(oe,{show:n.value},{default:i(()=>[s.id>0?(r(),w("div",Bs,[_("div",Ds,[l(qe,{size:72,src:s.avatar},null,8,["src"])]),_("div",Ls,[_("div",Rs,[_("strong",null,h(s.nickname),1),_("span",null," @"+h(s.username),1),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username&&s.is_friend?(r(),y(ee,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:i(()=>[g(" 好友 ")]),_:1})):P("",!0),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username&&s.is_following?(r(),y(ee,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:i(()=>[g(" 已关注 ")]),_:1})):P("",!0),s.is_admin?(r(),y(ee,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:i(()=>[g(" 管理员 ")]),_:1})):P("",!0)]),_("div",As,[_("span",Ns,"UID. "+h(s.id),1),_("span",Vs,h(f(ws)(s.created_on))+" 加入",1)]),_("div",Hs,[_("span",js,[l(le,{onClick:b[0]||(b[0]=ie(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:s.username,n:s.nickname,t:"follows"}}},{default:i(()=>[g(" 关注  "+h(s.follows),1)]),_:1},8,["to"])]),_("span",Es,[l(le,{onClick:b[1]||(b[1]=ie(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:s.username,n:s.nickname,t:"followings"}}},{default:i(()=>[g(" 粉丝  "+h(s.followings),1)]),_:1},8,["to"])])])]),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username?(r(),w("div",Gs,[l(We,{placement:"bottom-end",trigger:"click",size:"small",options:Te.value,onSelect:ze},{default:i(()=>[l(Se,{quaternary:"",circle:""},{icon:i(()=>[l(f(ue),null,{default:i(()=>[l(f(ys))]),_:1})]),_:1})]),_:1},8,["options"])])):P("",!0)])):P("",!0),l(Oe,{show:k.value,user:s,onSuccess:$e},null,8,["show","user"]),l(Os,{show:x.value,user:s,onSuccess:xe},null,8,["show","user"])]),_:1},8,["show"]),l(Be,{class:"profile-tabs-wrap",type:"line",animated:"",value:q.value,"onUpdate:value":ke},{default:i(()=>[l(O,{name:"post",tab:"泡泡"}),l(O,{name:"comment",tab:"评论"}),l(O,{name:"highlight",tab:"亮点"}),l(O,{name:"media",tab:"图文"}),l(O,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),u.value?(r(),w("div",Js,[l(De,{num:m.value},null,8,["num"])])):(r(),w("div",Qs,[a.value.length===0?(r(),w("div",Ks,[l(Le,{size:"large",description:"暂无数据"})])):P("",!0),f(d).state.desktopModelShow?(r(),w("div",Xs,[(r(!0),w(ce,null,re(a.value,S=>(r(),y(ne,{key:S.id},{default:i(()=>[l(Re,{post:S},null,8,["post"])]),_:2},1024))),128))])):(r(),w("div",Ys,[(r(!0),w(ce,null,re(a.value,S=>(r(),y(ne,{key:S.id},{default:i(()=>[l(Ae,{post:S},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),c.value>0?(r(),y(Ve,{key:0,justify:"center"},{default:i(()=>[l(f(ks),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:b[2]||(b[2]=S=>Ce())},{spinner:i(()=>[_("div",Zs,[p.value?P("",!0):(r(),y(oe,{key:0,size:14})),_("span",ea,h(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):P("",!0)])}}});const qa=se(sa,[["__scopeId","data-v-b2aa6b82"]]);export{qa as default}; diff --git a/web/dist/assets/User-9c44d196.css b/web/dist/assets/User-9c44d196.css deleted file mode 100644 index c0c74c66..00000000 --- a/web/dist/assets/User-9c44d196.css +++ /dev/null @@ -1 +0,0 @@ -.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf}.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-b2aa6b82]{padding:0 16px}.profile-baseinfo[data-v-b2aa6b82]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-b2aa6b82]{width:72px}.profile-baseinfo .base-info[data-v-b2aa6b82]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-b2aa6b82]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-b2aa6b82]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-b2aa6b82]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-b2aa6b82]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-b2aa6b82]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-b2aa6b82]{margin:20px}.load-more .load-more-wrap[data-v-b2aa6b82]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-b2aa6b82]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-b2aa6b82],.dark .pagination-wrap[data-v-b2aa6b82]{background-color:#101014bf} diff --git a/web/dist/assets/Wallet-53d5090b.js b/web/dist/assets/Wallet-53d5090b.js new file mode 100644 index 00000000..27c9a375 --- /dev/null +++ b/web/dist/assets/Wallet-53d5090b.js @@ -0,0 +1 @@ +import{_ as K}from"./post-skeleton-df8e8b0e.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js";import{d as Z,H as c,b as X,f as _,k as e,w as o,e as n,bf as y,Y as w,j as a,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ae,$ as ne,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{a0 as _e,a1 as re,a2 as ue,a3 as pe,J as de,_ as me}from"./index-3489d7cc.js";import{a1 as ge}from"./@vicons-f0266f88.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-eecf2ec3.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const B=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Be={key:1},Oe={key:0,class:"empty-wrap"},Pe={class:"bill-line"},Te={key:0,class:"amount-options"},We={key:1,style:{"margin-top":"10px"}},De={class:"qrcode-wrap"},Ee=B(()=>a("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Z({__name:"Wallet",setup(m){const i=le(),O=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+O.query.p||1),C=c(20),S=c(0),P=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},T=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},W=()=>{g.value=!0},D=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},E=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=Q,d=fe,F=ye,f=we,$=ke,L=be,U=K,V=xe,M=Re,j=ve,H=Ce,J=Se,Y=Ie,G=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":T,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",$e,[e(F,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:W},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:E},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(n(),_("div",Be,[b.value.length===0?(n(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(q,null,z(b.value,t=>(n(),N(M,{key:t.id},{default:o(()=>[a("div",Pe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(n(!0),_(q,null,z(P.value,t=>(n(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",De,[Ee,a("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Le,[e(J,{value:100,type:"info",dot:"",processing:""}),Ue])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const ft=me(Ve,[["__scopeId","data-v-870bd246"]]);export{ft as default}; diff --git a/web/dist/assets/Wallet-c436bcd7.js b/web/dist/assets/Wallet-c436bcd7.js deleted file mode 100644 index 8056f003..00000000 --- a/web/dist/assets/Wallet-c436bcd7.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as X}from"./post-skeleton-f095ca4e.js";import{_ as Y}from"./main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js";import{d as Z,r as c,j as J,c as _,V as e,a1 as o,o as n,_ as y,O as w,a,e as k,F as N,a4 as W,z as ee,v as te,M as r,Q as $,L as oe,a2 as ae,W as ne,X as se}from"./@vue-e0e89260.js";import{u as le}from"./vuex-473b3783.js";import{b as ce}from"./vue-router-b8e3382f.js";import{b as ie}from"./qrcode-9719fc56.js";import{T as _e,U as re,V as ue,W as pe,_ as de}from"./index-26a2b065.js";import{a as me}from"./formatTime-4210fcd1.js";import{U as ge}from"./@vicons-0524c43e.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,H as xe,j as Ce,l as Se,h as Ie,G as Re}from"./naive-ui-e703c4e6.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const q=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},We={key:0,class:"pagination-wrap"},$e={key:0,class:"skeleton-wrap"},qe={key:1},Te={key:0,class:"empty-wrap"},Ue={class:"bill-line"},Ve={key:0,class:"amount-options"},Be={key:1,style:{"margin-top":"10px"}},Fe={class:"qrcode-wrap"},Le=q(()=>a("canvas",{id:"qrcode-container"},null,-1)),Oe={class:"pay-tips"},Pe={class:"pay-sub-tips"},Ee=q(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=Z({__name:"Wallet",setup(m){const i=le(),T=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+T.query.p||1),C=c(20),S=c(0),U=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},V=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},B=()=>{g.value=!0},F=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},L=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{A()}),(s,l)=>{const I=Y,d=fe,O=ye,f=we,z=ke,P=be,E=X,M=xe,D=Re,Q=ve,j=Ce,G=Se,H=Ie,K=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(Q,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",We,[e(P,{page:x.value,"onUpdate:page":V,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(O,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",Ne,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:B},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:L},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",$e,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",qe,[b.value.length===0?(n(),_("div",Te,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(N,null,W(b.value,t=>(n(),$(D,{key:t.id},{default:o(()=>[a("div",Ue,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(me)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(K,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(H,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Ve,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_(N,null,W(U.value,t=>(n(),$(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(De=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Be,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:F},{icon:o(()=>[e(j,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Fe,[Le,a("div",Oe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Pe,[e(G,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=de(Me,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/content-23ae3d74.js b/web/dist/assets/content-23ae3d74.js new file mode 100644 index 00000000..c86c7528 --- /dev/null +++ b/web/dist/assets/content-23ae3d74.js @@ -0,0 +1 @@ +import{d as b,e,f as l,F as i,u as k,k as o,w as s,bf as c,j as C,y,x as I,q as g,Y as m,H as j,A as D,h as E}from"./@vue-a481fc63.js";import{$ as N,a0 as U}from"./@vicons-f0266f88.js";import{j as $,V as A,W as V,m as R,X as F,e as L,i as P}from"./naive-ui-eecf2ec3.js";import{_ as B,V as T,W as M}from"./index-3489d7cc.js";import{e as O}from"./paopao-video-player-2fe58954.js";const W={class:"link-wrap"},Z={class:"link-txt-wrap"},q=["href"],z={class:"link-txt"},H=b({__name:"post-link",props:{links:{default:()=>[]}},setup(d){const r=d;return(a,p)=>{const x=$;return e(),l("div",W,[(e(!0),l(i,null,k(r.links,n=>(e(),l("div",{class:"link-item",key:n.id},[o(x,{class:"hash-link"},{default:s(()=>[o(c(N))]),_:1}),C("div",Z,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:p[0]||(p[0]=y(()=>{},["stop"]))},[C("span",z,I(n.content),1)],8,q)])]))),128))])}}});const st=B(H,[["__scopeId","data-v-36eef76b"]]),X={key:0},ot=b({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(d){const r=d;return(a,p)=>{const x=A,n=V;return r.videos.length>0?(e(),l("div",X,[o(n,{"x-gap":4,"y-gap":4,cols:a.full?1:5},{default:s(()=>[o(x,{span:a.full?1:3},{default:s(()=>[(e(!0),l(i,null,k(r.videos,u=>(e(),g(c(O),{onClick:p[0]||(p[0]=y(()=>{},["stop"])),key:u.id,src:u.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):m("",!0)}}}),Y={class:"images-wrap"},rt=b({__name:"post-image",props:{imgs:{default:()=>[]}},setup(d){const r=d,a="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",p="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const u=R,f=A,v=V,w=F;return e(),l("div",Y,[[1].includes(r.imgs.length)?(e(),g(w,{key:0},{default:s(()=>[o(v,{"x-gap":4,"y-gap":4,cols:2},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,t=>(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[0]||(n[0]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[2,3].includes(r.imgs.length)?(e(),g(w,{key:1},{default:s(()=>[o(v,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,t=>(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[1]||(n[1]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[4].includes(r.imgs.length)?(e(),g(w,{key:2},{default:s(()=>[o(v,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,t=>(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[2]||(n[2]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[5].includes(r.imgs.length)?(e(),g(w,{key:3},{default:s(()=>[o(v,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,{key:t.id},[_<3?(e(),g(f,{key:0},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[3]||(n[3]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),o(v,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,{key:t.id},[_>=3?(e(),g(f,{key:0},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[4]||(n[4]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),[6].includes(r.imgs.length)?(e(),g(w,{key:4},{default:s(()=>[o(v,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,{key:t.id},[_<3?(e(),g(f,{key:0},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[5]||(n[5]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),o(v,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,{key:t.id},[_>=3?(e(),g(f,{key:0},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[6]||(n[6]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),r.imgs.length===7?(e(),g(w,{key:5},{default:s(()=>[o(v,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,null,[_<4?(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[7]||(n[7]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),o(v,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,null,[_>=4?(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[8]||(n[8]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),r.imgs.length===8?(e(),g(w,{key:6},{default:s(()=>[o(v,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,null,[_<4?(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[9]||(n[9]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),o(v,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,null,[_>=4?(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[10]||(n[10]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),r.imgs.length===9?(e(),g(w,{key:7},{default:s(()=>[o(v,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,null,[_<3?(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[11]||(n[11]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),o(v,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,null,[_>=3&&_<6?(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[12]||(n[12]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),o(v,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(r.imgs,(t,_)=>(e(),l(i,null,[_>=6?(e(),g(f,{key:t.id},{default:s(()=>[o(u,{onError:()=>t.content=c(a),onClick:n[13]||(n[13]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0)])}}});const G={class:"attachment-wrap"},J=b({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(d){const r=d,a=j(!1),p=j(""),x=j(0),n=f=>{a.value=!0,x.value=f.id,p.value="这是一个免费附件,您可以直接下载?",f.type===8&&(p.value=()=>E("div",{},[E("p",{},"这是一个收费附件,下载将收取"+(r.price/100).toFixed(2)+"元")]),T({id:x.value}).then(v=>{v.paid&&(p.value=()=>E("div",{},[E("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(v=>{a.value=!1}))},u=()=>{M({id:x.value}).then(f=>{window.open(f.signed_url.replace("http://","https://"),"_blank")}).catch(f=>{console.log(f)})};return(f,v)=>{const w=$,t=L,_=P;return e(),l("div",G,[(e(!0),l(i,null,k(f.attachments,h=>(e(),l("div",{class:"attach-item",key:h.id},[o(t,{onClick:y(K=>n(h),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:s(()=>[o(w,null,{default:s(()=>[o(c(U))]),_:1})]),default:s(()=>[D(" "+I(h.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),o(_,{show:a.value,"onUpdate:show":v[0]||(v[0]=h=>a.value=h),"mask-closable":!1,preset:"dialog",title:"下载提示",content:p.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:u},null,8,["show","content"])])}}});const lt=B(J,[["__scopeId","data-v-22563084"]]),at=d=>{const r=[],a=[];var p=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return d=d.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(p,n=>(r.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(a.push(n.substr(1).trim()),''+n.trim()+" ")),{content:d,tags:r,users:a}},ct=(d,r,a)=>{let p=!1;if(d.length>a){d=d.substring(0,a),p=!0;let u=d.charAt(a-1);(u=="#"||u=="#"||u=="@")&&(d=d.substring(0,a-1))}const x=/(#|#)([^#@\s])+?\s+?/g,n=/@([a-zA-Z0-9])+?\s+?/g;return d=d.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(x,u=>''+u.trim()+" ").replace(n,u=>''+u.trim()+" "),p&&(d=d.trimEnd()+' ...'+r+" "),d};export{rt as _,lt as a,ot as b,st as c,ct as d,at as p}; diff --git a/web/dist/assets/content-772a5dad.js b/web/dist/assets/content-772a5dad.js deleted file mode 100644 index af47f4e6..00000000 --- a/web/dist/assets/content-772a5dad.js +++ /dev/null @@ -1 +0,0 @@ -import{d as h,o as e,c as r,F as a,a4 as m,V as s,a1 as o,_ as c,a as C,a2 as k,M as I,Q as d,O as g,r as j,e as D,s as b}from"./@vue-e0e89260.js";import{Q as N,R as O}from"./@vicons-0524c43e.js";import{j as $,V,W as A,m as z,X as F,e as L,i as M}from"./naive-ui-e703c4e6.js";import{_ as B,O as P,P as R}from"./index-26a2b065.js";import{e as T}from"./paopao-video-player-aa5e8b3f.js";const U={class:"link-wrap"},Q={class:"link-txt-wrap"},S=["href"],W={class:"link-txt"},X=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",U,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(N))]),_:1}),C("div",Q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",W,I(n.content),1)],8,S)])]))),128))])}}});const ot=B(X,[["__scopeId","data-v-36eef76b"]]),Z={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=V,n=A;return l.videos.length>0?(e(),r("div",Z,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(T),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),q={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=z,_=V,f=A,w=F;return e(),r("div",q,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const G={class:"attachment-wrap"},H=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),P({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{R({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=$,t=L,i=M;return e(),r("div",G,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(O))]),_:1})]),default:o(()=>[D(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(H,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; diff --git a/web/dist/assets/content-2fda112b.css b/web/dist/assets/content-a8987469.css similarity index 68% rename from web/dist/assets/content-2fda112b.css rename to web/dist/assets/content-a8987469.css index dcd03a9d..a72f4653 100644 --- a/web/dist/assets/content-2fda112b.css +++ b/web/dist/assets/content-a8987469.css @@ -1 +1 @@ -.link-wrap[data-v-36eef76b]{margin-bottom:10px;position:relative}.link-wrap .link-item[data-v-36eef76b]{height:22px;display:flex;align-items:center;position:relative}.link-wrap .link-item .link-txt-wrap[data-v-36eef76b]{left:calc(1em + 4px);width:calc(100% - 1em);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:absolute}.link-wrap .link-item .link-txt-wrap .hash-link .link-txt[data-v-36eef76b]{word-break:break-all}.images-wrap{margin-top:10px}.post-img{display:flex;margin:0;border-radius:3px;overflow:hidden;background:rgba(0,0,0,.1);border:1px solid #eee}.post-img img{width:100%;height:100%}.x1{height:168px}.x2{height:108px}.x3{height:96px}.dark .post-img{border:1px solid #333}@media screen and (max-width: 821px){.x1{height:100px}.x2{height:70px}.x3{height:50px}}.attach-item[data-v-22563084]{margin:10px 0} +.link-wrap[data-v-36eef76b]{margin-bottom:10px;position:relative}.link-wrap .link-item[data-v-36eef76b]{height:22px;display:flex;align-items:center;position:relative}.link-wrap .link-item .link-txt-wrap[data-v-36eef76b]{left:calc(1em + 4px);width:calc(100% - 1em);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:absolute}.link-wrap .link-item .link-txt-wrap .hash-link .link-txt[data-v-36eef76b]{word-break:break-all}.images-wrap{margin-top:10px}.post-img{display:flex;margin:0;border-radius:3px;overflow:hidden;background:rgba(0,0,0,.1);border:1px solid #eee}.post-img img{width:100%;height:100%}.x1{height:174px}.x2{height:112px}.x3{height:100px}.dark .post-img{border:1px solid #333}@media screen and (max-width: 821px){.x1{height:100px}.x2{height:70px}.x3{height:50px}}.attach-item[data-v-22563084]{margin:10px 0} diff --git a/web/dist/assets/copy-to-clipboard-1dd3075d.js b/web/dist/assets/copy-to-clipboard-1dd3075d.js deleted file mode 100644 index 8d75d5e9..00000000 --- a/web/dist/assets/copy-to-clipboard-1dd3075d.js +++ /dev/null @@ -1 +0,0 @@ -import{t as p}from"./toggle-selection-93f4ad84.js";var C=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function y(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var m=p,f={"text/plain":"Text","text/html":"Url",default:"Text"},g="Copy to clipboard: #{key}, Enter";function b(a){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,t)}function w(a,t){var r,d,i,n,l,e,c=!1;t||(t={}),r=t.debug||!1;try{i=m(),n=document.createRange(),l=document.getSelection(),e=document.createElement("span"),e.textContent=a,e.ariaHidden="true",e.style.all="unset",e.style.position="fixed",e.style.top=0,e.style.clip="rect(0, 0, 0, 0)",e.style.whiteSpace="pre",e.style.webkitUserSelect="text",e.style.MozUserSelect="text",e.style.msUserSelect="text",e.style.userSelect="text",e.addEventListener("copy",function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),typeof o.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var s=f[t.format]||f.default;window.clipboardData.setData(s,a)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,a);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))}),document.body.appendChild(e),n.selectNodeContents(e),l.addRange(n);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");c=!0}catch(o){r&&console.error("unable to copy using execCommand: ",o),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",a),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(s){r&&console.error("unable to copy using clipboardData: ",s),r&&console.error("falling back to prompt"),d=b("message"in t?t.message:g),window.prompt(d,a)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(n):l.removeAllRanges()),e&&document.body.removeChild(e),i()}return c}var v=w;const h=y(v);export{h as a,C as c}; diff --git a/web/dist/assets/copy-to-clipboard-4ef7d3eb.js b/web/dist/assets/copy-to-clipboard-4ef7d3eb.js new file mode 100644 index 00000000..3a6ca15f --- /dev/null +++ b/web/dist/assets/copy-to-clipboard-4ef7d3eb.js @@ -0,0 +1 @@ +import{g as f}from"./@babel-725317a4.js";import{t as m}from"./toggle-selection-93f4ad84.js";var y=m,p={"text/plain":"Text","text/html":"Url",default:"Text"},g="Copy to clipboard: #{key}, Enter";function b(r){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,t)}function w(r,t){var o,i,d,l,c,e,n=!1;t||(t={}),o=t.debug||!1;try{d=y(),l=document.createRange(),c=document.getSelection(),e=document.createElement("span"),e.textContent=r,e.ariaHidden="true",e.style.all="unset",e.style.position="fixed",e.style.top=0,e.style.clip="rect(0, 0, 0, 0)",e.style.whiteSpace="pre",e.style.webkitUserSelect="text",e.style.MozUserSelect="text",e.style.msUserSelect="text",e.style.userSelect="text",e.addEventListener("copy",function(a){if(a.stopPropagation(),t.format)if(a.preventDefault(),typeof a.clipboardData>"u"){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var s=p[t.format]||p.default;window.clipboardData.setData(s,r)}else a.clipboardData.clearData(),a.clipboardData.setData(t.format,r);t.onCopy&&(a.preventDefault(),t.onCopy(a.clipboardData))}),document.body.appendChild(e),l.selectNodeContents(e),c.addRange(l);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");n=!0}catch(a){o&&console.error("unable to copy using execCommand: ",a),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",r),t.onCopy&&t.onCopy(window.clipboardData),n=!0}catch(s){o&&console.error("unable to copy using clipboardData: ",s),o&&console.error("falling back to prompt"),i=b("message"in t?t.message:g),window.prompt(i,r)}}finally{c&&(typeof c.removeRange=="function"?c.removeRange(l):c.removeAllRanges()),e&&document.body.removeChild(e),d()}return n}var D=w;const x=f(D);export{x as c}; diff --git a/web/dist/assets/count-e2caa1c1.js b/web/dist/assets/count-e2caa1c1.js new file mode 100644 index 00000000..23de124d --- /dev/null +++ b/web/dist/assets/count-e2caa1c1.js @@ -0,0 +1 @@ +const t=e=>e>=1e3?(e/1e3).toFixed(1)+"千":e>=1e4?(e/1e4).toFixed(1)+"万":e;export{t as p}; diff --git a/web/dist/assets/cssfilter-af71ba68.js b/web/dist/assets/cssfilter-af71ba68.js new file mode 100644 index 00000000..55600e9a --- /dev/null +++ b/web/dist/assets/cssfilter-af71ba68.js @@ -0,0 +1,2 @@ +var w={exports:{}},g={};function k(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function S(e,r,t){}function L(e,r,t){}var z=/javascript\s*\:/img;function C(e,r){return z.test(r)?"":r}g.whiteList=k();g.getDefaultWhiteList=k;g.onAttr=S;g.onIgnoreAttr=L;g.safeAttrValue=C;var E={indexOf:function(e,r){var t,a;if(Array.prototype.indexOf)return e.indexOf(r);for(t=0,a=e.length;tr.unix(e).fromNow(),f=e=>{let t=r.unix(e),o=r();return t.year()!=o.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):r().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},u=e=>{let t=r.unix(e),o=r();return t.year()!=o.year()?t.utc(!0).format("YYYY-MM-DD"):r().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},n=e=>r.unix(e).utc(!0).format("YYYY年MM月");export{a,n as b,u as c,f}; diff --git a/web/dist/assets/index-26a2b065.js b/web/dist/assets/index-26a2b065.js deleted file mode 100644 index 15cad858..00000000 --- a/web/dist/assets/index-26a2b065.js +++ /dev/null @@ -1 +0,0 @@ -import{d as z,r as E,E as J,j,o as v,Q as N,a1 as a,a as k,V as s,c as A,e as S,P as K,a2 as D,O as U,_ as h,n as Q,w as H,a3 as ae,F as X,a4 as Y,M as I,s as P,a5 as he,R as Z,L as ge,a6 as fe}from"./@vue-e0e89260.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-b8e3382f.js";import{c as ke,u as B}from"./vuex-473b3783.js";import{a as be}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ue,b as ie,c as Oe,d as Te,e as ce,f as Ae,g as Ee,h as de,i as Re,j as F,k as $e,u as Ce,l as Ie,m as Se,n as Ue,o as Me,p as qe,q as Ke,r as De,s as Ne,t as xe}from"./naive-ui-e703c4e6.js";import{S as Fe,M as Ve,L as ze,C as Be,B as We,P as He,W as je,a as Qe,H as ee,b as te,c as oe}from"./@vicons-0524c43e.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))c(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function l(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function c(i){if(i.ep)return;i.ep=!0;const n=l(i);fetch(i.href,n)}})();const Ge="modulepreload",Je=function(e){return"/"+e},se={},T=function(t,l,c){if(!l||l.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Je(n),n in se)return;se[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!c)for(let b=i.length-1;b>=0;b--){const _=i[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":Ge,m||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),m)return new Promise((b,_)=>{g.addEventListener("load",b),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=n,window.dispatchEvent(m),!m.defaultPrevented)throw n})},Xe=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>T(()=>import("./Home-416cfd1e.js"),["assets/Home-416cfd1e.js","assets/post-item.vue_vue_type_style_index_0_lang-18e150bb.js","assets/content-772a5dad.js","assets/@vue-e0e89260.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-f095ca4e.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-e5c2e8bf.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Home-dbebb66e.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-7441e88a.js"),["assets/Post-7441e88a.js","assets/@vue-e0e89260.js","assets/vuex-473b3783.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/IEnum-a180d93e.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-772a5dad.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vue-router-b8e3382f.js","assets/post-skeleton-f095ca4e.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-e5c2e8bf.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Post-b5b6aab2.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-45ef2f4a.js"),["assets/Topic-45ef2f4a.js","assets/@vicons-0524c43e.js","assets/@vue-e0e89260.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>T(()=>import("./Anouncement-40c2492f.js"),["assets/Anouncement-40c2492f.js","assets/post-skeleton-f095ca4e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/@vue-e0e89260.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/@vicons-0524c43e.js","assets/main-nav-569a7b0c.css","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>T(()=>import("./Profile-5f074a97.js"),["assets/Profile-5f074a97.js","assets/post-item.vue_vue_type_style_index_0_lang-18e150bb.js","assets/content-772a5dad.js","assets/@vue-e0e89260.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-f095ca4e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-e5c2e8bf.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Profile-0cbf435e.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-5fd22f4b.js"),["assets/User-5fd22f4b.js","assets/post-item.vue_vue_type_style_index_0_lang-18e150bb.js","assets/content-772a5dad.js","assets/@vue-e0e89260.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-f095ca4e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-e5c2e8bf.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/User-9c44d196.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-d2d903ee.js"),["assets/Messages-d2d903ee.js","assets/@vue-e0e89260.js","assets/vue-router-b8e3382f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/vuex-473b3783.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Messages-7a898af3.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-5728cb22.js"),["assets/Collection-5728cb22.js","assets/post-item.vue_vue_type_style_index_0_lang-18e150bb.js","assets/content-772a5dad.js","assets/@vue-e0e89260.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-f095ca4e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Collection-b97b3cf7.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-8c50ea43.js"),["assets/Contacts-8c50ea43.js","assets/vue-router-b8e3382f.js","assets/@vue-e0e89260.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f095ca4e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/vuex-473b3783.js","assets/@vicons-0524c43e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Contacts-baa2e9bb.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-5d4d08db.js"),["assets/Following-5d4d08db.js","assets/@vue-e0e89260.js","assets/vue-router-b8e3382f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f095ca4e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/vuex-473b3783.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Following-31b77f3b.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-c436bcd7.js"),["assets/Wallet-c436bcd7.js","assets/post-skeleton-f095ca4e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/@vue-e0e89260.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/@vicons-0524c43e.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>T(()=>import("./Setting-ec5ecd29.js"),["assets/Setting-ec5ecd29.js","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/vuex-473b3783.js","assets/@vue-e0e89260.js","assets/vue-router-b8e3382f.js","assets/vooks-a50491fd.js","assets/evtd-b614532e.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/@css-render-580d83ec.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-590de622.js"),["assets/404-590de622.js","assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js","assets/vuex-473b3783.js","assets/@vue-e0e89260.js","assets/vue-router-b8e3382f.js","assets/vooks-a50491fd.js","assets/evtd-b614532e.js","assets/@vicons-0524c43e.js","assets/naive-ui-e703c4e6.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/@css-render-580d83ec.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Xe});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Ye=ke({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0},e.userLogined=!1}},actions:{},modules:{}}),G=be.create({baseURL:"",timeout:3e4});G.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));G.interceptors.response.use(e=>{const{data:t={},code:l=0}=(e==null?void 0:e.data)||{};if(+l==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var l;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((l=t==null?void 0:t.data)==null?void 0:l.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return G(e)}const ne=e=>o({method:"post",url:"/v1/auth/login",data:e}),Ze=e=>o({method:"post",url:"/v1/auth/register",data:e}),W=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=z({__name:"auth",setup(e){const t=E("true".toLowerCase()==="true"),l=B(),c=E(!1),i=E(),n=J({username:"",password:""}),m=E(),d=J({username:"",password:"",repassword:""}),M={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=i.value)==null||u.validate(L=>{L||(c.value=!0,ne({username:n.username,password:n.password}).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("登录成功"),c.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{c.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=m.value)==null||u.validate(L=>{L||(c.value=!0,Ze({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("注册成功"),c.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{c.value=!1}))})};return j(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?W(_).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(_,u)=>{const L=Pe,p=Le,O=ue,r=ie,w=Oe,y=Te,$=ce,x=Ae,C=Ee,q=de,V=Re;return v(),N(V,{show:h(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>h(l).state.authModalShow=f),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[k("div",et,[s(q,{bordered:!1},{default:a(()=>[t.value?U("",!0):(v(),A("div",tt,[s(O,{justify:"center"},{default:a(()=>[s(p,null,{default:a(()=>[s(L,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),s(y,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(w,{label:"账户",path:"username"},{default:a(()=>[s(r,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:K(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{label:"密码",path:"password"},{default:a(()=>[s(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:K(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),N(C,{key:1,"default-value":h(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[s(x,{name:"signin",tab:"登录"},{default:a(()=>[s(y,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(w,{label:"账户",path:"username"},{default:a(()=>[s(r,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:K(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{label:"密码",path:"password"},{default:a(()=>[s(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:K(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:a(()=>[s(y,{ref_key:"registerRef",ref:m,model:d,rules:M},{default:a(()=>[s(w,{label:"用户名",path:"username"},{default:a(()=>[s(r,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(w,{label:"密码",path:"password"},{default:a(()=>[s(r,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:K(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{label:"重复密码",path:"repassword"},{default:a(()=>[s(r,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:K(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):U("",!0)]),_:1})])]),_:1},8,["show"])}}});const me=(e,t)=>{const l=e.__vccOpts||e;for(const[c,i]of t)l[c]=i;return l},st=me(ot,[["__scopeId","data-v-053dfa44"]]),Xt=e=>o({method:"get",url:"/v1/posts",params:e}),nt=e=>o({method:"get",url:"/v1/tags",params:e}),Yt=e=>o({method:"get",url:"/v1/post",params:e}),Zt=e=>o({method:"get",url:"/v1/post/star",params:e}),eo=e=>o({method:"post",url:"/v1/post/star",data:e}),to=e=>o({method:"get",url:"/v1/post/collection",params:e}),oo=e=>o({method:"post",url:"/v1/post/collection",data:e}),so=e=>o({method:"get",url:"/v1/post/comments",params:e}),no=e=>o({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>o({method:"post",url:"/v1/post",data:e}),ao=e=>o({method:"delete",url:"/v1/post",data:e}),lo=e=>o({method:"post",url:"/v1/post/lock",data:e}),uo=e=>o({method:"post",url:"/v1/post/stick",data:e}),io=e=>o({method:"post",url:"/v1/post/highlight",data:e}),co=e=>o({method:"post",url:"/v1/post/visibility",data:e}),po=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),mo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),_o=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),ho=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),go=e=>o({method:"post",url:"/v1/post/comment",data:e}),fo=e=>o({method:"delete",url:"/v1/post/comment",data:e}),vo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),wo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),yo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),ko=e=>o({method:"post",url:"/v1/topic/follow",data:e}),bo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},it={class:"copyright"},ct=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=E([]),l=E([]),c=E(!1),i=E(""),n=B(),m=le(),d="2023 paopao.info",M="Roc's Me",g="",b="泡泡(PaoPao)开源社区",_="https://www.paopao.info",u=+"6",L=+"12",p=()=>{c.value=!0,nt({type:"hot_extral",num:L,extral_num:u}).then(y=>{t.value=y.topics,l.value=y.extral_topics??[],w.value=!0,c.value=!1}).catch(y=>{c.value=!1})},O=y=>y>=1e3?(y/1e3).toFixed(1)+"k":y,r=()=>{m.push({name:"home",query:{q:i.value}})},w=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:y=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(y,$)=>{(y.refreshTopicFollow!==$.refreshTopicFollow||y.userLogined)&&p()}),j(()=>{p()}),(y,$)=>{const x=F,C=ie,q=ae("router-link"),V=$e,f=de,_e=ue;return h(n).state.collapsedRight?U("",!0):(v(),A("div",rt,[k("div",at,[s(C,{round:"",clearable:"",placeholder:"搜一搜...",value:i.value,"onUpdate:value":$[0]||($[0]=R=>i.value=R),onKeyup:K(D(r,["prevent"]),["enter"])},{prefix:a(()=>[s(x,{component:h(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),w.value?(v(),N(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(V,{show:c.value},{default:a(()=>[(v(!0),A(X,null,Y(l.value,R=>(v(),A("div",{class:"hot-tag-item",key:R.id},[s(q,{class:"hash-link",to:{name:"home",query:{q:R.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(R.tag),1)]),_:2},1032,["to"]),k("div",lt,I(O(R.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):U("",!0),s(f,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(V,{show:c.value},{default:a(()=>[(v(!0),A(X,null,Y(t.value,R=>(v(),A("div",{class:"hot-tag-item",key:R.id},[s(q,{class:"hash-link",to:{name:"home",query:{q:R.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(R.tag),1)]),_:2},1032,["to"]),k("div",ut,I(O(R.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",it,"© "+I(h(d)),1),k("div",null,[s(_e,null,{default:a(()=>[k("a",{href:h(g),target:"_blank",class:"hash-link"},I(h(M)),9,ct),k("a",{href:h(_),target:"_blank",class:"hash-link"},I(h(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-f4a84024"]]),Po=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Lo=e=>o({method:"post",url:"/v1/captcha",data:e}),Oo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),To=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),Ao=e=>o({method:"post",url:"/v1/friend/add",data:e}),Eo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Ro=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),$o=e=>o({method:"get",url:"/v1/user/follows",params:e}),Co=e=>o({method:"get",url:"/v1/user/followings",params:e}),Io=e=>o({method:"post",url:"/v1/friend/reject",data:e}),So=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Uo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Mo=e=>o({method:"post",url:"/v1/user/activate",data:e}),qo=e=>o({method:"post",url:"/v1/user/password",data:e}),Ko=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Do=e=>o({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),No=e=>o({method:"get",url:"/v1/user/messages",params:e}),xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Fo=e=>o({method:"get",url:"/v1/user/collections",params:e}),Vo=e=>o({method:"get",url:"/v1/user/profile",params:e}),zo=e=>o({method:"get",url:"/v1/user/posts",params:e}),Bo=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),Wo=e=>o({method:"post",url:"/v1/user/recharge",data:e}),Ho=e=>o({method:"get",url:"/v1/user/recharge",params:e}),jo=e=>o({method:"get",url:"/v1/suggest/users",params:e}),Qo=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),Go=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),Jo=e=>o({method:"get",url:"/v1/attachment",params:e}),Xo=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},kt={class:"username"},bt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},Tt=z({__name:"sidebar",setup(e){const t=B(),l=ye(),c=le(),i=E(!1),n=E(l.name||""),m=E(),d=E("true".toLowerCase()==="true"),M=+"5000";H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?m.value||(re().then(r=>{i.value=r.count>0}).catch(r=>{console.log(r)}),m.value=setInterval(()=>{re().then(r=>{i.value=r.count>0}).catch(r=>{console.log(r)})},M)):m.value&&clearInterval(m.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const g=Q(()=>{const r=[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}];return"false".toLowerCase()==="true"&&r.push({label:"公告",key:"anouncement",icon:()=>P(Ve),href:"/anouncement"}),r.push({label:"主页",key:"profile",icon:()=>P(ze),href:"/profile"}),r.push({label:"消息",key:"messages",icon:()=>P(Be),href:"/messages"}),r.push({label:"收藏",key:"collection",icon:()=>P(We),href:"/collection"}),r.push({label:"好友",key:"contacts",icon:()=>P(He),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&r.push({label:"钱包",key:"wallet",icon:()=>P(je),href:"/wallet"}),r.push({label:"设置",key:"setting",icon:()=>P(Qe),href:"/setting"}),t.state.userInfo.id>0?r:[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}]}),b=r=>"href"in r?P("div",{},r.label):r.label,_=r=>r.key==="messages"?P(Ie,{dot:!0,show:i.value,processing:!0},{default:()=>P(F,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(F,null,{default:r.icon}),u=(r,w={})=>{n.value=r,c.push({name:r,query:{t:new Date().getTime()}})},L=()=>{l.path==="/"&&t.commit("refresh"),u("home")},p=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},O=()=>{t.commit("userLogout"),t.commit("refresh"),L()};return window.$store=t,window.$message=Ce(),(r,w)=>{const y=Se,$=Ue,x=Me,C=ce;return v(),A("div",ht,[k("div",gt,[s(y,{class:"logo-img",width:"36",src:h(_t),"preview-disabled":!0,onClick:L},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:g.value,"render-label":b,"render-icon":_,value:n.value,"onUpdate:value":u},null,8,["options","value"]),h(t).state.userInfo.id>0?(v(),A("div",ft,[s(x,{class:"user-avatar",round:"",size:34,src:h(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,I(h(t).state.userInfo.nickname),1),s(C,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:O},{icon:a(()=>[s(h(F),null,{default:a(()=>[s(h(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(h(t).state.userInfo.username),1)]),k("div",bt,[s(C,{class:"logout",quaternary:"",circle:"",onClick:O},{icon:a(()=>[s(h(F),{size:24},{default:a(()=>[s(h(oe))]),_:1})]),_:1})])])):(v(),A("div",Pt,[d.value?U("",!0):(v(),A("div",Lt,[s(C,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=q=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),A("div",Ot,[s(C,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=q=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),s(C,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=q=>p("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):U("",!0)]))])}}});const At={"has-sider":"",class:"main-wrap",position:"static"},Et={key:0},Rt={class:"content-wrap"},$t=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?Ke:null);return(c,i)=>{const n=Tt,m=ae("router-view"),d=mt,M=st,g=De,b=Ne,_=xe,u=qe;return v(),N(u,{theme:l.value},{default:a(()=>[s(b,null,{default:a(()=>[s(g,null,{default:a(()=>{var L;return[k("div",{class:ge(["app-container",{dark:((L=l.value)==null?void 0:L.name)==="dark",mobile:!h(t).state.desktopModelShow}])},[k("div",At,[h(t).state.desktopModelShow?(v(),A("div",Et,[s(n)])):U("",!0),k("div",Rt,[s(m,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),N(he,null,[c.$route.meta.keepAlive?(v(),N(Z(p),{key:0})):U("",!0)],1024)),c.$route.meta.keepAlive?U("",!0):(v(),N(Z(p),{key:0}))]),_:1})]),s(d)]),s(M)],2)]}),_:1})]),_:1}),s(_)]),_:1},8,["theme"])}}});fe($t).use(pe).use(Ye).mount("#app");export{Uo as $,nt as A,zo as B,Oo as C,To as D,Vo as E,So as F,Ro as G,Eo as H,Xo as I,Ao as J,Io as K,xo as L,No as M,Fo as N,Go as O,Jo as P,no as Q,$o as R,Co as S,W as T,Bo as U,Wo as V,Ho as W,Po as X,Do as Y,qo as Z,me as _,Qo as a,Mo as a0,Ko as a1,Lo as a2,Tt as a3,Xt as b,ro as c,ho as d,wo as e,po as f,jo as g,mo as h,vo as i,fo as j,go as k,Zt as l,to as m,ao as n,lo as o,io as p,eo as q,oo as r,uo as s,_o as t,Yt as u,co as v,so as w,yo as x,bo as y,ko as z}; diff --git a/web/dist/assets/index-274d7c87.css b/web/dist/assets/index-274d7c87.css deleted file mode 100644 index 7776688c..00000000 --- a/web/dist/assets/index-274d7c87.css +++ /dev/null @@ -1 +0,0 @@ -.auth-wrap[data-v-053dfa44]{margin-top:-30px}.dark .auth-wrap[data-v-053dfa44]{background-color:#101014bf}.rightbar-wrap[data-v-f4a84024]{width:240px;position:fixed;left:calc(50% + var(--content-main) / 2 + 10px)}.rightbar-wrap .search-wrap[data-v-f4a84024]{margin:12px 0}.rightbar-wrap .hot-tag-item[data-v-f4a84024]{line-height:2;position:relative}.rightbar-wrap .hot-tag-item .hash-link[data-v-f4a84024]{width:calc(100% - 60px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.rightbar-wrap .hot-tag-item .post-num[data-v-f4a84024]{position:absolute;right:0;top:0;width:60px;text-align:right;line-height:2;opacity:.5}.rightbar-wrap .hottopic-wrap[data-v-f4a84024]{margin-bottom:10px}.rightbar-wrap .copyright-wrap .copyright[data-v-f4a84024]{font-size:12px;opacity:.75}.rightbar-wrap .copyright-wrap .hash-link[data-v-f4a84024]{font-size:12px}.dark .hottopic-wrap[data-v-f4a84024],.dark .copyright-wrap[data-v-f4a84024]{background-color:#18181c}.sidebar-wrap{z-index:99;width:200px;height:100vh;position:fixed;right:calc(50% + var(--content-main) / 2 + 10px);padding:12px 0;box-sizing:border-box}.sidebar-wrap .n-menu .n-menu-item-content:before{border-radius:21px}.logo-wrap{display:flex;justify-content:flex-start;margin-bottom:12px}.logo-wrap .logo-img{margin-left:24px}.logo-wrap .logo-img:hover{cursor:pointer}.user-wrap{display:flex;align-items:center;position:absolute;bottom:12px;left:12px;right:12px}.user-wrap .user-mini-wrap{display:none}.user-wrap .user-avatar{margin-right:8px}.user-wrap .user-info{display:flex;flex-direction:column}.user-wrap .user-info .nickname{font-size:16px;font-weight:700;line-height:16px;height:16px;margin-bottom:2px;display:flex;align-items:center}.user-wrap .user-info .nickname .nickname-txt{max-width:90px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.user-wrap .user-info .nickname .logout{margin-left:6px}.user-wrap .user-info .username{font-size:14px;line-height:16px;height:16px;width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;opacity:.75}.user-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-only-wrap button{margin:0 4px;width:80%}.user-wrap .login-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-wrap button{margin:0 4px}.auth-card .n-card-header{z-index:999}@media screen and (max-width: 821px){.sidebar-wrap{width:200px;right:calc(100% - 200px)}.logo-wrap .logo-img{margin-left:12px!important}.user-wrap .user-avatar,.user-wrap .user-info,.user-wrap .login-only-wrap,.user-wrap .login-wrap{margin-bottom:32px}}:root{--content-main: 600px}.app-container{margin:0}.app-container .app-wrap{width:100%;margin:0 auto}.main-wrap{min-height:100vh;display:flex;flex-direction:row;justify-content:center}.main-wrap .content-wrap{width:100%;max-width:var(--content-main);position:relative}.main-wrap .main-content-wrap{margin:0;border-top:none;border-radius:0}.main-wrap .main-content-wrap .n-list-item{padding:0}.empty-wrap{min-height:300px;display:flex;align-items:center;justify-content:center}.following-link{color:#000;color:none;text-decoration:none;cursor:pointer;opacity:.75}.following-link:hover{opacity:.8}.hash-link,.user-link{color:#18a058;text-decoration:none;cursor:pointer}.hash-link:hover,.user-link:hover{opacity:.8}.beian-link{color:#333;text-decoration:none}.beian-link:hover{opacity:.75}.username-link{color:#000;color:none;text-decoration:none;cursor:pointer}.username-link:hover{text-decoration:underline}.dark .hash-link,.dark .user-link{color:#63e2b7}.dark .following-link,.dark .username-link{color:#eee}.dark .beian-link{color:#ddd}@media screen and (max-width: 821px){.content-wrap{top:0;position:absolute!important}} diff --git a/web/dist/assets/index-3489d7cc.js b/web/dist/assets/index-3489d7cc.js new file mode 100644 index 00000000..f91a35f8 --- /dev/null +++ b/web/dist/assets/index-3489d7cc.js @@ -0,0 +1 @@ +import{d as K,H as L,R as X,b as V,e as f,q as z,w as u,j as w,k as s,bf as d,f as R,A as S,Z as N,y as q,Y as I,c as Q,E as j,r as ue,F as ee,u as te,x as A,h as k,a5 as ve,s as oe,l as we,ag as ye}from"./@vue-a481fc63.js";import{c as be,a as ke,u as ce,b as Le}from"./vue-router-e5a2430e.js";import{c as Te,u as W}from"./vuex-44de225f.js";import{a as Pe}from"./axios-4a70c6fc.js";import{_ as Ae,N as Re,a as pe,b as de,c as Me,d as Ee,e as me,f as Ce,g as Oe,h as _e,i as Ie,j as F,k as Se,u as Ue,l as $e,m as De,n as xe,o as Ne,p as qe,q as ze,r as Fe,s as Ke,t as Ve}from"./naive-ui-eecf2ec3.js";import{h as U}from"./moment-2ab8298d.js";import{S as We,M as Be,L as He,C as Ye,B as je,P as Qe,W as Ze,a as Ge,H as re,b as se,c as ne}from"./@vicons-f0266f88.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))h(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&h(c)}).observe(document,{childList:!0,subtree:!0});function r(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function h(n){if(n.ep)return;n.ep=!0;const l=r(n);fetch(n.href,l)}})();const Je="modulepreload",Xe=function(e){return"/"+e},ae={},P=function(t,r,h){if(!r||r.length===0)return t();const n=document.getElementsByTagName("link");return Promise.all(r.map(l=>{if(l=Xe(l),l in ae)return;ae[l]=!0;const c=l.endsWith(".css"),O=c?'[rel="stylesheet"]':"";if(!!h)for(let _=n.length-1;_>=0;_--){const i=n[_];if(i.href===l&&(!c||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${O}`))return;const g=document.createElement("link");if(g.rel=c?"stylesheet":Je,c||(g.as="script",g.crossOrigin=""),g.href=l,document.head.appendChild(g),c)return new Promise((_,i)=>{g.addEventListener("load",_),g.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>t()).catch(l=>{const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l})},et=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>P(()=>import("./Home-ba528c43.js"),["assets/Home-ba528c43.js","assets/whisper-add-friend-9521d988.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-add-friend-01aea97d.css","assets/whisper-473502c7.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-bce56e3e.js","assets/content-23ae3d74.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-df8e8b0e.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Home-e6b13f04.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>P(()=>import("./Post-8afc7bcc.js"),["assets/Post-8afc7bcc.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-23ae3d74.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-df8e8b0e.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-473502c7.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Post-39447b75.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>P(()=>import("./Topic-437d36d5.js"),["assets/Topic-437d36d5.js","assets/@vicons-f0266f88.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>P(()=>import("./Anouncement-9ddf3e18.js"),["assets/Anouncement-9ddf3e18.js","assets/post-skeleton-df8e8b0e.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>P(()=>import("./Profile-471fcf6c.js"),["assets/Profile-471fcf6c.js","assets/whisper-473502c7.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-bce56e3e.js","assets/content-23ae3d74.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-df8e8b0e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/main-nav-569a7b0c.css","assets/count-e2caa1c1.js","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-912dd7e3.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>P(()=>import("./User-3ea93752.js"),["assets/User-3ea93752.js","assets/post-item.vue_vue_type_style_index_0_lang-bce56e3e.js","assets/content-23ae3d74.js","assets/@vue-a481fc63.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-df8e8b0e.js","assets/post-skeleton-f1900002.css","assets/whisper-473502c7.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-9521d988.js","assets/whisper-add-friend-01aea97d.css","assets/count-e2caa1c1.js","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-0168cc80.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>P(()=>import("./Messages-4d0b5577.js"),["assets/Messages-4d0b5577.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-473502c7.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-9543d2b3.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>P(()=>import("./Collection-c6b44d8b.js"),["assets/Collection-c6b44d8b.js","assets/whisper-473502c7.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-bce56e3e.js","assets/content-23ae3d74.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-df8e8b0e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-e605040f.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>P(()=>import("./Contacts-89bcf6d7.js"),["assets/Contacts-89bcf6d7.js","assets/whisper-473502c7.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/@vicons-f0266f88.js","assets/post-skeleton-df8e8b0e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-c993e2de.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>P(()=>import("./Following-eaa8214c.js"),["assets/Following-eaa8214c.js","assets/whisper-473502c7.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/post-skeleton-df8e8b0e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-c2ff25f8.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>P(()=>import("./Wallet-53d5090b.js"),["assets/Wallet-53d5090b.js","assets/post-skeleton-df8e8b0e.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>P(()=>import("./Setting-bef151cc.js"),["assets/Setting-bef151cc.js","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Setting-94ec4c57.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>P(()=>import("./404-5027c57d.js"),["assets/404-5027c57d.js","assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],he=be({history:ke(),routes:et});he.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const tt=Te({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",unreadMsgCount:0,userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},profile:{useFriendship:!0,enableTrendsBar:!0,enableWallet:!1,allowTweetAttachment:!0,allowTweetAttachmentPrice:!0,allowTweetVideo:!0,allowUserRegister:!0,allowPhoneBind:!0,defaultTweetMaxLength:2e3,tweetWebEllipsisSize:400,tweetMobileEllipsisSize:300,defaultTweetVisibility:"friend",defaultMsgLoopInterval:5e3,copyrightTop:"2023 paopao.info",copyrightLeft:"Roc's Me",copyrightLeftLink:"",copyrightRight:"泡泡(PaoPao)开源社区",copyrightRightLink:"https://www.paopao.info"}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},updateUnreadMsgCount(e,t){e.unreadMsgCount=t},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},loadDefaultSiteProfile(e){e.profile.useFriendship="true".toLowerCase()==="true",e.profile.enableTrendsBar="true".toLowerCase()==="true",e.profile.enableWallet="false".toLocaleLowerCase()==="true",e.profile.allowTweetAttachment="true".toLowerCase()==="true",e.profile.allowTweetAttachmentPrice="false".toLowerCase()==="true",e.profile.allowTweetVideo="true".toLowerCase()==="true",e.profile.allowUserRegister="true".toLowerCase()==="true",e.profile.allowPhoneBind="true".toLowerCase()==="true",e.profile.defaultTweetMaxLength=+"2000",e.profile.tweetWebEllipsisSize=+"400",e.profile.tweetMobileEllipsisSize=+"300",e.profile.defaultTweetVisibility="friend".toLowerCase(),e.profile.defaultMsgLoopInterval=+"5000",e.profile.copyrightTop="2023 paopao.info",e.profile.copyrightLeft="Roc's Me",e.profile.copyrightLeftLink="",e.profile.copyrightRight="泡泡(PaoPao)开源社区",e.profile.copyrightRightLink="https://www.paopao.info"},updateSiteProfile(e,t){const r=e.profile;e.profile.useFriendship=t.use_friendship??r.useFriendship,e.profile.enableTrendsBar=t.enable_trends_bar??r.enableTrendsBar,e.profile.enableWallet=t.enable_wallet??r.enableWallet,e.profile.allowTweetAttachment=t.allow_tweet_attachment??r.allowTweetAttachment,e.profile.allowTweetAttachmentPrice=t.allow_tweet_attachment_price??r.allowTweetAttachmentPrice,e.profile.allowTweetVideo=t.allow_tweet_video??r.allowTweetVideo,e.profile.allowUserRegister=t.allow_user_register??r.allowUserRegister,e.profile.allowPhoneBind=t.allow_phone_bind??r.allowPhoneBind,e.profile.defaultTweetMaxLength=t.default_tweet_max_length??r.defaultTweetMaxLength,e.profile.tweetWebEllipsisSize=t.tweet_web_ellipsis_size??r.tweetWebEllipsisSize,e.profile.tweetMobileEllipsisSize=t.tweet_mobile_ellipsis_size??r.tweetMobileEllipsisSize,e.profile.defaultTweetVisibility=t.default_tweet_visibility??r.defaultTweetVisibility,e.profile.defaultMsgLoopInterval=t.default_msg_loop_interval??r.defaultMsgLoopInterval,e.profile.copyrightTop=t.copyright_top??r.copyrightTop,e.profile.copyrightLeft=t.copyright_left??r.copyrightLeft,e.profile.copyrightLeftLink=t.copyright_left_link??r.copyrightLeftLink,e.profile.copyrightRight=t.copyright_right??r.copyrightRight,e.profile.copyrightRightLink=t.copyright_right_link??r.copyrightRightLink},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),Z=Pe.create({baseURL:"",timeout:3e4});Z.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Z.interceptors.response.use(e=>{const{data:t={},code:r=0}=(e==null?void 0:e.data)||{};if(+r==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var r;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((r=t==null?void 0:t.data)==null?void 0:r.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return Z(e)}const le=e=>o({method:"post",url:"/v1/auth/login",data:e}),ot=e=>o({method:"post",url:"/v1/auth/register",data:e}),Y=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),rt={class:"auth-wrap"},st={key:0},nt=K({__name:"auth",setup(e){const t=W(),r=L(!1),h=L(),n=X({username:"",password:""}),l=L(),c=X({username:"",password:"",repassword:""}),O={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,i)=>!!c.password&&c.password.startsWith(i)&&c.password.length>=i.length,message:"两次密码输入不一致",trigger:"input"}]},T=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=h.value)==null||i.validate(M=>{M||(r.value=!0,le({username:n.username,password:n.password}).then(m=>{const b=(m==null?void 0:m.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(m=>{window.$message.success("登录成功"),r.value=!1,t.commit("updateUserinfo",m),t.commit("triggerAuth",!1),t.commit("refresh"),n.username="",n.password=""}).catch(m=>{r.value=!1}))})},g=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=l.value)==null||i.validate(M=>{M||(r.value=!0,ot({username:c.username,password:c.password}).then(m=>le({username:c.username,password:c.password})).then(m=>{const b=(m==null?void 0:m.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(m=>{window.$message.success("注册成功"),r.value=!1,t.commit("updateUserinfo",m),t.commit("triggerAuth",!1),c.username="",c.password="",c.repassword=""}).catch(m=>{r.value=!1}))})};return V(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?Y(_).then(i=>{t.commit("updateUserinfo",i),t.commit("triggerAuth",!1)}).catch(i=>{t.commit("userLogout")}):t.commit("userLogout")}),(_,i)=>{const M=Ae,m=Re,b=pe,a=de,v=Me,D=Ee,$=me,x=Ce,p=Oe,E=_e,B=Ie;return f(),z(B,{show:d(t).state.authModalShow,"onUpdate:show":i[7]||(i[7]=y=>d(t).state.authModalShow=y),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:u(()=>[w("div",rt,[s(E,{bordered:!1},{default:u(()=>[d(t).state.profile.allowUserRegister?I("",!0):(f(),R("div",st,[s(b,{justify:"center"},{default:u(()=>[s(m,null,{default:u(()=>[s(M,{type:"success"},{default:u(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),s(D,{ref_key:"loginRef",ref:h,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(v,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[0]||(i[0]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:N(q(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[1]||(i[1]=y=>n.password=y),placeholder:"请输入账户密码",onKeyup:N(q(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:T},{default:u(()=>[S(" 登录 ")]),_:1},8,["loading"])])),d(t).state.profile.allowUserRegister?(f(),z(p,{key:1,"default-value":d(t).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:u(()=>[s(x,{name:"signin",tab:"登录"},{default:u(()=>[s(D,{ref_key:"loginRef",ref:h,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(v,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[2]||(i[2]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:N(q(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[3]||(i[3]=y=>n.password=y),placeholder:"请输入账户密码",onKeyup:N(q(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:T},{default:u(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:l,model:c,rules:O},{default:u(()=>[s(v,{label:"用户名",path:"username"},{default:u(()=>[s(a,{value:c.username,"onUpdate:value":i[4]||(i[4]=y=>c.username=y),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(v,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:c.password,"onUpdate:value":i[5]||(i[5]=y=>c.password=y),onKeyup:N(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{label:"重复密码",path:"repassword"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:c.repassword,"onUpdate:value":i[6]||(i[6]=y=>c.repassword=y),onKeyup:N(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:g},{default:u(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):I("",!0)]),_:1})])]),_:1},8,["show"])}}});const fe=(e,t)=>{const r=e.__vccOpts||e;for(const[h,n]of t)r[h]=n;return r},at=fe(nt,[["__scopeId","data-v-6f778fc4"]]),no=e=>o({method:"get",url:"/v1/posts",params:e}),lt=e=>o({method:"get",url:"/v1/tags",params:e}),ao=e=>o({method:"get",url:"/v1/post",params:e}),lo=e=>o({method:"get",url:"/v1/post/star",params:e}),io=e=>o({method:"post",url:"/v1/post/star",data:e}),uo=e=>o({method:"get",url:"/v1/post/collection",params:e}),co=e=>o({method:"post",url:"/v1/post/collection",data:e}),po=e=>o({method:"get",url:"/v1/post/comments",params:e}),mo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),_o=e=>o({method:"get",url:"/v1/trends/index",params:e}),ho=e=>o({method:"post",url:"/v1/post",data:e}),fo=e=>o({method:"delete",url:"/v1/post",data:e}),go=e=>o({method:"post",url:"/v1/post/lock",data:e}),vo=e=>o({method:"post",url:"/v1/post/stick",data:e}),wo=e=>o({method:"post",url:"/v1/post/highlight",data:e}),yo=e=>o({method:"post",url:"/v1/post/visibility",data:e}),bo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),ko=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),Lo=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Po=e=>o({method:"post",url:"/v1/post/comment",data:e}),Ao=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Mo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),Eo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Co=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Oo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Io=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),So=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Uo=e=>o({method:"post",url:"/v1/captcha",data:e}),$o=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Do=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),xo=e=>o({method:"post",url:"/v1/friend/add",data:e}),No=e=>o({method:"post",url:"/v1/user/follow",data:e}),qo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),zo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Fo=e=>o({method:"get",url:"/v1/user/followings",params:e}),Ko=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Vo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Wo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Bo=e=>o({method:"post",url:"/v1/user/activate",data:e}),Ho=e=>o({method:"post",url:"/v1/user/password",data:e}),Yo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),jo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ie=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Qo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Zo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Go=()=>o({method:"post",url:"/v1/user/message/readall"}),Jo=e=>o({method:"get",url:"/v1/user/collections",params:e}),Xo=e=>o({method:"get",url:"/v1/user/profile",params:e}),er=e=>o({method:"get",url:"/v1/user/posts",params:e}),tr=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),or=e=>o({method:"post",url:"/v1/user/recharge",data:e}),rr=e=>o({method:"get",url:"/v1/user/recharge",params:e}),sr=e=>o({method:"get",url:"/v1/suggest/users",params:e}),nr=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),ar=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),lr=e=>o({method:"get",url:"/v1/attachment",params:e}),ir=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),it=()=>o({method:"get",url:"/v1/admin/site/status"});U.locale("zh-cn");const ut=e=>U.unix(e).fromNow(),ur=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},cr=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},pr=e=>U.unix(e).utc(!0).format("YYYY年MM月"),ct={key:0,class:"rightbar-wrap"},pt={class:"search-wrap"},dt={class:"post-num"},mt={class:"post-num"},_t={class:"copyright"},ht=["href"],ft=["href"],gt={class:"site-info-item"},vt=K({__name:"rightbar",setup(e){const t=L([]),r=L([]),h=L(!1),n=L(""),l=W(),c=ce(),O=L(0),T=L(0),g=L(0),_=L(0),i=L(null),M=+"6",m=+"12",b=()=>{it().then(p=>{O.value=p.register_user_count,T.value=p.online_user_count,g.value=p.history_max_online,_.value=p.server_up_time}).catch(p=>{}),x.disconnect()},a=()=>{h.value=!0,lt({type:"hot_extral",num:m,extral_num:M}).then(p=>{t.value=p.topics,r.value=p.extral_topics??[],$.value=!0,h.value=!1}).catch(p=>{h.value=!1})},v=p=>p>=1e3?(p/1e3).toFixed(1)+"k":p,D=()=>{c.push({name:"home",query:{q:n.value}})},$=Q({get:()=>l.state.userLogined&&r.value.length!==0,set:p=>{}});j(()=>({refreshTopicFollow:l.state.refreshTopicFollow,userLogined:l.state.userLogined}),(p,E)=>{(p.refreshTopicFollow!==E.refreshTopicFollow||p.userLogined)&&a(),l.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(E=>{E.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return V(()=>{i.value&&x.observe(i.value),a()}),(p,E)=>{const B=F,y=de,G=ue("router-link"),J=Se,H=_e,ge=pe;return d(l).state.collapsedRight?I("",!0):(f(),R("div",ct,[w("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":E[0]||(E[0]=C=>n.value=C),onKeyup:N(q(D,["prevent"]),["enter"])},{prefix:u(()=>[s(B,{component:d(We)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),$.value?(f(),z(H,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:h.value},{default:u(()=>[(f(!0),R(ee,null,te(r.value,C=>(f(),R("div",{class:"hot-tag-item",key:C.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:u(()=>[S(" #"+A(C.tag),1)]),_:2},1032,["to"]),w("div",dt,A(v(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):I("",!0),s(H,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:h.value},{default:u(()=>[(f(!0),R(ee,null,te(t.value,C=>(f(),R("div",{class:"hot-tag-item",key:C.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:u(()=>[S(" #"+A(C.tag),1)]),_:2},1032,["to"]),w("div",mt,A(v(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(H,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:u(()=>[w("div",_t,"© "+A(d(l).state.profile.copyrightTop),1),w("div",null,[s(ge,null,{default:u(()=>[w("a",{href:d(l).state.profile.copyrightLeftLink,target:"_blank",class:"hash-link"},A(d(l).state.profile.copyrightLeft),9,ht),w("a",{href:d(l).state.profile.copyrightRightLink,target:"_blank",class:"hash-link"},A(d(l).state.profile.copyrightRight),9,ft)]),_:1})])]),_:1}),d(l).state.userInfo.is_admin?(f(),R("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:i},[w("span",gt,A(O.value)+" 注册用户,"+A(T.value)+" 人在线,最高在线 "+A(g.value)+" 人,站点上线于 "+A(d(ut)(_.value)),1)],512)):I("",!0)]))}}});const wt=fe(vt,[["__scopeId","data-v-181f8063"]]),yt="/assets/logo-52afee68.png",bt={class:"sidebar-wrap"},kt={class:"logo-wrap"},Lt={key:0,class:"user-wrap"},Tt={class:"user-info"},Pt={class:"nickname"},At={class:"nickname-txt"},Rt={class:"username"},Mt={class:"user-mini-wrap"},Et={key:1,class:"user-wrap"},Ct={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},It=K({__name:"sidebar",setup(e){const t=W(),r=Le(),h=ce(),n=L(!1),l=L(r.name||""),c=L(),O="false".toLowerCase()==="true";j(r,()=>{l.value=r.name}),j(t.state,()=>{n.value=t.state.unreadMsgCount>0,t.state.userInfo.id>0?c.value||(ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)}),c.value=setInterval(()=>{ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)})},t.state.profile.defaultMsgLoopInterval)):c.value&&clearInterval(c.value)}),V(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const T=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}];return O&&a.push({label:"公告",key:"anouncement",icon:()=>k(Be),href:"/anouncement"}),a.push({label:"主页",key:"profile",icon:()=>k(He),href:"/profile"}),a.push({label:"消息",key:"messages",icon:()=>k(Ye),href:"/messages"}),a.push({label:"收藏",key:"collection",icon:()=>k(je),href:"/collection"}),t.state.profile.useFriendship&&a.push({label:"好友",key:"contacts",icon:()=>k(Qe),href:"/contacts"}),t.state.profile.enableWallet&&a.push({label:"钱包",key:"wallet",icon:()=>k(Ze),href:"/wallet"}),a.push({label:"设置",key:"setting",icon:()=>k(Ge),href:"/setting"}),t.state.userInfo.id>0?a:[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}]}),g=a=>"href"in a?k("div",{},a.label):a.label,_=a=>a.key==="messages"?k($e,{dot:!0,show:n.value,processing:!0},{default:()=>k(F,{color:a.key===l.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):k(F,null,{default:a.icon}),i=(a,v={})=>{l.value=a,h.push({name:a,query:{t:new Date().getTime()}})},M=()=>{r.path==="/"&&t.commit("refresh"),i("home")},m=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),M()};return window.$store=t,window.$message=Ue(),(a,v)=>{const D=De,$=xe,x=Ne,p=me;return f(),R("div",bt,[w("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:M},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:T.value,"render-label":g,"render-icon":_,value:l.value,"onUpdate:value":i},null,8,["options","value"]),d(t).state.userInfo.id>0?(f(),R("div",Lt,[s(x,{class:"user-avatar",round:"",size:34,src:d(t).state.userInfo.avatar},null,8,["src"]),w("div",Tt,[w("div",Pt,[w("span",At,A(d(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:b},{icon:u(()=>[s(d(F),null,{default:u(()=>[s(d(ne))]),_:1})]),_:1})]),w("div",Rt,"@"+A(d(t).state.userInfo.username),1)]),w("div",Mt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:b},{icon:u(()=>[s(d(F),{size:24},{default:u(()=>[s(d(ne))]),_:1})]),_:1})])])):(f(),R("div",Et,[d(t).state.profile.allowUserRegister?I("",!0):(f(),R("div",Ct,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=E=>m("signin"))},{default:u(()=>[S(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),R("div",Ot,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=E=>m("signin"))},{default:u(()=>[S(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=E=>m("signup"))},{default:u(()=>[S(" 注册 ")]),_:1})])):I("",!0)]))])}}});const St=()=>o({method:"get",url:"/v1/site/profile"}),Ut={"has-sider":"",class:"main-wrap",position:"static"},$t={key:0},Dt={class:"content-wrap"},xt=K({__name:"App",setup(e){const t=W(),r=Q(()=>t.state.theme==="dark"?ze:null);function h(){t.commit("loadDefaultSiteProfile"),"true".toLowerCase()==="true"&&St().then(n=>{t.commit("updateSiteProfile",n)}).catch(n=>{console.log(n)})}return V(()=>{h()}),(n,l)=>{const c=It,O=ue("router-view"),T=wt,g=at,_=Fe,i=Ke,M=Ve,m=qe;return f(),z(m,{theme:r.value},{default:u(()=>[s(i,null,{default:u(()=>[s(_,null,{default:u(()=>{var b;return[w("div",{class:we(["app-container",{dark:((b=r.value)==null?void 0:b.name)==="dark",mobile:!d(t).state.desktopModelShow}])},[w("div",Ut,[d(t).state.desktopModelShow?(f(),R("div",$t,[s(c)])):I("",!0),w("div",Dt,[s(O,{class:"app-wrap"},{default:u(({Component:a})=>[(f(),z(ve,null,[n.$route.meta.keepAlive?(f(),z(oe(a),{key:0})):I("",!0)],1024)),n.$route.meta.keepAlive?I("",!0):(f(),z(oe(a),{key:0}))]),_:1})]),s(T)]),s(g)],2)]}),_:1})]),_:1}),s(M)]),_:1},8,["theme"])}}});ye(xt).use(he).use(tt).mount("#app");export{$o as $,io as A,co as B,ao as C,po as D,yt as E,Co as F,Io as G,Oo as H,lt as I,ut as J,pr as K,Xo as L,ir as M,Do as N,xo as O,Ko as P,Zo as Q,Qo as R,Go as S,Jo as T,cr as U,ar as V,lr as W,mo as X,zo as Y,Fo as Z,fe as _,nr as a,Y as a0,tr as a1,or as a2,rr as a3,So as a4,jo as a5,Ho as a6,Wo as a7,Bo as a8,Yo as a9,Uo as aa,It as ab,_o as b,ho as c,no as d,er as e,No as f,sr as g,Vo as h,ur as i,To as j,Eo as k,bo as l,ko as m,Mo as n,Ao as o,Ro as p,Po as q,lo as r,uo as s,Lo as t,qo as u,fo as v,go as w,vo as x,wo as y,yo as z}; diff --git a/web/dist/assets/index-ea5660b6.css b/web/dist/assets/index-ea5660b6.css new file mode 100644 index 00000000..4fca5b7b --- /dev/null +++ b/web/dist/assets/index-ea5660b6.css @@ -0,0 +1 @@ +.auth-wrap[data-v-6f778fc4]{margin-top:-30px}.dark .auth-wrap[data-v-6f778fc4]{background-color:#101014bf}.rightbar-wrap[data-v-181f8063]::-webkit-scrollbar{width:0;height:0}.rightbar-wrap[data-v-181f8063]{width:240px;position:fixed;left:calc(50% + var(--content-main) / 2 + 10px);max-height:100vh;overflow:auto}.rightbar-wrap .search-wrap[data-v-181f8063]{margin:12px 0}.rightbar-wrap .hot-tag-item[data-v-181f8063]{line-height:2;position:relative}.rightbar-wrap .hot-tag-item .hash-link[data-v-181f8063]{width:calc(100% - 60px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.rightbar-wrap .hot-tag-item .post-num[data-v-181f8063]{position:absolute;right:0;top:0;width:60px;text-align:right;line-height:2;opacity:.5}.rightbar-wrap .hottopic-wrap[data-v-181f8063]{margin-bottom:10px}.rightbar-wrap .site-info[data-v-181f8063]{margin-top:8px;padding-left:16px;padding-right:16px}.rightbar-wrap .site-info .site-info-item[data-v-181f8063]{font-size:10px;opacity:.75}.rightbar-wrap .copyright-wrap .copyright[data-v-181f8063]{font-size:12px;opacity:.75}.rightbar-wrap .copyright-wrap .hash-link[data-v-181f8063]{font-size:12px}.dark .hottopic-wrap[data-v-181f8063],.dark .copyright-wrap[data-v-181f8063]{background-color:#18181c}.sidebar-wrap::-webkit-scrollbar{width:0;height:0}.sidebar-wrap{z-index:99;width:200px;height:100vh;position:fixed;right:calc(50% + var(--content-main) / 2 + 10px);padding:12px 0;box-sizing:border-box;max-height:100vh;overflow:auto}.sidebar-wrap .n-menu .n-menu-item-content:before{border-radius:21px}.sidebar-wrap .logo-wrap{display:flex;justify-content:flex-start;margin-bottom:12px}.sidebar-wrap .logo-wrap .logo-img{margin-left:24px}.sidebar-wrap .logo-wrap .logo-img:hover{cursor:pointer}.sidebar-wrap .user-wrap{display:flex;align-items:center;position:absolute;bottom:12px;left:12px;right:12px}.sidebar-wrap .user-wrap .user-mini-wrap{display:none}.sidebar-wrap .user-wrap .user-avatar{margin-right:8px}.sidebar-wrap .user-wrap .user-info{display:flex;flex-direction:column}.sidebar-wrap .user-wrap .user-info .nickname{font-size:16px;font-weight:700;line-height:16px;height:16px;margin-bottom:2px;display:flex;align-items:center}.sidebar-wrap .user-wrap .user-info .nickname .nickname-txt{max-width:90px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.sidebar-wrap .user-wrap .user-info .nickname .logout{margin-left:6px}.sidebar-wrap .user-wrap .user-info .username{font-size:14px;line-height:16px;height:16px;width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;opacity:.75}.sidebar-wrap .user-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.sidebar-wrap .user-wrap .login-only-wrap button{margin:0 4px;width:80%}.sidebar-wrap .user-wrap .login-wrap{display:flex;justify-content:center;width:100%}.sidebar-wrap .user-wrap .login-wrap button{margin:0 4px}.auth-card .n-card-header{z-index:999}@media screen and (max-width: 821px){.sidebar-wrap{width:200px;right:calc(100% - 200px)}.logo-wrap .logo-img{margin-left:12px!important}.user-wrap .user-avatar,.user-wrap .user-info,.user-wrap .login-only-wrap,.user-wrap .login-wrap{margin-bottom:32px}}:root{--content-main: 620px}.app-container{margin:0}.app-container .app-wrap{width:100%;margin:0 auto}.main-wrap{min-height:100vh;display:flex;flex-direction:row;justify-content:center}.main-wrap .content-wrap{width:100%;max-width:var(--content-main);position:relative}.main-wrap .main-content-wrap{margin:0;border-top:none;border-radius:0}.main-wrap .main-content-wrap .n-list-item{padding:0}.empty-wrap{min-height:300px;display:flex;align-items:center;justify-content:center}.following-link{color:#000;color:none;text-decoration:none;cursor:pointer;opacity:.75}.following-link:hover{opacity:.8}.slide-bar-user-link{text-decoration:none;cursor:pointer}.slide-bar-user-link:hover{color:#18a058;opacity:.8}.hash-link,.user-link{color:#18a058;text-decoration:none;cursor:pointer}.hash-link:hover,.user-link:hover{opacity:.8}.beian-link{color:#333;text-decoration:none}.beian-link:hover{opacity:.75}.username-link{color:#000;color:none;text-decoration:none;cursor:pointer}.username-link:hover{text-decoration:underline}.dark .hash-link,.dark .user-link{color:#63e2b7}.dark .following-link,.dark .username-link{color:#eee}.dark .beian-link{color:#ddd}@media screen and (max-width: 821px){.content-wrap{top:0;position:absolute!important}} diff --git a/web/dist/assets/lodash-94eb5868.js b/web/dist/assets/lodash-e0b37ac3.js similarity index 99% rename from web/dist/assets/lodash-94eb5868.js rename to web/dist/assets/lodash-e0b37ac3.js index 11d1e580..5bda85eb 100644 --- a/web/dist/assets/lodash-94eb5868.js +++ b/web/dist/assets/lodash-e0b37ac3.js @@ -1,4 +1,4 @@ -import{c as jt}from"./copy-to-clipboard-1dd3075d.js";var Je={exports:{}};/** +import{c as jt}from"./@babel-725317a4.js";var Je={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js deleted file mode 100644 index e397f990..00000000 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-2c8a0605.js +++ /dev/null @@ -1 +0,0 @@ -import{a3 as E}from"./index-26a2b065.js";import{u as S}from"./vuex-473b3783.js";import{u as z}from"./vue-router-b8e3382f.js";import{j as A}from"./vooks-a50491fd.js";import{Y as C,Z as N,_ as P,$ as D}from"./@vicons-0524c43e.js";import{a3 as R,a4 as V,j as I,e as j,a5 as x,h as H}from"./naive-ui-e703c4e6.js";import{d as $,r as h,j as q,o as a,c as f,_ as o,V as e,a1 as t,O as c,a as F,Q as _,e as L,M as U,F as Q}from"./@vue-e0e89260.js";const Y={key:0},Z={class:"navbar"},oe=$({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(g){const i=g,n=S(),m=z(),l=h(!1),k=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return q(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(s,d)=>{const y=E,b=R,O=V,r=I,p=j,M=x,T=H;return a(),f(Q,null,[o(n).state.drawerModelShow?(a(),f("div",Y,[e(O,{show:l.value,"onUpdate:show":d[0]||(d[0]=B=>l.value=B),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[F("div",Z,[o(n).state.drawerModelShow&&!s.back?(a(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),s.back?(a(),_(p,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(N))]),_:1})]),_:1})):c("",!0),L(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:o(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js new file mode 100644 index 00000000..567e373f --- /dev/null +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-ebb6720b.js @@ -0,0 +1 @@ +import{ab as A}from"./index-3489d7cc.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{a3 as C,a4 as N,a5 as P,a6 as D}from"./@vicons-f0266f88.js";import{u as R,a3 as x,a4 as H,j as I,e as V,a5 as $,h as j}from"./naive-ui-eecf2ec3.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as G}from"./@vue-a481fc63.js";const J={key:0},K={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=x,M=H,r=I,p=V,O=$,S=j;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; diff --git a/web/dist/assets/naive-ui-e703c4e6.js b/web/dist/assets/naive-ui-eecf2ec3.js similarity index 99% rename from web/dist/assets/naive-ui-e703c4e6.js rename to web/dist/assets/naive-ui-eecf2ec3.js index 29c97145..2998c1f6 100644 --- a/web/dist/assets/naive-ui-e703c4e6.js +++ b/web/dist/assets/naive-ui-eecf2ec3.js @@ -1,4 +1,4 @@ -import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f as Qs,p as _o,i as qt,j as Ai}from"./seemly-76b7b838.js";import{e as nn,F as ao,C as Ei,f as Js,v as Go,d as q,i as Se,g as Pr,w as Ke,h as wo,r as D,j as mo,k as lr,l as ed,m as ji,p as Oe,n as R,q as oo,s as i,T as no,t as fn,u as le,x as ko,y as io,z as Lo,A as Jt,B as od,D as Wn,E as Wi,G as Nr,H as Vr,I as td,J as rd,K as Ni}from"./@vue-e0e89260.js";import{r as Nn,V as vt,a as nd,b as kr,F as hn,c as Ir,d as Br,e as Vn,L as pn,f as id}from"./vueuc-59ca65c3.js";import{u as We,i as Ct,a as ld,b as so,c as gt,d as ad,e as Vi,f as Ui,g as sd,o as dd}from"./vooks-a50491fd.js";import{m as Tt,u as cd,a as ud,r as fd,g as Ki,k as hd,t as Ur}from"./lodash-es-8412e618.js";import{m as zr}from"./@emotion-8a8e73f6.js";import{c as Ft,m as pd,z as Tr}from"./vdirs-b0483831.js";import{c as vd,a as ar}from"./treemate-25c27bff.js";import{S as gd}from"./async-validator-dee29e8b.js";import{o as Do,a as Ro}from"./evtd-b614532e.js";import{p as md,u as Fr}from"./@css-render-580d83ec.js";import{d as bd}from"./date-fns-975a2d8f.js";import{C as xd,e as Cd}from"./css-render-6a5c5852.js";function vn(e,o="default",t=[]){const n=e.$slots[o];return n===void 0?t:n()}function go(e,o=[],t){const r={};return o.forEach(n=>{r[n]=e[n]}),Object.assign(r,t)}function _t(e,o=[],t){const r={};return Object.getOwnPropertyNames(e).forEach(l=>{o.includes(l)||(r[l]=e[l])}),Object.assign(r,t)}function tt(e,o=!0,t=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&t.push(nn(String(r)));return}if(Array.isArray(r)){tt(r,o,t);return}if(r.type===ao){if(r.children===null)return;Array.isArray(r.children)&&tt(r.children,o,t)}else r.type!==Ei&&t.push(r)}}),t}function ae(e,...o){if(Array.isArray(e))e.forEach(t=>ae(t,...o));else return e(...o)}function yo(e){return Object.keys(e)}const qe=(e,...o)=>typeof e=="function"?e(...o):typeof e=="string"?nn(e):typeof e=="number"?nn(String(e)):null;function qo(e,o){console.error(`[naive/${e}]: ${o}`)}function Eo(e,o){throw new Error(`[naive/${e}]: ${o}`)}function Un(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw Error(`${e} has no smaller size.`)}function Gi(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function ln(e,o="default",t=void 0){const r=e[o];if(!r)return qo("getFirstSlotVNode",`slot[${o}] is empty`),null;const n=tt(r(t));return n.length===1?n[0]:(qo("getFirstSlotVNode",`slot[${o}] should have exactly one child`),null)}function qi(e){return o=>{o?e.value=o.$el:e.value=null}}function sr(e){return e.some(o=>Js(o)?!(o.type===Ei||o.type===ao&&!sr(o.children)):!0)?e:null}function lo(e,o){return e&&sr(e())||o()}function an(e,o,t){return e&&sr(e(o))||t(o)}function Ee(e,o){const t=e&&sr(e());return o(t||null)}function ht(e){return!(e&&sr(e()))}function Zt(e){const o=e.filter(t=>t!==void 0);if(o.length!==0)return o.length===1?o[0]:t=>{e.forEach(r=>{r&&r(t)})}}function yd(e){var o;const t=(o=e.dirs)===null||o===void 0?void 0:o.find(({dir:r})=>r===Go);return!!(t&&t.value===!1)}const sn=q({render(){var e,o;return(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e)}}),wd=/^(\d|\.)+$/,Kn=/(\d|\.)+/;function eo(e,{c:o=1,offset:t=0,attachPx:r=!0}={}){if(typeof e=="number"){const n=(e+t)*o;return n===0?"0":`${n}px`}else if(typeof e=="string")if(wd.test(e)){const n=(Number(e)+t)*o;return r?n===0?"0":`${n}px`:`${n}`}else{const n=Kn.exec(e);return n?e.replace(Kn,String((Number(n[0])+t)*o)):e}return e}function Ot(e){return e.replace(/#|\(|\)|,|\s/g,"_")}function W(e,o){return e+(o==="default"?"":o.replace(/^[a-z]/,t=>t.toUpperCase()))}W("abc","def");const Sd="n",er=`.${Sd}-`,zd="__",$d="--",Yi=xd(),Xi=md({blockPrefix:er,elementPrefix:zd,modifierPrefix:$d});Yi.use(Xi);const{c:C,find:u1}=Yi,{cB:g,cE:y,cM:P,cNotM:je}=Xi;function Or(e){return C(({props:{bPrefix:o}})=>`${o||er}modal, ${o||er}drawer`,[e])}function gn(e){return C(({props:{bPrefix:o}})=>`${o||er}popover`,[e])}function Zi(e){return C(({props:{bPrefix:o}})=>`&${o||er}modal`,e)}const Rd=(...e)=>C(">",[g(...e)]);let Kr;function Pd(){return Kr===void 0&&(Kr=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Kr}const jo=typeof document<"u"&&typeof window<"u",Qi=new WeakSet;function kd(e){Qi.add(e)}function Ji(e){return!Qi.has(e)}function Id(e,o,t){var r;const n=Se(e,null);if(n===null)return;const l=(r=Pr())===null||r===void 0?void 0:r.proxy;Ke(t,a),a(t.value),wo(()=>{a(void 0,t.value)});function a(c,u){const f=n[o];u!==void 0&&s(f,u),c!==void 0&&d(f,c)}function s(c,u){c[u]||(c[u]=[]),c[u].splice(c[u].findIndex(f=>f===l),1)}function d(c,u){c[u]||(c[u]=[]),~c[u].findIndex(f=>f===l)||c[u].push(l)}}function Bd(e,o,t){if(!o)return e;const r=D(e.value);let n=null;return Ke(e,l=>{n!==null&&window.clearTimeout(n),l===!0?t&&!t.value?r.value=!0:n=window.setTimeout(()=>{r.value=!0},o):r.value=!1}),r}const mn="n-internal-select-menu",el="n-internal-select-menu-body",dr="n-modal-body",ol="n-modal",cr="n-drawer-body",bn="n-drawer",Dt="n-popover-body",tl="__disabled__";function Io(e){const o=Se(dr,null),t=Se(cr,null),r=Se(Dt,null),n=Se(el,null),l=D();if(typeof document<"u"){l.value=document.fullscreenElement;const a=()=>{l.value=document.fullscreenElement};mo(()=>{Do("fullscreenchange",document,a)}),wo(()=>{Ro("fullscreenchange",document,a)})}return We(()=>{var a;const{to:s}=e;return s!==void 0?s===!1?tl:s===!0?l.value||"body":s:o!=null&&o.value?(a=o.value.$el)!==null&&a!==void 0?a:o.value:t!=null&&t.value?t.value:r!=null&&r.value?r.value:n!=null&&n.value?n.value:s??(l.value||"body")})}Io.tdkey=tl;Io.propTo={type:[String,Object,Boolean],default:void 0};let Gn=!1;function rl(){if(jo&&window.CSS&&!Gn&&(Gn=!0,"registerProperty"in(window==null?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"",inherits:!1,initialValue:"#0000"})}catch{}}function nl(e,o){o&&(mo(()=>{const{value:t}=e;t&&Nn.registerHandler(t,o)}),wo(()=>{const{value:t}=e;t&&Nn.unregisterHandler(t)}))}let Pt=0,qn="",Yn="",Xn="",Zn="";const Qn=D("0px");function il(e){if(typeof document>"u")return;const o=document.documentElement;let t,r=!1;const n=()=>{o.style.marginRight=qn,o.style.overflow=Yn,o.style.overflowX=Xn,o.style.overflowY=Zn,Qn.value="0px"};mo(()=>{t=Ke(e,l=>{if(l){if(!Pt){const a=window.innerWidth-o.offsetWidth;a>0&&(qn=o.style.marginRight,o.style.marginRight=`${a}px`,Qn.value=`${a}px`),Yn=o.style.overflow,Xn=o.style.overflowX,Zn=o.style.overflowY,o.style.overflow="hidden",o.style.overflowX="hidden",o.style.overflowY="hidden"}r=!0,Pt++}else Pt--,Pt||n(),r=!1},{immediate:!0})}),wo(()=>{t==null||t(),r&&(Pt--,Pt||n(),r=!1)})}const xn=D(!1),Jn=()=>{xn.value=!0},ei=()=>{xn.value=!1};let Yt=0;const ll=()=>(jo&&(lr(()=>{Yt||(window.addEventListener("compositionstart",Jn),window.addEventListener("compositionend",ei)),Yt++}),wo(()=>{Yt<=1?(window.removeEventListener("compositionstart",Jn),window.removeEventListener("compositionend",ei),Yt=0):Yt--})),xn);function Td(e){const o={isDeactivated:!1};let t=!1;return ed(()=>{if(o.isDeactivated=!1,!t){t=!0;return}e()}),ji(()=>{o.isDeactivated=!0,t||(t=!0)}),o}const $r="n-form-item";function rt(e,{defaultSize:o="medium",mergedSize:t,mergedDisabled:r}={}){const n=Se($r,null);Oe($r,null);const l=R(t?()=>t(n):()=>{const{size:d}=e;if(d)return d;if(n){const{mergedSize:c}=n;if(c.value!==void 0)return c.value}return o}),a=R(r?()=>r(n):()=>{const{disabled:d}=e;return d!==void 0?d:n?n.disabled.value:!1}),s=R(()=>{const{status:d}=e;return d||(n==null?void 0:n.mergedValidationStatus.value)});return wo(()=>{n&&n.restoreValidation()}),{mergedSizeRef:l,mergedDisabledRef:a,mergedStatusRef:s,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}const So={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Fd,fontFamily:Od,lineHeight:Md}=So,al=C("body",` +import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f as Qs,p as _o,i as qt,j as Ai}from"./seemly-76b7b838.js";import{A as nn,F as ao,C as Ei,B as Js,D as Go,d as q,i as Se,g as Pr,E as Ke,G as wo,H as D,b as mo,o as lr,I as ed,J as ji,p as Oe,c as R,K as oo,h as i,T as no,L as fn,M as le,N as ko,n as io,O as Lo,P as Jt,Q as od,m as Wn,R as Wi,S as Nr,U as Vr,V as td,t as rd,W as Ni}from"./@vue-a481fc63.js";import{r as Nn,V as vt,a as nd,b as kr,F as hn,c as Ir,d as Br,e as Vn,L as pn,f as id}from"./vueuc-7c8d4b48.js";import{u as We,i as Ct,a as ld,b as so,c as gt,d as ad,e as Vi,f as Ui,g as sd,o as dd}from"./vooks-6d99783e.js";import{m as Tt,u as cd,a as ud,r as fd,g as Ki,k as hd,t as Ur}from"./lodash-es-8412e618.js";import{m as zr}from"./@emotion-8a8e73f6.js";import{c as pd,a as ar}from"./treemate-25c27bff.js";import{c as Ft,m as vd,z as Tr}from"./vdirs-b0483831.js";import{S as gd}from"./async-validator-dee29e8b.js";import{o as Do,a as Ro}from"./evtd-b614532e.js";import{p as md,u as Fr}from"./@css-render-7124a1a5.js";import{d as bd}from"./date-fns-975a2d8f.js";import{C as xd,e as Cd}from"./css-render-6a5c5852.js";function vn(e,o="default",t=[]){const n=e.$slots[o];return n===void 0?t:n()}function go(e,o=[],t){const r={};return o.forEach(n=>{r[n]=e[n]}),Object.assign(r,t)}function _t(e,o=[],t){const r={};return Object.getOwnPropertyNames(e).forEach(l=>{o.includes(l)||(r[l]=e[l])}),Object.assign(r,t)}function tt(e,o=!0,t=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&t.push(nn(String(r)));return}if(Array.isArray(r)){tt(r,o,t);return}if(r.type===ao){if(r.children===null)return;Array.isArray(r.children)&&tt(r.children,o,t)}else r.type!==Ei&&t.push(r)}}),t}function ae(e,...o){if(Array.isArray(e))e.forEach(t=>ae(t,...o));else return e(...o)}function yo(e){return Object.keys(e)}const qe=(e,...o)=>typeof e=="function"?e(...o):typeof e=="string"?nn(e):typeof e=="number"?nn(String(e)):null;function qo(e,o){console.error(`[naive/${e}]: ${o}`)}function Eo(e,o){throw new Error(`[naive/${e}]: ${o}`)}function Un(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw Error(`${e} has no smaller size.`)}function Gi(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function ln(e,o="default",t=void 0){const r=e[o];if(!r)return qo("getFirstSlotVNode",`slot[${o}] is empty`),null;const n=tt(r(t));return n.length===1?n[0]:(qo("getFirstSlotVNode",`slot[${o}] should have exactly one child`),null)}function qi(e){return o=>{o?e.value=o.$el:e.value=null}}function sr(e){return e.some(o=>Js(o)?!(o.type===Ei||o.type===ao&&!sr(o.children)):!0)?e:null}function lo(e,o){return e&&sr(e())||o()}function an(e,o,t){return e&&sr(e(o))||t(o)}function Ee(e,o){const t=e&&sr(e());return o(t||null)}function ht(e){return!(e&&sr(e()))}function Zt(e){const o=e.filter(t=>t!==void 0);if(o.length!==0)return o.length===1?o[0]:t=>{e.forEach(r=>{r&&r(t)})}}function yd(e){var o;const t=(o=e.dirs)===null||o===void 0?void 0:o.find(({dir:r})=>r===Go);return!!(t&&t.value===!1)}const sn=q({render(){var e,o;return(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e)}}),wd=/^(\d|\.)+$/,Kn=/(\d|\.)+/;function eo(e,{c:o=1,offset:t=0,attachPx:r=!0}={}){if(typeof e=="number"){const n=(e+t)*o;return n===0?"0":`${n}px`}else if(typeof e=="string")if(wd.test(e)){const n=(Number(e)+t)*o;return r?n===0?"0":`${n}px`:`${n}`}else{const n=Kn.exec(e);return n?e.replace(Kn,String((Number(n[0])+t)*o)):e}return e}function Ot(e){return e.replace(/#|\(|\)|,|\s/g,"_")}function W(e,o){return e+(o==="default"?"":o.replace(/^[a-z]/,t=>t.toUpperCase()))}W("abc","def");const Sd="n",er=`.${Sd}-`,zd="__",$d="--",Yi=xd(),Xi=md({blockPrefix:er,elementPrefix:zd,modifierPrefix:$d});Yi.use(Xi);const{c:C,find:u1}=Yi,{cB:g,cE:y,cM:P,cNotM:je}=Xi;function Or(e){return C(({props:{bPrefix:o}})=>`${o||er}modal, ${o||er}drawer`,[e])}function gn(e){return C(({props:{bPrefix:o}})=>`${o||er}popover`,[e])}function Zi(e){return C(({props:{bPrefix:o}})=>`&${o||er}modal`,e)}const Rd=(...e)=>C(">",[g(...e)]);let Kr;function Pd(){return Kr===void 0&&(Kr=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Kr}const jo=typeof document<"u"&&typeof window<"u",Qi=new WeakSet;function kd(e){Qi.add(e)}function Ji(e){return!Qi.has(e)}function Id(e,o,t){var r;const n=Se(e,null);if(n===null)return;const l=(r=Pr())===null||r===void 0?void 0:r.proxy;Ke(t,a),a(t.value),wo(()=>{a(void 0,t.value)});function a(c,u){const f=n[o];u!==void 0&&s(f,u),c!==void 0&&d(f,c)}function s(c,u){c[u]||(c[u]=[]),c[u].splice(c[u].findIndex(f=>f===l),1)}function d(c,u){c[u]||(c[u]=[]),~c[u].findIndex(f=>f===l)||c[u].push(l)}}function Bd(e,o,t){if(!o)return e;const r=D(e.value);let n=null;return Ke(e,l=>{n!==null&&window.clearTimeout(n),l===!0?t&&!t.value?r.value=!0:n=window.setTimeout(()=>{r.value=!0},o):r.value=!1}),r}const mn="n-internal-select-menu",el="n-internal-select-menu-body",dr="n-modal-body",ol="n-modal",cr="n-drawer-body",bn="n-drawer",Dt="n-popover-body",tl="__disabled__";function Io(e){const o=Se(dr,null),t=Se(cr,null),r=Se(Dt,null),n=Se(el,null),l=D();if(typeof document<"u"){l.value=document.fullscreenElement;const a=()=>{l.value=document.fullscreenElement};mo(()=>{Do("fullscreenchange",document,a)}),wo(()=>{Ro("fullscreenchange",document,a)})}return We(()=>{var a;const{to:s}=e;return s!==void 0?s===!1?tl:s===!0?l.value||"body":s:o!=null&&o.value?(a=o.value.$el)!==null&&a!==void 0?a:o.value:t!=null&&t.value?t.value:r!=null&&r.value?r.value:n!=null&&n.value?n.value:s??(l.value||"body")})}Io.tdkey=tl;Io.propTo={type:[String,Object,Boolean],default:void 0};let Gn=!1;function rl(){if(jo&&window.CSS&&!Gn&&(Gn=!0,"registerProperty"in(window==null?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"",inherits:!1,initialValue:"#0000"})}catch{}}function nl(e,o){o&&(mo(()=>{const{value:t}=e;t&&Nn.registerHandler(t,o)}),wo(()=>{const{value:t}=e;t&&Nn.unregisterHandler(t)}))}let Pt=0,qn="",Yn="",Xn="",Zn="";const Qn=D("0px");function il(e){if(typeof document>"u")return;const o=document.documentElement;let t,r=!1;const n=()=>{o.style.marginRight=qn,o.style.overflow=Yn,o.style.overflowX=Xn,o.style.overflowY=Zn,Qn.value="0px"};mo(()=>{t=Ke(e,l=>{if(l){if(!Pt){const a=window.innerWidth-o.offsetWidth;a>0&&(qn=o.style.marginRight,o.style.marginRight=`${a}px`,Qn.value=`${a}px`),Yn=o.style.overflow,Xn=o.style.overflowX,Zn=o.style.overflowY,o.style.overflow="hidden",o.style.overflowX="hidden",o.style.overflowY="hidden"}r=!0,Pt++}else Pt--,Pt||n(),r=!1},{immediate:!0})}),wo(()=>{t==null||t(),r&&(Pt--,Pt||n(),r=!1)})}const xn=D(!1),Jn=()=>{xn.value=!0},ei=()=>{xn.value=!1};let Yt=0;const ll=()=>(jo&&(lr(()=>{Yt||(window.addEventListener("compositionstart",Jn),window.addEventListener("compositionend",ei)),Yt++}),wo(()=>{Yt<=1?(window.removeEventListener("compositionstart",Jn),window.removeEventListener("compositionend",ei),Yt=0):Yt--})),xn);function Td(e){const o={isDeactivated:!1};let t=!1;return ed(()=>{if(o.isDeactivated=!1,!t){t=!0;return}e()}),ji(()=>{o.isDeactivated=!0,t||(t=!0)}),o}const $r="n-form-item";function rt(e,{defaultSize:o="medium",mergedSize:t,mergedDisabled:r}={}){const n=Se($r,null);Oe($r,null);const l=R(t?()=>t(n):()=>{const{size:d}=e;if(d)return d;if(n){const{mergedSize:c}=n;if(c.value!==void 0)return c.value}return o}),a=R(r?()=>r(n):()=>{const{disabled:d}=e;return d!==void 0?d:n?n.disabled.value:!1}),s=R(()=>{const{status:d}=e;return d||(n==null?void 0:n.mergedValidationStatus.value)});return wo(()=>{n&&n.restoreValidation()}),{mergedSizeRef:l,mergedDisabledRef:a,mergedStatusRef:s,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}const So={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Fd,fontFamily:Od,lineHeight:Md}=So,al=C("body",` margin: 0; font-size: ${Fd}; font-family: ${Od}; @@ -372,7 +372,7 @@ import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f top: calc(50% - 7px); color: var(--n-option-check-color); transition: color .3s var(--n-bezier); - `,[at({enterScale:"0.5"})])])]),yn=q({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ne.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const o=ne("InternalSelectMenu","-internal-select-menu",Fc,_r,e,le(e,"clsPrefix")),t=D(null),r=D(null),n=D(null),l=R(()=>e.treeMate.getFlattenedNodes()),a=R(()=>vd(l.value)),s=D(null);function d(){const{treeMate:N}=e;let G=null;const{value:Ce}=e;Ce===null?G=N.getFirstAvailableNode():(e.multiple?G=N.getNode((Ce||[])[(Ce||[]).length-1]):G=N.getNode(Ce),(!G||G.disabled)&&(G=N.getFirstAvailableNode())),L(G||null)}function c(){const{value:N}=s;N&&!e.treeMate.getNode(N.key)&&(s.value=null)}let u;Ke(()=>e.show,N=>{N?u=Ke(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?d():c(),io(M)):c()},{immediate:!0}):u==null||u()},{immediate:!0}),wo(()=>{u==null||u()});const f=R(()=>Mo(o.value.self[W("optionHeight",e.size)])),p=R(()=>Ko(o.value.self[W("padding",e.size)])),v=R(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),h=R(()=>{const N=l.value;return N&&N.length===0});function m(N){const{onToggle:G}=e;G&&G(N)}function b(N){const{onScroll:G}=e;G&&G(N)}function x(N){var G;(G=n.value)===null||G===void 0||G.sync(),b(N)}function S(){var N;(N=n.value)===null||N===void 0||N.sync()}function B(){const{value:N}=s;return N||null}function T(N,G){G.disabled||L(G,!1)}function z(N,G){G.disabled||m(G)}function I(N){var G;pt(N,"action")||(G=e.onKeyup)===null||G===void 0||G.call(e,N)}function w(N){var G;pt(N,"action")||(G=e.onKeydown)===null||G===void 0||G.call(e,N)}function O(N){var G;(G=e.onMousedown)===null||G===void 0||G.call(e,N),!e.focusable&&N.preventDefault()}function k(){const{value:N}=s;N&&L(N.getNext({loop:!0}),!0)}function $(){const{value:N}=s;N&&L(N.getPrev({loop:!0}),!0)}function L(N,G=!1){s.value=N,G&&M()}function M(){var N,G;const Ce=s.value;if(!Ce)return;const X=a.value(Ce.key);X!==null&&(e.virtualScroll?(N=r.value)===null||N===void 0||N.scrollTo({index:X}):(G=n.value)===null||G===void 0||G.scrollTo({index:X,elSize:f.value}))}function j(N){var G,Ce;!((G=t.value)===null||G===void 0)&&G.contains(N.target)&&((Ce=e.onFocus)===null||Ce===void 0||Ce.call(e,N))}function E(N){var G,Ce;!((G=t.value)===null||G===void 0)&&G.contains(N.relatedTarget)||(Ce=e.onBlur)===null||Ce===void 0||Ce.call(e,N)}Oe(mn,{handleOptionMouseEnter:T,handleOptionClick:z,valueSetRef:v,pendingTmNodeRef:s,nodePropsRef:le(e,"nodeProps"),showCheckmarkRef:le(e,"showCheckmark"),multipleRef:le(e,"multiple"),valueRef:le(e,"value"),renderLabelRef:le(e,"renderLabel"),renderOptionRef:le(e,"renderOption"),labelFieldRef:le(e,"labelField"),valueFieldRef:le(e,"valueField")}),Oe(el,t),mo(()=>{const{value:N}=n;N&&N.sync()});const U=R(()=>{const{size:N}=e,{common:{cubicBezierEaseInOut:G},self:{height:Ce,borderRadius:X,color:ve,groupHeaderTextColor:he,actionDividerColor:be,optionTextColorPressed:me,optionTextColor:se,optionTextColorDisabled:Re,optionTextColorActive:ge,optionOpacityDisabled:ee,optionCheckColor:xe,actionTextColor:de,optionColorPending:ye,optionColorActive:pe,loadingColor:Me,loadingSize:Q,optionColorActivePending:A,[W("optionFontSize",N)]:Z,[W("optionHeight",N)]:re,[W("optionPadding",N)]:ue}}=o.value;return{"--n-height":Ce,"--n-action-divider-color":be,"--n-action-text-color":de,"--n-bezier":G,"--n-border-radius":X,"--n-color":ve,"--n-option-font-size":Z,"--n-group-header-text-color":he,"--n-option-check-color":xe,"--n-option-color-pending":ye,"--n-option-color-active":pe,"--n-option-color-active-pending":A,"--n-option-height":re,"--n-option-opacity-disabled":ee,"--n-option-text-color":se,"--n-option-text-color-active":ge,"--n-option-text-color-disabled":Re,"--n-option-text-color-pressed":me,"--n-option-padding":ue,"--n-option-padding-left":Ko(ue,"left"),"--n-option-padding-right":Ko(ue,"right"),"--n-loading-color":Me,"--n-loading-size":Q}}),{inlineThemeDisabled:_}=e,V=_?Ae("internal-select-menu",R(()=>e.size[0]),U,e):void 0,te={selfRef:t,next:k,prev:$,getPendingTmNode:B};return nl(t,e.onResize),Object.assign({mergedTheme:o,virtualListRef:r,scrollbarRef:n,itemSize:f,padding:p,flattenedNodes:l,empty:h,virtualListContainer(){const{value:N}=r;return N==null?void 0:N.listElRef},virtualListContent(){const{value:N}=r;return N==null?void 0:N.itemsElRef},doScroll:b,handleFocusin:j,handleFocusout:E,handleKeyUp:I,handleKeyDown:w,handleMouseDown:O,handleVirtualListResize:S,handleVirtualListScroll:x,cssVars:_?void 0:U,themeClass:V==null?void 0:V.themeClass,onRender:V==null?void 0:V.onRender},te)},render(){const{$slots:e,virtualScroll:o,clsPrefix:t,mergedTheme:r,themeClass:n,onRender:l}=this;return l==null||l(),i("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${t}-base-select-menu`,n,this.multiple&&`${t}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},this.loading?i("div",{class:`${t}-base-select-menu__loading`},i(Et,{clsPrefix:t,strokeWidth:20})):this.empty?i("div",{class:`${t}-base-select-menu__empty`,"data-empty":!0},lo(e.empty,()=>[i(Sc,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty})])):i(ur,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:o?this.virtualListContainer:void 0,content:o?this.virtualListContent:void 0,onScroll:o?void 0:this.doScroll},{default:()=>o?i(nd,{ref:"virtualListRef",class:`${t}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i(di,{key:a.key,clsPrefix:t,tmNode:a}):a.ignored?null:i(si,{clsPrefix:t,key:a.key,tmNode:a})}):i("div",{class:`${t}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i(di,{key:a.key,clsPrefix:t,tmNode:a}):i(si,{clsPrefix:t,key:a.key,tmNode:a})))}),Ee(e.action,a=>a&&[i("div",{class:`${t}-base-select-menu__action`,"data-action":!0,key:"action"},a),i(ac,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Oc=g("base-wave",` + `,[at({enterScale:"0.5"})])])]),yn=q({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ne.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const o=ne("InternalSelectMenu","-internal-select-menu",Fc,_r,e,le(e,"clsPrefix")),t=D(null),r=D(null),n=D(null),l=R(()=>e.treeMate.getFlattenedNodes()),a=R(()=>pd(l.value)),s=D(null);function d(){const{treeMate:N}=e;let G=null;const{value:Ce}=e;Ce===null?G=N.getFirstAvailableNode():(e.multiple?G=N.getNode((Ce||[])[(Ce||[]).length-1]):G=N.getNode(Ce),(!G||G.disabled)&&(G=N.getFirstAvailableNode())),L(G||null)}function c(){const{value:N}=s;N&&!e.treeMate.getNode(N.key)&&(s.value=null)}let u;Ke(()=>e.show,N=>{N?u=Ke(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?d():c(),io(M)):c()},{immediate:!0}):u==null||u()},{immediate:!0}),wo(()=>{u==null||u()});const f=R(()=>Mo(o.value.self[W("optionHeight",e.size)])),p=R(()=>Ko(o.value.self[W("padding",e.size)])),v=R(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),h=R(()=>{const N=l.value;return N&&N.length===0});function m(N){const{onToggle:G}=e;G&&G(N)}function b(N){const{onScroll:G}=e;G&&G(N)}function x(N){var G;(G=n.value)===null||G===void 0||G.sync(),b(N)}function S(){var N;(N=n.value)===null||N===void 0||N.sync()}function B(){const{value:N}=s;return N||null}function T(N,G){G.disabled||L(G,!1)}function z(N,G){G.disabled||m(G)}function I(N){var G;pt(N,"action")||(G=e.onKeyup)===null||G===void 0||G.call(e,N)}function w(N){var G;pt(N,"action")||(G=e.onKeydown)===null||G===void 0||G.call(e,N)}function O(N){var G;(G=e.onMousedown)===null||G===void 0||G.call(e,N),!e.focusable&&N.preventDefault()}function k(){const{value:N}=s;N&&L(N.getNext({loop:!0}),!0)}function $(){const{value:N}=s;N&&L(N.getPrev({loop:!0}),!0)}function L(N,G=!1){s.value=N,G&&M()}function M(){var N,G;const Ce=s.value;if(!Ce)return;const X=a.value(Ce.key);X!==null&&(e.virtualScroll?(N=r.value)===null||N===void 0||N.scrollTo({index:X}):(G=n.value)===null||G===void 0||G.scrollTo({index:X,elSize:f.value}))}function j(N){var G,Ce;!((G=t.value)===null||G===void 0)&&G.contains(N.target)&&((Ce=e.onFocus)===null||Ce===void 0||Ce.call(e,N))}function E(N){var G,Ce;!((G=t.value)===null||G===void 0)&&G.contains(N.relatedTarget)||(Ce=e.onBlur)===null||Ce===void 0||Ce.call(e,N)}Oe(mn,{handleOptionMouseEnter:T,handleOptionClick:z,valueSetRef:v,pendingTmNodeRef:s,nodePropsRef:le(e,"nodeProps"),showCheckmarkRef:le(e,"showCheckmark"),multipleRef:le(e,"multiple"),valueRef:le(e,"value"),renderLabelRef:le(e,"renderLabel"),renderOptionRef:le(e,"renderOption"),labelFieldRef:le(e,"labelField"),valueFieldRef:le(e,"valueField")}),Oe(el,t),mo(()=>{const{value:N}=n;N&&N.sync()});const U=R(()=>{const{size:N}=e,{common:{cubicBezierEaseInOut:G},self:{height:Ce,borderRadius:X,color:ve,groupHeaderTextColor:he,actionDividerColor:be,optionTextColorPressed:me,optionTextColor:se,optionTextColorDisabled:Re,optionTextColorActive:ge,optionOpacityDisabled:ee,optionCheckColor:xe,actionTextColor:de,optionColorPending:ye,optionColorActive:pe,loadingColor:Me,loadingSize:Q,optionColorActivePending:A,[W("optionFontSize",N)]:Z,[W("optionHeight",N)]:re,[W("optionPadding",N)]:ue}}=o.value;return{"--n-height":Ce,"--n-action-divider-color":be,"--n-action-text-color":de,"--n-bezier":G,"--n-border-radius":X,"--n-color":ve,"--n-option-font-size":Z,"--n-group-header-text-color":he,"--n-option-check-color":xe,"--n-option-color-pending":ye,"--n-option-color-active":pe,"--n-option-color-active-pending":A,"--n-option-height":re,"--n-option-opacity-disabled":ee,"--n-option-text-color":se,"--n-option-text-color-active":ge,"--n-option-text-color-disabled":Re,"--n-option-text-color-pressed":me,"--n-option-padding":ue,"--n-option-padding-left":Ko(ue,"left"),"--n-option-padding-right":Ko(ue,"right"),"--n-loading-color":Me,"--n-loading-size":Q}}),{inlineThemeDisabled:_}=e,V=_?Ae("internal-select-menu",R(()=>e.size[0]),U,e):void 0,te={selfRef:t,next:k,prev:$,getPendingTmNode:B};return nl(t,e.onResize),Object.assign({mergedTheme:o,virtualListRef:r,scrollbarRef:n,itemSize:f,padding:p,flattenedNodes:l,empty:h,virtualListContainer(){const{value:N}=r;return N==null?void 0:N.listElRef},virtualListContent(){const{value:N}=r;return N==null?void 0:N.itemsElRef},doScroll:b,handleFocusin:j,handleFocusout:E,handleKeyUp:I,handleKeyDown:w,handleMouseDown:O,handleVirtualListResize:S,handleVirtualListScroll:x,cssVars:_?void 0:U,themeClass:V==null?void 0:V.themeClass,onRender:V==null?void 0:V.onRender},te)},render(){const{$slots:e,virtualScroll:o,clsPrefix:t,mergedTheme:r,themeClass:n,onRender:l}=this;return l==null||l(),i("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${t}-base-select-menu`,n,this.multiple&&`${t}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},this.loading?i("div",{class:`${t}-base-select-menu__loading`},i(Et,{clsPrefix:t,strokeWidth:20})):this.empty?i("div",{class:`${t}-base-select-menu__empty`,"data-empty":!0},lo(e.empty,()=>[i(Sc,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty})])):i(ur,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:o?this.virtualListContainer:void 0,content:o?this.virtualListContent:void 0,onScroll:o?void 0:this.doScroll},{default:()=>o?i(nd,{ref:"virtualListRef",class:`${t}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i(di,{key:a.key,clsPrefix:t,tmNode:a}):a.ignored?null:i(si,{clsPrefix:t,key:a.key,tmNode:a})}):i("div",{class:`${t}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i(di,{key:a.key,clsPrefix:t,tmNode:a}):i(si,{clsPrefix:t,key:a.key,tmNode:a})))}),Ee(e.action,a=>a&&[i("div",{class:`${t}-base-select-menu__action`,"data-action":!0,key:"action"},a),i(ac,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Oc=g("base-wave",` position: absolute; left: 0; right: 0; @@ -495,7 +495,7 @@ import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f ${t}: 100%; ${Gr[t]}: auto; ${r} - `,[g("popover-arrow",o)])])])}const Cl=Object.assign(Object.assign({},ne.props),{to:Io.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),yl=({arrowStyle:e,clsPrefix:o})=>i("div",{key:"__popover-arrow__",class:`${o}-popover-arrow-wrapper`},i("div",{class:`${o}-popover-arrow`,style:e})),Hc=q({name:"PopoverBody",inheritAttrs:!1,props:Cl,setup(e,{slots:o,attrs:t}){const{namespaceRef:r,mergedClsPrefixRef:n,inlineThemeDisabled:l}=ke(e),a=ne("Popover","-popover",Lc,jt,e,n),s=D(null),d=Se("NPopover"),c=D(null),u=D(e.show),f=D(!1);oo(()=>{const{show:w}=e;w&&!Pd()&&!e.internalDeactivateImmediately&&(f.value=!0)});const p=R(()=>{const{trigger:w,onClickoutside:O}=e,k=[],{positionManuallyRef:{value:$}}=d;return $||(w==="click"&&!O&&k.push([Ft,T,void 0,{capture:!0}]),w==="hover"&&k.push([pd,B])),O&&k.push([Ft,T,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&k.push([Go,e.show]),k}),v=R(()=>{const w=e.width==="trigger"?void 0:eo(e.width),O=[];w&&O.push({width:w});const{maxWidth:k,minWidth:$}=e;return k&&O.push({maxWidth:eo(k)}),$&&O.push({maxWidth:eo($)}),l||O.push(h.value),O}),h=R(()=>{const{common:{cubicBezierEaseInOut:w,cubicBezierEaseIn:O,cubicBezierEaseOut:k},self:{space:$,spaceArrow:L,padding:M,fontSize:j,textColor:E,dividerColor:U,color:_,boxShadow:V,borderRadius:te,arrowHeight:N,arrowOffset:G,arrowOffsetVertical:Ce}}=a.value;return{"--n-box-shadow":V,"--n-bezier":w,"--n-bezier-ease-in":O,"--n-bezier-ease-out":k,"--n-font-size":j,"--n-text-color":E,"--n-color":_,"--n-divider-color":U,"--n-border-radius":te,"--n-arrow-height":N,"--n-arrow-offset":G,"--n-arrow-offset-vertical":Ce,"--n-padding":M,"--n-space":$,"--n-space-arrow":L}}),m=l?Ae("popover",void 0,h,e):void 0;d.setBodyInstance({syncPosition:b}),wo(()=>{d.setBodyInstance(null)}),Ke(le(e,"show"),w=>{e.animated||(w?u.value=!0:u.value=!1)});function b(){var w;(w=s.value)===null||w===void 0||w.syncPosition()}function x(w){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&d.handleMouseEnter(w)}function S(w){e.trigger==="hover"&&e.keepAliveOnHover&&d.handleMouseLeave(w)}function B(w){e.trigger==="hover"&&!z().contains(Qt(w))&&d.handleMouseMoveOutside(w)}function T(w){(e.trigger==="click"&&!z().contains(Qt(w))||e.onClickoutside)&&d.handleClickOutside(w)}function z(){return d.getTriggerElement()}Oe(Dt,c),Oe(cr,null),Oe(dr,null);function I(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let O;const k=d.internalRenderBodyRef.value,{value:$}=n;if(k)O=k([`${$}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${$}-popover-shared--overlap`,e.showArrow&&`${$}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${$}-popover-shared--center-arrow`],c,v.value,x,S);else{const{value:L}=d.extraClassRef,{internalTrapFocus:M}=e,j=!ht(o.header)||!ht(o.footer),E=()=>{var U;const _=j?i(ao,null,Ee(o.header,N=>N?i("div",{class:`${$}-popover__header`,style:e.headerStyle},N):null),Ee(o.default,N=>N?i("div",{class:`${$}-popover__content`,style:e.contentStyle},o):null),Ee(o.footer,N=>N?i("div",{class:`${$}-popover__footer`,style:e.footerStyle},N):null)):e.scrollable?(U=o.default)===null||U===void 0?void 0:U.call(o):i("div",{class:`${$}-popover__content`,style:e.contentStyle},o),V=e.scrollable?i(gl,{contentClass:j?void 0:`${$}-popover__content`,contentStyle:j?void 0:e.contentStyle},{default:()=>_}):_,te=e.showArrow?yl({arrowStyle:e.arrowStyle,clsPrefix:$}):null;return[V,te]};O=i("div",ko({class:[`${$}-popover`,`${$}-popover-shared`,m==null?void 0:m.themeClass.value,L.map(U=>`${$}-${U}`),{[`${$}-popover--scrollable`]:e.scrollable,[`${$}-popover--show-header-or-footer`]:j,[`${$}-popover--raw`]:e.raw,[`${$}-popover-shared--overlap`]:e.overlap,[`${$}-popover-shared--show-arrow`]:e.showArrow,[`${$}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:c,style:v.value,onKeydown:d.handleKeydown,onMouseenter:x,onMouseleave:S},t),M?i(hn,{active:e.show,autoFocus:!0},{default:E}):E())}return Lo(O,p.value)}return{displayed:f,namespace:r,isMounted:d.isMountedRef,zIndex:d.zIndexRef,followerRef:s,adjustedTo:Io(e),followerEnabled:u,renderContentNode:I}},render(){return i(kr,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Io.tdkey},{default:()=>this.animated?i(no,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),Ac=Object.keys(Cl),Ec={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function jc(e,o,t){Ec[o].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const n=e.props[r],l=t[r];n?e.props[r]=(...a)=>{n(...a),l(...a)}:e.props[r]=l})}const bt={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Io.propTo,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Wc=Object.assign(Object.assign(Object.assign({},ne.props),bt),{internalOnAfterLeave:Function,internalRenderBody:Function}),hr=q({name:"Popover",inheritAttrs:!1,props:Wc,__popover__:!0,setup(e){const o=Ct(),t=D(null),r=R(()=>e.show),n=D(e.defaultShow),l=so(r,n),a=We(()=>e.disabled?!1:l.value),s=()=>{if(e.disabled)return!0;const{getDisabled:E}=e;return!!(E!=null&&E())},d=()=>s()?!1:l.value,c=gt(e,["arrow","showArrow"]),u=R(()=>e.overlap?!1:c.value);let f=null;const p=D(null),v=D(null),h=We(()=>e.x!==void 0&&e.y!==void 0);function m(E){const{"onUpdate:show":U,onUpdateShow:_,onShow:V,onHide:te}=e;n.value=E,U&&ae(U,E),_&&ae(_,E),E&&V&&ae(V,!0),E&&te&&ae(te,!1)}function b(){f&&f.syncPosition()}function x(){const{value:E}=p;E&&(window.clearTimeout(E),p.value=null)}function S(){const{value:E}=v;E&&(window.clearTimeout(E),v.value=null)}function B(){const E=s();if(e.trigger==="focus"&&!E){if(d())return;m(!0)}}function T(){const E=s();if(e.trigger==="focus"&&!E){if(!d())return;m(!1)}}function z(){const E=s();if(e.trigger==="hover"&&!E){if(S(),p.value!==null||d())return;const U=()=>{m(!0),p.value=null},{delay:_}=e;_===0?U():p.value=window.setTimeout(U,_)}}function I(){const E=s();if(e.trigger==="hover"&&!E){if(x(),v.value!==null||!d())return;const U=()=>{m(!1),v.value=null},{duration:_}=e;_===0?U():v.value=window.setTimeout(U,_)}}function w(){I()}function O(E){var U;d()&&(e.trigger==="click"&&(x(),S(),m(!1)),(U=e.onClickoutside)===null||U===void 0||U.call(e,E))}function k(){if(e.trigger==="click"&&!s()){x(),S();const E=!d();m(E)}}function $(E){e.internalTrapFocus&&E.key==="Escape"&&(x(),S(),m(!1))}function L(E){n.value=E}function M(){var E;return(E=t.value)===null||E===void 0?void 0:E.targetRef}function j(E){f=E}return Oe("NPopover",{getTriggerElement:M,handleKeydown:$,handleMouseEnter:z,handleMouseLeave:I,handleClickOutside:O,handleMouseMoveOutside:w,setBodyInstance:j,positionManuallyRef:h,isMountedRef:o,zIndexRef:le(e,"zIndex"),extraClassRef:le(e,"internalExtraClass"),internalRenderBodyRef:le(e,"internalRenderBody")}),oo(()=>{l.value&&s()&&m(!1)}),{binderInstRef:t,positionManually:h,mergedShowConsideringDisabledProp:a,uncontrolledShow:n,mergedShowArrow:u,getMergedShow:d,setShow:L,handleClick:k,handleMouseEnter:z,handleMouseLeave:I,handleFocus:B,handleBlur:T,syncPosition:b}},render(){var e;const{positionManually:o,$slots:t}=this;let r,n=!1;if(!o&&(t.activator?r=ln(t,"activator"):r=ln(t,"trigger"),r)){r=Jt(r),r=r.type===od?i("span",[r]):r;const l={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)n=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[l,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[l];else{const{internalInheritedEventHandlers:a}=this,s=[l,...a],d={onBlur:c=>{s.forEach(u=>{u.onBlur(c)})},onFocus:c=>{s.forEach(u=>{u.onFocus(c)})},onClick:c=>{s.forEach(u=>{u.onClick(c)})},onMouseenter:c=>{s.forEach(u=>{u.onMouseenter(c)})},onMouseleave:c=>{s.forEach(u=>{u.onMouseleave(c)})}};jc(r,a?"nested":o?"manual":this.trigger,d)}}return i(Ir,{ref:"binderInstRef",syncTarget:!n,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const l=this.getMergedShow();return[this.internalTrapFocus&&l?Lo(i("div",{style:{position:"fixed",inset:0}}),[[Tr,{enabled:l,zIndex:this.zIndex}]]):null,o?null:i(Br,null,{default:()=>r}),i(Hc,go(this.$props,Ac,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:l})),{default:()=>{var a,s;return(s=(a=this.$slots).default)===null||s===void 0?void 0:s.call(a)},header:()=>{var a,s;return(s=(a=this.$slots).header)===null||s===void 0?void 0:s.call(a)},footer:()=>{var a,s;return(s=(a=this.$slots).footer)===null||s===void 0?void 0:s.call(a)}})]}})}}),wl={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px",closeMarginRtl:"0 4px 0 0"},Nc={name:"Tag",common:fe,self(e){const{textColor2:o,primaryColorHover:t,primaryColorPressed:r,primaryColor:n,infoColor:l,successColor:a,warningColor:s,errorColor:d,baseColor:c,borderColor:u,tagColor:f,opacityDisabled:p,closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:b,closeColorPressed:x,borderRadiusSmall:S,fontSizeMini:B,fontSizeTiny:T,fontSizeSmall:z,fontSizeMedium:I,heightMini:w,heightTiny:O,heightSmall:k,heightMedium:$,buttonColor2Hover:L,buttonColor2Pressed:M,fontWeightStrong:j}=e;return Object.assign(Object.assign({},wl),{closeBorderRadius:S,heightTiny:w,heightSmall:O,heightMedium:k,heightLarge:$,borderRadius:S,opacityDisabled:p,fontSizeTiny:B,fontSizeSmall:T,fontSizeMedium:z,fontSizeLarge:I,fontWeightStrong:j,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:L,colorPressedCheckable:M,colorChecked:n,colorCheckedHover:t,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:o,color:f,colorBordered:"#0000",closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:b,closeColorPressed:x,borderPrimary:`1px solid ${J(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:J(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:Je(n,{lightness:.7}),closeIconColorHoverPrimary:Je(n,{lightness:.7}),closeIconColorPressedPrimary:Je(n,{lightness:.7}),closeColorHoverPrimary:J(n,{alpha:.16}),closeColorPressedPrimary:J(n,{alpha:.12}),borderInfo:`1px solid ${J(l,{alpha:.3})}`,textColorInfo:l,colorInfo:J(l,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:Je(l,{alpha:.7}),closeIconColorHoverInfo:Je(l,{alpha:.7}),closeIconColorPressedInfo:Je(l,{alpha:.7}),closeColorHoverInfo:J(l,{alpha:.16}),closeColorPressedInfo:J(l,{alpha:.12}),borderSuccess:`1px solid ${J(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:J(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:Je(a,{alpha:.7}),closeIconColorHoverSuccess:Je(a,{alpha:.7}),closeIconColorPressedSuccess:Je(a,{alpha:.7}),closeColorHoverSuccess:J(a,{alpha:.16}),closeColorPressedSuccess:J(a,{alpha:.12}),borderWarning:`1px solid ${J(s,{alpha:.3})}`,textColorWarning:s,colorWarning:J(s,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:Je(s,{alpha:.7}),closeIconColorHoverWarning:Je(s,{alpha:.7}),closeIconColorPressedWarning:Je(s,{alpha:.7}),closeColorHoverWarning:J(s,{alpha:.16}),closeColorPressedWarning:J(s,{alpha:.11}),borderError:`1px solid ${J(d,{alpha:.3})}`,textColorError:d,colorError:J(d,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:Je(d,{alpha:.7}),closeIconColorHoverError:Je(d,{alpha:.7}),closeIconColorPressedError:Je(d,{alpha:.7}),closeColorHoverError:J(d,{alpha:.16}),closeColorPressedError:J(d,{alpha:.12})})}},Sl=Nc,Vc=e=>{const{textColor2:o,primaryColorHover:t,primaryColorPressed:r,primaryColor:n,infoColor:l,successColor:a,warningColor:s,errorColor:d,baseColor:c,borderColor:u,opacityDisabled:f,tagColor:p,closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,borderRadiusSmall:b,fontSizeMini:x,fontSizeTiny:S,fontSizeSmall:B,fontSizeMedium:T,heightMini:z,heightTiny:I,heightSmall:w,heightMedium:O,closeColorHover:k,closeColorPressed:$,buttonColor2Hover:L,buttonColor2Pressed:M,fontWeightStrong:j}=e;return Object.assign(Object.assign({},wl),{closeBorderRadius:b,heightTiny:z,heightSmall:I,heightMedium:w,heightLarge:O,borderRadius:b,opacityDisabled:f,fontSizeTiny:x,fontSizeSmall:S,fontSizeMedium:B,fontSizeLarge:T,fontWeightStrong:j,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:L,colorPressedCheckable:M,colorChecked:n,colorCheckedHover:t,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:o,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:k,closeColorPressed:$,borderPrimary:`1px solid ${J(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:J(n,{alpha:.12}),colorBorderedPrimary:J(n,{alpha:.1}),closeIconColorPrimary:n,closeIconColorHoverPrimary:n,closeIconColorPressedPrimary:n,closeColorHoverPrimary:J(n,{alpha:.12}),closeColorPressedPrimary:J(n,{alpha:.18}),borderInfo:`1px solid ${J(l,{alpha:.3})}`,textColorInfo:l,colorInfo:J(l,{alpha:.12}),colorBorderedInfo:J(l,{alpha:.1}),closeIconColorInfo:l,closeIconColorHoverInfo:l,closeIconColorPressedInfo:l,closeColorHoverInfo:J(l,{alpha:.12}),closeColorPressedInfo:J(l,{alpha:.18}),borderSuccess:`1px solid ${J(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:J(a,{alpha:.12}),colorBorderedSuccess:J(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:J(a,{alpha:.12}),closeColorPressedSuccess:J(a,{alpha:.18}),borderWarning:`1px solid ${J(s,{alpha:.35})}`,textColorWarning:s,colorWarning:J(s,{alpha:.15}),colorBorderedWarning:J(s,{alpha:.12}),closeIconColorWarning:s,closeIconColorHoverWarning:s,closeIconColorPressedWarning:s,closeColorHoverWarning:J(s,{alpha:.12}),closeColorPressedWarning:J(s,{alpha:.18}),borderError:`1px solid ${J(d,{alpha:.23})}`,textColorError:d,colorError:J(d,{alpha:.1}),colorBorderedError:J(d,{alpha:.08}),closeIconColorError:d,closeIconColorHoverError:d,closeIconColorPressedError:d,closeColorHoverError:J(d,{alpha:.12}),closeColorPressedError:J(d,{alpha:.18})})},Uc={name:"Tag",common:Le,self:Vc},Kc=Uc,Gc={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},qc=g("tag",` + `,[g("popover-arrow",o)])])])}const Cl=Object.assign(Object.assign({},ne.props),{to:Io.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),yl=({arrowStyle:e,clsPrefix:o})=>i("div",{key:"__popover-arrow__",class:`${o}-popover-arrow-wrapper`},i("div",{class:`${o}-popover-arrow`,style:e})),Hc=q({name:"PopoverBody",inheritAttrs:!1,props:Cl,setup(e,{slots:o,attrs:t}){const{namespaceRef:r,mergedClsPrefixRef:n,inlineThemeDisabled:l}=ke(e),a=ne("Popover","-popover",Lc,jt,e,n),s=D(null),d=Se("NPopover"),c=D(null),u=D(e.show),f=D(!1);oo(()=>{const{show:w}=e;w&&!Pd()&&!e.internalDeactivateImmediately&&(f.value=!0)});const p=R(()=>{const{trigger:w,onClickoutside:O}=e,k=[],{positionManuallyRef:{value:$}}=d;return $||(w==="click"&&!O&&k.push([Ft,T,void 0,{capture:!0}]),w==="hover"&&k.push([vd,B])),O&&k.push([Ft,T,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&k.push([Go,e.show]),k}),v=R(()=>{const w=e.width==="trigger"?void 0:eo(e.width),O=[];w&&O.push({width:w});const{maxWidth:k,minWidth:$}=e;return k&&O.push({maxWidth:eo(k)}),$&&O.push({maxWidth:eo($)}),l||O.push(h.value),O}),h=R(()=>{const{common:{cubicBezierEaseInOut:w,cubicBezierEaseIn:O,cubicBezierEaseOut:k},self:{space:$,spaceArrow:L,padding:M,fontSize:j,textColor:E,dividerColor:U,color:_,boxShadow:V,borderRadius:te,arrowHeight:N,arrowOffset:G,arrowOffsetVertical:Ce}}=a.value;return{"--n-box-shadow":V,"--n-bezier":w,"--n-bezier-ease-in":O,"--n-bezier-ease-out":k,"--n-font-size":j,"--n-text-color":E,"--n-color":_,"--n-divider-color":U,"--n-border-radius":te,"--n-arrow-height":N,"--n-arrow-offset":G,"--n-arrow-offset-vertical":Ce,"--n-padding":M,"--n-space":$,"--n-space-arrow":L}}),m=l?Ae("popover",void 0,h,e):void 0;d.setBodyInstance({syncPosition:b}),wo(()=>{d.setBodyInstance(null)}),Ke(le(e,"show"),w=>{e.animated||(w?u.value=!0:u.value=!1)});function b(){var w;(w=s.value)===null||w===void 0||w.syncPosition()}function x(w){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&d.handleMouseEnter(w)}function S(w){e.trigger==="hover"&&e.keepAliveOnHover&&d.handleMouseLeave(w)}function B(w){e.trigger==="hover"&&!z().contains(Qt(w))&&d.handleMouseMoveOutside(w)}function T(w){(e.trigger==="click"&&!z().contains(Qt(w))||e.onClickoutside)&&d.handleClickOutside(w)}function z(){return d.getTriggerElement()}Oe(Dt,c),Oe(cr,null),Oe(dr,null);function I(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let O;const k=d.internalRenderBodyRef.value,{value:$}=n;if(k)O=k([`${$}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${$}-popover-shared--overlap`,e.showArrow&&`${$}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${$}-popover-shared--center-arrow`],c,v.value,x,S);else{const{value:L}=d.extraClassRef,{internalTrapFocus:M}=e,j=!ht(o.header)||!ht(o.footer),E=()=>{var U;const _=j?i(ao,null,Ee(o.header,N=>N?i("div",{class:`${$}-popover__header`,style:e.headerStyle},N):null),Ee(o.default,N=>N?i("div",{class:`${$}-popover__content`,style:e.contentStyle},o):null),Ee(o.footer,N=>N?i("div",{class:`${$}-popover__footer`,style:e.footerStyle},N):null)):e.scrollable?(U=o.default)===null||U===void 0?void 0:U.call(o):i("div",{class:`${$}-popover__content`,style:e.contentStyle},o),V=e.scrollable?i(gl,{contentClass:j?void 0:`${$}-popover__content`,contentStyle:j?void 0:e.contentStyle},{default:()=>_}):_,te=e.showArrow?yl({arrowStyle:e.arrowStyle,clsPrefix:$}):null;return[V,te]};O=i("div",ko({class:[`${$}-popover`,`${$}-popover-shared`,m==null?void 0:m.themeClass.value,L.map(U=>`${$}-${U}`),{[`${$}-popover--scrollable`]:e.scrollable,[`${$}-popover--show-header-or-footer`]:j,[`${$}-popover--raw`]:e.raw,[`${$}-popover-shared--overlap`]:e.overlap,[`${$}-popover-shared--show-arrow`]:e.showArrow,[`${$}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:c,style:v.value,onKeydown:d.handleKeydown,onMouseenter:x,onMouseleave:S},t),M?i(hn,{active:e.show,autoFocus:!0},{default:E}):E())}return Lo(O,p.value)}return{displayed:f,namespace:r,isMounted:d.isMountedRef,zIndex:d.zIndexRef,followerRef:s,adjustedTo:Io(e),followerEnabled:u,renderContentNode:I}},render(){return i(kr,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Io.tdkey},{default:()=>this.animated?i(no,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),Ac=Object.keys(Cl),Ec={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function jc(e,o,t){Ec[o].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const n=e.props[r],l=t[r];n?e.props[r]=(...a)=>{n(...a),l(...a)}:e.props[r]=l})}const bt={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Io.propTo,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Wc=Object.assign(Object.assign(Object.assign({},ne.props),bt),{internalOnAfterLeave:Function,internalRenderBody:Function}),hr=q({name:"Popover",inheritAttrs:!1,props:Wc,__popover__:!0,setup(e){const o=Ct(),t=D(null),r=R(()=>e.show),n=D(e.defaultShow),l=so(r,n),a=We(()=>e.disabled?!1:l.value),s=()=>{if(e.disabled)return!0;const{getDisabled:E}=e;return!!(E!=null&&E())},d=()=>s()?!1:l.value,c=gt(e,["arrow","showArrow"]),u=R(()=>e.overlap?!1:c.value);let f=null;const p=D(null),v=D(null),h=We(()=>e.x!==void 0&&e.y!==void 0);function m(E){const{"onUpdate:show":U,onUpdateShow:_,onShow:V,onHide:te}=e;n.value=E,U&&ae(U,E),_&&ae(_,E),E&&V&&ae(V,!0),E&&te&&ae(te,!1)}function b(){f&&f.syncPosition()}function x(){const{value:E}=p;E&&(window.clearTimeout(E),p.value=null)}function S(){const{value:E}=v;E&&(window.clearTimeout(E),v.value=null)}function B(){const E=s();if(e.trigger==="focus"&&!E){if(d())return;m(!0)}}function T(){const E=s();if(e.trigger==="focus"&&!E){if(!d())return;m(!1)}}function z(){const E=s();if(e.trigger==="hover"&&!E){if(S(),p.value!==null||d())return;const U=()=>{m(!0),p.value=null},{delay:_}=e;_===0?U():p.value=window.setTimeout(U,_)}}function I(){const E=s();if(e.trigger==="hover"&&!E){if(x(),v.value!==null||!d())return;const U=()=>{m(!1),v.value=null},{duration:_}=e;_===0?U():v.value=window.setTimeout(U,_)}}function w(){I()}function O(E){var U;d()&&(e.trigger==="click"&&(x(),S(),m(!1)),(U=e.onClickoutside)===null||U===void 0||U.call(e,E))}function k(){if(e.trigger==="click"&&!s()){x(),S();const E=!d();m(E)}}function $(E){e.internalTrapFocus&&E.key==="Escape"&&(x(),S(),m(!1))}function L(E){n.value=E}function M(){var E;return(E=t.value)===null||E===void 0?void 0:E.targetRef}function j(E){f=E}return Oe("NPopover",{getTriggerElement:M,handleKeydown:$,handleMouseEnter:z,handleMouseLeave:I,handleClickOutside:O,handleMouseMoveOutside:w,setBodyInstance:j,positionManuallyRef:h,isMountedRef:o,zIndexRef:le(e,"zIndex"),extraClassRef:le(e,"internalExtraClass"),internalRenderBodyRef:le(e,"internalRenderBody")}),oo(()=>{l.value&&s()&&m(!1)}),{binderInstRef:t,positionManually:h,mergedShowConsideringDisabledProp:a,uncontrolledShow:n,mergedShowArrow:u,getMergedShow:d,setShow:L,handleClick:k,handleMouseEnter:z,handleMouseLeave:I,handleFocus:B,handleBlur:T,syncPosition:b}},render(){var e;const{positionManually:o,$slots:t}=this;let r,n=!1;if(!o&&(t.activator?r=ln(t,"activator"):r=ln(t,"trigger"),r)){r=Jt(r),r=r.type===od?i("span",[r]):r;const l={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)n=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[l,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[l];else{const{internalInheritedEventHandlers:a}=this,s=[l,...a],d={onBlur:c=>{s.forEach(u=>{u.onBlur(c)})},onFocus:c=>{s.forEach(u=>{u.onFocus(c)})},onClick:c=>{s.forEach(u=>{u.onClick(c)})},onMouseenter:c=>{s.forEach(u=>{u.onMouseenter(c)})},onMouseleave:c=>{s.forEach(u=>{u.onMouseleave(c)})}};jc(r,a?"nested":o?"manual":this.trigger,d)}}return i(Br,{ref:"binderInstRef",syncTarget:!n,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const l=this.getMergedShow();return[this.internalTrapFocus&&l?Lo(i("div",{style:{position:"fixed",inset:0}}),[[Tr,{enabled:l,zIndex:this.zIndex}]]):null,o?null:i(Ir,null,{default:()=>r}),i(Hc,go(this.$props,Ac,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:l})),{default:()=>{var a,s;return(s=(a=this.$slots).default)===null||s===void 0?void 0:s.call(a)},header:()=>{var a,s;return(s=(a=this.$slots).header)===null||s===void 0?void 0:s.call(a)},footer:()=>{var a,s;return(s=(a=this.$slots).footer)===null||s===void 0?void 0:s.call(a)}})]}})}}),wl={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px",closeMarginRtl:"0 4px 0 0"},Nc={name:"Tag",common:fe,self(e){const{textColor2:o,primaryColorHover:t,primaryColorPressed:r,primaryColor:n,infoColor:l,successColor:a,warningColor:s,errorColor:d,baseColor:c,borderColor:u,tagColor:f,opacityDisabled:p,closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:b,closeColorPressed:x,borderRadiusSmall:S,fontSizeMini:B,fontSizeTiny:T,fontSizeSmall:z,fontSizeMedium:I,heightMini:w,heightTiny:O,heightSmall:k,heightMedium:$,buttonColor2Hover:L,buttonColor2Pressed:M,fontWeightStrong:j}=e;return Object.assign(Object.assign({},wl),{closeBorderRadius:S,heightTiny:w,heightSmall:O,heightMedium:k,heightLarge:$,borderRadius:S,opacityDisabled:p,fontSizeTiny:B,fontSizeSmall:T,fontSizeMedium:z,fontSizeLarge:I,fontWeightStrong:j,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:L,colorPressedCheckable:M,colorChecked:n,colorCheckedHover:t,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:o,color:f,colorBordered:"#0000",closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:b,closeColorPressed:x,borderPrimary:`1px solid ${J(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:J(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:Je(n,{lightness:.7}),closeIconColorHoverPrimary:Je(n,{lightness:.7}),closeIconColorPressedPrimary:Je(n,{lightness:.7}),closeColorHoverPrimary:J(n,{alpha:.16}),closeColorPressedPrimary:J(n,{alpha:.12}),borderInfo:`1px solid ${J(l,{alpha:.3})}`,textColorInfo:l,colorInfo:J(l,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:Je(l,{alpha:.7}),closeIconColorHoverInfo:Je(l,{alpha:.7}),closeIconColorPressedInfo:Je(l,{alpha:.7}),closeColorHoverInfo:J(l,{alpha:.16}),closeColorPressedInfo:J(l,{alpha:.12}),borderSuccess:`1px solid ${J(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:J(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:Je(a,{alpha:.7}),closeIconColorHoverSuccess:Je(a,{alpha:.7}),closeIconColorPressedSuccess:Je(a,{alpha:.7}),closeColorHoverSuccess:J(a,{alpha:.16}),closeColorPressedSuccess:J(a,{alpha:.12}),borderWarning:`1px solid ${J(s,{alpha:.3})}`,textColorWarning:s,colorWarning:J(s,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:Je(s,{alpha:.7}),closeIconColorHoverWarning:Je(s,{alpha:.7}),closeIconColorPressedWarning:Je(s,{alpha:.7}),closeColorHoverWarning:J(s,{alpha:.16}),closeColorPressedWarning:J(s,{alpha:.11}),borderError:`1px solid ${J(d,{alpha:.3})}`,textColorError:d,colorError:J(d,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:Je(d,{alpha:.7}),closeIconColorHoverError:Je(d,{alpha:.7}),closeIconColorPressedError:Je(d,{alpha:.7}),closeColorHoverError:J(d,{alpha:.16}),closeColorPressedError:J(d,{alpha:.12})})}},Sl=Nc,Vc=e=>{const{textColor2:o,primaryColorHover:t,primaryColorPressed:r,primaryColor:n,infoColor:l,successColor:a,warningColor:s,errorColor:d,baseColor:c,borderColor:u,opacityDisabled:f,tagColor:p,closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,borderRadiusSmall:b,fontSizeMini:x,fontSizeTiny:S,fontSizeSmall:B,fontSizeMedium:T,heightMini:z,heightTiny:I,heightSmall:w,heightMedium:O,closeColorHover:k,closeColorPressed:$,buttonColor2Hover:L,buttonColor2Pressed:M,fontWeightStrong:j}=e;return Object.assign(Object.assign({},wl),{closeBorderRadius:b,heightTiny:z,heightSmall:I,heightMedium:w,heightLarge:O,borderRadius:b,opacityDisabled:f,fontSizeTiny:x,fontSizeSmall:S,fontSizeMedium:B,fontSizeLarge:T,fontWeightStrong:j,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:L,colorPressedCheckable:M,colorChecked:n,colorCheckedHover:t,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:o,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:k,closeColorPressed:$,borderPrimary:`1px solid ${J(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:J(n,{alpha:.12}),colorBorderedPrimary:J(n,{alpha:.1}),closeIconColorPrimary:n,closeIconColorHoverPrimary:n,closeIconColorPressedPrimary:n,closeColorHoverPrimary:J(n,{alpha:.12}),closeColorPressedPrimary:J(n,{alpha:.18}),borderInfo:`1px solid ${J(l,{alpha:.3})}`,textColorInfo:l,colorInfo:J(l,{alpha:.12}),colorBorderedInfo:J(l,{alpha:.1}),closeIconColorInfo:l,closeIconColorHoverInfo:l,closeIconColorPressedInfo:l,closeColorHoverInfo:J(l,{alpha:.12}),closeColorPressedInfo:J(l,{alpha:.18}),borderSuccess:`1px solid ${J(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:J(a,{alpha:.12}),colorBorderedSuccess:J(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:J(a,{alpha:.12}),closeColorPressedSuccess:J(a,{alpha:.18}),borderWarning:`1px solid ${J(s,{alpha:.35})}`,textColorWarning:s,colorWarning:J(s,{alpha:.15}),colorBorderedWarning:J(s,{alpha:.12}),closeIconColorWarning:s,closeIconColorHoverWarning:s,closeIconColorPressedWarning:s,closeColorHoverWarning:J(s,{alpha:.12}),closeColorPressedWarning:J(s,{alpha:.18}),borderError:`1px solid ${J(d,{alpha:.23})}`,textColorError:d,colorError:J(d,{alpha:.1}),colorBorderedError:J(d,{alpha:.08}),closeIconColorError:d,closeIconColorHoverError:d,closeIconColorPressedError:d,closeColorHoverError:J(d,{alpha:.12}),closeColorPressedError:J(d,{alpha:.18})})},Uc={name:"Tag",common:Le,self:Vc},Kc=Uc,Gc={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},qc=g("tag",` white-space: nowrap; position: relative; box-sizing: border-box; @@ -1517,7 +1517,7 @@ import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f `),g("select-menu",` margin: 4px 0; box-shadow: var(--n-menu-box-shadow); - `,[at({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),rh=Object.assign(Object.assign({},ne.props),{to:Io.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),nh=q({name:"Select",props:rh,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,namespaceRef:r,inlineThemeDisabled:n}=ke(e),l=ne("Select","-select",th,Yl,e,o),a=D(e.defaultValue),s=le(e,"value"),d=so(s,a),c=D(!1),u=D(""),f=R(()=>{const{valueField:F,childrenField:K}=e,ie=Tl(F,K);return ar(M.value,ie)}),p=R(()=>xu($.value,e.valueField,e.childrenField)),v=D(!1),h=so(le(e,"show"),v),m=D(null),b=D(null),x=D(null),{localeRef:S}=Xo("Select"),B=R(()=>{var F;return(F=e.placeholder)!==null&&F!==void 0?F:S.value.placeholder}),T=gt(e,["items","options"]),z=[],I=D([]),w=D([]),O=D(new Map),k=R(()=>{const{fallbackOption:F}=e;if(F===void 0){const{labelField:K,valueField:ie}=e;return ze=>({[K]:String(ze),[ie]:ze})}return F===!1?!1:K=>Object.assign(F(K),{value:K})}),$=R(()=>w.value.concat(I.value).concat(T.value)),L=R(()=>{const{filter:F}=e;if(F)return F;const{labelField:K,valueField:ie}=e;return(ze,Pe)=>{if(!Pe)return!1;const Ie=Pe[K];if(typeof Ie=="string")return Yr(ze,Ie);const Te=Pe[ie];return typeof Te=="string"?Yr(ze,Te):typeof Te=="number"?Yr(ze,String(Te)):!1}}),M=R(()=>{if(e.remote)return T.value;{const{value:F}=$,{value:K}=u;return!K.length||!e.filterable?F:bu(F,L.value,K,e.childrenField)}});function j(F){const K=e.remote,{value:ie}=O,{value:ze}=p,{value:Pe}=k,Ie=[];return F.forEach(Te=>{if(ze.has(Te))Ie.push(ze.get(Te));else if(K&&ie.has(Te))Ie.push(ie.get(Te));else if(Pe){const _e=Pe(Te);_e&&Ie.push(_e)}}),Ie}const E=R(()=>{if(e.multiple){const{value:F}=d;return Array.isArray(F)?j(F):[]}return null}),U=R(()=>{const{value:F}=d;return!e.multiple&&!Array.isArray(F)?F===null?null:j([F])[0]||null:null}),_=rt(e),{mergedSizeRef:V,mergedDisabledRef:te,mergedStatusRef:N}=_;function G(F,K){const{onChange:ie,"onUpdate:value":ze,onUpdateValue:Pe}=e,{nTriggerFormChange:Ie,nTriggerFormInput:Te}=_;ie&&ae(ie,F,K),Pe&&ae(Pe,F,K),ze&&ae(ze,F,K),a.value=F,Ie(),Te()}function Ce(F){const{onBlur:K}=e,{nTriggerFormBlur:ie}=_;K&&ae(K,F),ie()}function X(){const{onClear:F}=e;F&&ae(F)}function ve(F){const{onFocus:K,showOnFocus:ie}=e,{nTriggerFormFocus:ze}=_;K&&ae(K,F),ze(),ie&&Re()}function he(F){const{onSearch:K}=e;K&&ae(K,F)}function be(F){const{onScroll:K}=e;K&&ae(K,F)}function me(){var F;const{remote:K,multiple:ie}=e;if(K){const{value:ze}=O;if(ie){const{valueField:Pe}=e;(F=E.value)===null||F===void 0||F.forEach(Ie=>{ze.set(Ie[Pe],Ie)})}else{const Pe=U.value;Pe&&ze.set(Pe[e.valueField],Pe)}}}function se(F){const{onUpdateShow:K,"onUpdate:show":ie}=e;K&&ae(K,F),ie&&ae(ie,F),v.value=F}function Re(){te.value||(se(!0),v.value=!0,e.filterable&&Co())}function ge(){se(!1)}function ee(){u.value="",w.value=z}const xe=D(!1);function de(){e.filterable&&(xe.value=!0)}function ye(){e.filterable&&(xe.value=!1,h.value||ee())}function pe(){te.value||(h.value?e.filterable?Co():ge():Re())}function Me(F){var K,ie;!((ie=(K=x.value)===null||K===void 0?void 0:K.selfRef)===null||ie===void 0)&&ie.contains(F.relatedTarget)||(c.value=!1,Ce(F),ge())}function Q(F){ve(F),c.value=!0}function A(F){c.value=!0}function Z(F){var K;!((K=m.value)===null||K===void 0)&&K.$el.contains(F.relatedTarget)||(c.value=!1,Ce(F),ge())}function re(){var F;(F=m.value)===null||F===void 0||F.focus(),ge()}function ue(F){var K;h.value&&(!((K=m.value)===null||K===void 0)&&K.$el.contains(Qt(F))||ge())}function Y(F){if(!Array.isArray(F))return[];if(k.value)return Array.from(F);{const{remote:K}=e,{value:ie}=p;if(K){const{value:ze}=O;return F.filter(Pe=>ie.has(Pe)||ze.has(Pe))}else return F.filter(ze=>ie.has(ze))}}function ce(F){He(F.rawNode)}function He(F){if(te.value)return;const{tag:K,remote:ie,clearFilterAfterSelect:ze,valueField:Pe}=e;if(K&&!ie){const{value:Ie}=w,Te=Ie[0]||null;if(Te){const _e=I.value;_e.length?_e.push(Te):I.value=[Te],w.value=z}}if(ie&&O.value.set(F[Pe],F),e.multiple){const Ie=Y(d.value),Te=Ie.findIndex(_e=>_e===F[Pe]);if(~Te){if(Ie.splice(Te,1),K&&!ie){const _e=Ve(F[Pe]);~_e&&(I.value.splice(_e,1),ze&&(u.value=""))}}else Ie.push(F[Pe]),ze&&(u.value="");G(Ie,j(Ie))}else{if(K&&!ie){const Ie=Ve(F[Pe]);~Ie?I.value=[I.value[Ie]]:I.value=z}xo(),ge(),G(F[Pe],F)}}function Ve(F){return I.value.findIndex(ie=>ie[e.valueField]===F)}function Ze(F){h.value||Re();const{value:K}=F.target;u.value=K;const{tag:ie,remote:ze}=e;if(he(K),ie&&!ze){if(!K){w.value=z;return}const{onCreate:Pe}=e,Ie=Pe?Pe(K):{[e.labelField]:K,[e.valueField]:K},{valueField:Te}=e;T.value.some(_e=>_e[Te]===Ie[Te])||I.value.some(_e=>_e[Te]===Ie[Te])?w.value=z:w.value=[Ie]}}function po(F){F.stopPropagation();const{multiple:K}=e;!K&&e.filterable&&ge(),X(),K?G([],[]):G(null,null)}function fo(F){!pt(F,"action")&&!pt(F,"empty")&&F.preventDefault()}function Bo(F){be(F)}function To(F){var K,ie,ze,Pe,Ie;if(!e.keyboard){F.preventDefault();return}switch(F.key){case" ":if(e.filterable)break;F.preventDefault();case"Enter":if(!(!((K=m.value)===null||K===void 0)&&K.isComposing)){if(h.value){const Te=(ie=x.value)===null||ie===void 0?void 0:ie.getPendingTmNode();Te?ce(Te):e.filterable||(ge(),xo())}else if(Re(),e.tag&&xe.value){const Te=w.value[0];if(Te){const _e=Te[e.valueField],{value:Qe}=d;e.multiple&&Array.isArray(Qe)&&Qe.some(vo=>vo===_e)||He(Te)}}}F.preventDefault();break;case"ArrowUp":if(F.preventDefault(),e.loading)return;h.value&&((ze=x.value)===null||ze===void 0||ze.prev());break;case"ArrowDown":if(F.preventDefault(),e.loading)return;h.value?(Pe=x.value)===null||Pe===void 0||Pe.next():Re();break;case"Escape":h.value&&(kd(F),ge()),(Ie=m.value)===null||Ie===void 0||Ie.focus();break}}function xo(){var F;(F=m.value)===null||F===void 0||F.focus()}function Co(){var F;(F=m.value)===null||F===void 0||F.focusInput()}function Ao(){var F;h.value&&((F=b.value)===null||F===void 0||F.syncPosition())}me(),Ke(le(e,"options"),me);const Fo={focus:()=>{var F;(F=m.value)===null||F===void 0||F.focus()},blur:()=>{var F;(F=m.value)===null||F===void 0||F.blur()}},co=R(()=>{const{self:{menuBoxShadow:F}}=l.value;return{"--n-menu-box-shadow":F}}),uo=n?Ae("select",void 0,co,e):void 0;return Object.assign(Object.assign({},Fo),{mergedStatus:N,mergedClsPrefix:o,mergedBordered:t,namespace:r,treeMate:f,isMounted:Ct(),triggerRef:m,menuRef:x,pattern:u,uncontrolledShow:v,mergedShow:h,adjustedTo:Io(e),uncontrolledValue:a,mergedValue:d,followerRef:b,localizedPlaceholder:B,selectedOption:U,selectedOptions:E,mergedSize:V,mergedDisabled:te,focused:c,activeWithoutMenuOpen:xe,inlineThemeDisabled:n,onTriggerInputFocus:de,onTriggerInputBlur:ye,handleTriggerOrMenuResize:Ao,handleMenuFocus:A,handleMenuBlur:Z,handleMenuTabOut:re,handleTriggerClick:pe,handleToggle:ce,handleDeleteOption:He,handlePatternInput:Ze,handleClear:po,handleTriggerBlur:Me,handleTriggerFocus:Q,handleKeydown:To,handleMenuAfterLeave:ee,handleMenuClickOutside:ue,handleMenuScroll:Bo,handleMenuKeydown:To,handleMenuMousedown:fo,mergedTheme:l,cssVars:n?void 0:co,themeClass:uo==null?void 0:uo.themeClass,onRender:uo==null?void 0:uo.onRender})},render(){return i("div",{class:`${this.mergedClsPrefix}-select`},i(Ir,null,{default:()=>[i(Br,null,{default:()=>i(ou,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,o;return[(o=(e=this.$slots).arrow)===null||o===void 0?void 0:o.call(e)]}})}),i(kr,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Io.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i(no,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,o,t;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),Lo(i(yn,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(o=this.menuProps)===null||o===void 0?void 0:o.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:"medium",renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(t=this.menuProps)===null||t===void 0?void 0:t.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,n;return[(n=(r=this.$slots).empty)===null||n===void 0?void 0:n.call(r)]},action:()=>{var r,n;return[(n=(r=this.$slots).action)===null||n===void 0?void 0:n.call(r)]}}),this.displayDirective==="show"?[[Go,this.mergedShow],[Ft,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Ft,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),ih={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"},Zl=e=>{const{textColor2:o,primaryColor:t,primaryColorHover:r,primaryColorPressed:n,inputColorDisabled:l,textColorDisabled:a,borderColor:s,borderRadius:d,fontSizeTiny:c,fontSizeSmall:u,fontSizeMedium:f,heightTiny:p,heightSmall:v,heightMedium:h}=e;return Object.assign(Object.assign({},ih),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${s}`,buttonBorderHover:`1px solid ${s}`,buttonBorderPressed:`1px solid ${s}`,buttonIconColor:o,buttonIconColorHover:o,buttonIconColorPressed:o,itemTextColor:o,itemTextColorHover:r,itemTextColorPressed:n,itemTextColorActive:t,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:l,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${t}`,itemBorderDisabled:`1px solid ${s}`,itemBorderRadius:d,itemSizeSmall:p,itemSizeMedium:v,itemSizeLarge:h,itemFontSizeSmall:c,itemFontSizeMedium:u,itemFontSizeLarge:f,jumperFontSizeSmall:c,jumperFontSizeMedium:u,jumperFontSizeLarge:f,jumperTextColor:o,jumperTextColorDisabled:a})},lh={name:"Pagination",common:Le,peers:{Select:Yl,Input:pr,Popselect:zn},self:Zl},ah=lh,sh={name:"Pagination",common:fe,peers:{Select:Xl,Input:Ho,Popselect:Kl},self(e){const{primaryColor:o,opacity3:t}=e,r=J(o,{alpha:Number(t)}),n=Zl(e);return n.itemBorderActive=`1px solid ${r}`,n.itemBorderDisabled="1px solid #0000",n}},Ql=sh;function dh(e,o,t){let r=!1,n=!1,l=1,a=o;if(o===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:a,fastBackwardTo:l,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(o===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:a,fastBackwardTo:l,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:"page",label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};const s=1,d=o;let c=e,u=e;const f=(t-5)/2;u+=Math.ceil(f),u=Math.min(Math.max(u,s+t-3),d-2),c-=Math.floor(f),c=Math.max(Math.min(c,d-t+3),s+2);let p=!1,v=!1;c>s+2&&(p=!0),u=s+1&&h.push({type:"page",label:s+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===s+1});for(let m=c;m<=u;++m)h.push({type:"page",label:m,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===m});return v?(n=!0,a=u+1,h.push({type:"fast-forward",active:!1,label:void 0,options:gi(u+1,d-1)})):u===d-2&&h[h.length-1].label!==d-1&&h.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:d-1,active:e===d-1}),h[h.length-1].label!==d&&h.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:d,active:e===d}),{hasFastBackward:r,hasFastForward:n,fastBackwardTo:l,fastForwardTo:a,items:h}}function gi(e,o){const t=[];for(let r=e;r<=o;++r)t.push({label:`${r}`,value:r});return t}const mi=` + `,[at({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),rh=Object.assign(Object.assign({},ne.props),{to:Io.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),nh=q({name:"Select",props:rh,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,namespaceRef:r,inlineThemeDisabled:n}=ke(e),l=ne("Select","-select",th,Yl,e,o),a=D(e.defaultValue),s=le(e,"value"),d=so(s,a),c=D(!1),u=D(""),f=R(()=>{const{valueField:F,childrenField:K}=e,ie=Tl(F,K);return ar(M.value,ie)}),p=R(()=>xu($.value,e.valueField,e.childrenField)),v=D(!1),h=so(le(e,"show"),v),m=D(null),b=D(null),x=D(null),{localeRef:S}=Xo("Select"),B=R(()=>{var F;return(F=e.placeholder)!==null&&F!==void 0?F:S.value.placeholder}),T=gt(e,["items","options"]),z=[],I=D([]),w=D([]),O=D(new Map),k=R(()=>{const{fallbackOption:F}=e;if(F===void 0){const{labelField:K,valueField:ie}=e;return ze=>({[K]:String(ze),[ie]:ze})}return F===!1?!1:K=>Object.assign(F(K),{value:K})}),$=R(()=>w.value.concat(I.value).concat(T.value)),L=R(()=>{const{filter:F}=e;if(F)return F;const{labelField:K,valueField:ie}=e;return(ze,Pe)=>{if(!Pe)return!1;const Ie=Pe[K];if(typeof Ie=="string")return Yr(ze,Ie);const Te=Pe[ie];return typeof Te=="string"?Yr(ze,Te):typeof Te=="number"?Yr(ze,String(Te)):!1}}),M=R(()=>{if(e.remote)return T.value;{const{value:F}=$,{value:K}=u;return!K.length||!e.filterable?F:bu(F,L.value,K,e.childrenField)}});function j(F){const K=e.remote,{value:ie}=O,{value:ze}=p,{value:Pe}=k,Ie=[];return F.forEach(Te=>{if(ze.has(Te))Ie.push(ze.get(Te));else if(K&&ie.has(Te))Ie.push(ie.get(Te));else if(Pe){const _e=Pe(Te);_e&&Ie.push(_e)}}),Ie}const E=R(()=>{if(e.multiple){const{value:F}=d;return Array.isArray(F)?j(F):[]}return null}),U=R(()=>{const{value:F}=d;return!e.multiple&&!Array.isArray(F)?F===null?null:j([F])[0]||null:null}),_=rt(e),{mergedSizeRef:V,mergedDisabledRef:te,mergedStatusRef:N}=_;function G(F,K){const{onChange:ie,"onUpdate:value":ze,onUpdateValue:Pe}=e,{nTriggerFormChange:Ie,nTriggerFormInput:Te}=_;ie&&ae(ie,F,K),Pe&&ae(Pe,F,K),ze&&ae(ze,F,K),a.value=F,Ie(),Te()}function Ce(F){const{onBlur:K}=e,{nTriggerFormBlur:ie}=_;K&&ae(K,F),ie()}function X(){const{onClear:F}=e;F&&ae(F)}function ve(F){const{onFocus:K,showOnFocus:ie}=e,{nTriggerFormFocus:ze}=_;K&&ae(K,F),ze(),ie&&Re()}function he(F){const{onSearch:K}=e;K&&ae(K,F)}function be(F){const{onScroll:K}=e;K&&ae(K,F)}function me(){var F;const{remote:K,multiple:ie}=e;if(K){const{value:ze}=O;if(ie){const{valueField:Pe}=e;(F=E.value)===null||F===void 0||F.forEach(Ie=>{ze.set(Ie[Pe],Ie)})}else{const Pe=U.value;Pe&&ze.set(Pe[e.valueField],Pe)}}}function se(F){const{onUpdateShow:K,"onUpdate:show":ie}=e;K&&ae(K,F),ie&&ae(ie,F),v.value=F}function Re(){te.value||(se(!0),v.value=!0,e.filterable&&Co())}function ge(){se(!1)}function ee(){u.value="",w.value=z}const xe=D(!1);function de(){e.filterable&&(xe.value=!0)}function ye(){e.filterable&&(xe.value=!1,h.value||ee())}function pe(){te.value||(h.value?e.filterable?Co():ge():Re())}function Me(F){var K,ie;!((ie=(K=x.value)===null||K===void 0?void 0:K.selfRef)===null||ie===void 0)&&ie.contains(F.relatedTarget)||(c.value=!1,Ce(F),ge())}function Q(F){ve(F),c.value=!0}function A(F){c.value=!0}function Z(F){var K;!((K=m.value)===null||K===void 0)&&K.$el.contains(F.relatedTarget)||(c.value=!1,Ce(F),ge())}function re(){var F;(F=m.value)===null||F===void 0||F.focus(),ge()}function ue(F){var K;h.value&&(!((K=m.value)===null||K===void 0)&&K.$el.contains(Qt(F))||ge())}function Y(F){if(!Array.isArray(F))return[];if(k.value)return Array.from(F);{const{remote:K}=e,{value:ie}=p;if(K){const{value:ze}=O;return F.filter(Pe=>ie.has(Pe)||ze.has(Pe))}else return F.filter(ze=>ie.has(ze))}}function ce(F){He(F.rawNode)}function He(F){if(te.value)return;const{tag:K,remote:ie,clearFilterAfterSelect:ze,valueField:Pe}=e;if(K&&!ie){const{value:Ie}=w,Te=Ie[0]||null;if(Te){const _e=I.value;_e.length?_e.push(Te):I.value=[Te],w.value=z}}if(ie&&O.value.set(F[Pe],F),e.multiple){const Ie=Y(d.value),Te=Ie.findIndex(_e=>_e===F[Pe]);if(~Te){if(Ie.splice(Te,1),K&&!ie){const _e=Ve(F[Pe]);~_e&&(I.value.splice(_e,1),ze&&(u.value=""))}}else Ie.push(F[Pe]),ze&&(u.value="");G(Ie,j(Ie))}else{if(K&&!ie){const Ie=Ve(F[Pe]);~Ie?I.value=[I.value[Ie]]:I.value=z}xo(),ge(),G(F[Pe],F)}}function Ve(F){return I.value.findIndex(ie=>ie[e.valueField]===F)}function Ze(F){h.value||Re();const{value:K}=F.target;u.value=K;const{tag:ie,remote:ze}=e;if(he(K),ie&&!ze){if(!K){w.value=z;return}const{onCreate:Pe}=e,Ie=Pe?Pe(K):{[e.labelField]:K,[e.valueField]:K},{valueField:Te}=e;T.value.some(_e=>_e[Te]===Ie[Te])||I.value.some(_e=>_e[Te]===Ie[Te])?w.value=z:w.value=[Ie]}}function po(F){F.stopPropagation();const{multiple:K}=e;!K&&e.filterable&&ge(),X(),K?G([],[]):G(null,null)}function fo(F){!pt(F,"action")&&!pt(F,"empty")&&F.preventDefault()}function Bo(F){be(F)}function To(F){var K,ie,ze,Pe,Ie;if(!e.keyboard){F.preventDefault();return}switch(F.key){case" ":if(e.filterable)break;F.preventDefault();case"Enter":if(!(!((K=m.value)===null||K===void 0)&&K.isComposing)){if(h.value){const Te=(ie=x.value)===null||ie===void 0?void 0:ie.getPendingTmNode();Te?ce(Te):e.filterable||(ge(),xo())}else if(Re(),e.tag&&xe.value){const Te=w.value[0];if(Te){const _e=Te[e.valueField],{value:Qe}=d;e.multiple&&Array.isArray(Qe)&&Qe.some(vo=>vo===_e)||He(Te)}}}F.preventDefault();break;case"ArrowUp":if(F.preventDefault(),e.loading)return;h.value&&((ze=x.value)===null||ze===void 0||ze.prev());break;case"ArrowDown":if(F.preventDefault(),e.loading)return;h.value?(Pe=x.value)===null||Pe===void 0||Pe.next():Re();break;case"Escape":h.value&&(kd(F),ge()),(Ie=m.value)===null||Ie===void 0||Ie.focus();break}}function xo(){var F;(F=m.value)===null||F===void 0||F.focus()}function Co(){var F;(F=m.value)===null||F===void 0||F.focusInput()}function Ao(){var F;h.value&&((F=b.value)===null||F===void 0||F.syncPosition())}me(),Ke(le(e,"options"),me);const Fo={focus:()=>{var F;(F=m.value)===null||F===void 0||F.focus()},blur:()=>{var F;(F=m.value)===null||F===void 0||F.blur()}},co=R(()=>{const{self:{menuBoxShadow:F}}=l.value;return{"--n-menu-box-shadow":F}}),uo=n?Ae("select",void 0,co,e):void 0;return Object.assign(Object.assign({},Fo),{mergedStatus:N,mergedClsPrefix:o,mergedBordered:t,namespace:r,treeMate:f,isMounted:Ct(),triggerRef:m,menuRef:x,pattern:u,uncontrolledShow:v,mergedShow:h,adjustedTo:Io(e),uncontrolledValue:a,mergedValue:d,followerRef:b,localizedPlaceholder:B,selectedOption:U,selectedOptions:E,mergedSize:V,mergedDisabled:te,focused:c,activeWithoutMenuOpen:xe,inlineThemeDisabled:n,onTriggerInputFocus:de,onTriggerInputBlur:ye,handleTriggerOrMenuResize:Ao,handleMenuFocus:A,handleMenuBlur:Z,handleMenuTabOut:re,handleTriggerClick:pe,handleToggle:ce,handleDeleteOption:He,handlePatternInput:Ze,handleClear:po,handleTriggerBlur:Me,handleTriggerFocus:Q,handleKeydown:To,handleMenuAfterLeave:ee,handleMenuClickOutside:ue,handleMenuScroll:Bo,handleMenuKeydown:To,handleMenuMousedown:fo,mergedTheme:l,cssVars:n?void 0:co,themeClass:uo==null?void 0:uo.themeClass,onRender:uo==null?void 0:uo.onRender})},render(){return i("div",{class:`${this.mergedClsPrefix}-select`},i(Br,null,{default:()=>[i(Ir,null,{default:()=>i(ou,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,o;return[(o=(e=this.$slots).arrow)===null||o===void 0?void 0:o.call(e)]}})}),i(kr,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Io.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i(no,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,o,t;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),Lo(i(yn,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(o=this.menuProps)===null||o===void 0?void 0:o.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:"medium",renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(t=this.menuProps)===null||t===void 0?void 0:t.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,n;return[(n=(r=this.$slots).empty)===null||n===void 0?void 0:n.call(r)]},action:()=>{var r,n;return[(n=(r=this.$slots).action)===null||n===void 0?void 0:n.call(r)]}}),this.displayDirective==="show"?[[Go,this.mergedShow],[Ft,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Ft,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),ih={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"},Zl=e=>{const{textColor2:o,primaryColor:t,primaryColorHover:r,primaryColorPressed:n,inputColorDisabled:l,textColorDisabled:a,borderColor:s,borderRadius:d,fontSizeTiny:c,fontSizeSmall:u,fontSizeMedium:f,heightTiny:p,heightSmall:v,heightMedium:h}=e;return Object.assign(Object.assign({},ih),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${s}`,buttonBorderHover:`1px solid ${s}`,buttonBorderPressed:`1px solid ${s}`,buttonIconColor:o,buttonIconColorHover:o,buttonIconColorPressed:o,itemTextColor:o,itemTextColorHover:r,itemTextColorPressed:n,itemTextColorActive:t,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:l,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${t}`,itemBorderDisabled:`1px solid ${s}`,itemBorderRadius:d,itemSizeSmall:p,itemSizeMedium:v,itemSizeLarge:h,itemFontSizeSmall:c,itemFontSizeMedium:u,itemFontSizeLarge:f,jumperFontSizeSmall:c,jumperFontSizeMedium:u,jumperFontSizeLarge:f,jumperTextColor:o,jumperTextColorDisabled:a})},lh={name:"Pagination",common:Le,peers:{Select:Yl,Input:pr,Popselect:zn},self:Zl},ah=lh,sh={name:"Pagination",common:fe,peers:{Select:Xl,Input:Ho,Popselect:Kl},self(e){const{primaryColor:o,opacity3:t}=e,r=J(o,{alpha:Number(t)}),n=Zl(e);return n.itemBorderActive=`1px solid ${r}`,n.itemBorderDisabled="1px solid #0000",n}},Ql=sh;function dh(e,o,t){let r=!1,n=!1,l=1,a=o;if(o===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:a,fastBackwardTo:l,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(o===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:a,fastBackwardTo:l,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:"page",label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};const s=1,d=o;let c=e,u=e;const f=(t-5)/2;u+=Math.ceil(f),u=Math.min(Math.max(u,s+t-3),d-2),c-=Math.floor(f),c=Math.max(Math.min(c,d-t+3),s+2);let p=!1,v=!1;c>s+2&&(p=!0),u=s+1&&h.push({type:"page",label:s+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===s+1});for(let m=c;m<=u;++m)h.push({type:"page",label:m,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===m});return v?(n=!0,a=u+1,h.push({type:"fast-forward",active:!1,label:void 0,options:gi(u+1,d-1)})):u===d-2&&h[h.length-1].label!==d-1&&h.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:d-1,active:e===d-1}),h[h.length-1].label!==d&&h.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:d,active:e===d}),{hasFastBackward:r,hasFastForward:n,fastBackwardTo:l,fastForwardTo:a,items:h}}function gi(e,o){const t=[];for(let r=e;r<=o;++r)t.push({label:`${r}`,value:r});return t}const mi=` background: var(--n-item-color-hover); color: var(--n-item-text-color-hover); border: var(--n-item-border-hover); @@ -1785,7 +1785,7 @@ import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f position: relative; fill: currentColor; transform: translateZ(0); -`,[P("color-transition",{transition:"color .3s var(--n-bezier)"}),P("depth",{color:"var(--n-color)"},[C("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),C("svg",{height:"1em",width:"1em"})]),Wh=Object.assign(Object.assign({},ne.props),{depth:[String,Number],size:[Number,String],color:String,component:Object}),Nh=q({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:Wh,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Icon","-icon",jh,Hh,e,o),n=R(()=>{const{depth:a}=e,{common:{cubicBezierEaseInOut:s},self:d}=r.value;if(a!==void 0){const{color:c,[`opacity${a}Depth`]:u}=d;return{"--n-bezier":s,"--n-color":c,"--n-opacity":u}}return{"--n-bezier":s,"--n-color":"","--n-opacity":""}}),l=t?Ae("icon",R(()=>`${e.depth||"d"}`),n,e):void 0;return{mergedClsPrefix:o,mergedStyle:R(()=>{const{size:a,color:s}=e;return{fontSize:eo(a),color:s}}),cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{$parent:o,depth:t,mergedClsPrefix:r,component:n,onRender:l,themeClass:a}=this;return!((e=o==null?void 0:o.$options)===null||e===void 0)&&e._n_icon__&&qo("icon","don't wrap `n-icon` inside `n-icon`"),l==null||l(),i("i",ko(this.$attrs,{role:"img",class:[`${r}-icon`,a,{[`${r}-icon--depth`]:t,[`${r}-icon--color-transition`]:t!==void 0}],style:[this.cssVars,this.mergedStyle]}),n?i(n):this.$slots)}}),kn="n-dropdown-menu",Hr="n-dropdown",yi="n-dropdown-option";function cn(e,o){return e.type==="submenu"||e.type===void 0&&e[o]!==void 0}function Vh(e){return e.type==="group"}function da(e){return e.type==="divider"}function Uh(e){return e.type==="render"}const ca=q({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const o=Se(Hr),{hoverKeyRef:t,keyboardKeyRef:r,lastToggledSubmenuKeyRef:n,pendingKeyPathRef:l,activeKeyPathRef:a,animatedRef:s,mergedShowRef:d,renderLabelRef:c,renderIconRef:u,labelFieldRef:f,childrenFieldRef:p,renderOptionRef:v,nodePropsRef:h,menuPropsRef:m}=o,b=Se(yi,null),x=Se(kn),S=Se(Dt),B=R(()=>e.tmNode.rawNode),T=R(()=>{const{value:V}=p;return cn(e.tmNode.rawNode,V)}),z=R(()=>{const{disabled:V}=e.tmNode;return V}),I=R(()=>{if(!T.value)return!1;const{key:V,disabled:te}=e.tmNode;if(te)return!1;const{value:N}=t,{value:G}=r,{value:Ce}=n,{value:X}=l;return N!==null?X.includes(V):G!==null?X.includes(V)&&X[X.length-1]!==V:Ce!==null?X.includes(V):!1}),w=R(()=>r.value===null&&!s.value),O=Bd(I,300,w),k=R(()=>!!(b!=null&&b.enteringSubmenuRef.value)),$=D(!1);Oe(yi,{enteringSubmenuRef:$});function L(){$.value=!0}function M(){$.value=!1}function j(){const{parentKey:V,tmNode:te}=e;te.disabled||d.value&&(n.value=V,r.value=null,t.value=te.key)}function E(){const{tmNode:V}=e;V.disabled||d.value&&t.value!==V.key&&j()}function U(V){if(e.tmNode.disabled||!d.value)return;const{relatedTarget:te}=V;te&&!pt({target:te},"dropdownOption")&&!pt({target:te},"scrollbarRail")&&(t.value=null)}function _(){const{value:V}=T,{tmNode:te}=e;d.value&&!V&&!te.disabled&&(o.doSelect(te.key,te.rawNode),o.doUpdateShow(!1))}return{labelField:f,renderLabel:c,renderIcon:u,siblingHasIcon:x.showIconRef,siblingHasSubmenu:x.hasSubmenuRef,menuProps:m,popoverBody:S,animated:s,mergedShowSubmenu:R(()=>O.value&&!k.value),rawNode:B,hasSubmenu:T,pending:We(()=>{const{value:V}=l,{key:te}=e.tmNode;return V.includes(te)}),childActive:We(()=>{const{value:V}=a,{key:te}=e.tmNode,N=V.findIndex(G=>te===G);return N===-1?!1:N{const{value:V}=a,{key:te}=e.tmNode,N=V.findIndex(G=>te===G);return N===-1?!1:N===V.length-1}),mergedDisabled:z,renderOption:v,nodeProps:h,handleClick:_,handleMouseMove:E,handleMouseEnter:j,handleMouseLeave:U,handleSubmenuBeforeEnter:L,handleSubmenuAfterEnter:M}},render(){var e,o;const{animated:t,rawNode:r,mergedShowSubmenu:n,clsPrefix:l,siblingHasIcon:a,siblingHasSubmenu:s,renderLabel:d,renderIcon:c,renderOption:u,nodeProps:f,props:p,scrollable:v}=this;let h=null;if(n){const S=(e=this.menuProps)===null||e===void 0?void 0:e.call(this,r,r.children);h=i(ua,Object.assign({},S,{clsPrefix:l,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const m={class:[`${l}-dropdown-option-body`,this.pending&&`${l}-dropdown-option-body--pending`,this.active&&`${l}-dropdown-option-body--active`,this.childActive&&`${l}-dropdown-option-body--child-active`,this.mergedDisabled&&`${l}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},b=f==null?void 0:f(r),x=i("div",Object.assign({class:[`${l}-dropdown-option`,b==null?void 0:b.class],"data-dropdown-option":!0},b),i("div",ko(m,p),[i("div",{class:[`${l}-dropdown-option-body__prefix`,a&&`${l}-dropdown-option-body__prefix--show-icon`]},[c?c(r):qe(r.icon)]),i("div",{"data-dropdown-option":!0,class:`${l}-dropdown-option-body__label`},d?d(r):qe((o=r[this.labelField])!==null&&o!==void 0?o:r.title)),i("div",{"data-dropdown-option":!0,class:[`${l}-dropdown-option-body__suffix`,s&&`${l}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?i(Nh,null,{default:()=>i(Nd,null)}):null)]),this.hasSubmenu?i(Ir,null,{default:()=>[i(Br,null,{default:()=>i("div",{class:`${l}-dropdown-offset-container`},i(kr,{show:this.mergedShowSubmenu,placement:this.placement,to:v&&this.popoverBody||void 0,teleportDisabled:!v},{default:()=>i("div",{class:`${l}-dropdown-menu-wrapper`},t?i(no,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>h}):h)}))})]}):null);return u?u({node:x,option:r}):x}}),Kh=q({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:o}=Se(kn),{renderLabelRef:t,labelFieldRef:r,nodePropsRef:n,renderOptionRef:l}=Se(Hr);return{labelField:r,showIcon:e,hasSubmenu:o,renderLabel:t,nodeProps:n,renderOption:l}},render(){var e;const{clsPrefix:o,hasSubmenu:t,showIcon:r,nodeProps:n,renderLabel:l,renderOption:a}=this,{rawNode:s}=this.tmNode,d=i("div",Object.assign({class:`${o}-dropdown-option`},n==null?void 0:n(s)),i("div",{class:`${o}-dropdown-option-body ${o}-dropdown-option-body--group`},i("div",{"data-dropdown-option":!0,class:[`${o}-dropdown-option-body__prefix`,r&&`${o}-dropdown-option-body__prefix--show-icon`]},qe(s.icon)),i("div",{class:`${o}-dropdown-option-body__label`,"data-dropdown-option":!0},l?l(s):qe((e=s.title)!==null&&e!==void 0?e:s[this.labelField])),i("div",{class:[`${o}-dropdown-option-body__suffix`,t&&`${o}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return a?a({node:d,option:s}):d}}),Gh=q({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:o,clsPrefix:t}=this,{children:r}=e;return i(ao,null,i(Kh,{clsPrefix:t,tmNode:e,key:e.key}),r==null?void 0:r.map(n=>{const{rawNode:l}=n;return l.show===!1?null:da(l)?i(aa,{clsPrefix:t,key:n.key}):n.isGroup?(qo("dropdown","`group` node is not allowed to be put in `group` node."),null):i(ca,{clsPrefix:t,tmNode:n,parentKey:o,key:n.key})}))}}),qh=q({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:o}}=this.tmNode;return i("div",o,[e==null?void 0:e()])}}),ua=q({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:o,childrenFieldRef:t}=Se(Hr);Oe(kn,{showIconRef:R(()=>{const n=o.value;return e.tmNodes.some(l=>{var a;if(l.isGroup)return(a=l.children)===null||a===void 0?void 0:a.some(({rawNode:d})=>n?n(d):d.icon);const{rawNode:s}=l;return n?n(s):s.icon})}),hasSubmenuRef:R(()=>{const{value:n}=t;return e.tmNodes.some(l=>{var a;if(l.isGroup)return(a=l.children)===null||a===void 0?void 0:a.some(({rawNode:d})=>cn(d,n));const{rawNode:s}=l;return cn(s,n)})})});const r=D(null);return Oe(dr,null),Oe(cr,null),Oe(Dt,r),{bodyRef:r}},render(){const{parentKey:e,clsPrefix:o,scrollable:t}=this,r=this.tmNodes.map(n=>{const{rawNode:l}=n;return l.show===!1?null:Uh(l)?i(qh,{tmNode:n,key:n.key}):da(l)?i(aa,{clsPrefix:o,key:n.key}):Vh(l)?i(Gh,{clsPrefix:o,tmNode:n,parentKey:e,key:n.key}):i(ca,{clsPrefix:o,tmNode:n,parentKey:e,key:n.key,props:l.props,scrollable:t})});return i("div",{class:[`${o}-dropdown-menu`,t&&`${o}-dropdown-menu--scrollable`],ref:"bodyRef"},t?i(gl,{contentClass:`${o}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?yl({clsPrefix:o,arrowStyle:this.arrowStyle}):null)}}),Yh=g("dropdown-menu",` +`,[P("color-transition",{transition:"color .3s var(--n-bezier)"}),P("depth",{color:"var(--n-color)"},[C("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),C("svg",{height:"1em",width:"1em"})]),Wh=Object.assign(Object.assign({},ne.props),{depth:[String,Number],size:[Number,String],color:String,component:Object}),Nh=q({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:Wh,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Icon","-icon",jh,Hh,e,o),n=R(()=>{const{depth:a}=e,{common:{cubicBezierEaseInOut:s},self:d}=r.value;if(a!==void 0){const{color:c,[`opacity${a}Depth`]:u}=d;return{"--n-bezier":s,"--n-color":c,"--n-opacity":u}}return{"--n-bezier":s,"--n-color":"","--n-opacity":""}}),l=t?Ae("icon",R(()=>`${e.depth||"d"}`),n,e):void 0;return{mergedClsPrefix:o,mergedStyle:R(()=>{const{size:a,color:s}=e;return{fontSize:eo(a),color:s}}),cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{$parent:o,depth:t,mergedClsPrefix:r,component:n,onRender:l,themeClass:a}=this;return!((e=o==null?void 0:o.$options)===null||e===void 0)&&e._n_icon__&&qo("icon","don't wrap `n-icon` inside `n-icon`"),l==null||l(),i("i",ko(this.$attrs,{role:"img",class:[`${r}-icon`,a,{[`${r}-icon--depth`]:t,[`${r}-icon--color-transition`]:t!==void 0}],style:[this.cssVars,this.mergedStyle]}),n?i(n):this.$slots)}}),kn="n-dropdown-menu",Hr="n-dropdown",yi="n-dropdown-option";function cn(e,o){return e.type==="submenu"||e.type===void 0&&e[o]!==void 0}function Vh(e){return e.type==="group"}function da(e){return e.type==="divider"}function Uh(e){return e.type==="render"}const ca=q({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const o=Se(Hr),{hoverKeyRef:t,keyboardKeyRef:r,lastToggledSubmenuKeyRef:n,pendingKeyPathRef:l,activeKeyPathRef:a,animatedRef:s,mergedShowRef:d,renderLabelRef:c,renderIconRef:u,labelFieldRef:f,childrenFieldRef:p,renderOptionRef:v,nodePropsRef:h,menuPropsRef:m}=o,b=Se(yi,null),x=Se(kn),S=Se(Dt),B=R(()=>e.tmNode.rawNode),T=R(()=>{const{value:V}=p;return cn(e.tmNode.rawNode,V)}),z=R(()=>{const{disabled:V}=e.tmNode;return V}),I=R(()=>{if(!T.value)return!1;const{key:V,disabled:te}=e.tmNode;if(te)return!1;const{value:N}=t,{value:G}=r,{value:Ce}=n,{value:X}=l;return N!==null?X.includes(V):G!==null?X.includes(V)&&X[X.length-1]!==V:Ce!==null?X.includes(V):!1}),w=R(()=>r.value===null&&!s.value),O=Bd(I,300,w),k=R(()=>!!(b!=null&&b.enteringSubmenuRef.value)),$=D(!1);Oe(yi,{enteringSubmenuRef:$});function L(){$.value=!0}function M(){$.value=!1}function j(){const{parentKey:V,tmNode:te}=e;te.disabled||d.value&&(n.value=V,r.value=null,t.value=te.key)}function E(){const{tmNode:V}=e;V.disabled||d.value&&t.value!==V.key&&j()}function U(V){if(e.tmNode.disabled||!d.value)return;const{relatedTarget:te}=V;te&&!pt({target:te},"dropdownOption")&&!pt({target:te},"scrollbarRail")&&(t.value=null)}function _(){const{value:V}=T,{tmNode:te}=e;d.value&&!V&&!te.disabled&&(o.doSelect(te.key,te.rawNode),o.doUpdateShow(!1))}return{labelField:f,renderLabel:c,renderIcon:u,siblingHasIcon:x.showIconRef,siblingHasSubmenu:x.hasSubmenuRef,menuProps:m,popoverBody:S,animated:s,mergedShowSubmenu:R(()=>O.value&&!k.value),rawNode:B,hasSubmenu:T,pending:We(()=>{const{value:V}=l,{key:te}=e.tmNode;return V.includes(te)}),childActive:We(()=>{const{value:V}=a,{key:te}=e.tmNode,N=V.findIndex(G=>te===G);return N===-1?!1:N{const{value:V}=a,{key:te}=e.tmNode,N=V.findIndex(G=>te===G);return N===-1?!1:N===V.length-1}),mergedDisabled:z,renderOption:v,nodeProps:h,handleClick:_,handleMouseMove:E,handleMouseEnter:j,handleMouseLeave:U,handleSubmenuBeforeEnter:L,handleSubmenuAfterEnter:M}},render(){var e,o;const{animated:t,rawNode:r,mergedShowSubmenu:n,clsPrefix:l,siblingHasIcon:a,siblingHasSubmenu:s,renderLabel:d,renderIcon:c,renderOption:u,nodeProps:f,props:p,scrollable:v}=this;let h=null;if(n){const S=(e=this.menuProps)===null||e===void 0?void 0:e.call(this,r,r.children);h=i(ua,Object.assign({},S,{clsPrefix:l,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const m={class:[`${l}-dropdown-option-body`,this.pending&&`${l}-dropdown-option-body--pending`,this.active&&`${l}-dropdown-option-body--active`,this.childActive&&`${l}-dropdown-option-body--child-active`,this.mergedDisabled&&`${l}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},b=f==null?void 0:f(r),x=i("div",Object.assign({class:[`${l}-dropdown-option`,b==null?void 0:b.class],"data-dropdown-option":!0},b),i("div",ko(m,p),[i("div",{class:[`${l}-dropdown-option-body__prefix`,a&&`${l}-dropdown-option-body__prefix--show-icon`]},[c?c(r):qe(r.icon)]),i("div",{"data-dropdown-option":!0,class:`${l}-dropdown-option-body__label`},d?d(r):qe((o=r[this.labelField])!==null&&o!==void 0?o:r.title)),i("div",{"data-dropdown-option":!0,class:[`${l}-dropdown-option-body__suffix`,s&&`${l}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?i(Nh,null,{default:()=>i(Nd,null)}):null)]),this.hasSubmenu?i(Br,null,{default:()=>[i(Ir,null,{default:()=>i("div",{class:`${l}-dropdown-offset-container`},i(kr,{show:this.mergedShowSubmenu,placement:this.placement,to:v&&this.popoverBody||void 0,teleportDisabled:!v},{default:()=>i("div",{class:`${l}-dropdown-menu-wrapper`},t?i(no,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>h}):h)}))})]}):null);return u?u({node:x,option:r}):x}}),Kh=q({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:o}=Se(kn),{renderLabelRef:t,labelFieldRef:r,nodePropsRef:n,renderOptionRef:l}=Se(Hr);return{labelField:r,showIcon:e,hasSubmenu:o,renderLabel:t,nodeProps:n,renderOption:l}},render(){var e;const{clsPrefix:o,hasSubmenu:t,showIcon:r,nodeProps:n,renderLabel:l,renderOption:a}=this,{rawNode:s}=this.tmNode,d=i("div",Object.assign({class:`${o}-dropdown-option`},n==null?void 0:n(s)),i("div",{class:`${o}-dropdown-option-body ${o}-dropdown-option-body--group`},i("div",{"data-dropdown-option":!0,class:[`${o}-dropdown-option-body__prefix`,r&&`${o}-dropdown-option-body__prefix--show-icon`]},qe(s.icon)),i("div",{class:`${o}-dropdown-option-body__label`,"data-dropdown-option":!0},l?l(s):qe((e=s.title)!==null&&e!==void 0?e:s[this.labelField])),i("div",{class:[`${o}-dropdown-option-body__suffix`,t&&`${o}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return a?a({node:d,option:s}):d}}),Gh=q({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:o,clsPrefix:t}=this,{children:r}=e;return i(ao,null,i(Kh,{clsPrefix:t,tmNode:e,key:e.key}),r==null?void 0:r.map(n=>{const{rawNode:l}=n;return l.show===!1?null:da(l)?i(aa,{clsPrefix:t,key:n.key}):n.isGroup?(qo("dropdown","`group` node is not allowed to be put in `group` node."),null):i(ca,{clsPrefix:t,tmNode:n,parentKey:o,key:n.key})}))}}),qh=q({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:o}}=this.tmNode;return i("div",o,[e==null?void 0:e()])}}),ua=q({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:o,childrenFieldRef:t}=Se(Hr);Oe(kn,{showIconRef:R(()=>{const n=o.value;return e.tmNodes.some(l=>{var a;if(l.isGroup)return(a=l.children)===null||a===void 0?void 0:a.some(({rawNode:d})=>n?n(d):d.icon);const{rawNode:s}=l;return n?n(s):s.icon})}),hasSubmenuRef:R(()=>{const{value:n}=t;return e.tmNodes.some(l=>{var a;if(l.isGroup)return(a=l.children)===null||a===void 0?void 0:a.some(({rawNode:d})=>cn(d,n));const{rawNode:s}=l;return cn(s,n)})})});const r=D(null);return Oe(dr,null),Oe(cr,null),Oe(Dt,r),{bodyRef:r}},render(){const{parentKey:e,clsPrefix:o,scrollable:t}=this,r=this.tmNodes.map(n=>{const{rawNode:l}=n;return l.show===!1?null:Uh(l)?i(qh,{tmNode:n,key:n.key}):da(l)?i(aa,{clsPrefix:o,key:n.key}):Vh(l)?i(Gh,{clsPrefix:o,tmNode:n,parentKey:e,key:n.key}):i(ca,{clsPrefix:o,tmNode:n,parentKey:e,key:n.key,props:l.props,scrollable:t})});return i("div",{class:[`${o}-dropdown-menu`,t&&`${o}-dropdown-menu--scrollable`],ref:"bodyRef"},t?i(gl,{contentClass:`${o}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?yl({clsPrefix:o,arrowStyle:this.arrowStyle}):null)}}),Yh=g("dropdown-menu",` transform-origin: var(--v-transform-origin); background-color: var(--n-color); border-radius: var(--n-border-radius); @@ -2583,7 +2583,7 @@ import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f `)]);function ft(e,o){return[P("hover",e,o),C("&:hover",e,o)]}const Fb=Object.assign(Object.assign({},ne.props),{options:{type:Array,default:()=>[]},collapsed:{type:Boolean,default:void 0},collapsedWidth:{type:Number,default:48},iconSize:{type:Number,default:20},collapsedIconSize:{type:Number,default:24},rootIndent:Number,indent:{type:Number,default:32},labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandAll:Boolean,defaultExpandedKeys:Array,expandedKeys:Array,value:[String,Number],defaultValue:{type:[String,Number],default:null},mode:{type:String,default:"vertical"},watchProps:{type:Array,default:void 0},disabled:Boolean,show:{type:Boolean,default:!0},inverted:Boolean,"onUpdate:expandedKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],onUpdateValue:[Function,Array],"onUpdate:value":[Function,Array],expandIcon:Function,renderIcon:Function,renderLabel:Function,renderExtra:Function,dropdownProps:Object,accordion:Boolean,nodeProps:Function,items:Array,onOpenNamesChange:[Function,Array],onSelect:[Function,Array],onExpandedNamesChange:[Function,Array],expandedNames:Array,defaultExpandedNames:Array,dropdownPlacement:{type:String,default:"bottom"}}),H1=q({name:"Menu",props:Fb,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Menu","-menu",Tb,Lg,e,o),n=Se(mb,null),l=R(()=>{var O;const{collapsed:k}=e;if(k!==void 0)return k;if(n){const{collapseModeRef:$,collapsedRef:L}=n;if($.value==="width")return(O=L.value)!==null&&O!==void 0?O:!1}return!1}),a=R(()=>{const{keyField:O,childrenField:k,disabledField:$}=e;return ar(e.items||e.options,{getIgnored(L){return ns(L)},getChildren(L){return L[k]},getDisabled(L){return L[$]},getKey(L){var M;return(M=L[O])!==null&&M!==void 0?M:L.name}})}),s=R(()=>new Set(a.value.treeNodes.map(O=>O.key))),{watchProps:d}=e,c=D(null);d!=null&&d.includes("defaultValue")?oo(()=>{c.value=e.defaultValue}):c.value=e.defaultValue;const u=le(e,"value"),f=so(u,c),p=D([]),v=()=>{p.value=e.defaultExpandAll?a.value.getNonLeafKeys():e.defaultExpandedNames||e.defaultExpandedKeys||a.value.getPath(f.value,{includeSelf:!1}).keyPath};d!=null&&d.includes("defaultExpandedKeys")?oo(v):v();const h=gt(e,["expandedNames","expandedKeys"]),m=so(h,p),b=R(()=>a.value.treeNodes),x=R(()=>a.value.getPath(f.value).keyPath);Oe(gr,{props:e,mergedCollapsedRef:l,mergedThemeRef:r,mergedValueRef:f,mergedExpandedKeysRef:m,activePathRef:x,mergedClsPrefixRef:o,isHorizontalRef:R(()=>e.mode==="horizontal"),invertedRef:le(e,"inverted"),doSelect:S,toggleExpand:T});function S(O,k){const{"onUpdate:value":$,onUpdateValue:L,onSelect:M}=e;L&&ae(L,O,k),$&&ae($,O,k),M&&ae(M,O,k),c.value=O}function B(O){const{"onUpdate:expandedKeys":k,onUpdateExpandedKeys:$,onExpandedNamesChange:L,onOpenNamesChange:M}=e;k&&ae(k,O),$&&ae($,O),L&&ae(L,O),M&&ae(M,O),p.value=O}function T(O){const k=Array.from(m.value),$=k.findIndex(L=>L===O);if(~$)k.splice($,1);else{if(e.accordion&&s.value.has(O)){const L=k.findIndex(M=>s.value.has(M));L>-1&&k.splice(L,1)}k.push(O)}B(k)}const z=O=>{const k=a.value.getPath(O??f.value,{includeSelf:!1}).keyPath;if(!k.length)return;const $=Array.from(m.value),L=new Set([...$,...k]);e.accordion&&s.value.forEach(M=>{L.has(M)&&!k.includes(M)&&L.delete(M)}),B(Array.from(L))},I=R(()=>{const{inverted:O}=e,{common:{cubicBezierEaseInOut:k},self:$}=r.value,{borderRadius:L,borderColorHorizontal:M,fontSize:j,itemHeight:E,dividerColor:U}=$,_={"--n-divider-color":U,"--n-bezier":k,"--n-font-size":j,"--n-border-color-horizontal":M,"--n-border-radius":L,"--n-item-height":E};return O?(_["--n-group-text-color"]=$.groupTextColorInverted,_["--n-color"]=$.colorInverted,_["--n-item-text-color"]=$.itemTextColorInverted,_["--n-item-text-color-hover"]=$.itemTextColorHoverInverted,_["--n-item-text-color-active"]=$.itemTextColorActiveInverted,_["--n-item-text-color-child-active"]=$.itemTextColorChildActiveInverted,_["--n-item-text-color-child-active-hover"]=$.itemTextColorChildActiveInverted,_["--n-item-text-color-active-hover"]=$.itemTextColorActiveHoverInverted,_["--n-item-icon-color"]=$.itemIconColorInverted,_["--n-item-icon-color-hover"]=$.itemIconColorHoverInverted,_["--n-item-icon-color-active"]=$.itemIconColorActiveInverted,_["--n-item-icon-color-active-hover"]=$.itemIconColorActiveHoverInverted,_["--n-item-icon-color-child-active"]=$.itemIconColorChildActiveInverted,_["--n-item-icon-color-child-active-hover"]=$.itemIconColorChildActiveHoverInverted,_["--n-item-icon-color-collapsed"]=$.itemIconColorCollapsedInverted,_["--n-item-text-color-horizontal"]=$.itemTextColorHorizontalInverted,_["--n-item-text-color-hover-horizontal"]=$.itemTextColorHoverHorizontalInverted,_["--n-item-text-color-active-horizontal"]=$.itemTextColorActiveHorizontalInverted,_["--n-item-text-color-child-active-horizontal"]=$.itemTextColorChildActiveHorizontalInverted,_["--n-item-text-color-child-active-hover-horizontal"]=$.itemTextColorChildActiveHoverHorizontalInverted,_["--n-item-text-color-active-hover-horizontal"]=$.itemTextColorActiveHoverHorizontalInverted,_["--n-item-icon-color-horizontal"]=$.itemIconColorHorizontalInverted,_["--n-item-icon-color-hover-horizontal"]=$.itemIconColorHoverHorizontalInverted,_["--n-item-icon-color-active-horizontal"]=$.itemIconColorActiveHorizontalInverted,_["--n-item-icon-color-active-hover-horizontal"]=$.itemIconColorActiveHoverHorizontalInverted,_["--n-item-icon-color-child-active-horizontal"]=$.itemIconColorChildActiveHorizontalInverted,_["--n-item-icon-color-child-active-hover-horizontal"]=$.itemIconColorChildActiveHoverHorizontalInverted,_["--n-arrow-color"]=$.arrowColorInverted,_["--n-arrow-color-hover"]=$.arrowColorHoverInverted,_["--n-arrow-color-active"]=$.arrowColorActiveInverted,_["--n-arrow-color-active-hover"]=$.arrowColorActiveHoverInverted,_["--n-arrow-color-child-active"]=$.arrowColorChildActiveInverted,_["--n-arrow-color-child-active-hover"]=$.arrowColorChildActiveHoverInverted,_["--n-item-color-hover"]=$.itemColorHoverInverted,_["--n-item-color-active"]=$.itemColorActiveInverted,_["--n-item-color-active-hover"]=$.itemColorActiveHoverInverted,_["--n-item-color-active-collapsed"]=$.itemColorActiveCollapsedInverted):(_["--n-group-text-color"]=$.groupTextColor,_["--n-color"]=$.color,_["--n-item-text-color"]=$.itemTextColor,_["--n-item-text-color-hover"]=$.itemTextColorHover,_["--n-item-text-color-active"]=$.itemTextColorActive,_["--n-item-text-color-child-active"]=$.itemTextColorChildActive,_["--n-item-text-color-child-active-hover"]=$.itemTextColorChildActiveHover,_["--n-item-text-color-active-hover"]=$.itemTextColorActiveHover,_["--n-item-icon-color"]=$.itemIconColor,_["--n-item-icon-color-hover"]=$.itemIconColorHover,_["--n-item-icon-color-active"]=$.itemIconColorActive,_["--n-item-icon-color-active-hover"]=$.itemIconColorActiveHover,_["--n-item-icon-color-child-active"]=$.itemIconColorChildActive,_["--n-item-icon-color-child-active-hover"]=$.itemIconColorChildActiveHover,_["--n-item-icon-color-collapsed"]=$.itemIconColorCollapsed,_["--n-item-text-color-horizontal"]=$.itemTextColorHorizontal,_["--n-item-text-color-hover-horizontal"]=$.itemTextColorHoverHorizontal,_["--n-item-text-color-active-horizontal"]=$.itemTextColorActiveHorizontal,_["--n-item-text-color-child-active-horizontal"]=$.itemTextColorChildActiveHorizontal,_["--n-item-text-color-child-active-hover-horizontal"]=$.itemTextColorChildActiveHoverHorizontal,_["--n-item-text-color-active-hover-horizontal"]=$.itemTextColorActiveHoverHorizontal,_["--n-item-icon-color-horizontal"]=$.itemIconColorHorizontal,_["--n-item-icon-color-hover-horizontal"]=$.itemIconColorHoverHorizontal,_["--n-item-icon-color-active-horizontal"]=$.itemIconColorActiveHorizontal,_["--n-item-icon-color-active-hover-horizontal"]=$.itemIconColorActiveHoverHorizontal,_["--n-item-icon-color-child-active-horizontal"]=$.itemIconColorChildActiveHorizontal,_["--n-item-icon-color-child-active-hover-horizontal"]=$.itemIconColorChildActiveHoverHorizontal,_["--n-arrow-color"]=$.arrowColor,_["--n-arrow-color-hover"]=$.arrowColorHover,_["--n-arrow-color-active"]=$.arrowColorActive,_["--n-arrow-color-active-hover"]=$.arrowColorActiveHover,_["--n-arrow-color-child-active"]=$.arrowColorChildActive,_["--n-arrow-color-child-active-hover"]=$.arrowColorChildActiveHover,_["--n-item-color-hover"]=$.itemColorHover,_["--n-item-color-active"]=$.itemColorActive,_["--n-item-color-active-hover"]=$.itemColorActiveHover,_["--n-item-color-active-collapsed"]=$.itemColorActiveCollapsed),_}),w=t?Ae("menu",R(()=>e.inverted?"a":"b"),I,e):void 0;return{mergedClsPrefix:o,controlledExpandedKeys:h,uncontrolledExpanededKeys:p,mergedExpandedKeys:m,uncontrolledValue:c,mergedValue:f,activePath:x,tmNodes:b,mergedTheme:r,mergedCollapsed:l,cssVars:t?void 0:I,themeClass:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,showOption:z}},render(){const{mergedClsPrefix:e,mode:o,themeClass:t,onRender:r}=this;return r==null||r(),i("div",{role:o==="horizontal"?"menubar":"menu",class:[`${e}-menu`,t,`${e}-menu--${o}`,this.mergedCollapsed&&`${e}-menu--collapsed`],style:this.cssVars},this.tmNodes.map(n=>En(n,this.$props)))}});function Ob(e,o={debug:!1,useSelectionEnd:!1,checkWidthOverflow:!0}){const t=e.selectionStart!==null?e.selectionStart:0,r=e.selectionEnd!==null?e.selectionEnd:0,n=o.useSelectionEnd?r:t,l=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],a=navigator.userAgent.toLowerCase().includes("firefox");if(!jo)throw new Error("textarea-caret-position#getCaretPosition should only be called in a browser");const s=o==null?void 0:o.debug;if(s){const h=document.querySelector("#input-textarea-caret-position-mirror-div");h!=null&&h.parentNode&&h.parentNode.removeChild(h)}const d=document.createElement("div");d.id="input-textarea-caret-position-mirror-div",document.body.appendChild(d);const c=d.style,u=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,f=e.nodeName==="INPUT";c.whiteSpace=f?"nowrap":"pre-wrap",f||(c.wordWrap="break-word"),c.position="absolute",s||(c.visibility="hidden"),l.forEach(h=>{if(f&&h==="lineHeight")if(u.boxSizing==="border-box"){const m=parseInt(u.height),b=parseInt(u.paddingTop)+parseInt(u.paddingBottom)+parseInt(u.borderTopWidth)+parseInt(u.borderBottomWidth),x=b+parseInt(u.lineHeight);m>x?c.lineHeight=`${m-b}px`:m===x?c.lineHeight=u.lineHeight:c.lineHeight="0"}else c.lineHeight=u.height;else c[h]=u[h]}),a?e.scrollHeight>parseInt(u.height)&&(c.overflowY="scroll"):c.overflow="hidden",d.textContent=e.value.substring(0,n),f&&d.textContent&&(d.textContent=d.textContent.replace(/\s/g," "));const p=document.createElement("span");p.textContent=e.value.substring(n)||".",p.style.position="relative",p.style.left=`${-e.scrollLeft}px`,p.style.top=`${-e.scrollTop}px`,d.appendChild(p);const v={top:p.offsetTop+parseInt(u.borderTopWidth),left:p.offsetLeft+parseInt(u.borderLeftWidth),absolute:!1,height:parseInt(u.fontSize)*1.5};return s?p.style.backgroundColor="#aaa":document.body.removeChild(d),v.left>=e.clientWidth&&o.checkWidthOverflow&&(v.left=e.clientWidth),v}const Mb=C([g("mention","width: 100%; z-index: auto; position: relative;"),g("mention-menu",` box-shadow: var(--n-menu-box-shadow); `,[at({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),_b=Object.assign(Object.assign({},ne.props),{to:Io.propTo,autosize:[Boolean,Object],options:{type:Array,default:[]},type:{type:String,default:"text"},separator:{type:String,validator:e=>e.length!==1?(qo("mention","`separator`'s length must be 1."),!1):!0,default:" "},bordered:{type:Boolean,default:void 0},disabled:Boolean,value:String,defaultValue:{type:String,default:""},loading:Boolean,prefix:{type:[String,Array],default:"@"},placeholder:{type:String,default:""},placement:{type:String,default:"bottom-start"},size:String,renderLabel:Function,status:String,"onUpdate:show":[Array,Function],onUpdateShow:[Array,Function],"onUpdate:value":[Array,Function],onUpdateValue:[Array,Function],onSearch:Function,onSelect:Function,onFocus:Function,onBlur:Function,internalDebug:Boolean}),A1=q({name:"Mention",props:_b,setup(e){const{namespaceRef:o,mergedClsPrefixRef:t,mergedBorderedRef:r,inlineThemeDisabled:n}=ke(e),l=ne("Mention","-mention",Mb,Mg,e,t),a=rt(e),s=D(null),d=D(null),c=D(null),u=D("");let f=null,p=null,v=null;const h=R(()=>{const{value:X}=u;return e.options.filter(ve=>X?typeof ve.label=="string"?ve.label.startsWith(X):typeof ve.value=="string"?ve.value.startsWith(X):!1:!0)}),m=R(()=>ar(h.value,{getKey:X=>X.value})),b=D(null),x=D(!1),S=D(e.defaultValue),B=le(e,"value"),T=so(B,S),z=R(()=>{const{self:{menuBoxShadow:X}}=l.value;return{"--n-menu-box-shadow":X}}),I=n?Ae("mention",void 0,z,e):void 0;function w(X){if(e.disabled)return;const{onUpdateShow:ve,"onUpdate:show":he}=e;ve&&ae(ve,X),he&&ae(he,X),X||(f=null,p=null,v=null),x.value=X}function O(X){const{onUpdateValue:ve,"onUpdate:value":he}=e,{nTriggerFormChange:be,nTriggerFormInput:me}=a;he&&ae(he,X),ve&&ae(ve,X),me(),be(),S.value=X}function k(){return e.type==="text"?s.value.inputElRef:s.value.textareaElRef}function $(){var X;const ve=k();if(document.activeElement!==ve){w(!1);return}const{selectionEnd:he}=ve;if(he===null){w(!1);return}const be=ve.value,{separator:me}=e,{prefix:se}=e,Re=typeof se=="string"?[se]:se;for(let ge=he-1;ge>=0;--ge){const ee=be[ge];if(ee===me||ee===` -`||ee==="\r"){w(!1);return}if(Re.includes(ee)){const xe=be.slice(ge+1,he);w(!0),(X=e.onSearch)===null||X===void 0||X.call(e,xe,ee),u.value=xe,f=ee,p=ge+1,v=he;return}}w(!1)}function L(){const{value:X}=d;if(!X)return;const ve=k(),he=Ob(ve);he.left+=ve.parentElement.offsetLeft,X.style.left=`${he.left}px`,X.style.top=`${he.top+he.height}px`}function M(){var X;x.value&&((X=c.value)===null||X===void 0||X.syncPosition())}function j(X){O(X),E()}function E(){setTimeout(()=>{L(),$(),io().then(M)},0)}function U(X){var ve,he;if(X.key==="ArrowLeft"||X.key==="ArrowRight"){if(!((ve=s.value)===null||ve===void 0)&&ve.isCompositing)return;E()}else if(X.key==="ArrowUp"||X.key==="ArrowDown"||X.key==="Enter"){if(!((he=s.value)===null||he===void 0)&&he.isCompositing)return;const{value:be}=b;if(x.value){if(be)if(X.preventDefault(),X.key==="ArrowUp")be.prev();else if(X.key==="ArrowDown")be.next();else{const me=be.getPendingTmNode();me?G(me):w(!1)}}else E()}}function _(X){const{onFocus:ve}=e;ve==null||ve(X);const{nTriggerFormFocus:he}=a;he(),E()}function V(){var X;(X=s.value)===null||X===void 0||X.focus()}function te(){var X;(X=s.value)===null||X===void 0||X.blur()}function N(X){const{onBlur:ve}=e;ve==null||ve(X);const{nTriggerFormBlur:he}=a;he(),w(!1)}function G(X){var ve;if(f===null||p===null||v===null)return;const{rawNode:{value:he=""}}=X,be=k(),me=be.value,{separator:se}=e,Re=me.slice(v),ge=Re.startsWith(se),ee=`${he}${ge?"":se}`;O(me.slice(0,p)+ee+Re),(ve=e.onSelect)===null||ve===void 0||ve.call(e,X.rawNode,f);const xe=p+ee.length+(ge?1:0);io().then(()=>{be.selectionStart=xe,be.selectionEnd=xe,$()})}function Ce(){e.disabled||E()}return{namespace:o,mergedClsPrefix:t,mergedBordered:r,mergedSize:a.mergedSizeRef,mergedStatus:a.mergedStatusRef,mergedTheme:l,treeMate:m,selectMenuInstRef:b,inputInstRef:s,cursorRef:d,followerRef:c,showMenu:x,adjustedTo:Io(e),isMounted:Ct(),mergedValue:T,handleInputFocus:_,handleInputBlur:N,handleInputUpdateValue:j,handleInputKeyDown:U,handleSelect:G,handleInputMouseDown:Ce,focus:V,blur:te,cssVars:n?void 0:z,themeClass:I==null?void 0:I.themeClass,onRender:I==null?void 0:I.onRender}},render(){const{mergedTheme:e,mergedClsPrefix:o,$slots:t}=this;return i("div",{class:`${o}-mention`},i(xt,{status:this.mergedStatus,themeOverrides:e.peerOverrides.Input,theme:e.peers.Input,size:this.mergedSize,autosize:this.autosize,type:this.type,ref:"inputInstRef",placeholder:this.placeholder,onMousedown:this.handleInputMouseDown,onUpdateValue:this.handleInputUpdateValue,onKeydown:this.handleInputKeyDown,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,bordered:this.mergedBordered,disabled:this.disabled,value:this.mergedValue}),i(Ir,null,{default:()=>[i(Br,null,{default:()=>i("div",{style:{position:"absolute",width:0,height:0},ref:"cursorRef"})}),i(kr,{ref:"followerRef",placement:this.placement,show:this.showMenu,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Io.tdkey},{default:()=>i(no,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{const{mergedTheme:r,onRender:n}=this;return n==null||n(),this.showMenu?i(yn,{clsPrefix:o,theme:r.peers.InternalSelectMenu,themeOverrides:r.peerOverrides.InternalSelectMenu,autoPending:!0,ref:"selectMenuInstRef",class:[`${o}-mention-menu`,this.themeClass],loading:this.loading,treeMate:this.treeMate,virtualScroll:!1,style:this.cssVars,onToggle:this.handleSelect,renderLabel:this.renderLabel},t):null}})})]}))}}),is={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},ls="n-message-api",as="n-message-provider",Db=C([g("message-wrapper",` +`||ee==="\r"){w(!1);return}if(Re.includes(ee)){const xe=be.slice(ge+1,he);w(!0),(X=e.onSearch)===null||X===void 0||X.call(e,xe,ee),u.value=xe,f=ee,p=ge+1,v=he;return}}w(!1)}function L(){const{value:X}=d;if(!X)return;const ve=k(),he=Ob(ve);he.left+=ve.parentElement.offsetLeft,X.style.left=`${he.left}px`,X.style.top=`${he.top+he.height}px`}function M(){var X;x.value&&((X=c.value)===null||X===void 0||X.syncPosition())}function j(X){O(X),E()}function E(){setTimeout(()=>{L(),$(),io().then(M)},0)}function U(X){var ve,he;if(X.key==="ArrowLeft"||X.key==="ArrowRight"){if(!((ve=s.value)===null||ve===void 0)&&ve.isCompositing)return;E()}else if(X.key==="ArrowUp"||X.key==="ArrowDown"||X.key==="Enter"){if(!((he=s.value)===null||he===void 0)&&he.isCompositing)return;const{value:be}=b;if(x.value){if(be)if(X.preventDefault(),X.key==="ArrowUp")be.prev();else if(X.key==="ArrowDown")be.next();else{const me=be.getPendingTmNode();me?G(me):w(!1)}}else E()}}function _(X){const{onFocus:ve}=e;ve==null||ve(X);const{nTriggerFormFocus:he}=a;he(),E()}function V(){var X;(X=s.value)===null||X===void 0||X.focus()}function te(){var X;(X=s.value)===null||X===void 0||X.blur()}function N(X){const{onBlur:ve}=e;ve==null||ve(X);const{nTriggerFormBlur:he}=a;he(),w(!1)}function G(X){var ve;if(f===null||p===null||v===null)return;const{rawNode:{value:he=""}}=X,be=k(),me=be.value,{separator:se}=e,Re=me.slice(v),ge=Re.startsWith(se),ee=`${he}${ge?"":se}`;O(me.slice(0,p)+ee+Re),(ve=e.onSelect)===null||ve===void 0||ve.call(e,X.rawNode,f);const xe=p+ee.length+(ge?1:0);io().then(()=>{be.selectionStart=xe,be.selectionEnd=xe,$()})}function Ce(){e.disabled||E()}return{namespace:o,mergedClsPrefix:t,mergedBordered:r,mergedSize:a.mergedSizeRef,mergedStatus:a.mergedStatusRef,mergedTheme:l,treeMate:m,selectMenuInstRef:b,inputInstRef:s,cursorRef:d,followerRef:c,showMenu:x,adjustedTo:Io(e),isMounted:Ct(),mergedValue:T,handleInputFocus:_,handleInputBlur:N,handleInputUpdateValue:j,handleInputKeyDown:U,handleSelect:G,handleInputMouseDown:Ce,focus:V,blur:te,cssVars:n?void 0:z,themeClass:I==null?void 0:I.themeClass,onRender:I==null?void 0:I.onRender}},render(){const{mergedTheme:e,mergedClsPrefix:o,$slots:t}=this;return i("div",{class:`${o}-mention`},i(xt,{status:this.mergedStatus,themeOverrides:e.peerOverrides.Input,theme:e.peers.Input,size:this.mergedSize,autosize:this.autosize,type:this.type,ref:"inputInstRef",placeholder:this.placeholder,onMousedown:this.handleInputMouseDown,onUpdateValue:this.handleInputUpdateValue,onKeydown:this.handleInputKeyDown,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,bordered:this.mergedBordered,disabled:this.disabled,value:this.mergedValue}),i(Br,null,{default:()=>[i(Ir,null,{default:()=>i("div",{style:{position:"absolute",width:0,height:0},ref:"cursorRef"})}),i(kr,{ref:"followerRef",placement:this.placement,show:this.showMenu,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Io.tdkey},{default:()=>i(no,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{const{mergedTheme:r,onRender:n}=this;return n==null||n(),this.showMenu?i(yn,{clsPrefix:o,theme:r.peers.InternalSelectMenu,themeOverrides:r.peerOverrides.InternalSelectMenu,autoPending:!0,ref:"selectMenuInstRef",class:[`${o}-mention-menu`,this.themeClass],loading:this.loading,treeMate:this.treeMate,virtualScroll:!1,style:this.cssVars,onToggle:this.handleSelect,renderLabel:this.renderLabel},t):null}})})]}))}}),is={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},ls="n-message-api",as="n-message-provider",Db=C([g("message-wrapper",` margin: var(--n-margin); z-index: 0; transform-origin: top center; @@ -3671,4 +3671,4 @@ import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f width: 0; height: 0; opacity: 0; - `)]);var Hi=globalThis&&globalThis.__awaiter||function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};function W0(e,o,t){const{doChange:r,xhrMap:n}=e;let l=0;function a(d){var c;let u=Object.assign({},o,{status:"error",percentage:l});n.delete(o.id),u=nr(((c=e.onError)===null||c===void 0?void 0:c.call(e,{file:u,event:d}))||u),r(u,d)}function s(d){var c;if(e.isErrorState){if(e.isErrorState(t)){a(d);return}}else if(t.status<200||t.status>=300){a(d);return}let u=Object.assign({},o,{status:"finished",percentage:l});n.delete(o.id),u=nr(((c=e.onFinish)===null||c===void 0?void 0:c.call(e,{file:u,event:d}))||u),r(u,d)}return{handleXHRLoad:s,handleXHRError:a,handleXHRAbort(d){const c=Object.assign({},o,{status:"removed",file:null,percentage:l});n.delete(o.id),r(c,d)},handleXHRProgress(d){const c=Object.assign({},o,{status:"uploading"});if(d.lengthComputable){const u=Math.ceil(d.loaded/d.total*100);c.percentage=u,l=u}r(c,d)}}}function N0(e){const{inst:o,file:t,data:r,headers:n,withCredentials:l,action:a,customRequest:s}=e,{doChange:d}=e.inst;let c=0;s({file:t,data:r,headers:n,withCredentials:l,action:a,onProgress(u){const f=Object.assign({},t,{status:"uploading"}),p=u.percent;f.percentage=p,c=p,d(f)},onFinish(){var u;let f=Object.assign({},t,{status:"finished",percentage:c});f=nr(((u=o.onFinish)===null||u===void 0?void 0:u.call(o,{file:f}))||f),d(f)},onError(){var u;let f=Object.assign({},t,{status:"error",percentage:c});f=nr(((u=o.onError)===null||u===void 0?void 0:u.call(o,{file:f}))||f),d(f)}})}function V0(e,o,t){const r=W0(e,o,t);t.onabort=r.handleXHRAbort,t.onerror=r.handleXHRError,t.onload=r.handleXHRLoad,t.upload&&(t.upload.onprogress=r.handleXHRProgress)}function gs(e,o){return typeof e=="function"?e({file:o}):e||{}}function U0(e,o,t){const r=gs(o,t);r&&Object.keys(r).forEach(n=>{e.setRequestHeader(n,r[n])})}function K0(e,o,t){const r=gs(o,t);r&&Object.keys(r).forEach(n=>{e.append(n,r[n])})}function G0(e,o,t,{method:r,action:n,withCredentials:l,responseType:a,headers:s,data:d}){const c=new XMLHttpRequest;c.responseType=a,e.xhrMap.set(t.id,c),c.withCredentials=l;const u=new FormData;if(K0(u,d,t),u.append(o,t.file),V0(e,t,c),n!==void 0){c.open(r.toUpperCase(),n),U0(c,s,t),c.send(u);const f=Object.assign({},t,{status:"uploading"});e.doChange(f)}}const q0=Object.assign(Object.assign({},ne.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>I0?ps(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerStyle:[String,Object],renderIcon:Object}),J1=q({name:"Upload",props:q0,setup(e){e.abstract&&e.listType==="image-card"&&Eo("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Upload","-upload",j0,Zm,e,o),n=rt(e),l=R(()=>{const{max:k}=e;return k!==void 0?v.value.length>=k:!1}),a=D(e.defaultFileList),s=le(e,"fileList"),d=D(null),c={value:!1},u=D(!1),f=new Map,p=so(s,a),v=R(()=>p.value.map(nr));function h(){var k;(k=d.value)===null||k===void 0||k.click()}function m(k){const $=k.target;S($.files?Array.from($.files).map(L=>({file:L,entry:null,source:"input"})):null,k),$.value=""}function b(k){const{"onUpdate:fileList":$,onUpdateFileList:L}=e;$&&ae($,k),L&&ae(L,k),a.value=k}const x=R(()=>e.multiple||e.directory);function S(k,$){if(!k||k.length===0)return;const{onBeforeUpload:L}=e;k=x.value?k:[k[0]];const{max:M,accept:j}=e;k=k.filter(({file:U,source:_})=>_==="dnd"&&(j!=null&&j.trim())?O0(U.name,U.type,j):!0),M&&(k=k.slice(0,M-v.value.length));const E=it();Promise.all(k.map(({file:U,entry:_})=>Hi(this,void 0,void 0,function*(){var V;const te={id:it(),batchId:E,name:U.name,status:"pending",percentage:0,file:U,url:null,type:U.type,thumbnailUrl:null,fullPath:(V=_==null?void 0:_.fullPath)!==null&&V!==void 0?V:`/${U.webkitRelativePath||U.name}`};return!L||(yield L({file:te,fileList:v.value}))!==!1?te:null}))).then(U=>Hi(this,void 0,void 0,function*(){let _=Promise.resolve();U.forEach(V=>{_=_.then(io).then(()=>{V&&T(V,$,{append:!0})})}),yield _})).then(()=>{e.defaultUpload&&B()})}function B(k){const{method:$,action:L,withCredentials:M,headers:j,data:E,name:U}=e,_=k!==void 0?v.value.filter(te=>te.id===k):v.value,V=k!==void 0;_.forEach(te=>{const{status:N}=te;(N==="pending"||N==="error"&&V)&&(e.customRequest?N0({inst:{doChange:T,xhrMap:f,onFinish:e.onFinish,onError:e.onError},file:te,action:L,withCredentials:M,headers:j,data:E,customRequest:e.customRequest}):G0({doChange:T,xhrMap:f,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},U,te,{method:$,action:L,withCredentials:M,responseType:e.responseType,headers:j,data:E}))})}const T=(k,$,L={append:!1,remove:!1})=>{const{append:M,remove:j}=L,E=Array.from(v.value),U=E.findIndex(_=>_.id===k.id);if(M||j||~U){M?E.push(k):j?E.splice(U,1):E.splice(U,1,k);const{onChange:_}=e;_&&_({file:k,fileList:E,event:$}),b(E)}};function z(k){var $;if(k.thumbnailUrl)return k.thumbnailUrl;const{createThumbnailUrl:L}=e;return L?($=L(k.file,k))!==null&&$!==void 0?$:k.url||"":k.url?k.url:k.file?k0(k.file):""}const I=R(()=>{const{common:{cubicBezierEaseInOut:k},self:{draggerColor:$,draggerBorder:L,draggerBorderHover:M,itemColorHover:j,itemColorHoverError:E,itemTextColorError:U,itemTextColorSuccess:_,itemTextColor:V,itemIconColor:te,itemDisabledOpacity:N,lineHeight:G,borderRadius:Ce,fontSize:X,itemBorderImageCardError:ve,itemBorderImageCard:he}}=r.value;return{"--n-bezier":k,"--n-border-radius":Ce,"--n-dragger-border":L,"--n-dragger-border-hover":M,"--n-dragger-color":$,"--n-font-size":X,"--n-item-color-hover":j,"--n-item-color-hover-error":E,"--n-item-disabled-opacity":N,"--n-item-icon-color":te,"--n-item-text-color":V,"--n-item-text-color-error":U,"--n-item-text-color-success":_,"--n-line-height":G,"--n-item-border-image-card-error":ve,"--n-item-border-image-card":he}}),w=t?Ae("upload",void 0,I,e):void 0;Oe(Ut,{mergedClsPrefixRef:o,mergedThemeRef:r,showCancelButtonRef:le(e,"showCancelButton"),showDownloadButtonRef:le(e,"showDownloadButton"),showRemoveButtonRef:le(e,"showRemoveButton"),showRetryButtonRef:le(e,"showRetryButton"),onRemoveRef:le(e,"onRemove"),onDownloadRef:le(e,"onDownload"),mergedFileListRef:v,triggerStyleRef:le(e,"triggerStyle"),shouldUseThumbnailUrlRef:le(e,"shouldUseThumbnailUrl"),renderIconRef:le(e,"renderIcon"),xhrMap:f,submit:B,doChange:T,showPreviewButtonRef:le(e,"showPreviewButton"),onPreviewRef:le(e,"onPreview"),getFileThumbnailUrlResolver:z,listTypeRef:le(e,"listType"),dragOverRef:u,openOpenFileDialog:h,draggerInsideRef:c,handleFileAddition:S,mergedDisabledRef:n.mergedDisabledRef,maxReachedRef:l,fileListStyleRef:le(e,"fileListStyle"),abstractRef:le(e,"abstract"),acceptRef:le(e,"accept"),cssVarsRef:t?void 0:I,themeClassRef:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,showTriggerRef:le(e,"showTrigger"),imageGroupPropsRef:le(e,"imageGroupProps"),mergedDirectoryDndRef:R(()=>{var k;return(k=e.directoryDnd)!==null&&k!==void 0?k:e.directory})});const O={clear:()=>{a.value=[]},submit:B,openOpenFileDialog:h};return Object.assign({mergedClsPrefix:o,draggerInsideRef:c,inputElRef:d,mergedTheme:r,dragOver:u,mergedMultiple:x,cssVars:t?void 0:I,themeClass:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,handleFileInputChange:m},O)},render(){var e,o;const{draggerInsideRef:t,mergedClsPrefix:r,$slots:n,directory:l,onRender:a}=this;if(n.default&&!this.abstract){const d=n.default()[0];!((e=d==null?void 0:d.type)===null||e===void 0)&&e[us]&&(t.value=!0)}const s=i("input",Object.assign({},this.inputProps,{ref:"inputElRef",type:"file",class:`${r}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:l||void 0,directory:l||void 0}));return this.abstract?i(ao,null,(o=n.default)===null||o===void 0?void 0:o.call(n),i(Ni,{to:"body"},s)):(a==null||a(),i("div",{class:[`${r}-upload`,t.value&&`${r}-upload--dragger-inside`,this.dragOver&&`${r}-upload--drag-over`,this.themeClass],style:this.cssVars},s,this.showTrigger&&this.listType!=="image-card"&&i(vs,null,n),this.showFileList&&i(E0,null,n)))}}),Y0=()=>({}),X0={name:"Equation",common:fe,self:Y0},Z0=X0,ex={name:"dark",common:fe,Alert:lu,Anchor:mu,AutoComplete:Ou,Avatar:Ll,AvatarGroup:Nu,BackTop:Ku,Badge:qu,Breadcrumb:rf,Button:$o,ButtonGroup:pg,Calendar:gf,Card:Vl,Carousel:If,Cascader:_f,Checkbox:Nt,Code:Ul,Collapse:Af,CollapseTransition:Wf,ColorPicker:xf,DataTable:Ph,DatePicker:lp,Descriptions:cp,Dialog:va,Divider:Fp,Drawer:Hp,Dropdown:Rn,DynamicInput:tv,DynamicTags:mv,Element:xv,Empty:zt,Ellipsis:ea,Equation:Z0,Form:Sv,GradientText:Uv,Icon:Eh,IconWrapper:og,Image:nb,Input:Ho,InputNumber:gg,LegacyTransfer:Cb,Layout:yg,List:$g,LoadingBar:Pg,Log:Ig,Menu:Ag,Mention:Tg,Message:fg,Modal:Cp,Notification:ag,PageHeader:Wg,Pagination:Ql,Popconfirm:Gg,Popover:$t,Popselect:Kl,Progress:Ea,Radio:ta,Rate:Zg,Result:tm,Row:rb,Scrollbar:zo,Select:Xl,Skeleton:l0,Slider:im,Space:$a,Spin:dm,Statistic:hm,Steps:mm,Switch:xm,Table:Rm,Tabs:Tm,Tag:Sl,Thing:_m,TimePicker:fa,Timeline:Hm,Tooltip:Dr,Transfer:jm,Tree:Ga,TreeSelect:Um,Typography:Ym,Upload:Jm,Watermark:ob};export{Ov as $,_1 as A,J1 as B,C1 as C,y1 as D,P1 as E,D1 as F,L1 as G,Sc as H,W1 as I,x1 as J,h1 as K,X1 as L,qr as M,Z1 as N,Jh as O,z1 as P,b1 as Q,O1 as R,f1 as S,S1 as T,V1 as U,B1 as V,M1 as W,cb as X,m1 as Y,K1 as Z,Q1 as _,k1 as a,Ev as a0,Hv as a1,N1 as a2,R1 as a3,$1 as a4,G1 as a5,xt as b,T1 as c,I1 as d,Po as e,q1 as f,Y1 as g,Rf as h,$p as i,Nh as j,U1 as k,v1 as l,fb as m,H1 as n,p1 as o,g1 as p,ex as q,w1 as r,E1 as s,F1 as t,j1 as u,A1 as v,vs as w,Qb as x,Pn as y,E0 as z}; + `)]);var Hi=globalThis&&globalThis.__awaiter||function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};function W0(e,o,t){const{doChange:r,xhrMap:n}=e;let l=0;function a(d){var c;let u=Object.assign({},o,{status:"error",percentage:l});n.delete(o.id),u=nr(((c=e.onError)===null||c===void 0?void 0:c.call(e,{file:u,event:d}))||u),r(u,d)}function s(d){var c;if(e.isErrorState){if(e.isErrorState(t)){a(d);return}}else if(t.status<200||t.status>=300){a(d);return}let u=Object.assign({},o,{status:"finished",percentage:l});n.delete(o.id),u=nr(((c=e.onFinish)===null||c===void 0?void 0:c.call(e,{file:u,event:d}))||u),r(u,d)}return{handleXHRLoad:s,handleXHRError:a,handleXHRAbort(d){const c=Object.assign({},o,{status:"removed",file:null,percentage:l});n.delete(o.id),r(c,d)},handleXHRProgress(d){const c=Object.assign({},o,{status:"uploading"});if(d.lengthComputable){const u=Math.ceil(d.loaded/d.total*100);c.percentage=u,l=u}r(c,d)}}}function N0(e){const{inst:o,file:t,data:r,headers:n,withCredentials:l,action:a,customRequest:s}=e,{doChange:d}=e.inst;let c=0;s({file:t,data:r,headers:n,withCredentials:l,action:a,onProgress(u){const f=Object.assign({},t,{status:"uploading"}),p=u.percent;f.percentage=p,c=p,d(f)},onFinish(){var u;let f=Object.assign({},t,{status:"finished",percentage:c});f=nr(((u=o.onFinish)===null||u===void 0?void 0:u.call(o,{file:f}))||f),d(f)},onError(){var u;let f=Object.assign({},t,{status:"error",percentage:c});f=nr(((u=o.onError)===null||u===void 0?void 0:u.call(o,{file:f}))||f),d(f)}})}function V0(e,o,t){const r=W0(e,o,t);t.onabort=r.handleXHRAbort,t.onerror=r.handleXHRError,t.onload=r.handleXHRLoad,t.upload&&(t.upload.onprogress=r.handleXHRProgress)}function gs(e,o){return typeof e=="function"?e({file:o}):e||{}}function U0(e,o,t){const r=gs(o,t);r&&Object.keys(r).forEach(n=>{e.setRequestHeader(n,r[n])})}function K0(e,o,t){const r=gs(o,t);r&&Object.keys(r).forEach(n=>{e.append(n,r[n])})}function G0(e,o,t,{method:r,action:n,withCredentials:l,responseType:a,headers:s,data:d}){const c=new XMLHttpRequest;c.responseType=a,e.xhrMap.set(t.id,c),c.withCredentials=l;const u=new FormData;if(K0(u,d,t),u.append(o,t.file),V0(e,t,c),n!==void 0){c.open(r.toUpperCase(),n),U0(c,s,t),c.send(u);const f=Object.assign({},t,{status:"uploading"});e.doChange(f)}}const q0=Object.assign(Object.assign({},ne.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>I0?ps(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerStyle:[String,Object],renderIcon:Object}),J1=q({name:"Upload",props:q0,setup(e){e.abstract&&e.listType==="image-card"&&Eo("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Upload","-upload",j0,Zm,e,o),n=rt(e),l=R(()=>{const{max:k}=e;return k!==void 0?v.value.length>=k:!1}),a=D(e.defaultFileList),s=le(e,"fileList"),d=D(null),c={value:!1},u=D(!1),f=new Map,p=so(s,a),v=R(()=>p.value.map(nr));function h(){var k;(k=d.value)===null||k===void 0||k.click()}function m(k){const $=k.target;S($.files?Array.from($.files).map(L=>({file:L,entry:null,source:"input"})):null,k),$.value=""}function b(k){const{"onUpdate:fileList":$,onUpdateFileList:L}=e;$&&ae($,k),L&&ae(L,k),a.value=k}const x=R(()=>e.multiple||e.directory);function S(k,$){if(!k||k.length===0)return;const{onBeforeUpload:L}=e;k=x.value?k:[k[0]];const{max:M,accept:j}=e;k=k.filter(({file:U,source:_})=>_==="dnd"&&(j!=null&&j.trim())?O0(U.name,U.type,j):!0),M&&(k=k.slice(0,M-v.value.length));const E=it();Promise.all(k.map(({file:U,entry:_})=>Hi(this,void 0,void 0,function*(){var V;const te={id:it(),batchId:E,name:U.name,status:"pending",percentage:0,file:U,url:null,type:U.type,thumbnailUrl:null,fullPath:(V=_==null?void 0:_.fullPath)!==null&&V!==void 0?V:`/${U.webkitRelativePath||U.name}`};return!L||(yield L({file:te,fileList:v.value}))!==!1?te:null}))).then(U=>Hi(this,void 0,void 0,function*(){let _=Promise.resolve();U.forEach(V=>{_=_.then(io).then(()=>{V&&T(V,$,{append:!0})})}),yield _})).then(()=>{e.defaultUpload&&B()})}function B(k){const{method:$,action:L,withCredentials:M,headers:j,data:E,name:U}=e,_=k!==void 0?v.value.filter(te=>te.id===k):v.value,V=k!==void 0;_.forEach(te=>{const{status:N}=te;(N==="pending"||N==="error"&&V)&&(e.customRequest?N0({inst:{doChange:T,xhrMap:f,onFinish:e.onFinish,onError:e.onError},file:te,action:L,withCredentials:M,headers:j,data:E,customRequest:e.customRequest}):G0({doChange:T,xhrMap:f,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},U,te,{method:$,action:L,withCredentials:M,responseType:e.responseType,headers:j,data:E}))})}const T=(k,$,L={append:!1,remove:!1})=>{const{append:M,remove:j}=L,E=Array.from(v.value),U=E.findIndex(_=>_.id===k.id);if(M||j||~U){M?E.push(k):j?E.splice(U,1):E.splice(U,1,k);const{onChange:_}=e;_&&_({file:k,fileList:E,event:$}),b(E)}};function z(k){var $;if(k.thumbnailUrl)return k.thumbnailUrl;const{createThumbnailUrl:L}=e;return L?($=L(k.file,k))!==null&&$!==void 0?$:k.url||"":k.url?k.url:k.file?k0(k.file):""}const I=R(()=>{const{common:{cubicBezierEaseInOut:k},self:{draggerColor:$,draggerBorder:L,draggerBorderHover:M,itemColorHover:j,itemColorHoverError:E,itemTextColorError:U,itemTextColorSuccess:_,itemTextColor:V,itemIconColor:te,itemDisabledOpacity:N,lineHeight:G,borderRadius:Ce,fontSize:X,itemBorderImageCardError:ve,itemBorderImageCard:he}}=r.value;return{"--n-bezier":k,"--n-border-radius":Ce,"--n-dragger-border":L,"--n-dragger-border-hover":M,"--n-dragger-color":$,"--n-font-size":X,"--n-item-color-hover":j,"--n-item-color-hover-error":E,"--n-item-disabled-opacity":N,"--n-item-icon-color":te,"--n-item-text-color":V,"--n-item-text-color-error":U,"--n-item-text-color-success":_,"--n-line-height":G,"--n-item-border-image-card-error":ve,"--n-item-border-image-card":he}}),w=t?Ae("upload",void 0,I,e):void 0;Oe(Ut,{mergedClsPrefixRef:o,mergedThemeRef:r,showCancelButtonRef:le(e,"showCancelButton"),showDownloadButtonRef:le(e,"showDownloadButton"),showRemoveButtonRef:le(e,"showRemoveButton"),showRetryButtonRef:le(e,"showRetryButton"),onRemoveRef:le(e,"onRemove"),onDownloadRef:le(e,"onDownload"),mergedFileListRef:v,triggerStyleRef:le(e,"triggerStyle"),shouldUseThumbnailUrlRef:le(e,"shouldUseThumbnailUrl"),renderIconRef:le(e,"renderIcon"),xhrMap:f,submit:B,doChange:T,showPreviewButtonRef:le(e,"showPreviewButton"),onPreviewRef:le(e,"onPreview"),getFileThumbnailUrlResolver:z,listTypeRef:le(e,"listType"),dragOverRef:u,openOpenFileDialog:h,draggerInsideRef:c,handleFileAddition:S,mergedDisabledRef:n.mergedDisabledRef,maxReachedRef:l,fileListStyleRef:le(e,"fileListStyle"),abstractRef:le(e,"abstract"),acceptRef:le(e,"accept"),cssVarsRef:t?void 0:I,themeClassRef:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,showTriggerRef:le(e,"showTrigger"),imageGroupPropsRef:le(e,"imageGroupProps"),mergedDirectoryDndRef:R(()=>{var k;return(k=e.directoryDnd)!==null&&k!==void 0?k:e.directory})});const O={clear:()=>{a.value=[]},submit:B,openOpenFileDialog:h};return Object.assign({mergedClsPrefix:o,draggerInsideRef:c,inputElRef:d,mergedTheme:r,dragOver:u,mergedMultiple:x,cssVars:t?void 0:I,themeClass:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,handleFileInputChange:m},O)},render(){var e,o;const{draggerInsideRef:t,mergedClsPrefix:r,$slots:n,directory:l,onRender:a}=this;if(n.default&&!this.abstract){const d=n.default()[0];!((e=d==null?void 0:d.type)===null||e===void 0)&&e[us]&&(t.value=!0)}const s=i("input",Object.assign({},this.inputProps,{ref:"inputElRef",type:"file",class:`${r}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:l||void 0,directory:l||void 0}));return this.abstract?i(ao,null,(o=n.default)===null||o===void 0?void 0:o.call(n),i(Ni,{to:"body"},s)):(a==null||a(),i("div",{class:[`${r}-upload`,t.value&&`${r}-upload--dragger-inside`,this.dragOver&&`${r}-upload--drag-over`,this.themeClass],style:this.cssVars},s,this.showTrigger&&this.listType!=="image-card"&&i(vs,null,n),this.showFileList&&i(E0,null,n)))}}),Y0=()=>({}),X0={name:"Equation",common:fe,self:Y0},Z0=X0,ex={name:"dark",common:fe,Alert:lu,Anchor:mu,AutoComplete:Ou,Avatar:Ll,AvatarGroup:Nu,BackTop:Ku,Badge:qu,Breadcrumb:rf,Button:$o,ButtonGroup:pg,Calendar:gf,Card:Vl,Carousel:If,Cascader:_f,Checkbox:Nt,Code:Ul,Collapse:Af,CollapseTransition:Wf,ColorPicker:xf,DataTable:Ph,DatePicker:lp,Descriptions:cp,Dialog:va,Divider:Fp,Drawer:Hp,Dropdown:Rn,DynamicInput:tv,DynamicTags:mv,Element:xv,Empty:zt,Ellipsis:ea,Equation:Z0,Form:Sv,GradientText:Uv,Icon:Eh,IconWrapper:og,Image:nb,Input:Ho,InputNumber:gg,LegacyTransfer:Cb,Layout:yg,List:$g,LoadingBar:Pg,Log:Ig,Menu:Ag,Mention:Tg,Message:fg,Modal:Cp,Notification:ag,PageHeader:Wg,Pagination:Ql,Popconfirm:Gg,Popover:$t,Popselect:Kl,Progress:Ea,Radio:ta,Rate:Zg,Result:tm,Row:rb,Scrollbar:zo,Select:Xl,Skeleton:l0,Slider:im,Space:$a,Spin:dm,Statistic:hm,Steps:mm,Switch:xm,Table:Rm,Tabs:Tm,Tag:Sl,Thing:_m,TimePicker:fa,Timeline:Hm,Tooltip:Dr,Transfer:jm,Tree:Ga,TreeSelect:Um,Typography:Ym,Upload:Jm,Watermark:ob};export{Ov as $,_1 as A,J1 as B,C1 as C,y1 as D,P1 as E,S1 as F,D1 as G,L1 as H,x1 as I,Sc as J,W1 as K,h1 as L,qr as M,Z1 as N,X1 as O,Jh as P,z1 as Q,b1 as R,O1 as S,f1 as T,V1 as U,B1 as V,M1 as W,cb as X,m1 as Y,K1 as Z,Q1 as _,k1 as a,Ev as a0,Hv as a1,N1 as a2,R1 as a3,$1 as a4,G1 as a5,xt as b,T1 as c,I1 as d,Po as e,q1 as f,Y1 as g,Rf as h,$p as i,Nh as j,U1 as k,v1 as l,fb as m,H1 as n,p1 as o,g1 as p,ex as q,w1 as r,E1 as s,F1 as t,j1 as u,A1 as v,vs as w,Qb as x,Pn as y,E0 as z}; diff --git a/web/dist/assets/paopao-video-player-aa5e8b3f.js b/web/dist/assets/paopao-video-player-2fe58954.js similarity index 98% rename from web/dist/assets/paopao-video-player-aa5e8b3f.js rename to web/dist/assets/paopao-video-player-2fe58954.js index de7528ef..85af9032 100644 --- a/web/dist/assets/paopao-video-player-aa5e8b3f.js +++ b/web/dist/assets/paopao-video-player-2fe58954.js @@ -1,4 +1,4 @@ -import{d as h,o as s,c as l,a as t,L as p,M as m,z as d,v as y,J as u,N as f,O as c,P as g,Q as P,R as B}from"./@vue-e0e89260.js";var T="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171769163' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='3910' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M327.68 184.32a81.92 81.92 0 0 1 81.92 81.92v491.52a81.92 81.92 0 1 1-163.84 0V266.24a81.92 81.92 0 0 1 81.92-81.92z m368.64 0a81.92 81.92 0 0 1 81.92 81.92v491.52a81.92 81.92 0 1 1-163.84 0V266.24a81.92 81.92 0 0 1 81.92-81.92z' p-id='3911' fill='white'%3e%3c/path%3e%3c/svg%3e",w=T,V="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171715945' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='2813' width='500' height='500' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath d='M817.088 484.96l-512-323.744C295.232 154.976 282.752 154.592 272.576 160.224 262.336 165.856 256 176.608 256 188.256l0 647.328c0 11.648 6.336 22.4 16.576 28.032 4.8 2.656 10.112 3.968 15.424 3.968 5.952 0 11.904-1.664 17.088-4.928l512-323.616C826.368 533.184 832 522.976 832 512 832 501.024 826.368 490.816 817.088 484.96z' fill='white' p-id='2814'%3e%3c/path%3e%3c/svg%3e",b=V,M="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687172017162' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='7048' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M462.06 142.1L284.12 320H80c-26.52 0-48 21.48-48 48v288c0 26.5 21.48 48 48 48h204.12l177.94 177.9c30.06 30.06 81.94 8.94 81.94-33.94V176.04c0-42.92-51.92-63.96-81.94-33.94zM992 512c0-127.06-64.12-243.88-171.54-312.48-22.38-14.28-52.06-7.64-66.24 14.92s-7.56 52.42 14.82 66.72C848.54 331.94 896 418.22 896 512s-47.46 180.06-126.96 230.84c-22.38 14.28-29 44.14-14.82 66.72 13.02 20.72 42.24 30.28 66.24 14.92C927.88 755.88 992 639.06 992 512z m-283.54-153.74c-23.16-12.66-52.38-4.32-65.22 18.9-12.78 23.22-4.32 52.4 18.9 65.22C687.96 456.56 704 483.26 704 512c0 28.76-16.04 55.44-41.84 69.62-23.22 12.82-31.68 42-18.9 65.22 12.86 23.32 42.1 31.6 65.22 18.9 56.46-31.1 91.54-90 91.54-153.76s-35.08-122.64-91.56-153.72z' p-id='7049' fill='white'%3e%3c/path%3e%3c/svg%3e",k=M,j="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171887277' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5997' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M810.666667 938.666667h-128c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666667h128c25.6 0 42.666667-17.066667 42.666666-42.666666v-128c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667v128c0 72.533333-55.466667 128-128 128zM341.333333 938.666667H213.333333c-72.533333 0-128-55.466667-128-128v-128c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667v128c0 25.6 17.066667 42.666667 42.666666 42.666666h128c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666667zM896 384c-25.6 0-42.666667-17.066667-42.666667-42.666667V213.333333c0-25.6-17.066667-42.666667-42.666666-42.666666h-128c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666667h128c72.533333 0 128 55.466667 128 128v128c0 25.6-17.066667 42.666667-42.666667 42.666667zM128 384c-25.6 0-42.666667-17.066667-42.666667-42.666667V213.333333c0-72.533333 55.466667-128 128-128h128c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666667H213.333333c-25.6 0-42.666667 17.066667-42.666666 42.666666v128c0 25.6-17.066667 42.666667-42.666667 42.666667z' p-id='5998' fill='white'%3e%3c/path%3e%3c/svg%3e",$=j,C=h({name:"BasicTheme",props:{uuid:{type:String,required:!0},src:{type:String,required:!0},autoplay:{type:Boolean,required:!0},loop:{type:Boolean,required:!0},controls:{type:Boolean,required:!0},hoverable:{type:Boolean,required:!0},mask:{type:Boolean,required:!0},colors:{type:[String,Array],required:!0},time:{type:Object,required:!0},playing:{type:Boolean,default:!1},duration:{type:[String,Number],required:!0}},data(){return{hovered:!1,volume:!1,amount:1,Pause:w,Play:b,Volume:k,Maximize:$}},computed:{colorFrom(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#fbbf24":(e=this.colors)!=null&&e[0]?this.colors[0]:"#fbbf24"},colorTo(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#fbbf24":(e=this.colors)!=null&&e[1]?this.colors[1]:"#ec4899"}},mounted(){this.$emit("setPlayer",this.$refs[this.uuid])},methods:{setVolume(){this.$refs[this.uuid].volume=this.amount},stopVolume(){return this.amount>0?this.amount=0:this.amount=1}}});const I={class:"relative"},D=["loop","autoplay","muted"],F=["src"],q={class:"flex items-center justify-start w-full"},E={class:"font-sans text-white text-xs w-24"},N={class:"mr-3 ml-2"},R=["src"],A=["src"],U={class:"relative"},G={class:"px-3 py-2 rounded-lg flex items-center transform translate-x-2",style:{"background-color":"rgba(0, 0, 0, .8)"}},O=["src"],L=["src"],Y=["src"];function H(e,n,a,r,i,v){return s(),l("div",{class:"shadow-xl rounded-xl overflow-hidden relative",onMouseenter:n[14]||(n[14]=o=>e.hovered=!0),onMouseleave:n[15]||(n[15]=o=>e.hovered=!1),onKeydown:n[16]||(n[16]=g(o=>e.$emit("play"),["left"]))},[t("div",I,[t("video",{ref:e.uuid,class:"w-full",loop:e.loop,autoplay:e.autoplay,muted:e.autoplay,onTimeupdate:n[0]||(n[0]=o=>e.$emit("timeupdate",o.target)),onPause:n[1]||(n[1]=o=>e.$emit("isPlaying",!1)),onPlay:n[2]||(n[2]=o=>e.$emit("isPlaying",!0)),onClick:n[3]||(n[3]=o=>e.$emit("play"))},[t("source",{src:e.src,type:"video/mp4"},null,8,F)],40,D),e.controls?(s(),l("div",{key:0,class:p([{"opacity-0 translate-y-full":!e.hoverable&&e.hovered,"opacity-0 translate-y-full":e.hoverable&&!e.hovered},"transition duration-300 transform absolute w-full bottom-0 left-0 flex items-center justify-between overlay px-5 pt-3 pb-5"])},[t("div",q,[t("p",E,m(e.time.display)+"/"+m(e.duration),1),t("div",N,[d(t("img",{src:e.Pause,alt:"Icon pause video",class:"w-5 cursor-pointer",onClick:n[4]||(n[4]=o=>e.$emit("play"))},null,8,R),[[y,e.playing]]),d(t("img",{src:e.Play,alt:"Icon play video",class:"w-5 cursor-pointer",onClick:n[5]||(n[5]=o=>e.$emit("play"))},null,8,A),[[y,!e.playing]])]),t("div",{class:"w-full h-1 bg-white bg-opacity-60 rounded-sm cursor-pointer",onClick:n[6]||(n[6]=o=>e.$emit("position",o))},[t("div",{class:"relative h-full pointer-events-none",style:u(`width: ${e.time.progress}%; transition: width .2s ease-in-out;`)},[t("div",{class:"w-full rounded-sm h-full gradient-variable bg-gradient-to-r pointer-events-none absolute top-0 left-0",style:u(`--tw-gradient-from: ${e.colorFrom};--tw-gradient-to: ${e.colorTo};transition: width .2s ease-in-out`)},null,4),t("div",{class:"w-full rounded-sm filter blur-sm h-full gradient-variable bg-gradient-to-r pointer-events-none absolute top-0 left-0",style:u(`--tw-gradient-from: ${e.colorFrom};--tw-gradient-to: ${e.colorTo};transition: width .2s ease-in-out`)},null,4)],4)])]),t("div",{class:"ml-5 flex items-center justify-end",onMouseleave:n[12]||(n[12]=o=>e.volume=!1)},[t("div",U,[t("div",{class:p(`w-128 origin-left translate-x-2 -rotate-90 w-128 transition duration-200 absolute transform top-0 py-2 ${e.volume?"-translate-y-4":"opacity-0 -translate-y-1 pointer-events-none"}`)},[t("div",G,[d(t("input",{"onUpdate:modelValue":n[7]||(n[7]=o=>e.amount=o),type:"range",step:"0.05",min:"0",max:"1",class:"rounded-lg overflow-hidden appearance-none bg-white bg-opacity-30 h-1 w-128 vertical-range",onInput:n[8]||(n[8]=function(){return e.setVolume&&e.setVolume(...arguments)})},null,544),[[f,e.amount]])])],2),t("img",{src:e.Volume,alt:"High volume video",class:"w-5 cursor-pointer relative",style:{"z-index":"2"},onClick:n[9]||(n[9]=function(){return e.stopVolume&&e.stopVolume(...arguments)}),onMouseenter:n[10]||(n[10]=o=>e.volume=!0)},null,40,O)]),t("img",{src:e.Maximize,alt:"Fullscreen",class:"w-3 ml-4 cursor-pointer",onClick:n[11]||(n[11]=o=>e.$emit("fullScreen"))},null,8,L)],32)],2)):c("",!0),!e.autoplay&&e.mask&&e.time.current===0?(s(),l("div",{key:1,class:p(`transition transform duration-300 absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-filter z-10 flex items-center justify-center ${e.playing?"opacity-0 pointer-events-none":""}`)},[t("div",{class:"w-20 h-20 rounded-full bg-white bg-opacity-20 transition duration-200 hover:bg-opacity-40 flex items-center justify-center cursor-pointer",onClick:n[13]||(n[13]=o=>e.$emit("play"))},[t("img",{src:e.Play,alt:"Icon play video",class:"transform translate-x-0.5 w-12"},null,8,Y)])],2)):c("",!0)])],32)}C.render=H;var S=h({name:"BasicTheme",props:{uuid:{type:String,required:!0},src:{type:String,required:!0},autoplay:{type:Boolean,required:!0},loop:{type:Boolean,required:!0},controls:{type:Boolean,required:!0},hoverable:{type:Boolean,required:!0},mask:{type:Boolean,required:!0},colors:{type:[String,Array],required:!0},time:{type:Object,required:!0},playing:{type:Boolean,default:!1},duration:{type:[String,Number],required:!0}},data(){return{hovered:!1,volume:!1,amount:1,Pause:w,Play:b,Volume:k,Maximize:$}},computed:{color(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#8B5CF6":(e=this.colors)!=null&&e[0]?this.colors[0]:"#8B5CF6"}},mounted(){this.$emit("setPlayer",this.$refs[this.uuid])},methods:{setVolume(){this.$refs[this.uuid].volume=this.amount},stopVolume(){return this.amount>0?this.amount=0:this.amount=1}}});const W={class:"relative"},X=["loop","autoplay","muted"],K=["src"],J={class:"mr-5"},Q=["src"],Z=["src"],_={class:"relative mr-6"},ee={class:"px-3 py-3 rounded-xl flex items-center transform translate-x-9 bg-black bg-opacity-30"},ne=["src"],te=["src"],oe=["src"];function re(e,n,a,r,i,v){return s(),l("div",{class:"shadow-xl rounded-3xl overflow-hidden relative",onMouseenter:n[13]||(n[13]=o=>e.hovered=!0),onMouseleave:n[14]||(n[14]=o=>e.hovered=!1),onKeydown:n[15]||(n[15]=g(o=>e.$emit("play"),["left"]))},[t("div",W,[t("video",{ref:e.uuid,class:"w-full",loop:e.loop,autoplay:e.autoplay,muted:e.autoplay,onTimeupdate:n[0]||(n[0]=o=>e.$emit("timeupdate",o.target)),onPause:n[1]||(n[1]=o=>e.$emit("isPlaying",!1)),onPlay:n[2]||(n[2]=o=>e.$emit("isPlaying",!0)),onClick:n[3]||(n[3]=o=>e.$emit("play"))},[t("source",{src:e.src,type:"video/mp4"},null,8,K)],40,X),e.controls?(s(),l("div",{key:0,class:p([{"opacity-0 translate-y-full":!e.hoverable&&e.hovered,"opacity-0 translate-y-full":e.hoverable&&!e.hovered},"absolute px-5 pb-5 bottom-0 left-0 w-full transition duration-300 transform"])},[t("div",{class:"w-full bg-black bg-opacity-30 px-5 py-4 rounded-xl flex items-center justify-between",onMouseleave:n[11]||(n[11]=o=>e.volume=!1)},[t("div",{class:"font-sans py-1 px-2 text-white rounded-md text-xs mr-5 whitespace-nowrap font-medium w-32 text-center",style:u(`font-size: 11px; background-color: ${e.color}`)},m(e.time.display)+" / "+m(e.duration),5),t("div",J,[d(t("img",{src:e.Pause,alt:"Icon pause video",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[4]||(n[4]=o=>e.$emit("play"))},null,8,Q),[[y,e.playing]]),d(t("img",{src:e.Play,alt:"Icon play video",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[5]||(n[5]=o=>e.$emit("play"))},null,8,Z),[[y,!e.playing]])]),t("div",{class:"w-full h-1 bg-white bg-opacity-40 rounded-sm cursor-pointer mr-6",onClick:n[6]||(n[6]=o=>e.$emit("position",o))},[t("div",{class:"w-full rounded-sm h-full bg-white pointer-events-none",style:u(`width: ${e.time.progress}%; transition: width .2s ease-in-out;`)},null,4)]),t("div",_,[t("div",{class:p(`w-128 origin-left translate-x-2 -rotate-90 w-128 transition duration-200 absolute transform top-0 py-2 ${e.volume?"-translate-y-4":"opacity-0 -translate-y-1 pointer-events-none"}`)},[t("div",ee,[d(t("input",{"onUpdate:modelValue":n[7]||(n[7]=o=>e.amount=o),type:"range",step:"0.05",min:"0",max:"1",class:"rounded-lg overflow-hidden appearance-none bg-white bg-opacity-30 h-1.5 w-128 vertical-range"},null,512),[[f,e.amount]])])],2),t("img",{src:e.Volume,alt:"High volume video",class:"w-5 cursor-pointer filter-white transition duration-300 relative",style:{"z-index":"2"},onClick:n[8]||(n[8]=function(){return e.stopVolume&&e.stopVolume(...arguments)}),onMouseenter:n[9]||(n[9]=o=>e.volume=!0)},null,40,ne)]),t("img",{src:e.Maximize,alt:"Fullscreen",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[10]||(n[10]=o=>e.$emit("fullScreen"))},null,8,te)],32)],2)):c("",!0),!e.autoplay&&e.mask&&e.time.current===0?(s(),l("div",{key:1,class:p(`transition transform duration-300 absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-filter z-10 flex items-center justify-center ${e.playing?"opacity-0 pointer-events-none":""}`)},[t("div",{class:"w-20 h-20 rounded-full bg-white bg-opacity-20 transition duration-200 hover:bg-opacity-40 flex items-center justify-center cursor-pointer",onClick:n[12]||(n[12]=o=>e.$emit("play"))},[t("img",{src:e.Play,alt:"Icon play video",class:"transform translate-x-0.5 w-12"},null,8,oe)])],2)):c("",!0)])],32)}S.render=re;var z=h({name:"PaoPaoVideoPlayer",components:{basic:S,gradient:C},props:{src:{type:String,required:!0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},mask:{type:Boolean,default:!0},colors:{type:[String,Array],default(){return["#8B5CF6","#ec4899"]}},hoverable:{type:Boolean,default:!1},theme:{type:String,default:"basic"}},data(){return{uuid:Math.random().toString(36).substr(2,18),player:null,duration:0,playing:!1,time:{progress:0,display:0,current:0}}},watch:{"time.current"(e){this.time.display=this.format(Number(e)),this.time.progress=e*100/this.player.duration}},methods:{isPlaying(e){this.playing=e},play(){return this.playing?this.player.pause():this.player.play()},setPlayer(e){this.player=e,this.player.addEventListener("loadeddata",()=>{this.player.readyState>=3&&(this.duration=this.format(Number(this.player.duration)),this.time.display=this.format(0))})},stop(){this.player.pause(),this.player.currentTime=0},fullScreen(){this.player.webkitEnterFullscreen()},position(e){this.player.pause();const n=e.target.getBoundingClientRect(),r=(e.clientX-n.left)*100/e.target.offsetWidth;this.player.currentTime=r*this.player.duration/100,this.player.play()},format(e){const n=Math.floor(e/3600),a=Math.floor(e%3600/60),r=Math.round(e%60);return[n,a>9?a:n?"0"+a:a||"00",r>9?r:"0"+r].filter(Boolean).join(":")}}});const ae={class:"paopao-video-player"};function ie(e,n,a,r,i,v){return s(),l("div",ae,[(s(),P(B(e.theme),{uuid:e.uuid,src:e.src,autoplay:e.autoplay,loop:e.loop,controls:e.controls,mask:e.mask,colors:e.colors,time:e.time,playing:e.playing,duration:e.duration,hoverable:e.hoverable,onPlay:e.play,onStop:e.stop,onTimeupdate:n[0]||(n[0]=o=>{let{currentTime:x}=o;return e.time.current=x}),onPosition:e.position,onFullScreen:e.fullScreen,onSetPlayer:e.setPlayer,onIsPlaying:e.isPlaying},null,40,["uuid","src","autoplay","loop","controls","mask","colors","time","playing","duration","hoverable","onPlay","onStop","onPosition","onFullScreen","onSetPlayer","onIsPlaying"]))])}function se(e,n){n===void 0&&(n={});var a=n.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var le=`/*! tailwindcss v2.2.17 | MIT License | https://tailwindcss.com */ +import{d as h,e as s,f as l,j as t,l as p,x as m,O as d,D as y,t as u,X as f,Y as c,Z as g,q as P,s as B}from"./@vue-a481fc63.js";var T="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171769163' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='3910' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M327.68 184.32a81.92 81.92 0 0 1 81.92 81.92v491.52a81.92 81.92 0 1 1-163.84 0V266.24a81.92 81.92 0 0 1 81.92-81.92z m368.64 0a81.92 81.92 0 0 1 81.92 81.92v491.52a81.92 81.92 0 1 1-163.84 0V266.24a81.92 81.92 0 0 1 81.92-81.92z' p-id='3911' fill='white'%3e%3c/path%3e%3c/svg%3e",w=T,V="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171715945' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='2813' width='500' height='500' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath d='M817.088 484.96l-512-323.744C295.232 154.976 282.752 154.592 272.576 160.224 262.336 165.856 256 176.608 256 188.256l0 647.328c0 11.648 6.336 22.4 16.576 28.032 4.8 2.656 10.112 3.968 15.424 3.968 5.952 0 11.904-1.664 17.088-4.928l512-323.616C826.368 533.184 832 522.976 832 512 832 501.024 826.368 490.816 817.088 484.96z' fill='white' p-id='2814'%3e%3c/path%3e%3c/svg%3e",b=V,M="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687172017162' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='7048' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M462.06 142.1L284.12 320H80c-26.52 0-48 21.48-48 48v288c0 26.5 21.48 48 48 48h204.12l177.94 177.9c30.06 30.06 81.94 8.94 81.94-33.94V176.04c0-42.92-51.92-63.96-81.94-33.94zM992 512c0-127.06-64.12-243.88-171.54-312.48-22.38-14.28-52.06-7.64-66.24 14.92s-7.56 52.42 14.82 66.72C848.54 331.94 896 418.22 896 512s-47.46 180.06-126.96 230.84c-22.38 14.28-29 44.14-14.82 66.72 13.02 20.72 42.24 30.28 66.24 14.92C927.88 755.88 992 639.06 992 512z m-283.54-153.74c-23.16-12.66-52.38-4.32-65.22 18.9-12.78 23.22-4.32 52.4 18.9 65.22C687.96 456.56 704 483.26 704 512c0 28.76-16.04 55.44-41.84 69.62-23.22 12.82-31.68 42-18.9 65.22 12.86 23.32 42.1 31.6 65.22 18.9 56.46-31.1 91.54-90 91.54-153.76s-35.08-122.64-91.56-153.72z' p-id='7049' fill='white'%3e%3c/path%3e%3c/svg%3e",k=M,j="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171887277' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5997' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M810.666667 938.666667h-128c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666667h128c25.6 0 42.666667-17.066667 42.666666-42.666666v-128c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667v128c0 72.533333-55.466667 128-128 128zM341.333333 938.666667H213.333333c-72.533333 0-128-55.466667-128-128v-128c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667v128c0 25.6 17.066667 42.666667 42.666666 42.666666h128c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666667zM896 384c-25.6 0-42.666667-17.066667-42.666667-42.666667V213.333333c0-25.6-17.066667-42.666667-42.666666-42.666666h-128c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666667h128c72.533333 0 128 55.466667 128 128v128c0 25.6-17.066667 42.666667-42.666667 42.666667zM128 384c-25.6 0-42.666667-17.066667-42.666667-42.666667V213.333333c0-72.533333 55.466667-128 128-128h128c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666667H213.333333c-25.6 0-42.666667 17.066667-42.666666 42.666666v128c0 25.6-17.066667 42.666667-42.666667 42.666667z' p-id='5998' fill='white'%3e%3c/path%3e%3c/svg%3e",$=j,C=h({name:"BasicTheme",props:{uuid:{type:String,required:!0},src:{type:String,required:!0},autoplay:{type:Boolean,required:!0},loop:{type:Boolean,required:!0},controls:{type:Boolean,required:!0},hoverable:{type:Boolean,required:!0},mask:{type:Boolean,required:!0},colors:{type:[String,Array],required:!0},time:{type:Object,required:!0},playing:{type:Boolean,default:!1},duration:{type:[String,Number],required:!0}},data(){return{hovered:!1,volume:!1,amount:1,Pause:w,Play:b,Volume:k,Maximize:$}},computed:{colorFrom(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#fbbf24":(e=this.colors)!=null&&e[0]?this.colors[0]:"#fbbf24"},colorTo(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#fbbf24":(e=this.colors)!=null&&e[1]?this.colors[1]:"#ec4899"}},mounted(){this.$emit("setPlayer",this.$refs[this.uuid])},methods:{setVolume(){this.$refs[this.uuid].volume=this.amount},stopVolume(){return this.amount>0?this.amount=0:this.amount=1}}});const I={class:"relative"},D=["loop","autoplay","muted"],F=["src"],q={class:"flex items-center justify-start w-full"},E={class:"font-sans text-white text-xs w-24"},N={class:"mr-3 ml-2"},A=["src"],R=["src"],U={class:"relative"},G={class:"px-3 py-2 rounded-lg flex items-center transform translate-x-2",style:{"background-color":"rgba(0, 0, 0, .8)"}},O=["src"],L=["src"],Y=["src"];function H(e,n,a,r,i,v){return s(),l("div",{class:"shadow-xl rounded-xl overflow-hidden relative",onMouseenter:n[14]||(n[14]=o=>e.hovered=!0),onMouseleave:n[15]||(n[15]=o=>e.hovered=!1),onKeydown:n[16]||(n[16]=g(o=>e.$emit("play"),["left"]))},[t("div",I,[t("video",{ref:e.uuid,class:"w-full",loop:e.loop,autoplay:e.autoplay,muted:e.autoplay,onTimeupdate:n[0]||(n[0]=o=>e.$emit("timeupdate",o.target)),onPause:n[1]||(n[1]=o=>e.$emit("isPlaying",!1)),onPlay:n[2]||(n[2]=o=>e.$emit("isPlaying",!0)),onClick:n[3]||(n[3]=o=>e.$emit("play"))},[t("source",{src:e.src,type:"video/mp4"},null,8,F)],40,D),e.controls?(s(),l("div",{key:0,class:p([{"opacity-0 translate-y-full":!e.hoverable&&e.hovered,"opacity-0 translate-y-full":e.hoverable&&!e.hovered},"transition duration-300 transform absolute w-full bottom-0 left-0 flex items-center justify-between overlay px-5 pt-3 pb-5"])},[t("div",q,[t("p",E,m(e.time.display)+"/"+m(e.duration),1),t("div",N,[d(t("img",{src:e.Pause,alt:"Icon pause video",class:"w-5 cursor-pointer",onClick:n[4]||(n[4]=o=>e.$emit("play"))},null,8,A),[[y,e.playing]]),d(t("img",{src:e.Play,alt:"Icon play video",class:"w-5 cursor-pointer",onClick:n[5]||(n[5]=o=>e.$emit("play"))},null,8,R),[[y,!e.playing]])]),t("div",{class:"w-full h-1 bg-white bg-opacity-60 rounded-sm cursor-pointer",onClick:n[6]||(n[6]=o=>e.$emit("position",o))},[t("div",{class:"relative h-full pointer-events-none",style:u(`width: ${e.time.progress}%; transition: width .2s ease-in-out;`)},[t("div",{class:"w-full rounded-sm h-full gradient-variable bg-gradient-to-r pointer-events-none absolute top-0 left-0",style:u(`--tw-gradient-from: ${e.colorFrom};--tw-gradient-to: ${e.colorTo};transition: width .2s ease-in-out`)},null,4),t("div",{class:"w-full rounded-sm filter blur-sm h-full gradient-variable bg-gradient-to-r pointer-events-none absolute top-0 left-0",style:u(`--tw-gradient-from: ${e.colorFrom};--tw-gradient-to: ${e.colorTo};transition: width .2s ease-in-out`)},null,4)],4)])]),t("div",{class:"ml-5 flex items-center justify-end",onMouseleave:n[12]||(n[12]=o=>e.volume=!1)},[t("div",U,[t("div",{class:p(`w-128 origin-left translate-x-2 -rotate-90 w-128 transition duration-200 absolute transform top-0 py-2 ${e.volume?"-translate-y-4":"opacity-0 -translate-y-1 pointer-events-none"}`)},[t("div",G,[d(t("input",{"onUpdate:modelValue":n[7]||(n[7]=o=>e.amount=o),type:"range",step:"0.05",min:"0",max:"1",class:"rounded-lg overflow-hidden appearance-none bg-white bg-opacity-30 h-1 w-128 vertical-range",onInput:n[8]||(n[8]=function(){return e.setVolume&&e.setVolume(...arguments)})},null,544),[[f,e.amount]])])],2),t("img",{src:e.Volume,alt:"High volume video",class:"w-5 cursor-pointer relative",style:{"z-index":"2"},onClick:n[9]||(n[9]=function(){return e.stopVolume&&e.stopVolume(...arguments)}),onMouseenter:n[10]||(n[10]=o=>e.volume=!0)},null,40,O)]),t("img",{src:e.Maximize,alt:"Fullscreen",class:"w-3 ml-4 cursor-pointer",onClick:n[11]||(n[11]=o=>e.$emit("fullScreen"))},null,8,L)],32)],2)):c("",!0),!e.autoplay&&e.mask&&e.time.current===0?(s(),l("div",{key:1,class:p(`transition transform duration-300 absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-filter z-10 flex items-center justify-center ${e.playing?"opacity-0 pointer-events-none":""}`)},[t("div",{class:"w-20 h-20 rounded-full bg-white bg-opacity-20 transition duration-200 hover:bg-opacity-40 flex items-center justify-center cursor-pointer",onClick:n[13]||(n[13]=o=>e.$emit("play"))},[t("img",{src:e.Play,alt:"Icon play video",class:"transform translate-x-0.5 w-12"},null,8,Y)])],2)):c("",!0)])],32)}C.render=H;var S=h({name:"BasicTheme",props:{uuid:{type:String,required:!0},src:{type:String,required:!0},autoplay:{type:Boolean,required:!0},loop:{type:Boolean,required:!0},controls:{type:Boolean,required:!0},hoverable:{type:Boolean,required:!0},mask:{type:Boolean,required:!0},colors:{type:[String,Array],required:!0},time:{type:Object,required:!0},playing:{type:Boolean,default:!1},duration:{type:[String,Number],required:!0}},data(){return{hovered:!1,volume:!1,amount:1,Pause:w,Play:b,Volume:k,Maximize:$}},computed:{color(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#8B5CF6":(e=this.colors)!=null&&e[0]?this.colors[0]:"#8B5CF6"}},mounted(){this.$emit("setPlayer",this.$refs[this.uuid])},methods:{setVolume(){this.$refs[this.uuid].volume=this.amount},stopVolume(){return this.amount>0?this.amount=0:this.amount=1}}});const W={class:"relative"},X=["loop","autoplay","muted"],K=["src"],Z={class:"mr-5"},J=["src"],Q=["src"],_={class:"relative mr-6"},ee={class:"px-3 py-3 rounded-xl flex items-center transform translate-x-9 bg-black bg-opacity-30"},ne=["src"],te=["src"],oe=["src"];function re(e,n,a,r,i,v){return s(),l("div",{class:"shadow-xl rounded-3xl overflow-hidden relative",onMouseenter:n[13]||(n[13]=o=>e.hovered=!0),onMouseleave:n[14]||(n[14]=o=>e.hovered=!1),onKeydown:n[15]||(n[15]=g(o=>e.$emit("play"),["left"]))},[t("div",W,[t("video",{ref:e.uuid,class:"w-full",loop:e.loop,autoplay:e.autoplay,muted:e.autoplay,onTimeupdate:n[0]||(n[0]=o=>e.$emit("timeupdate",o.target)),onPause:n[1]||(n[1]=o=>e.$emit("isPlaying",!1)),onPlay:n[2]||(n[2]=o=>e.$emit("isPlaying",!0)),onClick:n[3]||(n[3]=o=>e.$emit("play"))},[t("source",{src:e.src,type:"video/mp4"},null,8,K)],40,X),e.controls?(s(),l("div",{key:0,class:p([{"opacity-0 translate-y-full":!e.hoverable&&e.hovered,"opacity-0 translate-y-full":e.hoverable&&!e.hovered},"absolute px-5 pb-5 bottom-0 left-0 w-full transition duration-300 transform"])},[t("div",{class:"w-full bg-black bg-opacity-30 px-5 py-4 rounded-xl flex items-center justify-between",onMouseleave:n[11]||(n[11]=o=>e.volume=!1)},[t("div",{class:"font-sans py-1 px-2 text-white rounded-md text-xs mr-5 whitespace-nowrap font-medium w-32 text-center",style:u(`font-size: 11px; background-color: ${e.color}`)},m(e.time.display)+" / "+m(e.duration),5),t("div",Z,[d(t("img",{src:e.Pause,alt:"Icon pause video",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[4]||(n[4]=o=>e.$emit("play"))},null,8,J),[[y,e.playing]]),d(t("img",{src:e.Play,alt:"Icon play video",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[5]||(n[5]=o=>e.$emit("play"))},null,8,Q),[[y,!e.playing]])]),t("div",{class:"w-full h-1 bg-white bg-opacity-40 rounded-sm cursor-pointer mr-6",onClick:n[6]||(n[6]=o=>e.$emit("position",o))},[t("div",{class:"w-full rounded-sm h-full bg-white pointer-events-none",style:u(`width: ${e.time.progress}%; transition: width .2s ease-in-out;`)},null,4)]),t("div",_,[t("div",{class:p(`w-128 origin-left translate-x-2 -rotate-90 w-128 transition duration-200 absolute transform top-0 py-2 ${e.volume?"-translate-y-4":"opacity-0 -translate-y-1 pointer-events-none"}`)},[t("div",ee,[d(t("input",{"onUpdate:modelValue":n[7]||(n[7]=o=>e.amount=o),type:"range",step:"0.05",min:"0",max:"1",class:"rounded-lg overflow-hidden appearance-none bg-white bg-opacity-30 h-1.5 w-128 vertical-range"},null,512),[[f,e.amount]])])],2),t("img",{src:e.Volume,alt:"High volume video",class:"w-5 cursor-pointer filter-white transition duration-300 relative",style:{"z-index":"2"},onClick:n[8]||(n[8]=function(){return e.stopVolume&&e.stopVolume(...arguments)}),onMouseenter:n[9]||(n[9]=o=>e.volume=!0)},null,40,ne)]),t("img",{src:e.Maximize,alt:"Fullscreen",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[10]||(n[10]=o=>e.$emit("fullScreen"))},null,8,te)],32)],2)):c("",!0),!e.autoplay&&e.mask&&e.time.current===0?(s(),l("div",{key:1,class:p(`transition transform duration-300 absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-filter z-10 flex items-center justify-center ${e.playing?"opacity-0 pointer-events-none":""}`)},[t("div",{class:"w-20 h-20 rounded-full bg-white bg-opacity-20 transition duration-200 hover:bg-opacity-40 flex items-center justify-center cursor-pointer",onClick:n[12]||(n[12]=o=>e.$emit("play"))},[t("img",{src:e.Play,alt:"Icon play video",class:"transform translate-x-0.5 w-12"},null,8,oe)])],2)):c("",!0)])],32)}S.render=re;var z=h({name:"PaoPaoVideoPlayer",components:{basic:S,gradient:C},props:{src:{type:String,required:!0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},mask:{type:Boolean,default:!0},colors:{type:[String,Array],default(){return["#8B5CF6","#ec4899"]}},hoverable:{type:Boolean,default:!1},theme:{type:String,default:"basic"}},data(){return{uuid:Math.random().toString(36).substr(2,18),player:null,duration:0,playing:!1,time:{progress:0,display:0,current:0}}},watch:{"time.current"(e){this.time.display=this.format(Number(e)),this.time.progress=e*100/this.player.duration}},methods:{isPlaying(e){this.playing=e},play(){return this.playing?this.player.pause():this.player.play()},setPlayer(e){this.player=e,this.player.addEventListener("loadeddata",()=>{this.player.readyState>=3&&(this.duration=this.format(Number(this.player.duration)),this.time.display=this.format(0))})},stop(){this.player.pause(),this.player.currentTime=0},fullScreen(){this.player.webkitEnterFullscreen()},position(e){this.player.pause();const n=e.target.getBoundingClientRect(),r=(e.clientX-n.left)*100/e.target.offsetWidth;this.player.currentTime=r*this.player.duration/100,this.player.play()},format(e){const n=Math.floor(e/3600),a=Math.floor(e%3600/60),r=Math.round(e%60);return[n,a>9?a:n?"0"+a:a||"00",r>9?r:"0"+r].filter(Boolean).join(":")}}});const ae={class:"paopao-video-player"};function ie(e,n,a,r,i,v){return s(),l("div",ae,[(s(),P(B(e.theme),{uuid:e.uuid,src:e.src,autoplay:e.autoplay,loop:e.loop,controls:e.controls,mask:e.mask,colors:e.colors,time:e.time,playing:e.playing,duration:e.duration,hoverable:e.hoverable,onPlay:e.play,onStop:e.stop,onTimeupdate:n[0]||(n[0]=o=>{let{currentTime:x}=o;return e.time.current=x}),onPosition:e.position,onFullScreen:e.fullScreen,onSetPlayer:e.setPlayer,onIsPlaying:e.isPlaying},null,40,["uuid","src","autoplay","loop","controls","mask","colors","time","playing","duration","hoverable","onPlay","onStop","onPosition","onFullScreen","onSetPlayer","onIsPlaying"]))])}function se(e,n){n===void 0&&(n={});var a=n.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var le=`/*! tailwindcss v2.2.17 | MIT License | https://tailwindcss.com */ /*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ diff --git a/web/dist/assets/post-item-593ff254.css b/web/dist/assets/post-item-593ff254.css deleted file mode 100644 index a4e275ef..00000000 --- a/web/dist/assets/post-item-593ff254.css +++ /dev/null @@ -1 +0,0 @@ -.post-item .timestamp-mobile{margin-top:2px;opacity:.75;font-size:11px}.post-item{width:100%;padding:16px;box-sizing:border-box}.post-item .nickname-wrap{font-size:14px}.post-item .username-wrap{font-size:14px;opacity:.75}.post-item .top-tag{transform:scale(.75)}.post-item .item-header-extra{display:flex;align-items:center;opacity:.75}.post-item .item-header-extra .timestamp{font-size:12px}.post-item .post-text{text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.post-item .opt-item{display:flex;align-items:center;opacity:.7}.post-item .opt-item .opt-item-icon{margin-right:10px}.post-item:hover{background:#f7f9f9;cursor:pointer}.post-item .n-thing-avatar{margin-top:0}.post-item .n-thing-header{line-height:16px;margin-bottom:8px!important}.dark .post-item{background-color:#101014bf}.dark .post-item:hover{background:#18181c} diff --git a/web/dist/assets/post-item-d81938d1.css b/web/dist/assets/post-item-d81938d1.css new file mode 100644 index 00000000..277214cb --- /dev/null +++ b/web/dist/assets/post-item-d81938d1.css @@ -0,0 +1 @@ +.post-item .timestamp-mobile{margin-top:2px;opacity:.75;font-size:11px}.post-item:hover{background:#f7f9f9;cursor:pointer}.post-item{width:100%;padding:16px;box-sizing:border-box}.post-item .nickname-wrap{font-size:14px}.post-item .username-wrap{font-size:14px;opacity:.75}.post-item .top-tag{transform:scale(.75)}.post-item .item-header-extra{display:flex;align-items:center;opacity:.75}.post-item .item-header-extra .timestamp{font-size:12px}.post-item .post-text{text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.post-item .opt-item{display:flex;align-items:center;opacity:.7}.post-item .opt-item .opt-item-icon{margin-right:10px}.post-item:hover{background:#f7f9f9}.post-item.hover{cursor:pointer}.post-item .n-thing-avatar{margin-top:0}.post-item .n-thing-header{line-height:16px;margin-bottom:8px!important}.dark .post-item{background-color:#101014bf}.dark .post-item:hover{background:#18181c} diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-18e150bb.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-18e150bb.js deleted file mode 100644 index d50b48bc..00000000 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-18e150bb.js +++ /dev/null @@ -1 +0,0 @@ -import{p as N,a as P,_ as V,b as D,c as I}from"./content-772a5dad.js";import{d as F,n as S,a3 as A,o as i,c as k,V as o,a7 as E,a1 as s,a as u,F as Q,a4 as R,a2 as f,_ as p,e as _,M as m,Q as r,O as c,s as B}from"./@vue-e0e89260.js";import{u as G}from"./vuex-473b3783.js";import{u as J}from"./vue-router-b8e3382f.js";import{c as K}from"./formatTime-4210fcd1.js";import{a as oe}from"./copy-to-clipboard-1dd3075d.js";import{i as ie,j as U,l as W,m as X,o as le}from"./@vicons-0524c43e.js";import{j as y,o as Y,M as Z,e as ue,O as re,a as ee,L as te}from"./naive-ui-e703c4e6.js";const ce={class:"post-item"},pe={class:"nickname-wrap"},_e={class:"username-wrap"},me={class:"timestamp-mobile"},de={class:"item-header-extra"},ve=["innerHTML"],he={class:"opt-item"},ge={class:"opt-item"},He=F({__name:"mobile-post-item",props:{post:{}},setup(C){const q=C,h=J(),T=G(),t=l=>()=>B(y,null,{default:()=>B(l)}),x=S(()=>[{label:"复制链接",key:"copyTweetLink",icon:t(le)}]),O=async l=>{switch(l){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}`),window.$message.success("链接已复制到剪贴板");break}},e=S(()=>{let l=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},q.post);return l.contents.map(n=>{(+n.type==1||+n.type==2)&&l.texts.push(n),+n.type==3&&l.imgs.push(n),+n.type==4&&l.videos.push(n),+n.type==6&&l.links.push(n),+n.type==7&&l.attachments.push(n),+n.type==8&&l.charge_attachments.push(n)}),l}),a=l=>{h.push({name:"post",query:{id:l}})},v=(l,n)=>{if(l.target.dataset.detail){const d=l.target.dataset.detail.split(":");if(d.length===2){T.commit("refresh"),d[0]==="tag"?h.push({name:"home",query:{q:d[1],t:"tag"}}):h.push({name:"user",query:{s:d[1]}});return}}a(n)};return(l,n)=>{const d=Y,L=A("router-link"),w=Z,M=ue,$=re,b=P,j=V,g=D,H=I,se=ee,ae=te;return i(),k("div",ce,[o(ae,{"content-indented":""},E({avatar:s(()=>[o(d,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",pe,[o(L,{onClick:n[0]||(n[0]=f(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[_(m(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",_e," @"+m(e.value.user.username),1),e.value.is_top?(i(),r(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[_(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(i(),r(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[_(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(i(),r(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[_(" 好友可见 ")]),_:1})):c("",!0),u("div",null,[u("span",me,m(p(K)(e.value.created_on))+" "+m(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",de,[o($,{placement:"bottom-end",trigger:"click",size:"small",options:x.value,onSelect:O},{default:s(()=>[o(M,{quaternary:"",circle:""},{icon:s(()=>[o(p(y),null,{default:s(()=>[o(p(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(i(),r(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(i(),r(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(i(),r(j,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(i(),r(g,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(i(),r(H,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:s(()=>[o(se,{justify:"space-between"},{default:s(()=>[u("div",he,[o(p(y),{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(U))]),_:1}),_(" "+m(e.value.upvote_count),1)]),u("div",{class:"opt-item",onClick:n[3]||(n[3]=f(z=>a(e.value.id),["stop"]))},[o(p(y),{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(W))]),_:1}),_(" "+m(e.value.comment_count),1)]),u("div",ge,[o(p(y),{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(X))]),_:1}),_(" "+m(e.value.collection_count),1)])]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:n[2]||(n[2]=z=>a(e.value.id))},[(i(!0),k(Q,null,R(e.value.texts,z=>(i(),k("span",{key:z.id,class:"post-text",onClick:n[1]||(n[1]=f(ne=>v(ne,e.value.id),["stop"])),innerHTML:p(N)(z.content).content},null,8,ve))),128))])]),key:"0"}:void 0]),1024)])}}});const ye={class:"nickname-wrap"},ke={class:"username-wrap"},fe={class:"item-header-extra"},xe={class:"timestamp"},we=["innerHTML"],$e={class:"opt-item"},be={class:"opt-item"},Se=F({__name:"post-item",props:{post:{}},setup(C){const q=C,h=J(),T=G(),t=S(()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},q.post);return e.contents.map(a=>{(+a.type==1||+a.type==2)&&e.texts.push(a),+a.type==3&&e.imgs.push(a),+a.type==4&&e.videos.push(a),+a.type==6&&e.links.push(a),+a.type==7&&e.attachments.push(a),+a.type==8&&e.charge_attachments.push(a)}),e}),x=e=>{h.push({name:"post",query:{id:e}})},O=(e,a)=>{if(e.target.dataset.detail){const v=e.target.dataset.detail.split(":");if(v.length===2){T.commit("refresh"),v[0]==="tag"?h.push({name:"home",query:{q:v[1],t:"tag"}}):h.push({name:"user",query:{s:v[1]}});return}}x(a)};return(e,a)=>{const v=Y,l=A("router-link"),n=Z,d=P,L=V,w=D,M=I,$=y,b=ee,j=te;return i(),k("div",{class:"post-item",onClick:a[3]||(a[3]=g=>x(t.value.id))},[o(j,{"content-indented":""},E({avatar:s(()=>[o(v,{round:"",size:30,src:t.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ye,[o(l,{onClick:a[0]||(a[0]=f(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:t.value.user.username}}},{default:s(()=>[_(m(t.value.user.nickname),1)]),_:1},8,["to"])]),u("span",ke," @"+m(t.value.user.username),1),t.value.is_top?(i(),r(n,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[_(" 置顶 ")]),_:1})):c("",!0),t.value.visibility==1?(i(),r(n,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[_(" 私密 ")]),_:1})):c("",!0),t.value.visibility==2?(i(),r(n,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[_(" 好友可见 ")]),_:1})):c("",!0)]),"header-extra":s(()=>[u("div",fe,[u("span",xe,m(t.value.ip_loc?t.value.ip_loc+" · ":t.value.ip_loc)+" "+m(p(K)(t.value.created_on)),1)])]),footer:s(()=>[t.value.attachments.length>0?(i(),r(d,{key:0,attachments:t.value.attachments},null,8,["attachments"])):c("",!0),t.value.charge_attachments.length>0?(i(),r(d,{key:1,attachments:t.value.charge_attachments,price:t.value.attachment_price},null,8,["attachments","price"])):c("",!0),t.value.imgs.length>0?(i(),r(L,{key:2,imgs:t.value.imgs},null,8,["imgs"])):c("",!0),t.value.videos.length>0?(i(),r(w,{key:3,videos:t.value.videos},null,8,["videos"])):c("",!0),t.value.links.length>0?(i(),r(M,{key:4,links:t.value.links},null,8,["links"])):c("",!0)]),action:s(()=>[o(b,{justify:"space-between"},{default:s(()=>[u("div",$e,[o($,{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(U))]),_:1}),_(" "+m(t.value.upvote_count),1)]),u("div",{class:"opt-item",onClick:a[2]||(a[2]=f(g=>x(t.value.id),["stop"]))},[o($,{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(W))]),_:1}),_(" "+m(t.value.comment_count),1)]),u("div",be,[o($,{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(X))]),_:1}),_(" "+m(t.value.collection_count),1)])]),_:1})]),_:2},[t.value.texts.length>0?{name:"description",fn:s(()=>[(i(!0),k(Q,null,R(t.value.texts,g=>(i(),k("span",{key:g.id,class:"post-text",onClick:a[1]||(a[1]=f(H=>O(H,t.value.id),["stop"])),innerHTML:p(N)(g.content).content},null,8,we))),128))]),key:"0"}:void 0]),1024)])}}});export{Se as _,He as a}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bce56e3e.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bce56e3e.js new file mode 100644 index 00000000..6e684f06 --- /dev/null +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bce56e3e.js @@ -0,0 +1 @@ +import{d as R,a as E,_ as V,b as W,c as J}from"./content-23ae3d74.js";import{d as U,c as O,r as Y,e as l,f as C,k as n,al as G,w as s,j as u,F as K,u as Q,y as v,bf as i,A as p,x as _,q as c,Y as r,h as q}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{U as ee,A as te,B as oe}from"./index-3489d7cc.js";import{c as se}from"./copy-to-clipboard-4ef7d3eb.js";import{k as ne,l as ae,n as le,o as ie,r as ue,s as ce,t as re,J as pe,R as _e,q as de}from"./@vicons-f0266f88.js";import{j as h,o as me,M as ve,e as he,P as fe,a as ke,O as ge}from"./naive-ui-eecf2ec3.js";const ye={class:"post-item"},we={class:"nickname-wrap"},be={class:"username-wrap"},Ce={class:"timestamp-mobile"},xe={class:"item-header-extra"},$e=["innerHTML"],Oe=["onClick"],qe=["onClick"],Ee=U({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(z,{emit:g}){const a=z,y=Z(),x=X(),d=t=>()=>q(h,null,{default:()=>q(t)}),T=O(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),B=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":g("send-whisper",a.post.user);break;case"delete":case"requesting":g("handle-friend-action",a.post);break;case"follow":case"unfollow":g("handle-follow-action",a.post);break}},e=O({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),P=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},A=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},w=t=>{y.push({name:"post",query:{id:t}})},S=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){x.commit("refresh"),m[0]==="tag"?y.push({name:"home",query:{q:m[1],t:"tag"}}):y.push({name:"user",query:{s:m[1]}});return}}w(o)};return(t,o)=>{const m=me,k=Y("router-link"),b=ve,F=he,L=fe,$=E,M=V,j=W,D=J,H=ke,I=ge;return l(),C("div",ye,[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",we,[n(k,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",be," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(b,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(b,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(b,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",Ce,_(i(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",xe,[n(L,{placement:"bottom-end",trigger:"click",size:"small",options:T.value,onSelect:B},{default:s(()=>[n(F,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c($,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c($,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Oe),u("div",{class:"opt-item",onClick:o[3]||(o[3]=v(f=>w(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:v(A,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,qe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:o[2]||(o[2]=f=>w(e.value.id))},[(l(!0),C(K,null,Q(e.value.texts,f=>(l(),C("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=v(N=>S(N,e.value.id),["stop"])),innerHTML:i(R)(f.content,"查看全文",i(x).state.profile.tweetMobileEllipsisSize)},null,8,$e))),128))])]),key:"0"}:void 0]),1024)])}}});const ze={class:"nickname-wrap"},Te={class:"username-wrap"},Be={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Se=["onClick"],Fe=["onClick"],Ve=U({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(z,{emit:g}){const a=z,y=Z(),x=X(),d=t=>()=>q(h,null,{default:()=>q(t)}),T=O(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),B=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":g("send-whisper",a.post.user);break;case"delete":case"requesting":g("handle-friend-action",a.post);break;case"follow":case"unfollow":g("handle-follow-action",a.post);break}},e=O({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),P=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},A=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},w=t=>{y.push({name:"post",query:{id:t}})},S=(t,o)=>{const m=t.target.dataset.detail;if(m&&m!=="post"){const k=m.split(":");if(k.length===2){x.commit("refresh"),k[0]==="tag"?y.push({name:"home",query:{q:k[1],t:"tag"}}):y.push({name:"user",query:{s:k[1]}});return}}w(o)};return(t,o)=>{const m=me,k=Y("router-link"),b=ve,F=he,L=fe,$=E,M=V,j=W,D=J,H=ke,I=ge;return l(),C("div",{class:"post-item",onClick:o[3]||(o[3]=f=>w(e.value.id))},[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ze,[n(k,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Te," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(b,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(b,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(b,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":s(()=>[u("div",Be,[u("span",Pe,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(i(ee)(e.value.created_on)),1),n(L,{placement:"bottom-end",trigger:"hover",size:"small",options:T.value,onSelect:B},{default:s(()=>[n(F,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c($,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c($,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item hover",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Se),u("div",{class:"opt-item hover",onClick:o[2]||(o[2]=v(f=>w(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:v(A,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,Fe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),C(K,null,Q(e.value.texts,f=>(l(),C("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=v(N=>S(N,e.value.id),["stop"])),innerHTML:i(R)(f.content,"查看全文",i(x).state.profile.tweetWebEllipsisSize)},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Ve as _,Ee as a}; diff --git a/web/dist/assets/post-skeleton-df8e8b0e.js b/web/dist/assets/post-skeleton-df8e8b0e.js new file mode 100644 index 00000000..81e4c583 --- /dev/null +++ b/web/dist/assets/post-skeleton-df8e8b0e.js @@ -0,0 +1 @@ +import{U as r}from"./naive-ui-eecf2ec3.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-3489d7cc.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/assets/post-skeleton-f095ca4e.js b/web/dist/assets/post-skeleton-f095ca4e.js deleted file mode 100644 index 2efadf9e..00000000 --- a/web/dist/assets/post-skeleton-f095ca4e.js +++ /dev/null @@ -1 +0,0 @@ -import{U as r}from"./naive-ui-e703c4e6.js";import{d as c,o as s,c as n,a4 as p,a as o,V as t,F as l}from"./@vue-e0e89260.js";import{_ as i}from"./index-26a2b065.js";const m={class:"user"},d={class:"content"},u=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/assets/v3-infinite-loading-2c58ec2f.js b/web/dist/assets/v3-infinite-loading-2c58ec2f.js new file mode 100644 index 00000000..778c100c --- /dev/null +++ b/web/dist/assets/v3-infinite-loading-2c58ec2f.js @@ -0,0 +1 @@ +import{d as L,H as v,_ as $,E as C,b as H,V as D,e as w,f as E,O as N,D as O,j as i,v as u,k as V,x as g,Y as y,n as h,$ as M,a0 as R}from"./@vue-a481fc63.js";function T(e,o){const n=e.getBoundingClientRect();if(!o)return n.top>=0&&n.bottom<=window.innerHeight;const t=o.getBoundingClientRect();return n.top>=t.top&&n.bottom<=t.bottom}async function j(e){return await h(),e.value instanceof HTMLElement?e.value:e.value?document.querySelector(e.value):null}function x(e){let o=`0px 0px ${e.distance}px 0px`;e.top&&(o=`${e.distance}px 0px 0px 0px`);const n=new IntersectionObserver(t=>{t[0].isIntersecting&&(e.firstload&&e.emit(),e.firstload=!0)},{root:e.parentEl,rootMargin:o});return n.observe(e.infiniteLoading.value),n}const k=(e,o)=>{const n=e.__vccOpts||e;for(const[t,c]of o)n[t]=c;return n},q={},U=e=>(M("data-v-d3e37633"),e=e(),R(),e),z={class:"container"},A=U(()=>i("div",{class:"spinner"},null,-1)),F=[A];function G(e,o){return w(),E("div",z,F)}const J=k(q,[["render",G],["__scopeId","data-v-d3e37633"]]),K={class:"state-error"},P=L({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(e,{emit:o}){const n=e;let t=null,c=0;const d=v(null),s=v(""),{top:p,firstload:_,distance:I}=n,{identifier:b,target:B}=$(n),a={infiniteLoading:d,top:p,firstload:_,distance:I,parentEl:null,emit(){c=(a.parentEl||document.documentElement).scrollHeight,m.loading(),o("infinite",m)}},m={loading(){s.value="loading"},async loaded(){s.value="loaded";const r=a.parentEl||document.documentElement;await h(),p&&(r.scrollTop=r.scrollHeight-c),T(d.value,a.parentEl)&&a.emit()},complete(){s.value="complete",t==null||t.disconnect()},error(){s.value="error"}};return C(b,()=>{t==null||t.disconnect(),t=x(a)}),H(async()=>{a.parentEl=await j(B),t=x(a)}),D(()=>{t==null||t.disconnect()}),(r,f)=>(w(),E("div",{ref_key:"infiniteLoading",ref:d,style:{"min-height":"1px"}},[N(i("div",null,[u(r.$slots,"spinner",{},()=>[V(J)],!0)],512),[[O,s.value=="loading"]]),s.value=="complete"?u(r.$slots,"complete",{key:0},()=>{var l;return[i("span",null,g(((l=r.slots)==null?void 0:l.complete)||"No more results!"),1)]},!0):y("",!0),s.value=="error"?u(r.$slots,"error",{key:1,retry:a.emit},()=>{var l;return[i("span",K,[i("span",null,g(((l=r.slots)==null?void 0:l.error)||"Oops something went wrong!"),1),i("button",{class:"retry",onClick:f[0]||(f[0]=(...S)=>a.emit&&a.emit(...S))},"retry")])]},!0):y("",!0)],512))}}),Y=k(P,[["__scopeId","data-v-a7077831"]]);export{Y as W}; diff --git a/web/dist/assets/v3-infinite-loading-e5c2e8bf.js b/web/dist/assets/v3-infinite-loading-e5c2e8bf.js deleted file mode 100644 index ac22fc6d..00000000 --- a/web/dist/assets/v3-infinite-loading-e5c2e8bf.js +++ /dev/null @@ -1 +0,0 @@ -import{d as L,r as v,S as C,w as $,j as H,I as M,o as x,c as h,z as N,v as O,a as i,U as u,V,M as g,O as y,y as E,W as D,X as R}from"./@vue-e0e89260.js";function T(t,o){const n=t.getBoundingClientRect();if(!o)return n.top>=0&&n.bottom<=window.innerHeight;const e=o.getBoundingClientRect();return n.top>=e.top&&n.bottom<=e.bottom}async function U(t){return await E(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null}function w(t){let o=`0px 0px ${t.distance}px 0px`;t.top&&(o=`${t.distance}px 0px 0px 0px`);const n=new IntersectionObserver(e=>{e[0].isIntersecting&&(t.firstload&&t.emit(),t.firstload=!0)},{root:t.parentEl,rootMargin:o});return n.observe(t.infiniteLoading.value),n}const I=(t,o)=>{const n=t.__vccOpts||t;for(const[e,c]of o)n[e]=c;return n},j={},q=t=>(D("data-v-d3e37633"),t=t(),R(),t),z={class:"container"},W=q(()=>i("div",{class:"spinner"},null,-1)),A=[W];function F(t,o){return x(),h("div",z,A)}const G=I(j,[["render",F],["__scopeId","data-v-d3e37633"]]),J={class:"state-error"},K=L({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(t,{emit:o}){const n=t;let e=null,c=0;const d=v(null),s=v(""),{top:p,firstload:k,distance:S}=n,{identifier:_,target:B}=C(n),a={infiniteLoading:d,top:p,firstload:k,distance:S,parentEl:null,emit(){c=(a.parentEl||document.documentElement).scrollHeight,m.loading(),o("infinite",m)}},m={loading(){s.value="loading"},async loaded(){s.value="loaded";const r=a.parentEl||document.documentElement;await E(),p&&(r.scrollTop=r.scrollHeight-c),T(d.value,a.parentEl)&&a.emit()},complete(){s.value="complete",e==null||e.disconnect()},error(){s.value="error"}};return $(_,()=>{e==null||e.disconnect(),e=w(a)}),H(async()=>{a.parentEl=await U(B),e=w(a)}),M(()=>{e==null||e.disconnect()}),(r,f)=>(x(),h("div",{ref_key:"infiniteLoading",ref:d,style:{"min-height":"1px"}},[N(i("div",null,[u(r.$slots,"spinner",{},()=>[V(G)],!0)],512),[[O,s.value=="loading"]]),s.value=="complete"?u(r.$slots,"complete",{key:0},()=>{var l;return[i("span",null,g(((l=r.slots)==null?void 0:l.complete)||"No more results!"),1)]},!0):y("",!0),s.value=="error"?u(r.$slots,"error",{key:1,retry:a.emit},()=>{var l;return[i("span",J,[i("span",null,g(((l=r.slots)==null?void 0:l.error)||"Oops something went wrong!"),1),i("button",{class:"retry",onClick:f[0]||(f[0]=(...b)=>a.emit&&a.emit(...b))},"retry")])]},!0):y("",!0)],512))}}),X=I(K,[["__scopeId","data-v-a7077831"]]);export{X as W}; diff --git a/web/dist/assets/vooks-6d99783e.js b/web/dist/assets/vooks-6d99783e.js new file mode 100644 index 00000000..81778bfa --- /dev/null +++ b/web/dist/assets/vooks-6d99783e.js @@ -0,0 +1 @@ +import{H as f,a1 as c,E as q,c as k,g as V,b as U,G as g,o as B,R as X}from"./@vue-a481fc63.js";import{o as h,a as v}from"./evtd-b614532e.js";function N(e){const n=f(!!e.value);if(n.value)return c(n);const t=q(e,o=>{o&&(n.value=!0,t())});return c(n)}function ee(e){const n=k(e),t=f(n.value);return q(n,o=>{t.value=o}),typeof e=="function"?t:{__v_isRef:!0,get value(){return t.value},set value(o){e.set(o)}}}function I(){return V()!==null}const $=typeof window<"u";let y,E;const Y=()=>{var e,n;y=$?(n=(e=document)===null||e===void 0?void 0:e.fonts)===null||n===void 0?void 0:n.ready:void 0,E=!1,y!==void 0?y.then(()=>{E=!0}):E=!0};Y();function ne(e){if(E)return;let n=!1;U(()=>{E||y==null||y.then(()=>{n||e()})}),g(()=>{n=!0})}const M=f(null);function j(e){if(e.clientX>0||e.clientY>0)M.value={x:e.clientX,y:e.clientY};else{const{target:n}=e;if(n instanceof Element){const{left:t,top:o,width:u,height:i}=n.getBoundingClientRect();t>0||o>0?M.value={x:t+u/2,y:o+i/2}:M.value={x:0,y:0}}else M.value=null}}let L=0,D=!0;function te(){if(!$)return c(f(null));L===0&&h("click",document,j,!0);const e=()=>{L+=1};return D&&(D=I())?(B(e),g(()=>{L-=1,L===0&&v("click",document,j,!0)})):e(),c(M)}const G=f(void 0);let C=0;function R(){G.value=Date.now()}let S=!0;function ie(e){if(!$)return c(f(!1));const n=f(!1);let t=null;function o(){t!==null&&window.clearTimeout(t)}function u(){o(),n.value=!0,t=window.setTimeout(()=>{n.value=!1},e)}C===0&&h("click",window,R,!0);const i=()=>{C+=1,h("click",window,u,!0)};return S&&(S=I())?(B(i),g(()=>{C-=1,C===0&&v("click",window,R,!0),v("click",window,u,!0),o()})):i(),c(n)}let T=0;const K=typeof window<"u"&&window.matchMedia!==void 0,w=f(null);let r,p;function x(e){e.matches&&(w.value="dark")}function P(e){e.matches&&(w.value="light")}function O(){r=window.matchMedia("(prefers-color-scheme: dark)"),p=window.matchMedia("(prefers-color-scheme: light)"),r.matches?w.value="dark":p.matches?w.value="light":w.value=null,r.addEventListener?(r.addEventListener("change",x),p.addEventListener("change",P)):r.addListener&&(r.addListener(x),p.addListener(P))}function Q(){"removeEventListener"in r?(r.removeEventListener("change",x),p.removeEventListener("change",P)):"removeListener"in r&&(r.removeListener(x),p.removeListener(P)),r=void 0,p=void 0}let F=!0;function ae(){return K?(T===0&&O(),F&&(F=I())&&(B(()=>{T+=1}),g(()=>{T-=1,T===0&&Q()})),c(w)):c(w)}function oe(e,n){return q(e,t=>{t!==void 0&&(n.value=t)}),k(()=>e.value===void 0?n.value:e.value)}function ue(){const e=f(!1);return U(()=>{e.value=!0}),c(e)}function se(e,n){return k(()=>{for(const t of n)if(e[t]!==void 0)return e[t];return e[n[n.length-1]]})}const z=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function re(){return z}const A={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function J(e){return`(min-width: ${e}px)`}const b={};function le(e=A){if(!$)return k(()=>[]);if(typeof window.matchMedia!="function")return k(()=>[]);const n=f({}),t=Object.keys(e),o=(u,i)=>{u.matches?n.value[i]=!0:n.value[i]=!1};return t.forEach(u=>{const i=e[u];let s,l;b[i]===void 0?(s=window.matchMedia(J(i)),s.addEventListener?s.addEventListener("change",a=>{l.forEach(d=>{d(a,u)})}):s.addListener&&s.addListener(a=>{l.forEach(d=>{d(a,u)})}),l=new Set,b[i]={mql:s,cbs:l}):(s=b[i].mql,l=b[i].cbs),l.add(o),s.matches&&l.forEach(a=>{a(s,u)})}),g(()=>{t.forEach(u=>{const{cbs:i}=b[e[u]];i.has(o)&&i.delete(o)})}),k(()=>{const{value:u}=n;return t.filter(i=>u[i])})}function fe(e={},n){const t=X({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:u}=e,i=a=>{switch(a.key){case"Control":t.ctrl=!0;break;case"Meta":t.command=!0,t.win=!0;break;case"Shift":t.shift=!0;break;case"Tab":t.tab=!0;break}o!==void 0&&Object.keys(o).forEach(d=>{if(d!==a.key)return;const m=o[d];if(typeof m=="function")m(a);else{const{stop:H=!1,prevent:_=!1}=m;H&&a.stopPropagation(),_&&a.preventDefault(),m.handler(a)}})},s=a=>{switch(a.key){case"Control":t.ctrl=!1;break;case"Meta":t.command=!1,t.win=!1;break;case"Shift":t.shift=!1;break;case"Tab":t.tab=!1;break}u!==void 0&&Object.keys(u).forEach(d=>{if(d!==a.key)return;const m=u[d];if(typeof m=="function")m(a);else{const{stop:H=!1,prevent:_=!1}=m;H&&a.stopPropagation(),_&&a.preventDefault(),m.handler(a)}})},l=()=>{(n===void 0||n.value)&&(h("keydown",document,i),h("keyup",document,s)),n!==void 0&&q(n,a=>{a?(h("keydown",document,i),h("keyup",document,s)):(v("keydown",document,i),v("keyup",document,s))})};return I()?(B(l),g(()=>{(n===void 0||n.value)&&(v("keydown",document,i),v("keyup",document,s))})):l(),c(t)}export{re as a,oe as b,se as c,fe as d,ie as e,te as f,le as g,N as h,ue as i,ae as j,ne as o,ee as u}; diff --git a/web/dist/assets/vooks-a50491fd.js b/web/dist/assets/vooks-a50491fd.js deleted file mode 100644 index adef0668..00000000 --- a/web/dist/assets/vooks-a50491fd.js +++ /dev/null @@ -1 +0,0 @@ -import{r as f,Y as c,w as q,n as k,g as U,j as Y,h as g,k as B,E as V}from"./@vue-e0e89260.js";import{o as h,a as v}from"./evtd-b614532e.js";function N(e){const n=f(!!e.value);if(n.value)return c(n);const t=q(e,o=>{o&&(n.value=!0,t())});return c(n)}function ee(e){const n=k(e),t=f(n.value);return q(n,o=>{t.value=o}),typeof e=="function"?t:{__v_isRef:!0,get value(){return t.value},set value(o){e.set(o)}}}function I(){return U()!==null}const $=typeof window<"u";let y,E;const X=()=>{var e,n;y=$?(n=(e=document)===null||e===void 0?void 0:e.fonts)===null||n===void 0?void 0:n.ready:void 0,E=!1,y!==void 0?y.then(()=>{E=!0}):E=!0};X();function ne(e){if(E)return;let n=!1;Y(()=>{E||y==null||y.then(()=>{n||e()})}),g(()=>{n=!0})}const M=f(null);function D(e){if(e.clientX>0||e.clientY>0)M.value={x:e.clientX,y:e.clientY};else{const{target:n}=e;if(n instanceof Element){const{left:t,top:o,width:u,height:i}=n.getBoundingClientRect();t>0||o>0?M.value={x:t+u/2,y:o+i/2}:M.value={x:0,y:0}}else M.value=null}}let L=0,H=!0;function te(){if(!$)return c(f(null));L===0&&h("click",document,D,!0);const e=()=>{L+=1};return H&&(H=I())?(B(e),g(()=>{L-=1,L===0&&v("click",document,D,!0)})):e(),c(M)}const K=f(void 0);let C=0;function S(){K.value=Date.now()}let F=!0;function ie(e){if(!$)return c(f(!1));const n=f(!1);let t=null;function o(){t!==null&&window.clearTimeout(t)}function u(){o(),n.value=!0,t=window.setTimeout(()=>{n.value=!1},e)}C===0&&h("click",window,S,!0);const i=()=>{C+=1,h("click",window,u,!0)};return F&&(F=I())?(B(i),g(()=>{C-=1,C===0&&v("click",window,S,!0),v("click",window,u,!0),o()})):i(),c(n)}let T=0;const O=typeof window<"u"&&window.matchMedia!==void 0,p=f(null);let r,w;function x(e){e.matches&&(p.value="dark")}function P(e){e.matches&&(p.value="light")}function Q(){r=window.matchMedia("(prefers-color-scheme: dark)"),w=window.matchMedia("(prefers-color-scheme: light)"),r.matches?p.value="dark":w.matches?p.value="light":p.value=null,r.addEventListener?(r.addEventListener("change",x),w.addEventListener("change",P)):r.addListener&&(r.addListener(x),w.addListener(P))}function z(){"removeEventListener"in r?(r.removeEventListener("change",x),w.removeEventListener("change",P)):"removeListener"in r&&(r.removeListener(x),w.removeListener(P)),r=void 0,w=void 0}let R=!0;function ae(){return O?(T===0&&Q(),R&&(R=I())&&(B(()=>{T+=1}),g(()=>{T-=1,T===0&&z()})),c(p)):c(p)}function oe(e,n){return q(e,t=>{t!==void 0&&(n.value=t)}),k(()=>e.value===void 0?n.value:e.value)}function ue(){const e=f(!1);return Y(()=>{e.value=!0}),c(e)}function se(e,n){return k(()=>{for(const t of n)if(e[t]!==void 0)return e[t];return e[n[n.length-1]]})}const A=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function re(){return A}const G={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function J(e){return`(min-width: ${e}px)`}const b={};function le(e=G){if(!$)return k(()=>[]);if(typeof window.matchMedia!="function")return k(()=>[]);const n=f({}),t=Object.keys(e),o=(u,i)=>{u.matches?n.value[i]=!0:n.value[i]=!1};return t.forEach(u=>{const i=e[u];let s,l;b[i]===void 0?(s=window.matchMedia(J(i)),s.addEventListener?s.addEventListener("change",a=>{l.forEach(d=>{d(a,u)})}):s.addListener&&s.addListener(a=>{l.forEach(d=>{d(a,u)})}),l=new Set,b[i]={mql:s,cbs:l}):(s=b[i].mql,l=b[i].cbs),l.add(o),s.matches&&l.forEach(a=>{a(s,u)})}),g(()=>{t.forEach(u=>{const{cbs:i}=b[e[u]];i.has(o)&&i.delete(o)})}),k(()=>{const{value:u}=n;return t.filter(i=>u[i])})}function fe(e={},n){const t=V({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:u}=e,i=a=>{switch(a.key){case"Control":t.ctrl=!0;break;case"Meta":t.command=!0,t.win=!0;break;case"Shift":t.shift=!0;break;case"Tab":t.tab=!0;break}o!==void 0&&Object.keys(o).forEach(d=>{if(d!==a.key)return;const m=o[d];if(typeof m=="function")m(a);else{const{stop:j=!1,prevent:_=!1}=m;j&&a.stopPropagation(),_&&a.preventDefault(),m.handler(a)}})},s=a=>{switch(a.key){case"Control":t.ctrl=!1;break;case"Meta":t.command=!1,t.win=!1;break;case"Shift":t.shift=!1;break;case"Tab":t.tab=!1;break}u!==void 0&&Object.keys(u).forEach(d=>{if(d!==a.key)return;const m=u[d];if(typeof m=="function")m(a);else{const{stop:j=!1,prevent:_=!1}=m;j&&a.stopPropagation(),_&&a.preventDefault(),m.handler(a)}})},l=()=>{(n===void 0||n.value)&&(h("keydown",document,i),h("keyup",document,s)),n!==void 0&&q(n,a=>{a?(h("keydown",document,i),h("keyup",document,s)):(v("keydown",document,i),v("keyup",document,s))})};return I()?(B(l),g(()=>{(n===void 0||n.value)&&(v("keydown",document,i),v("keyup",document,s))})):l(),c(t)}export{re as a,oe as b,se as c,fe as d,ie as e,te as f,le as g,N as h,ue as i,ae as j,ne as o,ee as u}; diff --git a/web/dist/assets/vue-1e3b54ec.js b/web/dist/assets/vue-1e3b54ec.js new file mode 100644 index 00000000..e018094b --- /dev/null +++ b/web/dist/assets/vue-1e3b54ec.js @@ -0,0 +1 @@ +import{a2 as a,a3 as e,C as s,a4 as t,F as o,a5 as r,a6 as n,a7 as i,a8 as l,W as c,Q as d,T as p,L as m,a9 as f,aa as b,ab as u,ac as S,ad as h,ae as v,P as R,af as C,c as y,ag as g,q as w,Y as T,f as x,j as E,ah as M,ai as k,aj as V,ak as P,al as D,z as B,A as N,k as A,am as H,a as z,d as U,an as j,ao as F,ap as I,aq as K,ar as O,as as _,at as q,au as W,av as G,aw as L,ax as J,g as Q,ay as X,az as Y,aA as Z,h as $,aB as aa,aC as ea,aD as sa,aE as ta,aF as oa,i as ra,aG as na,S as ia,aH as la,aI as ca,aJ as da,aK as pa,aL as ma,B as fa,m as ba,aM as ua,aN as Sa,N as ha,n as va,l as Ra,aO as Ca,t as ya,I as ga,o as wa,G as Ta,aP as xa,J as Ea,aQ as Ma,b as ka,aR as Va,aS as Pa,aT as Da,aU as Ba,V as Na,aV as Aa,e as Ha,a0 as za,p as Ua,aW as ja,$ as Fa,aX as Ia,R as Ka,a1 as Oa,H as _a,aY as qa,aZ as Wa,u as Ga,v as La,r as Ja,a_ as Qa,s as Xa,a$ as Ya,b0 as Za,b1 as $a,b2 as ae,b3 as ee,b4 as se,b5 as te,b6 as oe,b7 as re,b8 as ne,b9 as ie,x as le,ba as ce,bb as de,U as pe,M as me,_ as fe,bc as be,bd as ue,be as Se,bf as he,bg as ve,bh as Re,bi as Ce,bj as ye,bk as ge,bl as we,bm as Te,bn as xe,bo as Ee,bp as Me,bq as ke,X as Ve,D as Pe,br as De,bs as Be,E as Ne,K as Ae,bt as He,bu as ze,bv as Ue,w as je,bw as Fe,O as Ie,Z as Ke,bx as Oe,y as _e,by as qe}from"./@vue-a481fc63.js";const We=()=>{},Le=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:a,BaseTransitionPropsValidators:e,Comment:s,EffectScope:t,Fragment:o,KeepAlive:r,ReactiveEffect:n,Static:i,Suspense:l,Teleport:c,Text:d,Transition:p,TransitionGroup:m,VueElement:f,assertNumber:b,callWithAsyncErrorHandling:u,callWithErrorHandling:S,camelize:h,capitalize:v,cloneVNode:R,compatUtils:C,compile:We,computed:y,createApp:g,createBlock:w,createCommentVNode:T,createElementBlock:x,createElementVNode:E,createHydrationRenderer:M,createPropsRestProxy:k,createRenderer:V,createSSRApp:P,createSlots:D,createStaticVNode:B,createTextVNode:N,createVNode:A,customRef:H,defineAsyncComponent:z,defineComponent:U,defineCustomElement:j,defineEmits:F,defineExpose:I,defineModel:K,defineOptions:O,defineProps:_,defineSSRCustomElement:q,defineSlots:W,get devtools(){return G},effect:L,effectScope:J,getCurrentInstance:Q,getCurrentScope:X,getTransitionRawChildren:Y,guardReactiveProps:Z,h:$,handleError:aa,hasInjectionContext:ea,hydrate:sa,initCustomFormatter:ta,initDirectivesForSSR:oa,inject:ra,isMemoSame:na,isProxy:ia,isReactive:la,isReadonly:ca,isRef:da,isRuntimeOnly:pa,isShallow:ma,isVNode:fa,markRaw:ba,mergeDefaults:ua,mergeModels:Sa,mergeProps:ha,nextTick:va,normalizeClass:Ra,normalizeProps:Ca,normalizeStyle:ya,onActivated:ga,onBeforeMount:wa,onBeforeUnmount:Ta,onBeforeUpdate:xa,onDeactivated:Ea,onErrorCaptured:Ma,onMounted:ka,onRenderTracked:Va,onRenderTriggered:Pa,onScopeDispose:Da,onServerPrefetch:Ba,onUnmounted:Na,onUpdated:Aa,openBlock:Ha,popScopeId:za,provide:Ua,proxyRefs:ja,pushScopeId:Fa,queuePostFlushCb:Ia,reactive:Ka,readonly:Oa,ref:_a,registerRuntimeCompiler:qa,render:Wa,renderList:Ga,renderSlot:La,resolveComponent:Ja,resolveDirective:Qa,resolveDynamicComponent:Xa,resolveFilter:Ya,resolveTransitionHooks:Za,setBlockTracking:$a,setDevtoolsHook:ae,setTransitionHooks:ee,shallowReactive:se,shallowReadonly:te,shallowRef:oe,ssrContextKey:re,ssrUtils:ne,stop:ie,toDisplayString:le,toHandlerKey:ce,toHandlers:de,toRaw:pe,toRef:me,toRefs:fe,toValue:be,transformVNodeArgs:ue,triggerRef:Se,unref:he,useAttrs:ve,useCssModule:Re,useCssVars:Ce,useModel:ye,useSSRContext:ge,useSlots:we,useTransitionState:Te,vModelCheckbox:xe,vModelDynamic:Ee,vModelRadio:Me,vModelSelect:ke,vModelText:Ve,vShow:Pe,version:De,warn:Be,watch:Ne,watchEffect:Ae,watchPostEffect:He,watchSyncEffect:ze,withAsyncContext:Ue,withCtx:je,withDefaults:Fe,withDirectives:Ie,withKeys:Ke,withMemo:Oe,withModifiers:_e,withScopeId:qe},Symbol.toStringTag,{value:"Module"}));export{Le as h}; diff --git a/web/dist/assets/vue-4ed993c7.js b/web/dist/assets/vue-4ed993c7.js deleted file mode 100644 index 8b137891..00000000 --- a/web/dist/assets/vue-4ed993c7.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/web/dist/assets/vue-router-b8e3382f.js b/web/dist/assets/vue-router-b8e3382f.js deleted file mode 100644 index 616f6884..00000000 --- a/web/dist/assets/vue-router-b8e3382f.js +++ /dev/null @@ -1,5 +0,0 @@ -import{Z as tt,_ as F,n as N,E as Be,y as nt,i as B,d as qe,s as ze,p as ae,r as rt,w as st}from"./@vue-e0e89260.js";/*! - * vue-router v4.1.6 - * (c) 2022 Eduardo San Martin Morote - * @license MIT - */const z=typeof window<"u";function ot(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const S=Object.assign;function le(e,t){const n={};for(const r in t){const s=t[r];n[r]=I(s)?s.map(e):e(s)}return n}const W=()=>{},I=Array.isArray,ct=/\/$/,it=e=>e.replace(ct,"");function ue(e,t,n="/"){let r,s={},l="",d="";const g=t.indexOf("#");let i=t.indexOf("?");return g=0&&(i=-1),i>-1&&(r=t.slice(0,i),l=t.slice(i+1,g>-1?g:t.length),s=e(l)),g>-1&&(r=r||t.slice(0,g),d=t.slice(g,t.length)),r=ft(r??t,n),{fullPath:r+(l&&"?")+l+d,path:r,query:s,hash:d}}function at(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Se(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function lt(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&G(t.matched[r],n.matched[s])&&Ge(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function G(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ge(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!ut(e[n],t[n]))return!1;return!0}function ut(e,t){return I(e)?ke(e,t):I(t)?ke(t,e):e===t}function ke(e,t){return I(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function ft(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let s=n.length-1,l,d;for(l=0;l1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(l-(l===r.length?1:0)).join("/")}var X;(function(e){e.pop="pop",e.push="push"})(X||(X={}));var Y;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Y||(Y={}));function ht(e){if(!e)if(z){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),it(e)}const dt=/^[^#]+#/;function pt(e,t){return e.replace(dt,"#")+t}function mt(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const ee=()=>({left:window.pageXOffset,top:window.pageYOffset});function gt(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=mt(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Ce(e,t){return(history.state?history.state.position-t:-1)+e}const he=new Map;function vt(e,t){he.set(e,t)}function yt(e){const t=he.get(e);return he.delete(e),t}let Rt=()=>location.protocol+"//"+location.host;function Ke(e,t){const{pathname:n,search:r,hash:s}=t,l=e.indexOf("#");if(l>-1){let g=s.includes(e.slice(l))?e.slice(l).length:1,i=s.slice(g);return i[0]!=="/"&&(i="/"+i),Se(i,"")}return Se(n,e)+r+s}function Et(e,t,n,r){let s=[],l=[],d=null;const g=({state:u})=>{const m=Ke(e,location),R=n.value,b=t.value;let C=0;if(u){if(n.value=m,t.value=u,d&&d===R){d=null;return}C=b?u.position-b.position:0}else r(m);s.forEach(E=>{E(n.value,R,{delta:C,type:X.pop,direction:C?C>0?Y.forward:Y.back:Y.unknown})})};function i(){d=n.value}function f(u){s.push(u);const m=()=>{const R=s.indexOf(u);R>-1&&s.splice(R,1)};return l.push(m),m}function o(){const{history:u}=window;u.state&&u.replaceState(S({},u.state,{scroll:ee()}),"")}function a(){for(const u of l)u();l=[],window.removeEventListener("popstate",g),window.removeEventListener("beforeunload",o)}return window.addEventListener("popstate",g),window.addEventListener("beforeunload",o),{pauseListeners:i,listen:f,destroy:a}}function be(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ee():null}}function Pt(e){const{history:t,location:n}=window,r={value:Ke(e,n)},s={value:t.state};s.value||l(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(i,f,o){const a=e.indexOf("#"),u=a>-1?(n.host&&document.querySelector("base")?e:e.slice(a))+i:Rt()+e+i;try{t[o?"replaceState":"pushState"](f,"",u),s.value=f}catch(m){console.error(m),n[o?"replace":"assign"](u)}}function d(i,f){const o=S({},t.state,be(s.value.back,i,s.value.forward,!0),f,{position:s.value.position});l(i,o,!0),r.value=i}function g(i,f){const o=S({},s.value,t.state,{forward:i,scroll:ee()});l(o.current,o,!0);const a=S({},be(r.value,i,null),{position:o.position+1},f);l(i,a,!1),r.value=i}return{location:r,state:s,push:g,replace:d}}function wt(e){e=ht(e);const t=Pt(e),n=Et(e,t.state,t.location,t.replace);function r(l,d=!0){d||n.pauseListeners(),history.go(l)}const s=S({location:"",base:e,go:r,createHref:pt.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function ln(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),wt(e)}function St(e){return typeof e=="string"||e&&typeof e=="object"}function Ve(e){return typeof e=="string"||typeof e=="symbol"}const H={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Ue=Symbol("");var Ae;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ae||(Ae={}));function K(e,t){return S(new Error,{type:e,[Ue]:!0},t)}function $(e,t){return e instanceof Error&&Ue in e&&(t==null||!!(e.type&t))}const _e="[^/]+?",kt={sensitive:!1,strict:!1,start:!0,end:!0},Ct=/[.+*?^${}()[\]/\\]/g;function bt(e,t){const n=S({},kt,t),r=[];let s=n.start?"^":"";const l=[];for(const f of e){const o=f.length?[]:[90];n.strict&&!f.length&&(s+="/");for(let a=0;at.length?t.length===1&&t[0]===40+40?1:-1:0}function _t(e,t){let n=0;const r=e.score,s=t.score;for(;n0&&t[t.length-1]<0}const Ot={type:0,value:""},xt=/[a-zA-Z0-9_]/;function Mt(e){if(!e)return[[]];if(e==="/")return[[Ot]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=0,r=n;const s=[];let l;function d(){l&&s.push(l),l=[]}let g=0,i,f="",o="";function a(){f&&(n===0?l.push({type:0,value:f}):n===1||n===2||n===3?(l.length>1&&(i==="*"||i==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),l.push({type:1,value:f,regexp:o,repeatable:i==="*"||i==="+",optional:i==="*"||i==="?"})):t("Invalid state to consume buffer"),f="")}function u(){f+=i}for(;g{d(w)}:W}function d(o){if(Ve(o)){const a=r.get(o);a&&(r.delete(o),n.splice(n.indexOf(a),1),a.children.forEach(d),a.alias.forEach(d))}else{const a=n.indexOf(o);a>-1&&(n.splice(a,1),o.record.name&&r.delete(o.record.name),o.children.forEach(d),o.alias.forEach(d))}}function g(){return n}function i(o){let a=0;for(;a=0&&(o.record.path!==n[a].record.path||!De(o,n[a]));)a++;n.splice(a,0,o),o.record.name&&!Me(o)&&r.set(o.record.name,o)}function f(o,a){let u,m={},R,b;if("name"in o&&o.name){if(u=r.get(o.name),!u)throw K(1,{location:o});b=u.record.name,m=S(xe(a.params,u.keys.filter(w=>!w.optional).map(w=>w.name)),o.params&&xe(o.params,u.keys.map(w=>w.name))),R=u.stringify(m)}else if("path"in o)R=o.path,u=n.find(w=>w.re.test(R)),u&&(m=u.parse(R),b=u.record.name);else{if(u=a.name?r.get(a.name):n.find(w=>w.re.test(a.path)),!u)throw K(1,{location:o,currentLocation:a});b=u.record.name,m=S({},a.params,o.params),R=u.stringify(m)}const C=[];let E=u;for(;E;)C.unshift(E.record),E=E.parent;return{name:b,path:R,params:m,matched:C,meta:Ht(C)}}return e.forEach(o=>l(o)),{addRoute:l,resolve:f,removeRoute:d,getRoutes:g,getRecordMatcher:s}}function xe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Lt(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:$t(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function $t(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="boolean"?n:n[r];return t}function Me(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ht(e){return e.reduce((t,n)=>S(t,n.meta),{})}function Ne(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function De(e,t){return t.children.some(n=>n===e||De(e,n))}const Qe=/#/g,Tt=/&/g,jt=/\//g,Bt=/=/g,qt=/\?/g,Fe=/\+/g,zt=/%5B/g,Gt=/%5D/g,We=/%5E/g,Kt=/%60/g,Ye=/%7B/g,Vt=/%7C/g,Xe=/%7D/g,Ut=/%20/g;function me(e){return encodeURI(""+e).replace(Vt,"|").replace(zt,"[").replace(Gt,"]")}function Dt(e){return me(e).replace(Ye,"{").replace(Xe,"}").replace(We,"^")}function de(e){return me(e).replace(Fe,"%2B").replace(Ut,"+").replace(Qe,"%23").replace(Tt,"%26").replace(Kt,"`").replace(Ye,"{").replace(Xe,"}").replace(We,"^")}function Qt(e){return de(e).replace(Bt,"%3D")}function Ft(e){return me(e).replace(Qe,"%23").replace(qt,"%3F")}function Wt(e){return e==null?"":Ft(e).replace(jt,"%2F")}function J(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function Yt(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;sl&&de(l)):[r&&de(r)]).forEach(l=>{l!==void 0&&(t+=(t.length?"&":"")+n,l!=null&&(t+="="+l))})}return t}function Xt(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=I(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const Zt=Symbol(""),Le=Symbol(""),te=Symbol(""),ge=Symbol(""),pe=Symbol("");function Q(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function T(e,t,n,r,s){const l=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((d,g)=>{const i=a=>{a===!1?g(K(4,{from:n,to:t})):a instanceof Error?g(a):St(a)?g(K(2,{from:t,to:a})):(l&&r.enterCallbacks[s]===l&&typeof a=="function"&&l.push(a),d())},f=e.call(r&&r.instances[s],t,n,i);let o=Promise.resolve(f);e.length<3&&(o=o.then(i)),o.catch(a=>g(a))})}function fe(e,t,n,r){const s=[];for(const l of e)for(const d in l.components){let g=l.components[d];if(!(t!=="beforeRouteEnter"&&!l.instances[d]))if(Jt(g)){const f=(g.__vccOpts||g)[t];f&&s.push(T(f,n,r,l,d))}else{let i=g();s.push(()=>i.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${d}" at "${l.path}"`));const o=ot(f)?f.default:f;l.components[d]=o;const u=(o.__vccOpts||o)[t];return u&&T(u,n,r,l,d)()}))}}return s}function Jt(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function $e(e){const t=B(te),n=B(ge),r=N(()=>t.resolve(F(e.to))),s=N(()=>{const{matched:i}=r.value,{length:f}=i,o=i[f-1],a=n.matched;if(!o||!a.length)return-1;const u=a.findIndex(G.bind(null,o));if(u>-1)return u;const m=He(i[f-2]);return f>1&&He(o)===m&&a[a.length-1].path!==m?a.findIndex(G.bind(null,i[f-2])):u}),l=N(()=>s.value>-1&&rn(n.params,r.value.params)),d=N(()=>s.value>-1&&s.value===n.matched.length-1&&Ge(n.params,r.value.params));function g(i={}){return nn(i)?t[F(e.replace)?"replace":"push"](F(e.to)).catch(W):Promise.resolve()}return{route:r,href:N(()=>r.value.href),isActive:l,isExactActive:d,navigate:g}}const en=qe({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:$e,setup(e,{slots:t}){const n=Be($e(e)),{options:r}=B(te),s=N(()=>({[Te(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Te(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const l=t.default&&t.default(n);return e.custom?l:ze("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},l)}}}),tn=en;function nn(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function rn(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!I(s)||s.length!==r.length||r.some((l,d)=>l!==s[d]))return!1}return!0}function He(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Te=(e,t,n)=>e??t??n,sn=qe({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=B(pe),s=N(()=>e.route||r.value),l=B(Le,0),d=N(()=>{let f=F(l);const{matched:o}=s.value;let a;for(;(a=o[f])&&!a.components;)f++;return f}),g=N(()=>s.value.matched[d.value]);ae(Le,N(()=>d.value+1)),ae(Zt,g),ae(pe,s);const i=rt();return st(()=>[i.value,g.value,e.name],([f,o,a],[u,m,R])=>{o&&(o.instances[a]=f,m&&m!==o&&f&&f===u&&(o.leaveGuards.size||(o.leaveGuards=m.leaveGuards),o.updateGuards.size||(o.updateGuards=m.updateGuards))),f&&o&&(!m||!G(o,m)||!u)&&(o.enterCallbacks[a]||[]).forEach(b=>b(f))},{flush:"post"}),()=>{const f=s.value,o=e.name,a=g.value,u=a&&a.components[o];if(!u)return je(n.default,{Component:u,route:f});const m=a.props[o],R=m?m===!0?f.params:typeof m=="function"?m(f):m:null,C=ze(u,S({},R,t,{onVnodeUnmounted:E=>{E.component.isUnmounted&&(a.instances[o]=null)},ref:i}));return je(n.default,{Component:C,route:f})||C}}});function je(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const on=sn;function un(e){const t=It(e.routes,e),n=e.parseQuery||Yt,r=e.stringifyQuery||Ie,s=e.history,l=Q(),d=Q(),g=Q(),i=tt(H);let f=H;z&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const o=le.bind(null,c=>""+c),a=le.bind(null,Wt),u=le.bind(null,J);function m(c,p){let h,v;return Ve(c)?(h=t.getRecordMatcher(c),v=p):v=c,t.addRoute(v,h)}function R(c){const p=t.getRecordMatcher(c);p&&t.removeRoute(p)}function b(){return t.getRoutes().map(c=>c.record)}function C(c){return!!t.getRecordMatcher(c)}function E(c,p){if(p=S({},p||i.value),typeof c=="string"){const y=ue(n,c,p.path),_=t.resolve({path:y.path},p),D=s.createHref(y.fullPath);return S(y,_,{params:u(_.params),hash:J(y.hash),redirectedFrom:void 0,href:D})}let h;if("path"in c)h=S({},c,{path:ue(n,c.path,p.path).path});else{const y=S({},c.params);for(const _ in y)y[_]==null&&delete y[_];h=S({},c,{params:a(c.params)}),p.params=a(p.params)}const v=t.resolve(h,p),k=c.hash||"";v.params=o(u(v.params));const A=at(r,S({},c,{hash:Dt(k),path:v.path})),P=s.createHref(A);return S({fullPath:A,hash:k,query:r===Ie?Xt(c.query):c.query||{}},v,{redirectedFrom:void 0,href:P})}function w(c){return typeof c=="string"?ue(n,c,i.value.path):S({},c)}function O(c,p){if(f!==c)return K(8,{from:p,to:c})}function M(c){return V(c)}function j(c){return M(S(w(c),{replace:!0}))}function L(c){const p=c.matched[c.matched.length-1];if(p&&p.redirect){const{redirect:h}=p;let v=typeof h=="function"?h(c):h;return typeof v=="string"&&(v=v.includes("?")||v.includes("#")?v=w(v):{path:v},v.params={}),S({query:c.query,hash:c.hash,params:"path"in v?{}:c.params},v)}}function V(c,p){const h=f=E(c),v=i.value,k=c.state,A=c.force,P=c.replace===!0,y=L(h);if(y)return V(S(w(y),{state:typeof y=="object"?S({},k,y.state):k,force:A,replace:P}),p||h);const _=h;_.redirectedFrom=p;let D;return!A&<(r,v,h)&&(D=K(16,{to:_,from:v}),Pe(v,v,!0,!1)),(D?Promise.resolve(D):ve(_,v)).catch(x=>$(x)?$(x,2)?x:se(x):re(x,_,v)).then(x=>{if(x){if($(x,2))return V(S({replace:P},w(x.to),{state:typeof x.to=="object"?S({},k,x.to.state):k,force:A}),p||_)}else x=Re(_,v,!0,P,k);return ye(_,v,x),x})}function Ze(c,p){const h=O(c,p);return h?Promise.reject(h):Promise.resolve()}function ve(c,p){let h;const[v,k,A]=cn(c,p);h=fe(v.reverse(),"beforeRouteLeave",c,p);for(const y of v)y.leaveGuards.forEach(_=>{h.push(T(_,c,p))});const P=Ze.bind(null,c,p);return h.push(P),q(h).then(()=>{h=[];for(const y of l.list())h.push(T(y,c,p));return h.push(P),q(h)}).then(()=>{h=fe(k,"beforeRouteUpdate",c,p);for(const y of k)y.updateGuards.forEach(_=>{h.push(T(_,c,p))});return h.push(P),q(h)}).then(()=>{h=[];for(const y of c.matched)if(y.beforeEnter&&!p.matched.includes(y))if(I(y.beforeEnter))for(const _ of y.beforeEnter)h.push(T(_,c,p));else h.push(T(y.beforeEnter,c,p));return h.push(P),q(h)}).then(()=>(c.matched.forEach(y=>y.enterCallbacks={}),h=fe(A,"beforeRouteEnter",c,p),h.push(P),q(h))).then(()=>{h=[];for(const y of d.list())h.push(T(y,c,p));return h.push(P),q(h)}).catch(y=>$(y,8)?y:Promise.reject(y))}function ye(c,p,h){for(const v of g.list())v(c,p,h)}function Re(c,p,h,v,k){const A=O(c,p);if(A)return A;const P=p===H,y=z?history.state:{};h&&(v||P?s.replace(c.fullPath,S({scroll:P&&y&&y.scroll},k)):s.push(c.fullPath,k)),i.value=c,Pe(c,p,h,P),se()}let U;function Je(){U||(U=s.listen((c,p,h)=>{if(!we.listening)return;const v=E(c),k=L(v);if(k){V(S(k,{replace:!0}),v).catch(W);return}f=v;const A=i.value;z&&vt(Ce(A.fullPath,h.delta),ee()),ve(v,A).catch(P=>$(P,12)?P:$(P,2)?(V(P.to,v).then(y=>{$(y,20)&&!h.delta&&h.type===X.pop&&s.go(-1,!1)}).catch(W),Promise.reject()):(h.delta&&s.go(-h.delta,!1),re(P,v,A))).then(P=>{P=P||Re(v,A,!1),P&&(h.delta&&!$(P,8)?s.go(-h.delta,!1):h.type===X.pop&&$(P,20)&&s.go(-1,!1)),ye(v,A,P)}).catch(W)}))}let ne=Q(),Ee=Q(),Z;function re(c,p,h){se(c);const v=Ee.list();return v.length?v.forEach(k=>k(c,p,h)):console.error(c),Promise.reject(c)}function et(){return Z&&i.value!==H?Promise.resolve():new Promise((c,p)=>{ne.add([c,p])})}function se(c){return Z||(Z=!c,Je(),ne.list().forEach(([p,h])=>c?h(c):p()),ne.reset()),c}function Pe(c,p,h,v){const{scrollBehavior:k}=e;if(!z||!k)return Promise.resolve();const A=!h&&yt(Ce(c.fullPath,0))||(v||!h)&&history.state&&history.state.scroll||null;return nt().then(()=>k(c,p,A)).then(P=>P&>(P)).catch(P=>re(P,c,p))}const oe=c=>s.go(c);let ce;const ie=new Set,we={currentRoute:i,listening:!0,addRoute:m,removeRoute:R,hasRoute:C,getRoutes:b,resolve:E,options:e,push:M,replace:j,go:oe,back:()=>oe(-1),forward:()=>oe(1),beforeEach:l.add,beforeResolve:d.add,afterEach:g.add,onError:Ee.add,isReady:et,install(c){const p=this;c.component("RouterLink",tn),c.component("RouterView",on),c.config.globalProperties.$router=p,Object.defineProperty(c.config.globalProperties,"$route",{enumerable:!0,get:()=>F(i)}),z&&!ce&&i.value===H&&(ce=!0,M(s.location).catch(k=>{}));const h={};for(const k in H)h[k]=N(()=>i.value[k]);c.provide(te,p),c.provide(ge,Be(h)),c.provide(pe,i);const v=c.unmount;ie.add(c),c.unmount=function(){ie.delete(c),ie.size<1&&(f=H,U&&U(),U=null,i.value=H,ce=!1,Z=!1),v()}}};return we}function q(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function cn(e,t){const n=[],r=[],s=[],l=Math.max(t.matched.length,e.matched.length);for(let d=0;dG(f,g))?r.push(g):n.push(g));const i=e.matched[d];i&&(t.matched.find(f=>G(f,i))||s.push(i))}return[n,r,s]}function fn(){return B(te)}function hn(){return B(ge)}export{ln as a,hn as b,un as c,fn as u}; diff --git a/web/dist/assets/vue-router-e5a2430e.js b/web/dist/assets/vue-router-e5a2430e.js new file mode 100644 index 00000000..caeaeb66 --- /dev/null +++ b/web/dist/assets/vue-router-e5a2430e.js @@ -0,0 +1,5 @@ +import{b6 as tt,bf as Q,b4 as nt,n as rt,i as B,d as qe,R as st,c as L,h as ze,p as ae,H as ot,E as ct}from"./@vue-a481fc63.js";/*! + * vue-router v4.2.4 + * (c) 2023 Eduardo San Martin Morote + * @license MIT + */const z=typeof window<"u";function it(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const S=Object.assign;function le(e,t){const n={};for(const r in t){const s=t[r];n[r]=N(s)?s.map(e):e(s)}return n}const F=()=>{},N=Array.isArray,at=/\/$/,lt=e=>e.replace(at,"");function ue(e,t,n="/"){let r,s={},l="",d="";const m=t.indexOf("#");let i=t.indexOf("?");return m=0&&(i=-1),i>-1&&(r=t.slice(0,i),l=t.slice(i+1,m>-1?m:t.length),s=e(l)),m>-1&&(r=r||t.slice(0,m),d=t.slice(m,t.length)),r=dt(r??t,n),{fullPath:r+(l&&"?")+l+d,path:r,query:s,hash:d}}function ut(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function be(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function ft(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&G(t.matched[r],n.matched[s])&&Ge(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function G(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ge(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!ht(e[n],t[n]))return!1;return!0}function ht(e,t){return N(e)?Ce(e,t):N(t)?Ce(t,e):e===t}function Ce(e,t){return N(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function dt(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let l=n.length-1,d,m;for(d=0;d1&&l--;else break;return n.slice(0,l).join("/")+"/"+r.slice(d-(d===r.length?1:0)).join("/")}var X;(function(e){e.pop="pop",e.push="push"})(X||(X={}));var Y;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Y||(Y={}));function pt(e){if(!e)if(z){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),lt(e)}const mt=/^[^#]+#/;function gt(e,t){return e.replace(mt,"#")+t}function vt(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const te=()=>({left:window.pageXOffset,top:window.pageYOffset});function yt(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=vt(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function ke(e,t){return(history.state?history.state.position-t:-1)+e}const he=new Map;function Rt(e,t){he.set(e,t)}function Et(e){const t=he.get(e);return he.delete(e),t}let Pt=()=>location.protocol+"//"+location.host;function Ke(e,t){const{pathname:n,search:r,hash:s}=t,l=e.indexOf("#");if(l>-1){let m=s.includes(e.slice(l))?e.slice(l).length:1,i=s.slice(m);return i[0]!=="/"&&(i="/"+i),be(i,"")}return be(n,e)+r+s}function wt(e,t,n,r){let s=[],l=[],d=null;const m=({state:u})=>{const g=Ke(e,location),R=n.value,k=t.value;let C=0;if(u){if(n.value=g,t.value=u,d&&d===R){d=null;return}C=k?u.position-k.position:0}else r(g);s.forEach(E=>{E(n.value,R,{delta:C,type:X.pop,direction:C?C>0?Y.forward:Y.back:Y.unknown})})};function i(){d=n.value}function f(u){s.push(u);const g=()=>{const R=s.indexOf(u);R>-1&&s.splice(R,1)};return l.push(g),g}function o(){const{history:u}=window;u.state&&u.replaceState(S({},u.state,{scroll:te()}),"")}function a(){for(const u of l)u();l=[],window.removeEventListener("popstate",m),window.removeEventListener("beforeunload",o)}return window.addEventListener("popstate",m),window.addEventListener("beforeunload",o,{passive:!0}),{pauseListeners:i,listen:f,destroy:a}}function Ae(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?te():null}}function St(e){const{history:t,location:n}=window,r={value:Ke(e,n)},s={value:t.state};s.value||l(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(i,f,o){const a=e.indexOf("#"),u=a>-1?(n.host&&document.querySelector("base")?e:e.slice(a))+i:Pt()+e+i;try{t[o?"replaceState":"pushState"](f,"",u),s.value=f}catch(g){console.error(g),n[o?"replace":"assign"](u)}}function d(i,f){const o=S({},t.state,Ae(s.value.back,i,s.value.forward,!0),f,{position:s.value.position});l(i,o,!0),r.value=i}function m(i,f){const o=S({},s.value,t.state,{forward:i,scroll:te()});l(o.current,o,!0);const a=S({},Ae(r.value,i,null),{position:o.position+1},f);l(i,a,!1),r.value=i}return{location:r,state:s,push:m,replace:d}}function bt(e){e=pt(e);const t=St(e),n=wt(e,t.state,t.location,t.replace);function r(l,d=!0){d||n.pauseListeners(),history.go(l)}const s=S({location:"",base:e,go:r,createHref:gt.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function fn(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),bt(e)}function Ct(e){return typeof e=="string"||e&&typeof e=="object"}function Ve(e){return typeof e=="string"||typeof e=="symbol"}const T={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Ue=Symbol("");var Oe;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Oe||(Oe={}));function K(e,t){return S(new Error,{type:e,[Ue]:!0},t)}function I(e,t){return e instanceof Error&&Ue in e&&(t==null||!!(e.type&t))}const _e="[^/]+?",kt={sensitive:!1,strict:!1,start:!0,end:!0},At=/[.+*?^${}()[\]/\\]/g;function Ot(e,t){const n=S({},kt,t),r=[];let s=n.start?"^":"";const l=[];for(const f of e){const o=f.length?[]:[90];n.strict&&!f.length&&(s+="/");for(let a=0;at.length?t.length===1&&t[0]===40+40?1:-1:0}function xt(e,t){let n=0;const r=e.score,s=t.score;for(;n0&&t[t.length-1]<0}const Mt={type:0,value:""},Nt=/[a-zA-Z0-9_]/;function Lt(e){if(!e)return[[]];if(e==="/")return[[Mt]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${n})/"${f}": ${g}`)}let n=0,r=n;const s=[];let l;function d(){l&&s.push(l),l=[]}let m=0,i,f="",o="";function a(){f&&(n===0?l.push({type:0,value:f}):n===1||n===2||n===3?(l.length>1&&(i==="*"||i==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),l.push({type:1,value:f,regexp:o,repeatable:i==="*"||i==="+",optional:i==="*"||i==="?"})):t("Invalid state to consume buffer"),f="")}function u(){f+=i}for(;m{d(w)}:F}function d(o){if(Ve(o)){const a=r.get(o);a&&(r.delete(o),n.splice(n.indexOf(a),1),a.children.forEach(d),a.alias.forEach(d))}else{const a=n.indexOf(o);a>-1&&(n.splice(a,1),o.record.name&&r.delete(o.record.name),o.children.forEach(d),o.alias.forEach(d))}}function m(){return n}function i(o){let a=0;for(;a=0&&(o.record.path!==n[a].record.path||!De(o,n[a]));)a++;n.splice(a,0,o),o.record.name&&!Ne(o)&&r.set(o.record.name,o)}function f(o,a){let u,g={},R,k;if("name"in o&&o.name){if(u=r.get(o.name),!u)throw K(1,{location:o});k=u.record.name,g=S(Me(a.params,u.keys.filter(w=>!w.optional).map(w=>w.name)),o.params&&Me(o.params,u.keys.map(w=>w.name))),R=u.stringify(g)}else if("path"in o)R=o.path,u=n.find(w=>w.re.test(R)),u&&(g=u.parse(R),k=u.record.name);else{if(u=a.name?r.get(a.name):n.find(w=>w.re.test(a.path)),!u)throw K(1,{location:o,currentLocation:a});k=u.record.name,g=S({},a.params,o.params),R=u.stringify(g)}const C=[];let E=u;for(;E;)C.unshift(E.record),E=E.parent;return{name:k,path:R,params:g,matched:C,meta:jt(C)}}return e.forEach(o=>l(o)),{addRoute:l,resolve:f,removeRoute:d,getRoutes:m,getRecordMatcher:s}}function Me(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Tt(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:$t(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function $t(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Ne(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function jt(e){return e.reduce((t,n)=>S(t,n.meta),{})}function Le(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function De(e,t){return t.children.some(n=>n===e||De(e,n))}const We=/#/g,Bt=/&/g,qt=/\//g,zt=/=/g,Gt=/\?/g,Qe=/\+/g,Kt=/%5B/g,Vt=/%5D/g,Fe=/%5E/g,Ut=/%60/g,Ye=/%7B/g,Dt=/%7C/g,Xe=/%7D/g,Wt=/%20/g;function me(e){return encodeURI(""+e).replace(Dt,"|").replace(Kt,"[").replace(Vt,"]")}function Qt(e){return me(e).replace(Ye,"{").replace(Xe,"}").replace(Fe,"^")}function de(e){return me(e).replace(Qe,"%2B").replace(Wt,"+").replace(We,"%23").replace(Bt,"%26").replace(Ut,"`").replace(Ye,"{").replace(Xe,"}").replace(Fe,"^")}function Ft(e){return de(e).replace(zt,"%3D")}function Yt(e){return me(e).replace(We,"%23").replace(Gt,"%3F")}function Xt(e){return e==null?"":Yt(e).replace(qt,"%2F")}function ee(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function Zt(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;sl&&de(l)):[r&&de(r)]).forEach(l=>{l!==void 0&&(t+=(t.length?"&":"")+n,l!=null&&(t+="="+l))})}return t}function Jt(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=N(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const en=Symbol(""),Ie=Symbol(""),ne=Symbol(""),ge=Symbol(""),pe=Symbol("");function W(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function $(e,t,n,r,s){const l=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((d,m)=>{const i=a=>{a===!1?m(K(4,{from:n,to:t})):a instanceof Error?m(a):Ct(a)?m(K(2,{from:t,to:a})):(l&&r.enterCallbacks[s]===l&&typeof a=="function"&&l.push(a),d())},f=e.call(r&&r.instances[s],t,n,i);let o=Promise.resolve(f);e.length<3&&(o=o.then(i)),o.catch(a=>m(a))})}function fe(e,t,n,r){const s=[];for(const l of e)for(const d in l.components){let m=l.components[d];if(!(t!=="beforeRouteEnter"&&!l.instances[d]))if(tn(m)){const f=(m.__vccOpts||m)[t];f&&s.push($(f,n,r,l,d))}else{let i=m();s.push(()=>i.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${d}" at "${l.path}"`));const o=it(f)?f.default:f;l.components[d]=o;const u=(o.__vccOpts||o)[t];return u&&$(u,n,r,l,d)()}))}}return s}function tn(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Te(e){const t=B(ne),n=B(ge),r=L(()=>t.resolve(Q(e.to))),s=L(()=>{const{matched:i}=r.value,{length:f}=i,o=i[f-1],a=n.matched;if(!o||!a.length)return-1;const u=a.findIndex(G.bind(null,o));if(u>-1)return u;const g=$e(i[f-2]);return f>1&&$e(o)===g&&a[a.length-1].path!==g?a.findIndex(G.bind(null,i[f-2])):u}),l=L(()=>s.value>-1&&on(n.params,r.value.params)),d=L(()=>s.value>-1&&s.value===n.matched.length-1&&Ge(n.params,r.value.params));function m(i={}){return sn(i)?t[Q(e.replace)?"replace":"push"](Q(e.to)).catch(F):Promise.resolve()}return{route:r,href:L(()=>r.value.href),isActive:l,isExactActive:d,navigate:m}}const nn=qe({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Te,setup(e,{slots:t}){const n=st(Te(e)),{options:r}=B(ne),s=L(()=>({[je(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[je(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const l=t.default&&t.default(n);return e.custom?l:ze("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},l)}}}),rn=nn;function sn(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function on(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!N(s)||s.length!==r.length||r.some((l,d)=>l!==s[d]))return!1}return!0}function $e(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const je=(e,t,n)=>e??t??n,cn=qe({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=B(pe),s=L(()=>e.route||r.value),l=B(Ie,0),d=L(()=>{let f=Q(l);const{matched:o}=s.value;let a;for(;(a=o[f])&&!a.components;)f++;return f}),m=L(()=>s.value.matched[d.value]);ae(Ie,L(()=>d.value+1)),ae(en,m),ae(pe,s);const i=ot();return ct(()=>[i.value,m.value,e.name],([f,o,a],[u,g,R])=>{o&&(o.instances[a]=f,g&&g!==o&&f&&f===u&&(o.leaveGuards.size||(o.leaveGuards=g.leaveGuards),o.updateGuards.size||(o.updateGuards=g.updateGuards))),f&&o&&(!g||!G(o,g)||!u)&&(o.enterCallbacks[a]||[]).forEach(k=>k(f))},{flush:"post"}),()=>{const f=s.value,o=e.name,a=m.value,u=a&&a.components[o];if(!u)return Be(n.default,{Component:u,route:f});const g=a.props[o],R=g?g===!0?f.params:typeof g=="function"?g(f):g:null,C=ze(u,S({},R,t,{onVnodeUnmounted:E=>{E.component.isUnmounted&&(a.instances[o]=null)},ref:i}));return Be(n.default,{Component:C,route:f})||C}}});function Be(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const an=cn;function hn(e){const t=It(e.routes,e),n=e.parseQuery||Zt,r=e.stringifyQuery||He,s=e.history,l=W(),d=W(),m=W(),i=tt(T);let f=T;z&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const o=le.bind(null,c=>""+c),a=le.bind(null,Xt),u=le.bind(null,ee);function g(c,p){let h,v;return Ve(c)?(h=t.getRecordMatcher(c),v=p):v=c,t.addRoute(v,h)}function R(c){const p=t.getRecordMatcher(c);p&&t.removeRoute(p)}function k(){return t.getRoutes().map(c=>c.record)}function C(c){return!!t.getRecordMatcher(c)}function E(c,p){if(p=S({},p||i.value),typeof c=="string"){const y=ue(n,c,p.path),O=t.resolve({path:y.path},p),D=s.createHref(y.fullPath);return S(y,O,{params:u(O.params),hash:ee(y.hash),redirectedFrom:void 0,href:D})}let h;if("path"in c)h=S({},c,{path:ue(n,c.path,p.path).path});else{const y=S({},c.params);for(const O in y)y[O]==null&&delete y[O];h=S({},c,{params:a(y)}),p.params=a(p.params)}const v=t.resolve(h,p),b=c.hash||"";v.params=o(u(v.params));const A=ut(r,S({},c,{hash:Qt(b),path:v.path})),P=s.createHref(A);return S({fullPath:A,hash:b,query:r===He?Jt(c.query):c.query||{}},v,{redirectedFrom:void 0,href:P})}function w(c){return typeof c=="string"?ue(n,c,i.value.path):S({},c)}function _(c,p){if(f!==c)return K(8,{from:p,to:c})}function M(c){return V(c)}function j(c){return M(S(w(c),{replace:!0}))}function H(c){const p=c.matched[c.matched.length-1];if(p&&p.redirect){const{redirect:h}=p;let v=typeof h=="function"?h(c):h;return typeof v=="string"&&(v=v.includes("?")||v.includes("#")?v=w(v):{path:v},v.params={}),S({query:c.query,hash:c.hash,params:"path"in v?{}:c.params},v)}}function V(c,p){const h=f=E(c),v=i.value,b=c.state,A=c.force,P=c.replace===!0,y=H(h);if(y)return V(S(w(y),{state:typeof y=="object"?S({},b,y.state):b,force:A,replace:P}),p||h);const O=h;O.redirectedFrom=p;let D;return!A&&ft(r,v,h)&&(D=K(16,{to:O,from:v}),we(v,v,!0,!1)),(D?Promise.resolve(D):ye(O,v)).catch(x=>I(x)?I(x,2)?x:oe(x):se(x,O,v)).then(x=>{if(x){if(I(x,2))return V(S({replace:P},w(x.to),{state:typeof x.to=="object"?S({},b,x.to.state):b,force:A}),p||O)}else x=Ee(O,v,!0,P,b);return Re(O,v,x),x})}function Ze(c,p){const h=_(c,p);return h?Promise.reject(h):Promise.resolve()}function ve(c){const p=J.values().next().value;return p&&typeof p.runWithContext=="function"?p.runWithContext(c):c()}function ye(c,p){let h;const[v,b,A]=ln(c,p);h=fe(v.reverse(),"beforeRouteLeave",c,p);for(const y of v)y.leaveGuards.forEach(O=>{h.push($(O,c,p))});const P=Ze.bind(null,c,p);return h.push(P),q(h).then(()=>{h=[];for(const y of l.list())h.push($(y,c,p));return h.push(P),q(h)}).then(()=>{h=fe(b,"beforeRouteUpdate",c,p);for(const y of b)y.updateGuards.forEach(O=>{h.push($(O,c,p))});return h.push(P),q(h)}).then(()=>{h=[];for(const y of A)if(y.beforeEnter)if(N(y.beforeEnter))for(const O of y.beforeEnter)h.push($(O,c,p));else h.push($(y.beforeEnter,c,p));return h.push(P),q(h)}).then(()=>(c.matched.forEach(y=>y.enterCallbacks={}),h=fe(A,"beforeRouteEnter",c,p),h.push(P),q(h))).then(()=>{h=[];for(const y of d.list())h.push($(y,c,p));return h.push(P),q(h)}).catch(y=>I(y,8)?y:Promise.reject(y))}function Re(c,p,h){m.list().forEach(v=>ve(()=>v(c,p,h)))}function Ee(c,p,h,v,b){const A=_(c,p);if(A)return A;const P=p===T,y=z?history.state:{};h&&(v||P?s.replace(c.fullPath,S({scroll:P&&y&&y.scroll},b)):s.push(c.fullPath,b)),i.value=c,we(c,p,h,P),oe()}let U;function Je(){U||(U=s.listen((c,p,h)=>{if(!Se.listening)return;const v=E(c),b=H(v);if(b){V(S(b,{replace:!0}),v).catch(F);return}f=v;const A=i.value;z&&Rt(ke(A.fullPath,h.delta),te()),ye(v,A).catch(P=>I(P,12)?P:I(P,2)?(V(P.to,v).then(y=>{I(y,20)&&!h.delta&&h.type===X.pop&&s.go(-1,!1)}).catch(F),Promise.reject()):(h.delta&&s.go(-h.delta,!1),se(P,v,A))).then(P=>{P=P||Ee(v,A,!1),P&&(h.delta&&!I(P,8)?s.go(-h.delta,!1):h.type===X.pop&&I(P,20)&&s.go(-1,!1)),Re(v,A,P)}).catch(F)}))}let re=W(),Pe=W(),Z;function se(c,p,h){oe(c);const v=Pe.list();return v.length?v.forEach(b=>b(c,p,h)):console.error(c),Promise.reject(c)}function et(){return Z&&i.value!==T?Promise.resolve():new Promise((c,p)=>{re.add([c,p])})}function oe(c){return Z||(Z=!c,Je(),re.list().forEach(([p,h])=>c?h(c):p()),re.reset()),c}function we(c,p,h,v){const{scrollBehavior:b}=e;if(!z||!b)return Promise.resolve();const A=!h&&Et(ke(c.fullPath,0))||(v||!h)&&history.state&&history.state.scroll||null;return rt().then(()=>b(c,p,A)).then(P=>P&&yt(P)).catch(P=>se(P,c,p))}const ce=c=>s.go(c);let ie;const J=new Set,Se={currentRoute:i,listening:!0,addRoute:g,removeRoute:R,hasRoute:C,getRoutes:k,resolve:E,options:e,push:M,replace:j,go:ce,back:()=>ce(-1),forward:()=>ce(1),beforeEach:l.add,beforeResolve:d.add,afterEach:m.add,onError:Pe.add,isReady:et,install(c){const p=this;c.component("RouterLink",rn),c.component("RouterView",an),c.config.globalProperties.$router=p,Object.defineProperty(c.config.globalProperties,"$route",{enumerable:!0,get:()=>Q(i)}),z&&!ie&&i.value===T&&(ie=!0,M(s.location).catch(b=>{}));const h={};for(const b in T)Object.defineProperty(h,b,{get:()=>i.value[b],enumerable:!0});c.provide(ne,p),c.provide(ge,nt(h)),c.provide(pe,i);const v=c.unmount;J.add(c),c.unmount=function(){J.delete(c),J.size<1&&(f=T,U&&U(),U=null,i.value=T,ie=!1,Z=!1),v()}}};function q(c){return c.reduce((p,h)=>p.then(()=>ve(h)),Promise.resolve())}return Se}function ln(e,t){const n=[],r=[],s=[],l=Math.max(t.matched.length,e.matched.length);for(let d=0;dG(f,m))?r.push(m):n.push(m));const i=e.matched[d];i&&(t.matched.find(f=>G(f,i))||s.push(i))}return[n,r,s]}function dn(){return B(ne)}function pn(){return B(ge)}export{fn as a,pn as b,hn as c,dn as u}; diff --git a/web/dist/assets/vueuc-59ca65c3.js b/web/dist/assets/vueuc-7c8d4b48.js similarity index 94% rename from web/dist/assets/vueuc-59ca65c3.js rename to web/dist/assets/vueuc-7c8d4b48.js index b9a4cfa7..120c37c6 100644 --- a/web/dist/assets/vueuc-59ca65c3.js +++ b/web/dist/assets/vueuc-7c8d4b48.js @@ -1 +1 @@ -import{a as K,o as se}from"./evtd-b614532e.js";import{j as Me,d as ce,p as G,e as Ce,g as Le}from"./seemly-76b7b838.js";import{e as He,F as Se,C as Ve,d as k,p as Ye,g as Te,i as fe,r as F,h as R,z as ze,u as Z,n as D,s as E,K as Xe,j as q,w as U,y as Ee,U as Ae,l as De,m as Ne,x as _e}from"./@vue-e0e89260.js";import{u as ee}from"./@css-render-580d83ec.js";import{h as je,u as ue,o as Pe,i as Ue}from"./vooks-a50491fd.js";import{z as Ke}from"./vdirs-b0483831.js";import{R as qe}from"./@juggle-41516555.js";import{C as Ge}from"./css-render-6a5c5852.js";function ae(n,e,t="default"){const r=e[t];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${t}] is empty.`);return r()}function de(n,e=!0,t=[]){return n.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&t.push(He(String(r)));return}if(Array.isArray(r)){de(r,e,t);return}if(r.type===Se){if(r.children===null)return;Array.isArray(r.children)&&de(r.children,e,t)}else r.type!==Ve&&t.push(r)}}),t}function he(n,e,t="default"){const r=e[t];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${t}] is empty.`);const o=de(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${n}]: slot[${t}] should have exactly one child.`)}let H=null;function Fe(){if(H===null&&(H=document.getElementById("v-binder-view-measurer"),H===null)){H=document.createElement("div"),H.id="v-binder-view-measurer";const{style:n}=H;n.position="fixed",n.left="0",n.right="0",n.top="0",n.bottom="0",n.pointerEvents="none",n.visibility="hidden",document.body.appendChild(H)}return H.getBoundingClientRect()}function Je(n,e){const t=Fe();return{top:e,left:n,height:0,width:0,right:t.width-n,bottom:t.height-e}}function oe(n){const e=n.getBoundingClientRect(),t=Fe();return{left:e.left-t.left,top:e.top-t.top,bottom:t.height+t.top-e.bottom,right:t.width+t.left-e.right,width:e.width,height:e.height}}function Qe(n){return n.nodeType===9?null:n.parentNode}function Be(n){if(n===null)return null;const e=Qe(n);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:t,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(t+o+r))return e}return Be(e)}const Ze=k({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(n){var e;Ye("VBinder",(e=Te())===null||e===void 0?void 0:e.proxy);const t=fe("VBinder",null),r=F(null),o=i=>{r.value=i,t&&n.syncTargetWithParent&&t.setTargetRef(i)};let l=[];const p=()=>{let i=r.value;for(;i=Be(i),i!==null;)l.push(i);for(const b of l)se("scroll",b,x,!0)},g=()=>{for(const i of l)K("scroll",i,x,!0);l=[]},a=new Set,m=i=>{a.size===0&&p(),a.has(i)||a.add(i)},y=i=>{a.has(i)&&a.delete(i),a.size===0&&g()},x=()=>{Me(d)},d=()=>{a.forEach(i=>i())},c=new Set,v=i=>{c.size===0&&se("resize",window,u),c.has(i)||c.add(i)},h=i=>{c.has(i)&&c.delete(i),c.size===0&&K("resize",window,u)},u=()=>{c.forEach(i=>i())};return R(()=>{K("resize",window,u),g()}),{targetRef:r,setTargetRef:o,addScrollListener:m,removeScrollListener:y,addResizeListener:v,removeResizeListener:h}},render(){return ae("binder",this.$slots)}}),$t=Ze,Mt=k({name:"Target",setup(){const{setTargetRef:n,syncTarget:e}=fe("VBinder");return{syncTarget:e,setTargetDirective:{mounted:n,updated:n}}},render(){const{syncTarget:n,setTargetDirective:e}=this;return n?ze(he("follower",this.$slots),[[e]]):he("follower",this.$slots)}});function pe(n,e){console.error(`[vueuc/${n}]: ${e}`)}const{c:W}=Ge(),te="vueuc-style";function me(n){return n&-n}class Re{constructor(e,t){this.l=e,this.min=t;const r=new Array(e+1);for(let o=0;oo)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let l=e*r;for(;e>0;)l+=t[e],e-=me(e);return l}getBound(e){let t=0,r=this.l;for(;r>t;){const o=Math.floor((t+r)/2),l=this.sum(o);if(l>e){r=o;continue}else if(l{const{to:e}=n;return e??"body"})}},render(){return this.showTeleport?this.disabled?ae("lazy-teleport",this.$slots):E(Xe,{disabled:this.disabled,to:this.mergedTo},ae("lazy-teleport",this.$slots)):null}}),J={top:"bottom",bottom:"top",left:"right",right:"left"},be={start:"end",center:"center",end:"start"},ie={top:"height",bottom:"height",left:"width",right:"width"},tt={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},nt={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},rt={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},ge={top:!0,bottom:!1,left:!0,right:!1},we={top:"end",bottom:"start",left:"end",right:"start"};function ot(n,e,t,r,o,l){if(!o||l)return{placement:n,top:0,left:0};const[p,g]=n.split("-");let a=g??"center",m={top:0,left:0};const y=(c,v,h)=>{let u=0,i=0;const b=t[c]-e[v]-e[c];return b>0&&r&&(h?i=ge[v]?b:-b:u=ge[v]?b:-b),{left:u,top:i}},x=p==="left"||p==="right";if(a!=="center"){const c=rt[n],v=J[c],h=ie[c];if(t[h]>e[h]){if(e[c]+e[h]e[v]&&(a=be[g])}else{const c=p==="bottom"||p==="top"?"left":"top",v=J[c],h=ie[c],u=(t[h]-e[h])/2;(e[c]e[v]?(a=we[c],m=y(h,c,x)):(a=we[v],m=y(h,v,x)))}let d=p;return e[p] *",{pointerEvents:"all"})])]),St=k({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(n){const e=fe("VBinder"),t=ue(()=>n.enabled!==void 0?n.enabled:n.show),r=F(null),o=F(null),l=()=>{const{syncTrigger:d}=n;d.includes("scroll")&&e.addScrollListener(a),d.includes("resize")&&e.addResizeListener(a)},p=()=>{e.removeScrollListener(a),e.removeResizeListener(a)};q(()=>{t.value&&(a(),l())});const g=ee();st.mount({id:"vueuc/binder",head:!0,anchorMetaName:te,ssr:g}),R(()=>{p()}),Pe(()=>{t.value&&a()});const a=()=>{if(!t.value)return;const d=r.value;if(d===null)return;const c=e.targetRef,{x:v,y:h,overlap:u}=n,i=v!==void 0&&h!==void 0?Je(v,h):oe(c);d.style.setProperty("--v-target-width",`${Math.round(i.width)}px`),d.style.setProperty("--v-target-height",`${Math.round(i.height)}px`);const{width:b,minWidth:z,placement:I,internalShift:C,flip:O}=n;d.setAttribute("v-placement",I),u?d.setAttribute("v-overlap",""):d.removeAttribute("v-overlap");const{style:B}=d;b==="target"?B.width=`${i.width}px`:b!==void 0?B.width=b:B.width="",z==="target"?B.minWidth=`${i.width}px`:z!==void 0?B.minWidth=z:B.minWidth="";const X=oe(d),N=oe(o.value),{left:_,top:s,placement:f}=ot(I,i,X,C,O,u),w=it(f,u),{left:$,top:M,transform:T}=lt(f,N,i,s,_,u);d.setAttribute("v-placement",f),d.style.setProperty("--v-offset-left",`${Math.round(_)}px`),d.style.setProperty("--v-offset-top",`${Math.round(s)}px`),d.style.transform=`translateX(${$}) translateY(${M}) ${T}`,d.style.setProperty("--v-transform-origin",w),d.style.transformOrigin=w};U(t,d=>{d?(l(),m()):p()});const m=()=>{Ee().then(a).catch(d=>console.error(d))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(d=>{U(Z(n,d),a)}),["teleportDisabled"].forEach(d=>{U(Z(n,d),m)}),U(Z(n,"syncTrigger"),d=>{d.includes("resize")?e.addResizeListener(a):e.removeResizeListener(a),d.includes("scroll")?e.addScrollListener(a):e.removeScrollListener(a)});const y=Ue(),x=ue(()=>{const{to:d}=n;if(d!==void 0)return d;y.value});return{VBinder:e,mergedEnabled:t,offsetContainerRef:o,followerRef:r,mergedTo:x,syncPosition:a}},render(){return E(et,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var n,e;const t=E("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[E("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))]);return this.zindexable?ze(t,[[Ke,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):t}})}});class ut{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||qe)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const t of e){const r=this.elHandlersMap.get(t.target);r!==void 0&&r(t)}}registerHandler(e,t){this.elHandlersMap.set(e,t),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const ye=new ut,xe=k({name:"ResizeObserver",props:{onResize:Function},setup(n){let e=!1;const t=Te().proxy;function r(o){const{onResize:l}=n;l!==void 0&&l(o)}q(()=>{const o=t.$el;if(o===void 0){pe("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){pe("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(ye.registerHandler(o.nextElementSibling,r),e=!0)}),R(()=>{e&&ye.unregisterHandler(t.$el.nextElementSibling)})},render(){return Ae(this.$slots,"default")}});let Q;function at(){return Q===void 0&&("matchMedia"in window?Q=window.matchMedia("(pointer:coarse)").matches:Q=!1),Q}let le;function $e(){return le===void 0&&(le="chrome"in window?window.devicePixelRatio:1),le}const dt=W(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[W("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[W("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Tt=k({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(n){const e=ee();dt.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:te,ssr:e}),q(()=>{const{defaultScrollIndex:s,defaultScrollKey:f}=n;s!=null?v({index:s}):f!=null&&v({key:f})});let t=!1,r=!1;De(()=>{if(t=!1,!r){r=!0;return}v({top:x.value,left:y})}),Ne(()=>{t=!0,r||(r=!0)});const o=D(()=>{const s=new Map,{keyField:f}=n;return n.items.forEach((w,$)=>{s.set(w[f],$)}),s}),l=F(null),p=F(void 0),g=new Map,a=D(()=>{const{items:s,itemSize:f,keyField:w}=n,$=new Re(s.length,f);return s.forEach((M,T)=>{const S=M[w],A=g.get(S);A!==void 0&&$.add(T,A)}),$}),m=F(0);let y=0;const x=F(0),d=ue(()=>Math.max(a.value.getBound(x.value-ce(n.paddingTop))-1,0)),c=D(()=>{const{value:s}=p;if(s===void 0)return[];const{items:f,itemSize:w}=n,$=d.value,M=Math.min($+Math.ceil(s/w+1),f.length-1),T=[];for(let S=$;S<=M;++S)T.push(f[S]);return T}),v=(s,f)=>{if(typeof s=="number"){b(s,f,"auto");return}const{left:w,top:$,index:M,key:T,position:S,behavior:A,debounce:L=!0}=s;if(w!==void 0||$!==void 0)b(w,$,A);else if(M!==void 0)i(M,A,L);else if(T!==void 0){const ne=o.value.get(T);ne!==void 0&&i(ne,A,L)}else S==="bottom"?b(0,Number.MAX_SAFE_INTEGER,A):S==="top"&&b(0,0,A)};let h,u=null;function i(s,f,w){const{value:$}=a,M=$.sum(s)+ce(n.paddingTop);if(!w)l.value.scrollTo({left:0,top:M,behavior:f});else{h=s,u!==null&&window.clearTimeout(u),u=window.setTimeout(()=>{h=void 0,u=null},16);const{scrollTop:T,offsetHeight:S}=l.value;if(M>T){const A=$.get(s);M+A<=T+S||l.value.scrollTo({left:0,top:M+A-S,behavior:f})}else l.value.scrollTo({left:0,top:M,behavior:f})}}function b(s,f,w){l.value.scrollTo({left:s,top:f,behavior:w})}function z(s,f){var w,$,M;if(t||n.ignoreItemResize||_(f.target))return;const{value:T}=a,S=o.value.get(s),A=T.get(S),L=(M=($=(w=f.borderBoxSize)===null||w===void 0?void 0:w[0])===null||$===void 0?void 0:$.blockSize)!==null&&M!==void 0?M:f.contentRect.height;if(L===A)return;L-n.itemSize===0?g.delete(s):g.set(s,L-n.itemSize);const j=L-A;if(j===0)return;T.add(S,j);const V=l.value;if(V!=null){if(h===void 0){const re=T.sum(S);V.scrollTop>re&&V.scrollBy(0,j)}else if(SV.scrollTop+V.offsetHeight&&V.scrollBy(0,j)}N()}m.value++}const I=!at();let C=!1;function O(s){var f;(f=n.onScroll)===null||f===void 0||f.call(n,s),(!I||!C)&&N()}function B(s){var f;if((f=n.onWheel)===null||f===void 0||f.call(n,s),I){const w=l.value;if(w!=null){if(s.deltaX===0&&(w.scrollTop===0&&s.deltaY<=0||w.scrollTop+w.offsetHeight>=w.scrollHeight&&s.deltaY>=0))return;s.preventDefault(),w.scrollTop+=s.deltaY/$e(),w.scrollLeft+=s.deltaX/$e(),N(),C=!0,Me(()=>{C=!1})}}}function X(s){if(t||_(s.target)||s.contentRect.height===p.value)return;p.value=s.contentRect.height;const{onResize:f}=n;f!==void 0&&f(s)}function N(){const{value:s}=l;s!=null&&(x.value=s.scrollTop,y=s.scrollLeft)}function _(s){let f=s;for(;f!==null;){if(f.style.display==="none")return!0;f=f.parentElement}return!1}return{listHeight:p,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:D(()=>{const{itemResizable:s}=n,f=G(a.value.sum());return m.value,[n.itemsStyle,{boxSizing:"content-box",height:s?"":f,minHeight:s?f:"",paddingTop:G(n.paddingTop),paddingBottom:G(n.paddingBottom)}]}),visibleItemsStyle:D(()=>(m.value,{transform:`translateY(${G(a.value.sum(d.value))})`})),viewportItems:c,listElRef:l,itemsElRef:F(null),scrollTo:v,handleListResize:X,handleListScroll:O,handleListWheel:B,handleItemResize:z}},render(){const{itemResizable:n,keyField:e,keyToIndex:t,visibleItemsTag:r}=this;return E(xe,{onResize:this.handleListResize},{default:()=>{var o,l;return E("div",_e(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?E("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[E(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(p=>{const g=p[e],a=t.get(g),m=this.$slots.default({item:p,index:a})[0];return n?E(xe,{key:g,onResize:y=>this.handleItemResize(g,y)},{default:()=>m}):(m.key=g,m)})})]):(l=(o=this.$slots).empty)===null||l===void 0?void 0:l.call(o)])}})}}),ft=W(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[W("&::-webkit-scrollbar",{width:0,height:0})]),zt=k({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const n=F(null);function e(o){!(o.currentTarget.offsetWidthx){const{updateCounter:C}=n;for(let O=b;O>=0;--O){const B=u-1-O;C!==void 0?C(B):m.textContent=`${B}`;const X=m.offsetWidth;if(v-=d[O],v+X<=x||O===0){h=!0,b=O-1,c&&(b===-1?(c.style.maxWidth=`${x-X}px`,c.style.boxSizing="border-box"):c.style.maxWidth="");break}}}}const{onUpdateOverflow:i}=n;h?i!==void 0&&i(!0):(i!==void 0&&i(!1),m.setAttribute(Y,""))}const l=ee();return ct.mount({id:"vueuc/overflow",head:!0,anchorMetaName:te,ssr:l}),q(o),{selfRef:t,counterRef:r,sync:o}},render(){const{$slots:n}=this;return Ee(this.sync),E("div",{class:"v-overflow",ref:"selfRef"},[Ae(n,"default"),n.counter?n.counter():E("span",{style:{display:"inline-block"},ref:"counterRef"}),n.tail?n.tail():null])}});function Ie(n){return n instanceof HTMLElement}function Oe(n){for(let e=0;e=0;e--){const t=n.childNodes[e];if(Ie(t)&&(ke(t)||We(t)))return!0}return!1}function ke(n){if(!ht(n))return!1;try{n.focus({preventScroll:!0})}catch{}return document.activeElement===n}function ht(n){if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.getAttribute("disabled"))return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return n.type!=="hidden"&&n.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let P=[];const At=k({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(n){const e=Ce(),t=F(null),r=F(null);let o=!1,l=!1;const p=typeof document>"u"?null:document.activeElement;function g(){return P[P.length-1]===e}function a(u){var i;u.code==="Escape"&&g()&&((i=n.onEsc)===null||i===void 0||i.call(n,u))}q(()=>{U(()=>n.active,u=>{u?(x(),se("keydown",document,a)):(K("keydown",document,a),o&&d())},{immediate:!0})}),R(()=>{K("keydown",document,a),o&&d()});function m(u){if(!l&&g()){const i=y();if(i===null||i.contains(Le(u)))return;c("first")}}function y(){const u=t.value;if(u===null)return null;let i=u;for(;i=i.nextSibling,!(i===null||i instanceof Element&&i.tagName==="DIV"););return i}function x(){var u;if(!n.disabled){if(P.push(e),n.autoFocus){const{initialFocusTo:i}=n;i===void 0?c("first"):(u=ve(i))===null||u===void 0||u.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",m,!0)}}function d(){var u;if(n.disabled||(document.removeEventListener("focus",m,!0),P=P.filter(b=>b!==e),g()))return;const{finalFocusTo:i}=n;i!==void 0?(u=ve(i))===null||u===void 0||u.focus({preventScroll:!0}):n.returnFocusOnDeactivated&&p instanceof HTMLElement&&(l=!0,p.focus({preventScroll:!0}),l=!1)}function c(u){if(g()&&n.active){const i=t.value,b=r.value;if(i!==null&&b!==null){const z=y();if(z==null||z===b){l=!0,i.focus({preventScroll:!0}),l=!1;return}l=!0;const I=u==="first"?Oe(z):We(z);l=!1,I||(l=!0,i.focus({preventScroll:!0}),l=!1)}}}function v(u){if(l)return;const i=y();i!==null&&(u.relatedTarget!==null&&i.contains(u.relatedTarget)?c("last"):c("first"))}function h(u){l||(u.relatedTarget!==null&&u.relatedTarget===t.value?c("last"):c("first"))}return{focusableStartRef:t,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:v,handleEndFocus:h}},render(){const{default:n}=this.$slots;if(n===void 0)return null;if(this.disabled)return n();const{active:e,focusableStyle:t}=this;return E(Se,null,[E("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:t,onFocus:this.handleStartFocus}),n(),E("div",{"aria-hidden":"true",style:t,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});export{At as F,et as L,xe as V,Tt as a,St as b,$t as c,Mt as d,Et as e,zt as f,ye as r}; +import{a as q,o as se}from"./evtd-b614532e.js";import{j as Me,d as ce,p as G,e as Ce,g as Le}from"./seemly-76b7b838.js";import{A as He,F as Se,C as Ve,d as k,p as Ye,g as Te,i as fe,H as F,G as R,O as ze,M as Z,c as D,h as E,W as Xe,b as K,E as U,n as Ee,v as Ae,I as De,J as Ne,N as _e}from"./@vue-a481fc63.js";import{u as ee}from"./@css-render-7124a1a5.js";import{h as je,u as ue,o as Pe,i as Ue}from"./vooks-6d99783e.js";import{z as qe}from"./vdirs-b0483831.js";import{R as Ke}from"./@juggle-41516555.js";import{C as Ge}from"./css-render-6a5c5852.js";function ae(n,e,t="default"){const r=e[t];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${t}] is empty.`);return r()}function de(n,e=!0,t=[]){return n.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&t.push(He(String(r)));return}if(Array.isArray(r)){de(r,e,t);return}if(r.type===Se){if(r.children===null)return;Array.isArray(r.children)&&de(r.children,e,t)}else r.type!==Ve&&t.push(r)}}),t}function he(n,e,t="default"){const r=e[t];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${t}] is empty.`);const o=de(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${n}]: slot[${t}] should have exactly one child.`)}let H=null;function Fe(){if(H===null&&(H=document.getElementById("v-binder-view-measurer"),H===null)){H=document.createElement("div"),H.id="v-binder-view-measurer";const{style:n}=H;n.position="fixed",n.left="0",n.right="0",n.top="0",n.bottom="0",n.pointerEvents="none",n.visibility="hidden",document.body.appendChild(H)}return H.getBoundingClientRect()}function Je(n,e){const t=Fe();return{top:e,left:n,height:0,width:0,right:t.width-n,bottom:t.height-e}}function oe(n){const e=n.getBoundingClientRect(),t=Fe();return{left:e.left-t.left,top:e.top-t.top,bottom:t.height+t.top-e.bottom,right:t.width+t.left-e.right,width:e.width,height:e.height}}function Qe(n){return n.nodeType===9?null:n.parentNode}function Be(n){if(n===null)return null;const e=Qe(n);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:t,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(t+o+r))return e}return Be(e)}const Ze=k({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(n){var e;Ye("VBinder",(e=Te())===null||e===void 0?void 0:e.proxy);const t=fe("VBinder",null),r=F(null),o=i=>{r.value=i,t&&n.syncTargetWithParent&&t.setTargetRef(i)};let l=[];const p=()=>{let i=r.value;for(;i=Be(i),i!==null;)l.push(i);for(const b of l)se("scroll",b,x,!0)},g=()=>{for(const i of l)q("scroll",i,x,!0);l=[]},a=new Set,m=i=>{a.size===0&&p(),a.has(i)||a.add(i)},y=i=>{a.has(i)&&a.delete(i),a.size===0&&g()},x=()=>{Me(d)},d=()=>{a.forEach(i=>i())},c=new Set,v=i=>{c.size===0&&se("resize",window,u),c.has(i)||c.add(i)},h=i=>{c.has(i)&&c.delete(i),c.size===0&&q("resize",window,u)},u=()=>{c.forEach(i=>i())};return R(()=>{q("resize",window,u),g()}),{targetRef:r,setTargetRef:o,addScrollListener:m,removeScrollListener:y,addResizeListener:v,removeResizeListener:h}},render(){return ae("binder",this.$slots)}}),$t=Ze,Mt=k({name:"Target",setup(){const{setTargetRef:n,syncTarget:e}=fe("VBinder");return{syncTarget:e,setTargetDirective:{mounted:n,updated:n}}},render(){const{syncTarget:n,setTargetDirective:e}=this;return n?ze(he("follower",this.$slots),[[e]]):he("follower",this.$slots)}});function pe(n,e){console.error(`[vueuc/${n}]: ${e}`)}const{c:W}=Ge(),te="vueuc-style";function me(n){return n&-n}class Re{constructor(e,t){this.l=e,this.min=t;const r=new Array(e+1);for(let o=0;oo)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let l=e*r;for(;e>0;)l+=t[e],e-=me(e);return l}getBound(e){let t=0,r=this.l;for(;r>t;){const o=Math.floor((t+r)/2),l=this.sum(o);if(l>e){r=o;continue}else if(l{const{to:e}=n;return e??"body"})}},render(){return this.showTeleport?this.disabled?ae("lazy-teleport",this.$slots):E(Xe,{disabled:this.disabled,to:this.mergedTo},ae("lazy-teleport",this.$slots)):null}}),J={top:"bottom",bottom:"top",left:"right",right:"left"},be={start:"end",center:"center",end:"start"},ie={top:"height",bottom:"height",left:"width",right:"width"},tt={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},nt={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},rt={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},ge={top:!0,bottom:!1,left:!0,right:!1},we={top:"end",bottom:"start",left:"end",right:"start"};function ot(n,e,t,r,o,l){if(!o||l)return{placement:n,top:0,left:0};const[p,g]=n.split("-");let a=g??"center",m={top:0,left:0};const y=(c,v,h)=>{let u=0,i=0;const b=t[c]-e[v]-e[c];return b>0&&r&&(h?i=ge[v]?b:-b:u=ge[v]?b:-b),{left:u,top:i}},x=p==="left"||p==="right";if(a!=="center"){const c=rt[n],v=J[c],h=ie[c];if(t[h]>e[h]){if(e[c]+e[h]e[v]&&(a=be[g])}else{const c=p==="bottom"||p==="top"?"left":"top",v=J[c],h=ie[c],u=(t[h]-e[h])/2;(e[c]e[v]?(a=we[c],m=y(h,c,x)):(a=we[v],m=y(h,v,x)))}let d=p;return e[p] *",{pointerEvents:"all"})])]),St=k({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(n){const e=fe("VBinder"),t=ue(()=>n.enabled!==void 0?n.enabled:n.show),r=F(null),o=F(null),l=()=>{const{syncTrigger:d}=n;d.includes("scroll")&&e.addScrollListener(a),d.includes("resize")&&e.addResizeListener(a)},p=()=>{e.removeScrollListener(a),e.removeResizeListener(a)};K(()=>{t.value&&(a(),l())});const g=ee();st.mount({id:"vueuc/binder",head:!0,anchorMetaName:te,ssr:g}),R(()=>{p()}),Pe(()=>{t.value&&a()});const a=()=>{if(!t.value)return;const d=r.value;if(d===null)return;const c=e.targetRef,{x:v,y:h,overlap:u}=n,i=v!==void 0&&h!==void 0?Je(v,h):oe(c);d.style.setProperty("--v-target-width",`${Math.round(i.width)}px`),d.style.setProperty("--v-target-height",`${Math.round(i.height)}px`);const{width:b,minWidth:z,placement:I,internalShift:C,flip:O}=n;d.setAttribute("v-placement",I),u?d.setAttribute("v-overlap",""):d.removeAttribute("v-overlap");const{style:B}=d;b==="target"?B.width=`${i.width}px`:b!==void 0?B.width=b:B.width="",z==="target"?B.minWidth=`${i.width}px`:z!==void 0?B.minWidth=z:B.minWidth="";const X=oe(d),N=oe(o.value),{left:_,top:s,placement:f}=ot(I,i,X,C,O,u),w=it(f,u),{left:$,top:M,transform:T}=lt(f,N,i,s,_,u);d.setAttribute("v-placement",f),d.style.setProperty("--v-offset-left",`${Math.round(_)}px`),d.style.setProperty("--v-offset-top",`${Math.round(s)}px`),d.style.transform=`translateX(${$}) translateY(${M}) ${T}`,d.style.setProperty("--v-transform-origin",w),d.style.transformOrigin=w};U(t,d=>{d?(l(),m()):p()});const m=()=>{Ee().then(a).catch(d=>console.error(d))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(d=>{U(Z(n,d),a)}),["teleportDisabled"].forEach(d=>{U(Z(n,d),m)}),U(Z(n,"syncTrigger"),d=>{d.includes("resize")?e.addResizeListener(a):e.removeResizeListener(a),d.includes("scroll")?e.addScrollListener(a):e.removeScrollListener(a)});const y=Ue(),x=ue(()=>{const{to:d}=n;if(d!==void 0)return d;y.value});return{VBinder:e,mergedEnabled:t,offsetContainerRef:o,followerRef:r,mergedTo:x,syncPosition:a}},render(){return E(et,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var n,e;const t=E("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[E("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))]);return this.zindexable?ze(t,[[qe,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):t}})}});class ut{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Ke)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const t of e){const r=this.elHandlersMap.get(t.target);r!==void 0&&r(t)}}registerHandler(e,t){this.elHandlersMap.set(e,t),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const ye=new ut,xe=k({name:"ResizeObserver",props:{onResize:Function},setup(n){let e=!1;const t=Te().proxy;function r(o){const{onResize:l}=n;l!==void 0&&l(o)}K(()=>{const o=t.$el;if(o===void 0){pe("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){pe("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(ye.registerHandler(o.nextElementSibling,r),e=!0)}),R(()=>{e&&ye.unregisterHandler(t.$el.nextElementSibling)})},render(){return Ae(this.$slots,"default")}});let Q;function at(){return Q===void 0&&("matchMedia"in window?Q=window.matchMedia("(pointer:coarse)").matches:Q=!1),Q}let le;function $e(){return le===void 0&&(le="chrome"in window?window.devicePixelRatio:1),le}const dt=W(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[W("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[W("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Tt=k({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(n){const e=ee();dt.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:te,ssr:e}),K(()=>{const{defaultScrollIndex:s,defaultScrollKey:f}=n;s!=null?v({index:s}):f!=null&&v({key:f})});let t=!1,r=!1;De(()=>{if(t=!1,!r){r=!0;return}v({top:x.value,left:y})}),Ne(()=>{t=!0,r||(r=!0)});const o=D(()=>{const s=new Map,{keyField:f}=n;return n.items.forEach((w,$)=>{s.set(w[f],$)}),s}),l=F(null),p=F(void 0),g=new Map,a=D(()=>{const{items:s,itemSize:f,keyField:w}=n,$=new Re(s.length,f);return s.forEach((M,T)=>{const S=M[w],A=g.get(S);A!==void 0&&$.add(T,A)}),$}),m=F(0);let y=0;const x=F(0),d=ue(()=>Math.max(a.value.getBound(x.value-ce(n.paddingTop))-1,0)),c=D(()=>{const{value:s}=p;if(s===void 0)return[];const{items:f,itemSize:w}=n,$=d.value,M=Math.min($+Math.ceil(s/w+1),f.length-1),T=[];for(let S=$;S<=M;++S)T.push(f[S]);return T}),v=(s,f)=>{if(typeof s=="number"){b(s,f,"auto");return}const{left:w,top:$,index:M,key:T,position:S,behavior:A,debounce:L=!0}=s;if(w!==void 0||$!==void 0)b(w,$,A);else if(M!==void 0)i(M,A,L);else if(T!==void 0){const ne=o.value.get(T);ne!==void 0&&i(ne,A,L)}else S==="bottom"?b(0,Number.MAX_SAFE_INTEGER,A):S==="top"&&b(0,0,A)};let h,u=null;function i(s,f,w){const{value:$}=a,M=$.sum(s)+ce(n.paddingTop);if(!w)l.value.scrollTo({left:0,top:M,behavior:f});else{h=s,u!==null&&window.clearTimeout(u),u=window.setTimeout(()=>{h=void 0,u=null},16);const{scrollTop:T,offsetHeight:S}=l.value;if(M>T){const A=$.get(s);M+A<=T+S||l.value.scrollTo({left:0,top:M+A-S,behavior:f})}else l.value.scrollTo({left:0,top:M,behavior:f})}}function b(s,f,w){l.value.scrollTo({left:s,top:f,behavior:w})}function z(s,f){var w,$,M;if(t||n.ignoreItemResize||_(f.target))return;const{value:T}=a,S=o.value.get(s),A=T.get(S),L=(M=($=(w=f.borderBoxSize)===null||w===void 0?void 0:w[0])===null||$===void 0?void 0:$.blockSize)!==null&&M!==void 0?M:f.contentRect.height;if(L===A)return;L-n.itemSize===0?g.delete(s):g.set(s,L-n.itemSize);const j=L-A;if(j===0)return;T.add(S,j);const V=l.value;if(V!=null){if(h===void 0){const re=T.sum(S);V.scrollTop>re&&V.scrollBy(0,j)}else if(SV.scrollTop+V.offsetHeight&&V.scrollBy(0,j)}N()}m.value++}const I=!at();let C=!1;function O(s){var f;(f=n.onScroll)===null||f===void 0||f.call(n,s),(!I||!C)&&N()}function B(s){var f;if((f=n.onWheel)===null||f===void 0||f.call(n,s),I){const w=l.value;if(w!=null){if(s.deltaX===0&&(w.scrollTop===0&&s.deltaY<=0||w.scrollTop+w.offsetHeight>=w.scrollHeight&&s.deltaY>=0))return;s.preventDefault(),w.scrollTop+=s.deltaY/$e(),w.scrollLeft+=s.deltaX/$e(),N(),C=!0,Me(()=>{C=!1})}}}function X(s){if(t||_(s.target)||s.contentRect.height===p.value)return;p.value=s.contentRect.height;const{onResize:f}=n;f!==void 0&&f(s)}function N(){const{value:s}=l;s!=null&&(x.value=s.scrollTop,y=s.scrollLeft)}function _(s){let f=s;for(;f!==null;){if(f.style.display==="none")return!0;f=f.parentElement}return!1}return{listHeight:p,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:D(()=>{const{itemResizable:s}=n,f=G(a.value.sum());return m.value,[n.itemsStyle,{boxSizing:"content-box",height:s?"":f,minHeight:s?f:"",paddingTop:G(n.paddingTop),paddingBottom:G(n.paddingBottom)}]}),visibleItemsStyle:D(()=>(m.value,{transform:`translateY(${G(a.value.sum(d.value))})`})),viewportItems:c,listElRef:l,itemsElRef:F(null),scrollTo:v,handleListResize:X,handleListScroll:O,handleListWheel:B,handleItemResize:z}},render(){const{itemResizable:n,keyField:e,keyToIndex:t,visibleItemsTag:r}=this;return E(xe,{onResize:this.handleListResize},{default:()=>{var o,l;return E("div",_e(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?E("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[E(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(p=>{const g=p[e],a=t.get(g),m=this.$slots.default({item:p,index:a})[0];return n?E(xe,{key:g,onResize:y=>this.handleItemResize(g,y)},{default:()=>m}):(m.key=g,m)})})]):(l=(o=this.$slots).empty)===null||l===void 0?void 0:l.call(o)])}})}}),ft=W(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[W("&::-webkit-scrollbar",{width:0,height:0})]),zt=k({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const n=F(null);function e(o){!(o.currentTarget.offsetWidthx){const{updateCounter:C}=n;for(let O=b;O>=0;--O){const B=u-1-O;C!==void 0?C(B):m.textContent=`${B}`;const X=m.offsetWidth;if(v-=d[O],v+X<=x||O===0){h=!0,b=O-1,c&&(b===-1?(c.style.maxWidth=`${x-X}px`,c.style.boxSizing="border-box"):c.style.maxWidth="");break}}}}const{onUpdateOverflow:i}=n;h?i!==void 0&&i(!0):(i!==void 0&&i(!1),m.setAttribute(Y,""))}const l=ee();return ct.mount({id:"vueuc/overflow",head:!0,anchorMetaName:te,ssr:l}),K(o),{selfRef:t,counterRef:r,sync:o}},render(){const{$slots:n}=this;return Ee(this.sync),E("div",{class:"v-overflow",ref:"selfRef"},[Ae(n,"default"),n.counter?n.counter():E("span",{style:{display:"inline-block"},ref:"counterRef"}),n.tail?n.tail():null])}});function Ie(n){return n instanceof HTMLElement}function Oe(n){for(let e=0;e=0;e--){const t=n.childNodes[e];if(Ie(t)&&(ke(t)||We(t)))return!0}return!1}function ke(n){if(!ht(n))return!1;try{n.focus({preventScroll:!0})}catch{}return document.activeElement===n}function ht(n){if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.getAttribute("disabled"))return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return n.type!=="hidden"&&n.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let P=[];const At=k({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(n){const e=Ce(),t=F(null),r=F(null);let o=!1,l=!1;const p=typeof document>"u"?null:document.activeElement;function g(){return P[P.length-1]===e}function a(u){var i;u.code==="Escape"&&g()&&((i=n.onEsc)===null||i===void 0||i.call(n,u))}K(()=>{U(()=>n.active,u=>{u?(x(),se("keydown",document,a)):(q("keydown",document,a),o&&d())},{immediate:!0})}),R(()=>{q("keydown",document,a),o&&d()});function m(u){if(!l&&g()){const i=y();if(i===null||i.contains(Le(u)))return;c("first")}}function y(){const u=t.value;if(u===null)return null;let i=u;for(;i=i.nextSibling,!(i===null||i instanceof Element&&i.tagName==="DIV"););return i}function x(){var u;if(!n.disabled){if(P.push(e),n.autoFocus){const{initialFocusTo:i}=n;i===void 0?c("first"):(u=ve(i))===null||u===void 0||u.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",m,!0)}}function d(){var u;if(n.disabled||(document.removeEventListener("focus",m,!0),P=P.filter(b=>b!==e),g()))return;const{finalFocusTo:i}=n;i!==void 0?(u=ve(i))===null||u===void 0||u.focus({preventScroll:!0}):n.returnFocusOnDeactivated&&p instanceof HTMLElement&&(l=!0,p.focus({preventScroll:!0}),l=!1)}function c(u){if(g()&&n.active){const i=t.value,b=r.value;if(i!==null&&b!==null){const z=y();if(z==null||z===b){l=!0,i.focus({preventScroll:!0}),l=!1;return}l=!0;const I=u==="first"?Oe(z):We(z);l=!1,I||(l=!0,i.focus({preventScroll:!0}),l=!1)}}}function v(u){if(l)return;const i=y();i!==null&&(u.relatedTarget!==null&&i.contains(u.relatedTarget)?c("last"):c("first"))}function h(u){l||(u.relatedTarget!==null&&u.relatedTarget===t.value?c("last"):c("first"))}return{focusableStartRef:t,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:v,handleEndFocus:h}},render(){const{default:n}=this.$slots;if(n===void 0)return null;if(this.disabled)return n();const{active:e,focusableStyle:t}=this;return E(Se,null,[E("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:t,onFocus:this.handleStartFocus}),n(),E("div",{"aria-hidden":"true",style:t,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});export{At as F,et as L,xe as V,Tt as a,St as b,Mt as c,$t as d,Et as e,zt as f,ye as r}; diff --git a/web/dist/assets/vuex-473b3783.js b/web/dist/assets/vuex-44de225f.js similarity index 93% rename from web/dist/assets/vuex-473b3783.js rename to web/dist/assets/vuex-44de225f.js index 708e2a87..a71833fb 100644 --- a/web/dist/assets/vuex-473b3783.js +++ b/web/dist/assets/vuex-44de225f.js @@ -1,5 +1,5 @@ -import{w as M,$ as V,E as H,a0 as U,i as k,n as B}from"./@vue-e0e89260.js";/*! +import{E as M,ax as V,R as H,bz as U,i as k,c as B}from"./@vue-a481fc63.js";/*! * vuex v4.1.0 * (c) 2022 Evan You * @license MIT - */var x="store";function st(e){return e===void 0&&(e=null),k(e!==null?e:x)}function g(e,t){Object.keys(e).forEach(function(i){return t(e[i],i)})}function K(e){return e!==null&&typeof e=="object"}function W(e){return e&&typeof e.then=="function"}function Y(e,t){return function(){return e(t)}}function T(e,t,i){return t.indexOf(e)<0&&(i&&i.prepend?t.unshift(e):t.push(e)),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function A(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var i=e.state;y(e,i,[],e._modules.root,!0),S(e,i,t)}function S(e,t,i){var r=e._state,n=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,a={},s={},u=V(!0);u.run(function(){g(o,function(l,c){a[c]=Y(l,e),s[c]=B(function(){return a[c]()}),Object.defineProperty(e.getters,c,{get:function(){return s[c].value},enumerable:!0})})}),e._state=H({data:t}),e._scope=u,e.strict&&Q(e),r&&i&&e._withCommit(function(){r.data=null}),n&&n.stop()}function y(e,t,i,r,n){var o=!i.length,a=e._modules.getNamespace(i);if(r.namespaced&&(e._modulesNamespaceMap[a],e._modulesNamespaceMap[a]=r),!o&&!n){var s=E(t,i.slice(0,-1)),u=i[i.length-1];e._withCommit(function(){s[u]=r.state})}var l=r.context=X(e,a,i);r.forEachMutation(function(c,f){var h=a+f;q(e,h,c,l)}),r.forEachAction(function(c,f){var h=c.root?f:a+f,d=c.handler||c;z(e,h,d,l)}),r.forEachGetter(function(c,f){var h=a+f;J(e,h,c,l)}),r.forEachChild(function(c,f){y(e,t,i.concat(f),c,n)})}function X(e,t,i){var r=t==="",n={dispatch:r?e.dispatch:function(o,a,s){var u=b(o,a,s),l=u.payload,c=u.options,f=u.type;return(!c||!c.root)&&(f=t+f),e.dispatch(f,l)},commit:r?e.commit:function(o,a,s){var u=b(o,a,s),l=u.payload,c=u.options,f=u.type;(!c||!c.root)&&(f=t+f),e.commit(f,l,c)}};return Object.defineProperties(n,{getters:{get:r?function(){return e.getters}:function(){return G(e,t)}},state:{get:function(){return E(e.state,i)}}}),n}function G(e,t){if(!e._makeLocalGettersCache[t]){var i={},r=t.length;Object.keys(e.getters).forEach(function(n){if(n.slice(0,r)===t){var o=n.slice(r);Object.defineProperty(i,o,{get:function(){return e.getters[n]},enumerable:!0})}}),e._makeLocalGettersCache[t]=i}return e._makeLocalGettersCache[t]}function q(e,t,i,r){var n=e._mutations[t]||(e._mutations[t]=[]);n.push(function(a){i.call(e,r.state,a)})}function z(e,t,i,r){var n=e._actions[t]||(e._actions[t]=[]);n.push(function(a){var s=i.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},a);return W(s)||(s=Promise.resolve(s)),e._devtoolHook?s.catch(function(u){throw e._devtoolHook.emit("vuex:error",u),u}):s})}function J(e,t,i,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(o){return i(r.state,r.getters,o.state,o.getters)})}function Q(e){M(function(){return e._state.data},function(){},{deep:!0,flush:"sync"})}function E(e,t){return t.reduce(function(i,r){return i[r]},e)}function b(e,t,i){return K(e)&&e.type&&(i=t,t=e,e=e.type),{type:e,payload:t,options:i}}var Z="vuex bindings",j="vuex:mutations",C="vuex:actions",_="vuex",tt=0;function et(e,t){U({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[Z]},function(i){i.addTimelineLayer({id:j,label:"Vuex Mutations",color:I}),i.addTimelineLayer({id:C,label:"Vuex Actions",color:I}),i.addInspector({id:_,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),i.on.getInspectorTree(function(r){if(r.app===e&&r.inspectorId===_)if(r.filter){var n=[];D(n,t._modules.root,r.filter,""),r.rootNodes=n}else r.rootNodes=[N(t._modules.root,"")]}),i.on.getInspectorState(function(r){if(r.app===e&&r.inspectorId===_){var n=r.nodeId;G(t,n),r.state=nt(at(t._modules,n),n==="root"?t.getters:t._makeLocalGettersCache,n)}}),i.on.editInspectorState(function(r){if(r.app===e&&r.inspectorId===_){var n=r.nodeId,o=r.path;n!=="root"&&(o=n.split("/").filter(Boolean).concat(o)),t._withCommit(function(){r.set(t._state.data,o,r.state.value)})}}),t.subscribe(function(r,n){var o={};r.payload&&(o.payload=r.payload),o.state=n,i.notifyComponentUpdate(),i.sendInspectorTree(_),i.sendInspectorState(_),i.addTimelineEvent({layerId:j,event:{time:Date.now(),title:r.type,data:o}})}),t.subscribeAction({before:function(r,n){var o={};r.payload&&(o.payload=r.payload),r._id=tt++,r._time=Date.now(),o.state=n,i.addTimelineEvent({layerId:C,event:{time:r._time,title:r.type,groupId:r._id,subtitle:"start",data:o}})},after:function(r,n){var o={},a=Date.now()-r._time;o.duration={_custom:{type:"duration",display:a+"ms",tooltip:"Action duration",value:a}},r.payload&&(o.payload=r.payload),o.state=n,i.addTimelineEvent({layerId:C,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:o}})}})})}var I=8702998,rt=6710886,it=16777215,$={label:"namespaced",textColor:it,backgroundColor:rt};function L(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function N(e,t){return{id:t||"root",label:L(t),tags:e.namespaced?[$]:[],children:Object.keys(e._children).map(function(i){return N(e._children[i],t+i+"/")})}}function D(e,t,i,r){r.includes(i)&&e.push({id:r||"root",label:r.endsWith("/")?r.slice(0,r.length-1):r||"Root",tags:t.namespaced?[$]:[]}),Object.keys(t._children).forEach(function(n){D(e,t._children[n],i,r+n+"/")})}function nt(e,t,i){t=i==="root"?t:t[i];var r=Object.keys(t),n={state:Object.keys(e.state).map(function(a){return{key:a,editable:!0,value:e.state[a]}})};if(r.length){var o=ot(t);n.getters=Object.keys(o).map(function(a){return{key:a.endsWith("/")?L(a):a,editable:!1,value:O(function(){return o[a]})}})}return n}function ot(e){var t={};return Object.keys(e).forEach(function(i){var r=i.split("/");if(r.length>1){var n=t,o=r.pop();r.forEach(function(a){n[a]||(n[a]={_custom:{value:{},display:a,tooltip:"Module",abstract:!0}}),n=n[a]._custom.value}),n[o]=O(function(){return e[i]})}else t[i]=O(function(){return e[i]})}),t}function at(e,t){var i=t.split("/").filter(function(r){return r});return i.reduce(function(r,n,o){var a=r[n];if(!a)throw new Error('Missing module "'+n+'" for path "'+t+'".');return o===i.length-1?a:a._children},t==="root"?e:e.root._children)}function O(e){try{return e()}catch(t){return t}}var v=function(t,i){this.runtime=i,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=(typeof r=="function"?r():r)||{}},R={namespaced:{configurable:!0}};R.namespaced.get=function(){return!!this._rawModule.namespaced};v.prototype.addChild=function(t,i){this._children[t]=i};v.prototype.removeChild=function(t){delete this._children[t]};v.prototype.getChild=function(t){return this._children[t]};v.prototype.hasChild=function(t){return t in this._children};v.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)};v.prototype.forEachChild=function(t){g(this._children,t)};v.prototype.forEachGetter=function(t){this._rawModule.getters&&g(this._rawModule.getters,t)};v.prototype.forEachAction=function(t){this._rawModule.actions&&g(this._rawModule.actions,t)};v.prototype.forEachMutation=function(t){this._rawModule.mutations&&g(this._rawModule.mutations,t)};Object.defineProperties(v.prototype,R);var m=function(t){this.register([],t,!1)};m.prototype.get=function(t){return t.reduce(function(i,r){return i.getChild(r)},this.root)};m.prototype.getNamespace=function(t){var i=this.root;return t.reduce(function(r,n){return i=i.getChild(n),r+(i.namespaced?n+"/":"")},"")};m.prototype.update=function(t){P([],this.root,t)};m.prototype.register=function(t,i,r){var n=this;r===void 0&&(r=!0);var o=new v(i,r);if(t.length===0)this.root=o;else{var a=this.get(t.slice(0,-1));a.addChild(t[t.length-1],o)}i.modules&&g(i.modules,function(s,u){n.register(t.concat(u),s,r)})};m.prototype.unregister=function(t){var i=this.get(t.slice(0,-1)),r=t[t.length-1],n=i.getChild(r);n&&n.runtime&&i.removeChild(r)};m.prototype.isRegistered=function(t){var i=this.get(t.slice(0,-1)),r=t[t.length-1];return i?i.hasChild(r):!1};function P(e,t,i){if(t.update(i),i.modules)for(var r in i.modules){if(!t.getChild(r))return;P(e.concat(r),t.getChild(r),i.modules[r])}}function ut(e){return new p(e)}var p=function(t){var i=this;t===void 0&&(t={});var r=t.plugins;r===void 0&&(r=[]);var n=t.strict;n===void 0&&(n=!1);var o=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new m(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=o;var a=this,s=this,u=s.dispatch,l=s.commit;this.dispatch=function(h,d){return u.call(a,h,d)},this.commit=function(h,d,F){return l.call(a,h,d,F)},this.strict=n;var c=this._modules.root.state;y(this,c,[],this._modules.root),S(this,c),r.forEach(function(f){return f(i)})},w={state:{configurable:!0}};p.prototype.install=function(t,i){t.provide(i||x,this),t.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:!1;r&&et(t,this)};w.state.get=function(){return this._state.data};w.state.set=function(e){};p.prototype.commit=function(t,i,r){var n=this,o=b(t,i,r),a=o.type,s=o.payload,u={type:a,payload:s},l=this._mutations[a];l&&(this._withCommit(function(){l.forEach(function(f){f(s)})}),this._subscribers.slice().forEach(function(c){return c(u,n.state)}))};p.prototype.dispatch=function(t,i){var r=this,n=b(t,i),o=n.type,a=n.payload,s={type:o,payload:a},u=this._actions[o];if(u){try{this._actionSubscribers.slice().filter(function(c){return c.before}).forEach(function(c){return c.before(s,r.state)})}catch{}var l=u.length>1?Promise.all(u.map(function(c){return c(a)})):u[0](a);return new Promise(function(c,f){l.then(function(h){try{r._actionSubscribers.filter(function(d){return d.after}).forEach(function(d){return d.after(s,r.state)})}catch{}c(h)},function(h){try{r._actionSubscribers.filter(function(d){return d.error}).forEach(function(d){return d.error(s,r.state,h)})}catch{}f(h)})})}};p.prototype.subscribe=function(t,i){return T(t,this._subscribers,i)};p.prototype.subscribeAction=function(t,i){var r=typeof t=="function"?{before:t}:t;return T(r,this._actionSubscribers,i)};p.prototype.watch=function(t,i,r){var n=this;return M(function(){return t(n.state,n.getters)},i,Object.assign({},r))};p.prototype.replaceState=function(t){var i=this;this._withCommit(function(){i._state.data=t})};p.prototype.registerModule=function(t,i,r){r===void 0&&(r={}),typeof t=="string"&&(t=[t]),this._modules.register(t,i),y(this,this.state,t,this._modules.get(t),r.preserveState),S(this,this.state)};p.prototype.unregisterModule=function(t){var i=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var r=E(i.state,t.slice(0,-1));delete r[t[t.length-1]]}),A(this)};p.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)};p.prototype.hotUpdate=function(t){this._modules.update(t),A(this,!0)};p.prototype._withCommit=function(t){var i=this._committing;this._committing=!0,t(),this._committing=i};Object.defineProperties(p.prototype,w);export{ut as c,st as u}; + */var x="store";function st(e){return e===void 0&&(e=null),k(e!==null?e:x)}function g(e,t){Object.keys(e).forEach(function(i){return t(e[i],i)})}function K(e){return e!==null&&typeof e=="object"}function W(e){return e&&typeof e.then=="function"}function Y(e,t){return function(){return e(t)}}function T(e,t,i){return t.indexOf(e)<0&&(i&&i.prepend?t.unshift(e):t.push(e)),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function A(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var i=e.state;y(e,i,[],e._modules.root,!0),S(e,i,t)}function S(e,t,i){var r=e._state,n=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,a={},s={},u=V(!0);u.run(function(){g(o,function(l,c){a[c]=Y(l,e),s[c]=B(function(){return a[c]()}),Object.defineProperty(e.getters,c,{get:function(){return s[c].value},enumerable:!0})})}),e._state=H({data:t}),e._scope=u,e.strict&&Q(e),r&&i&&e._withCommit(function(){r.data=null}),n&&n.stop()}function y(e,t,i,r,n){var o=!i.length,a=e._modules.getNamespace(i);if(r.namespaced&&(e._modulesNamespaceMap[a],e._modulesNamespaceMap[a]=r),!o&&!n){var s=E(t,i.slice(0,-1)),u=i[i.length-1];e._withCommit(function(){s[u]=r.state})}var l=r.context=z(e,a,i);r.forEachMutation(function(c,f){var h=a+f;X(e,h,c,l)}),r.forEachAction(function(c,f){var h=c.root?f:a+f,d=c.handler||c;q(e,h,d,l)}),r.forEachGetter(function(c,f){var h=a+f;J(e,h,c,l)}),r.forEachChild(function(c,f){y(e,t,i.concat(f),c,n)})}function z(e,t,i){var r=t==="",n={dispatch:r?e.dispatch:function(o,a,s){var u=b(o,a,s),l=u.payload,c=u.options,f=u.type;return(!c||!c.root)&&(f=t+f),e.dispatch(f,l)},commit:r?e.commit:function(o,a,s){var u=b(o,a,s),l=u.payload,c=u.options,f=u.type;(!c||!c.root)&&(f=t+f),e.commit(f,l,c)}};return Object.defineProperties(n,{getters:{get:r?function(){return e.getters}:function(){return G(e,t)}},state:{get:function(){return E(e.state,i)}}}),n}function G(e,t){if(!e._makeLocalGettersCache[t]){var i={},r=t.length;Object.keys(e.getters).forEach(function(n){if(n.slice(0,r)===t){var o=n.slice(r);Object.defineProperty(i,o,{get:function(){return e.getters[n]},enumerable:!0})}}),e._makeLocalGettersCache[t]=i}return e._makeLocalGettersCache[t]}function X(e,t,i,r){var n=e._mutations[t]||(e._mutations[t]=[]);n.push(function(a){i.call(e,r.state,a)})}function q(e,t,i,r){var n=e._actions[t]||(e._actions[t]=[]);n.push(function(a){var s=i.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},a);return W(s)||(s=Promise.resolve(s)),e._devtoolHook?s.catch(function(u){throw e._devtoolHook.emit("vuex:error",u),u}):s})}function J(e,t,i,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(o){return i(r.state,r.getters,o.state,o.getters)})}function Q(e){M(function(){return e._state.data},function(){},{deep:!0,flush:"sync"})}function E(e,t){return t.reduce(function(i,r){return i[r]},e)}function b(e,t,i){return K(e)&&e.type&&(i=t,t=e,e=e.type),{type:e,payload:t,options:i}}var Z="vuex bindings",j="vuex:mutations",C="vuex:actions",_="vuex",tt=0;function et(e,t){U({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[Z]},function(i){i.addTimelineLayer({id:j,label:"Vuex Mutations",color:I}),i.addTimelineLayer({id:C,label:"Vuex Actions",color:I}),i.addInspector({id:_,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),i.on.getInspectorTree(function(r){if(r.app===e&&r.inspectorId===_)if(r.filter){var n=[];D(n,t._modules.root,r.filter,""),r.rootNodes=n}else r.rootNodes=[N(t._modules.root,"")]}),i.on.getInspectorState(function(r){if(r.app===e&&r.inspectorId===_){var n=r.nodeId;G(t,n),r.state=nt(at(t._modules,n),n==="root"?t.getters:t._makeLocalGettersCache,n)}}),i.on.editInspectorState(function(r){if(r.app===e&&r.inspectorId===_){var n=r.nodeId,o=r.path;n!=="root"&&(o=n.split("/").filter(Boolean).concat(o)),t._withCommit(function(){r.set(t._state.data,o,r.state.value)})}}),t.subscribe(function(r,n){var o={};r.payload&&(o.payload=r.payload),o.state=n,i.notifyComponentUpdate(),i.sendInspectorTree(_),i.sendInspectorState(_),i.addTimelineEvent({layerId:j,event:{time:Date.now(),title:r.type,data:o}})}),t.subscribeAction({before:function(r,n){var o={};r.payload&&(o.payload=r.payload),r._id=tt++,r._time=Date.now(),o.state=n,i.addTimelineEvent({layerId:C,event:{time:r._time,title:r.type,groupId:r._id,subtitle:"start",data:o}})},after:function(r,n){var o={},a=Date.now()-r._time;o.duration={_custom:{type:"duration",display:a+"ms",tooltip:"Action duration",value:a}},r.payload&&(o.payload=r.payload),o.state=n,i.addTimelineEvent({layerId:C,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:o}})}})})}var I=8702998,rt=6710886,it=16777215,L={label:"namespaced",textColor:it,backgroundColor:rt};function $(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function N(e,t){return{id:t||"root",label:$(t),tags:e.namespaced?[L]:[],children:Object.keys(e._children).map(function(i){return N(e._children[i],t+i+"/")})}}function D(e,t,i,r){r.includes(i)&&e.push({id:r||"root",label:r.endsWith("/")?r.slice(0,r.length-1):r||"Root",tags:t.namespaced?[L]:[]}),Object.keys(t._children).forEach(function(n){D(e,t._children[n],i,r+n+"/")})}function nt(e,t,i){t=i==="root"?t:t[i];var r=Object.keys(t),n={state:Object.keys(e.state).map(function(a){return{key:a,editable:!0,value:e.state[a]}})};if(r.length){var o=ot(t);n.getters=Object.keys(o).map(function(a){return{key:a.endsWith("/")?$(a):a,editable:!1,value:O(function(){return o[a]})}})}return n}function ot(e){var t={};return Object.keys(e).forEach(function(i){var r=i.split("/");if(r.length>1){var n=t,o=r.pop();r.forEach(function(a){n[a]||(n[a]={_custom:{value:{},display:a,tooltip:"Module",abstract:!0}}),n=n[a]._custom.value}),n[o]=O(function(){return e[i]})}else t[i]=O(function(){return e[i]})}),t}function at(e,t){var i=t.split("/").filter(function(r){return r});return i.reduce(function(r,n,o){var a=r[n];if(!a)throw new Error('Missing module "'+n+'" for path "'+t+'".');return o===i.length-1?a:a._children},t==="root"?e:e.root._children)}function O(e){try{return e()}catch(t){return t}}var v=function(t,i){this.runtime=i,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=(typeof r=="function"?r():r)||{}},R={namespaced:{configurable:!0}};R.namespaced.get=function(){return!!this._rawModule.namespaced};v.prototype.addChild=function(t,i){this._children[t]=i};v.prototype.removeChild=function(t){delete this._children[t]};v.prototype.getChild=function(t){return this._children[t]};v.prototype.hasChild=function(t){return t in this._children};v.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)};v.prototype.forEachChild=function(t){g(this._children,t)};v.prototype.forEachGetter=function(t){this._rawModule.getters&&g(this._rawModule.getters,t)};v.prototype.forEachAction=function(t){this._rawModule.actions&&g(this._rawModule.actions,t)};v.prototype.forEachMutation=function(t){this._rawModule.mutations&&g(this._rawModule.mutations,t)};Object.defineProperties(v.prototype,R);var m=function(t){this.register([],t,!1)};m.prototype.get=function(t){return t.reduce(function(i,r){return i.getChild(r)},this.root)};m.prototype.getNamespace=function(t){var i=this.root;return t.reduce(function(r,n){return i=i.getChild(n),r+(i.namespaced?n+"/":"")},"")};m.prototype.update=function(t){P([],this.root,t)};m.prototype.register=function(t,i,r){var n=this;r===void 0&&(r=!0);var o=new v(i,r);if(t.length===0)this.root=o;else{var a=this.get(t.slice(0,-1));a.addChild(t[t.length-1],o)}i.modules&&g(i.modules,function(s,u){n.register(t.concat(u),s,r)})};m.prototype.unregister=function(t){var i=this.get(t.slice(0,-1)),r=t[t.length-1],n=i.getChild(r);n&&n.runtime&&i.removeChild(r)};m.prototype.isRegistered=function(t){var i=this.get(t.slice(0,-1)),r=t[t.length-1];return i?i.hasChild(r):!1};function P(e,t,i){if(t.update(i),i.modules)for(var r in i.modules){if(!t.getChild(r))return;P(e.concat(r),t.getChild(r),i.modules[r])}}function ut(e){return new p(e)}var p=function(t){var i=this;t===void 0&&(t={});var r=t.plugins;r===void 0&&(r=[]);var n=t.strict;n===void 0&&(n=!1);var o=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new m(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=o;var a=this,s=this,u=s.dispatch,l=s.commit;this.dispatch=function(h,d){return u.call(a,h,d)},this.commit=function(h,d,F){return l.call(a,h,d,F)},this.strict=n;var c=this._modules.root.state;y(this,c,[],this._modules.root),S(this,c),r.forEach(function(f){return f(i)})},w={state:{configurable:!0}};p.prototype.install=function(t,i){t.provide(i||x,this),t.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:!1;r&&et(t,this)};w.state.get=function(){return this._state.data};w.state.set=function(e){};p.prototype.commit=function(t,i,r){var n=this,o=b(t,i,r),a=o.type,s=o.payload,u={type:a,payload:s},l=this._mutations[a];l&&(this._withCommit(function(){l.forEach(function(f){f(s)})}),this._subscribers.slice().forEach(function(c){return c(u,n.state)}))};p.prototype.dispatch=function(t,i){var r=this,n=b(t,i),o=n.type,a=n.payload,s={type:o,payload:a},u=this._actions[o];if(u){try{this._actionSubscribers.slice().filter(function(c){return c.before}).forEach(function(c){return c.before(s,r.state)})}catch{}var l=u.length>1?Promise.all(u.map(function(c){return c(a)})):u[0](a);return new Promise(function(c,f){l.then(function(h){try{r._actionSubscribers.filter(function(d){return d.after}).forEach(function(d){return d.after(s,r.state)})}catch{}c(h)},function(h){try{r._actionSubscribers.filter(function(d){return d.error}).forEach(function(d){return d.error(s,r.state,h)})}catch{}f(h)})})}};p.prototype.subscribe=function(t,i){return T(t,this._subscribers,i)};p.prototype.subscribeAction=function(t,i){var r=typeof t=="function"?{before:t}:t;return T(r,this._actionSubscribers,i)};p.prototype.watch=function(t,i,r){var n=this;return M(function(){return t(n.state,n.getters)},i,Object.assign({},r))};p.prototype.replaceState=function(t){var i=this;this._withCommit(function(){i._state.data=t})};p.prototype.registerModule=function(t,i,r){r===void 0&&(r={}),typeof t=="string"&&(t=[t]),this._modules.register(t,i),y(this,this.state,t,this._modules.get(t),r.preserveState),S(this,this.state)};p.prototype.unregisterModule=function(t){var i=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var r=E(i.state,t.slice(0,-1));delete r[t[t.length-1]]}),A(this)};p.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)};p.prototype.hotUpdate=function(t){this._modules.update(t),A(this,!0)};p.prototype._withCommit=function(t){var i=this._committing;this._committing=!0,t(),this._committing=i};Object.defineProperties(p.prototype,w);export{ut as c,st as u}; diff --git a/web/dist/assets/whisper-473502c7.js b/web/dist/assets/whisper-473502c7.js new file mode 100644 index 00000000..789df806 --- /dev/null +++ b/web/dist/assets/whisper-473502c7.js @@ -0,0 +1 @@ +import{$ as b,_ as k}from"./index-3489d7cc.js";import{d as B,H as p,e as C,q as N,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";import{S as U,I as V,T as $,b as z,e as I,i as R}from"./naive-ui-eecf2ec3.js";const S={class:"whisper-wrap"},T={class:"whisper-line"},W={class:"whisper-line send-wrap"},j=B({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=U,w=V,f=$,v=z,g=I,y=R;return C(),N(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",S,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",T,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",W,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(j,[["__scopeId","data-v-0cbfe47c"]]);export{H as _}; diff --git a/web/dist/assets/whisper-61451957.css b/web/dist/assets/whisper-61451957.css new file mode 100644 index 00000000..a527d616 --- /dev/null +++ b/web/dist/assets/whisper-61451957.css @@ -0,0 +1 @@ +.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf} diff --git a/web/dist/assets/whisper-add-friend-01aea97d.css b/web/dist/assets/whisper-add-friend-01aea97d.css new file mode 100644 index 00000000..1d423c25 --- /dev/null +++ b/web/dist/assets/whisper-add-friend-01aea97d.css @@ -0,0 +1 @@ +.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf} diff --git a/web/dist/assets/whisper-add-friend-9521d988.js b/web/dist/assets/whisper-add-friend-9521d988.js new file mode 100644 index 00000000..8f3349b6 --- /dev/null +++ b/web/dist/assets/whisper-add-friend-9521d988.js @@ -0,0 +1 @@ +import{N as b,_ as k}from"./index-3489d7cc.js";import{S as B,I as N,T as A,b as C,e as F,i as V}from"./naive-ui-eecf2ec3.js";import{d as W,H as i,e as q,q as z,w as s,j as a,k as n,A as _,x as r}from"./@vue-a481fc63.js";const I={class:"whisper-wrap"},R={class:"whisper-line"},S={class:"whisper-line send-wrap"},T=W({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:d}){const u=p,o=i(""),t=i(!1),l=()=>{d("success")},m=()=>{t.value=!0,b({user_id:u.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",l()}).catch(e=>{t.value=!1})};return(e,c)=>{const h=B,w=N,f=A,g=C,v=F,y=V;return q(),z(y,{show:e.show,"onUpdate:show":l,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",I,[n(f,{"show-icon":!1},{default:s(()=>[_(" 发送添加朋友申请给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",R,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=x=>o.value=x),maxlength:"120","show-count":""},null,8,["value"])]),a("div",S,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(T,[["__scopeId","data-v-60be56a2"]]);export{H as W}; diff --git a/web/dist/assets/xss-a5544f63.js b/web/dist/assets/xss-a5544f63.js new file mode 100644 index 00000000..cee06829 --- /dev/null +++ b/web/dist/assets/xss-a5544f63.js @@ -0,0 +1 @@ +import{l as G}from"./cssfilter-af71ba68.js";var X={exports:{}},o={},x={indexOf:function(r,t){var e,n;if(Array.prototype.indexOf)return r.indexOf(t);for(e=0,n=r.length;e/g,fr=/"/g,lr=/"/g,ur=/&#([a-zA-Z0-9]*);?/gim,cr=/:?/gim,gr=/&newline;?/gim,w=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,k=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,D=/u\s*r\s*l\s*\(.*/gi;function U(r){return r.replace(fr,""")}function m(r){return r.replace(lr,'"')}function N(r){return r.replace(ur,function(e,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10))})}function Q(r){return r.replace(cr,":").replace(gr," ")}function $(r){for(var t="",e=0,n=r.length;e",n);if(a===-1)break;e=a+3}return t}function Tr(r){var t=r.split("");return t=t.filter(function(e){var n=e.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0}),t.join("")}o.whiteList=W();o.getDefaultWhiteList=W;o.onTag=er;o.onIgnoreTag=tr;o.onTagAttr=nr;o.onIgnoreTagAttr=ir;o.safeAttrValue=ar;o.escapeHtml=H;o.escapeQuote=U;o.unescapeQuote=m;o.escapeHtmlEntities=N;o.escapeDangerHtml5Entities=Q;o.clearNonPrintableCharacter=$;o.friendlyAttrValue=q;o.escapeAttrValue=z;o.onIgnoreTagStripAll=pr;o.StripTagBody=vr;o.stripCommentTag=dr;o.stripBlankChar=Tr;o.cssFilter=B;o.getDefaultCSSWhiteList=rr;var P={},h=x;function Ar(r){var t=h.spaceIndex(r);if(t===-1)var e=r.slice(1,-1);else var e=r.slice(1,t+1);return e=h.trim(e).toLowerCase(),e.slice(0,1)==="/"&&(e=e.slice(1)),e.slice(-1)==="/"&&(e=e.slice(0,-1)),e}function hr(r){return r.slice(0,2)===""){n+=e(r.slice(a,f)),c=r.slice(f,i+1),l=Ar(c),n+=t(f,n.length,l,c,hr(c)),a=i+1,f=!1;continue}if(g==='"'||g==="'")for(var A=1,v=r.charAt(i-A);v.trim()===""||v==="=";){if(v==="="){s=g;continue r}v=r.charAt(i-++A)}}else if(g===s){s=!1;continue}}return a0;t--){var e=r[t];if(e!==" ")return e==="="?t:-1}}function wr(r){return r[0]==='"'&&r[r.length-1]==='"'||r[0]==="'"&&r[r.length-1]==="'"}function V(r){return wr(r)?r.substr(1,r.length-2):r}P.parseTag=Er;P.parseAttr=Ir;var Cr=G.FilterCSS,p=o,Z=P,yr=Z.parseTag,Lr=Z.parseAttr,y=x;function C(r){return r==null}function Pr(r){var t=y.spaceIndex(r);if(t===-1)return{html:"",closing:r[r.length-2]==="/"};r=y.trim(r.slice(t+1,-1));var e=r[r.length-1]==="/";return e&&(r=y.trim(r.slice(0,-1))),{html:r,closing:e}}function Rr(r){var t={};for(var e in r)t[e]=r[e];return t}function M(r){r=Rr(r||{}),r.stripIgnoreTag&&(r.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),r.onIgnoreTag=p.onIgnoreTagStripAll),r.whiteList=r.whiteList||r.allowList||p.whiteList,r.onTag=r.onTag||p.onTag,r.onTagAttr=r.onTagAttr||p.onTagAttr,r.onIgnoreTag=r.onIgnoreTag||p.onIgnoreTag,r.onIgnoreTagAttr=r.onIgnoreTagAttr||p.onIgnoreTagAttr,r.safeAttrValue=r.safeAttrValue||p.safeAttrValue,r.escapeHtml=r.escapeHtml||p.escapeHtml,this.options=r,r.css===!1?this.cssFilter=!1:(r.css=r.css||{},this.cssFilter=new Cr(r.css))}M.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var t=this,e=t.options,n=e.whiteList,a=e.onTag,f=e.onIgnoreTag,s=e.onTagAttr,i=e.onIgnoreTagAttr,u=e.safeAttrValue,l=e.escapeHtml,c=t.cssFilter;e.stripBlankChar&&(r=p.stripBlankChar(r)),e.allowCommentTag||(r=p.stripCommentTag(r));var g=!1;if(e.stripIgnoreTagBody){var g=p.StripTagBody(e.stripIgnoreTagBody,f);f=g.onIgnoreTag}var A=yr(r,function(v,J,d,T,K){var b={sourcePosition:v,position:J,isClosing:K,isWhite:n.hasOwnProperty(d)},I=a(d,T,b);if(!C(I))return I;if(b.isWhite){if(b.isClosing)return"";var O=Pr(T),Y=n[d],F=Lr(O.html,function(E,S){var R=y.indexOf(Y,E)!==-1,_=s(d,E,S,R);if(!C(_))return _;if(R)return S=u(d,E,S,c),S?E+'="'+S+'"':E;var _=i(d,E,S,R);return C(_)?void 0:_}),T="<"+d;return F&&(T+=" "+F),O.closing&&(T+=" /"),T+=">",T}else{var I=f(d,T,b);return C(I)?l(T):I}},l);return g&&(A=g.remove(A)),A};var Xr=M;(function(r,t){var e=o,n=P,a=Xr;function f(u,l){var c=new a(l);return c.process(u)}t=r.exports=f,t.filterXSS=f,t.FilterXSS=a;for(var s in e)t[s]=e[s];for(var s in n)t[s]=n[s];typeof window<"u"&&(window.filterXSS=r.exports);function i(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}i()&&(self.filterXSS=r.exports)})(X,X.exports);var xr=X.exports;export{xr as l}; diff --git a/web/dist/index.html b/web/dist/index.html index 86d8c5c3..f22ccc13 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,27 +8,28 @@ 泡泡 - - - - + + + + - - + + - + - - - + + + + diff --git a/web/package.json b/web/package.json index 3d5444cd..0685720e 100644 --- a/web/package.json +++ b/web/package.json @@ -9,6 +9,7 @@ "tauri": "tauri" }, "dependencies": { + "@opentiny/vue-slide-bar": "^3.10.0", "@vicons/carbon": "^0.12.0", "@vicons/fa": "^0.12.0", "@vicons/ionicons5": "^0.12.0", @@ -16,7 +17,7 @@ "@vicons/tabler": "^0.12.0", "axios": "^1.4.0", "copy-to-clipboard": "^3.3.3", - "less": "^4.1.3", + "less": "^4.2.0", "lodash": "^4.17.21", "moment": "^2.29.4", "naive-ui": "^2.34.4", @@ -32,12 +33,12 @@ }, "devDependencies": { "@tauri-apps/cli": "^1.4.0", - "@types/node": "^18.16.0", + "@types/node": "^18.17.1", "@types/qrcode": "^1.5.1", - "@vitejs/plugin-vue": "^4.2.3", + "@vitejs/plugin-vue": "^4.3.3", "@vue/compiler-sfc": "^3.3.4", "rollup-plugin-visualizer": "^5.9.2", - "typescript": "^5.1.6", - "vite": "^4.4.6" + "typescript": "^5.2.2", + "vite": "^4.4.9" } } diff --git a/web/src-tauri/tauri.conf.json b/web/src-tauri/tauri.conf.json index 39bc1a8e..a84e6589 100644 --- a/web/src-tauri/tauri.conf.json +++ b/web/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "Paopao", - "version": "0.2.0" + "version": "0.3.0" }, "build": { "distDir": "../dist", @@ -62,8 +62,8 @@ "windows": [ { "title": "泡泡 | 一个清新文艺的微社区", - "width": 1080, - "height": 860, + "width": 1140, + "height": 960, "resizable": false, "fullscreen": false, "transparent": true, diff --git a/web/src/App.vue b/web/src/App.vue index c19e49d1..36b9ec92 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -43,12 +43,28 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/web/src/components/tag-item.vue b/web/src/components/tag-item.vue index aa7d8b8c..dc5e5cee 100644 --- a/web/src/components/tag-item.vue +++ b/web/src/components/tag-item.vue @@ -23,7 +23,7 @@ ({{ tag.quote_num }}) ({{ tag.quote_num }}) @@ -57,6 +57,7 @@ import { ref, onMounted, computed } from 'vue'; import { MoreVertOutlined } from '@vicons/material'; import type { DropdownOption } from 'naive-ui'; import { stickTopic, followTopic, unfollowTopic } from '@/api/post'; +import defaultUserAvatar from '@/assets/img/logo.png'; const hasFollowing= ref(false); const props = withDefaults( @@ -68,6 +69,15 @@ const props = withDefaults( {} ); +const tagUserAvatar = computed(() => { + if (props.tag.user) { + return props.tag.user.avatar + } else { + return defaultUserAvatar + } +}) + + const tagOptions = computed(() => { let options: DropdownOption[] = []; if (props.tag.is_following === 0) { diff --git a/web/src/store/index.ts b/web/src/store/index.ts index 02ac21aa..2e490fb1 100644 --- a/web/src/store/index.ts +++ b/web/src/store/index.ts @@ -1,4 +1,3 @@ -import { stat } from "fs"; import { createStore } from "vuex"; export default createStore({ @@ -12,6 +11,7 @@ export default createStore({ desktopModelShow: document.body.clientWidth > 821, authModalShow: false, authModelTab: "signin", + unreadMsgCount: 0, userLogined: false, userInfo: { id: 0, @@ -20,6 +20,28 @@ export default createStore({ created_on: 0, follows: 0, followings: 0, + tweets_count: 0, + is_admin: false, + }, + profile: { + useFriendship: true, + enableTrendsBar: true, + enableWallet: false, + allowTweetAttachment: true, + allowTweetAttachmentPrice: true, + allowTweetVideo: true, + allowUserRegister: true, + allowPhoneBind: true, + defaultTweetMaxLength: 2000, + tweetWebEllipsisSize: 400, + tweetMobileEllipsisSize: 300, + defaultTweetVisibility: "friend", + defaultMsgLoopInterval: 5000, + copyrightTop: "2023 paopao.info", + copyrightLeft: "Roc's Me", + copyrightLeftLink: "", + copyrightRight: "泡泡(PaoPao)开源社区", + copyrightRightLink: "https://www.paopao.info", }, }, mutations: { @@ -29,6 +51,9 @@ export default createStore({ refreshTopicFollow(state) { state.refreshTopicFollow = Date.now(); }, + updateUnreadMsgCount(state, count) { + state.unreadMsgCount = count; + }, triggerTheme(state, theme) { state.theme = theme; }, @@ -52,6 +77,110 @@ export default createStore({ state.userLogined = true; } }, + loadDefaultSiteProfile(state) { + state.profile.useFriendship = + import.meta.env.VITE_USE_FRIENDSHIP.toLowerCase() === "true"; + + state.profile.enableTrendsBar = + import.meta.env.VITE_ENABLE_TRENDS_BAR.toLowerCase() === "true"; + + state.profile.enableWallet = + import.meta.env.VITE_ENABLE_WALLET.toLocaleLowerCase() === "true"; + + state.profile.allowTweetAttachment = + import.meta.env.VITE_ALLOW_TWEET_ATTACHMENT.toLowerCase() === "true"; + + state.profile.allowTweetAttachmentPrice = + import.meta.env.VITE_ALLOW_TWEET_ATTACHMENT_PRICE.toLowerCase() === + "true"; + + state.profile.allowTweetVideo = + import.meta.env.VITE_ALLOW_TWEET_VIDEO.toLowerCase() === "true"; + + state.profile.allowUserRegister = + import.meta.env.VITE_ALLOW_USER_REGISTER.toLowerCase() === "true"; + + state.profile.allowPhoneBind = + import.meta.env.VITE_ALLOW_PHONE_BIND.toLowerCase() === "true"; + + state.profile.defaultTweetMaxLength = Number( + import.meta.env.VITE_DEFAULT_TWEET_MAX_LENGTH + ); + + state.profile.tweetWebEllipsisSize = Number( + import.meta.env.VITE_TWEET_WEB_ELLIPSIS_SIZE + ); + + state.profile.tweetMobileEllipsisSize = Number( + import.meta.env.VITE_TWEET_MOBILE_ELLIPSIS_SIZE + ); + + state.profile.defaultTweetVisibility = + import.meta.env.VITE_DEFAULT_TWEET_VISIBILITY.toLowerCase(); + + state.profile.defaultMsgLoopInterval = Number( + import.meta.env.VITE_DEFAULT_MSG_LOOP_INTERVAL + ); + + state.profile.copyrightTop = import.meta.env.VITE_COPYRIGHT_TOP; + + state.profile.copyrightLeft = import.meta.env.VITE_COPYRIGHT_LEFT; + + state.profile.copyrightLeftLink = + import.meta.env.VITE_COPYRIGHT_LEFT_LINK; + + state.profile.copyrightRight = import.meta.env.VITE_COPYRIGHT_RIGHT; + state.profile.copyrightRightLink = + import.meta.env.VITE_COPYRIGHT_RIGHT_LINK; + }, + updateSiteProfile(state, data) { + const p = state.profile; + state.profile.useFriendship = data.use_friendship ?? p.useFriendship; + + state.profile.enableTrendsBar = + data.enable_trends_bar ?? p.enableTrendsBar; + + state.profile.enableWallet = data.enable_wallet ?? p.enableWallet; + + state.profile.allowTweetAttachment = + data.allow_tweet_attachment ?? p.allowTweetAttachment; + + state.profile.allowTweetAttachmentPrice = + data.allow_tweet_attachment_price ?? p.allowTweetAttachmentPrice; + + state.profile.allowTweetVideo = + data.allow_tweet_video ?? p.allowTweetVideo; + + state.profile.allowUserRegister = + data.allow_user_register ?? p.allowUserRegister; + + state.profile.allowPhoneBind = data.allow_phone_bind ?? p.allowPhoneBind; + + state.profile.defaultTweetMaxLength = + data.default_tweet_max_length ?? p.defaultTweetMaxLength; + + state.profile.tweetWebEllipsisSize = + data.tweet_web_ellipsis_size ?? p.tweetWebEllipsisSize; + + state.profile.tweetMobileEllipsisSize = + data.tweet_mobile_ellipsis_size ?? p.tweetMobileEllipsisSize; + + state.profile.defaultTweetVisibility = + data.default_tweet_visibility ?? p.defaultTweetVisibility; + + state.profile.defaultMsgLoopInterval = + data.default_msg_loop_interval ?? p.defaultMsgLoopInterval; + + state.profile.copyrightTop = data.copyright_top ?? p.copyrightTop; + state.profile.copyrightLeft = data.copyright_left ?? p.copyrightLeft; + + state.profile.copyrightLeftLink = + data.copyright_left_link ?? p.copyrightLeftLink; + + state.profile.copyrightRight = data.copyright_right ?? p.copyrightRight; + state.profile.copyrightRightLink = + data.copyright_right_link ?? p.copyrightRightLink; + }, userLogout(state) { localStorage.removeItem("PAOPAO_TOKEN"); state.userInfo = { @@ -61,6 +190,8 @@ export default createStore({ created_on: 0, follows: 0, followings: 0, + tweets_count: 0, + is_admin: false, }; state.userLogined = false; }, diff --git a/web/src/types/Item.d.ts b/web/src/types/Item.d.ts index 41afc932..4d4a58f3 100644 --- a/web/src/types/Item.d.ts +++ b/web/src/types/Item.d.ts @@ -24,6 +24,8 @@ declare module Item { follows: number; /** 粉丝数 */ followings: number; + /** 推文数 */ + tweets_count?: number; /** 用户余额(分) */ balance?: number; /** 用户状态 */ @@ -70,6 +72,8 @@ declare module Item { ip?: string; /** 评论者城市地址 */ ip_loc: string; + /** 是否精选 */ + is_essence: import("@/utils/IEnum").YesNoEnum; /** 点赞数 */ thumbs_up_count: number; /** 是否点赞,0为未点赞,1为已点赞 */ @@ -140,6 +144,22 @@ declare module Item { created_on: number; } + interface IndexTrendsItem { + nickname: string; + username: string; + avatar: string; + is_fresh: boolean; + } + + /** slide bar item */ + interface SlideBarItem { + title: string; + style: number; + username: string; + avatar: string; + show: boolean; + } + /** 帖子内容 */ interface PostItemProps { /** 内容ID */ @@ -241,6 +261,8 @@ declare module Item { sender_user: UserInfo; /** 接收方UID */ receiver_user_id: number; + /** 接收人用户数据 */ + receiver_user: UserInfo; /** 帖子ID */ post_id: number; /** 帖子内容 */ diff --git a/web/src/types/NetParams.d.ts b/web/src/types/NetParams.d.ts index 0e2dc7eb..3539bb55 100644 --- a/web/src/types/NetParams.d.ts +++ b/web/src/types/NetParams.d.ts @@ -37,7 +37,12 @@ declare module NetParams { interface UserGetUnreadMsgCount {} + interface ReadMessageReq { + id: number; + } + interface UserGetMessages { + style: "all" | "system" | "whisper" | "requesting" | "unread"; page: number; page_size: number; } @@ -63,6 +68,8 @@ declare module NetParams { status: number; } + interface SiteInfoReq {} + interface FollowUserReq { user_id: number; } @@ -119,6 +126,11 @@ declare module NetParams { page_size: number; } + interface IndexTrendsReq { + page: number; + page_size: number; + } + interface GetUserFollows { username: string; page: number; @@ -150,6 +162,7 @@ declare module NetParams { interface PostGetPosts { query: string | null; type: string; + style: "newest" | "hots" | "following" | "search"; page: number; page_size: number; } @@ -196,7 +209,7 @@ declare module NetParams { interface PostGetPostComments { id: number; - sort_strategy: "default" | "newest"; + style: "default" | "hots" | "newest"; page?: number; page_size?: number; } @@ -244,6 +257,10 @@ declare module NetParams { id: number; } + interface PostHighlightComment { + id: number; + } + interface PostCreateCommentReply { /** 艾特的用户UID */ at_user_id: number; diff --git a/web/src/types/NetReq.d.ts b/web/src/types/NetReq.d.ts index e4f964c8..76cb7907 100644 --- a/web/src/types/NetReq.d.ts +++ b/web/src/types/NetReq.d.ts @@ -41,6 +41,10 @@ declare module NetReq { count: number; } + interface ReadMessageResp {} + + interface ReadAllMessageResp {} + interface UserGetMessages { /** 消息列表 */ list: Item.MessageProps[]; @@ -86,6 +90,13 @@ declare module NetReq { interface UserChangeStatus {} + interface SiteInfoResp { + register_user_count: number; + online_user_count: number; + history_max_online: number; + server_up_time: number; + } + interface FollowUserResp {} interface UnfollowUserResp {} @@ -167,6 +178,10 @@ declare module NetReq { interface PostDeleteComment {} + interface PostHighlightComment { + highlight_status: import("@/utils/IEnum").YesNoEnum; + } + type PostCreateCommentReply = Item.ReplyProps; interface PostDeleteCommentReply {} @@ -178,6 +193,11 @@ declare module NetReq { pager: Item.PagerProps; } + interface IndexTrendsResp { + list: Item.IndexTrendsItem[]; + pager: Item.PagerProps; + } + interface PostStickTopic { /** 置顶状态:0为未置顶,1为置顶 */ top_status: 0 | 1; @@ -186,4 +206,24 @@ declare module NetReq { interface PostFollowTopic {} interface PostUnfollowTopic {} + + interface SiteProfile { + use_friendship?: boolean; + enable_trends_bar?: boolean; + enable_wallet?: boolean; + allow_tweet_attachment?: boolean; + allow_tweet_attachment_price?: boolean; + allow_tweet_video?: boolean; + allow_user_register?: boolean; + allow_phone_bind?: boolean; + default_tweet_max_length?: number; + default_tweet_ellipsis_size?: number; + default_tweet_visibility?: string; + default_msg_loop_interval?: number; + copyright_top?: string; + copyright_left?: string; + copyright_left_link?: string; + copyright_right?: string; + copyright_right_link?: string; + } } diff --git a/web/src/utils/IEnum.ts b/web/src/utils/IEnum.ts index 1ae3829a..4ab792e9 100644 --- a/web/src/utils/IEnum.ts +++ b/web/src/utils/IEnum.ts @@ -79,6 +79,8 @@ export enum VisibilityEnum { PRIVATE, /** 好友可见 */ FRIEND, + /** 关注可见 */ + Following, } /** 二态枚举 */ diff --git a/web/src/utils/content.ts b/web/src/utils/content.ts index f48e55be..a240b285 100644 --- a/web/src/utils/content.ts +++ b/web/src/utils/content.ts @@ -28,3 +28,47 @@ export const parsePostTag = (content: string) => { }); return { content, tags, users }; }; + +export const preparePost = (content: string, hint: string, maxSize: number) => { + let isEllipsis = false; + if (content.length > maxSize) { + content = content.substring(0, maxSize); + isEllipsis = true; + let latestChar = content.charAt(maxSize - 1); + if (latestChar == "#" || latestChar == "#" || latestChar == "@") { + content = content.substring(0, maxSize - 1); + } + } + const tagExp = /(#|#)([^#@\s])+?\s+?/g; // 这⾥中⽂#和英⽂#都会识别 + const atExp = /@([a-zA-Z0-9])+?\s+?/g; // 这⾥中⽂#和英⽂#都会识别 + content = content + .replace(/<[^>]*?>/gi, "") + .replace(/(.*?)<\/[^>]*?>/gi, "") + .replace(tagExp, (item) => { + return ( + '' + + item.trim() + + " " + ); + }) + .replace(atExp, (item) => { + return ( + '' + + item.trim() + + " " + ); + }); + if (isEllipsis) { + content = + content.trimEnd() + + " ..." + + '' + + hint + + " "; + } + return content; +}; diff --git a/web/src/utils/count.ts b/web/src/utils/count.ts new file mode 100644 index 00000000..c36873ec --- /dev/null +++ b/web/src/utils/count.ts @@ -0,0 +1,8 @@ +export const prettyQuoteNum = (num: number) => { + if (num >= 1000) { + return (num / 1000).toFixed(1) + "千"; + } else if (num >= 10000) { + return (num / 10000).toFixed(1) + "万"; + } + return num; +}; diff --git a/web/src/utils/formatTime.ts b/web/src/utils/formatTime.ts index da1499de..98ab61f1 100644 --- a/web/src/utils/formatTime.ts +++ b/web/src/utils/formatTime.ts @@ -10,6 +10,10 @@ export const formatTime = (time: number) => { return moment.unix(time).utc(true).format("YYYY-MM-DD HH:mm"); }; +export const formatHumanTime = (time: number) => { + return moment().from(moment.unix(time)); +}; + export const formatRelativeTime = (time: number) => { return moment.unix(time).fromNow(); }; diff --git a/web/src/views/Collection.vue b/web/src/views/Collection.vue index f12ffb76..26807744 100644 --- a/web/src/views/Collection.vue +++ b/web/src/views/Collection.vue @@ -3,7 +3,7 @@ -
+
@@ -13,62 +13,151 @@
- +
- +
+ + - -
- -
+ + + + +
\ No newline at end of file + diff --git a/web/src/views/Messages.vue b/web/src/views/Messages.vue index 3fb84b79..18fa1ef8 100644 --- a/web/src/views/Messages.vue +++ b/web/src/views/Messages.vue @@ -3,62 +3,348 @@ -
+ + + +
+ + + {{ store.state.unreadMsgCount }} 条未读 + + + 全标已读 +
+
+ + + + {{ messageStyle }} + + +
+
+
-
- - - - +
+ + + +
-
- -
+ + + + +