k2-im 0.1.42 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +1 -1
- package/dist/chat-kit-pinia.d.ts +128 -39
- package/dist/chat-kit-pinia.js +1 -1
- package/dist/chat-kit-vue.d.ts +41 -2
- package/dist/chat-kit-vue.js +1 -1
- package/dist/chat-kit.d.ts +128 -39
- package/dist/chat-kit.js +1 -1
- package/dist/{chunk-B4SOXSDP.js → chunk-7HVSGFV2.js} +1 -1
- package/dist/{chunk-GQHGZRFP.js → chunk-EZUXTJ2D.js} +1 -1
- package/dist/chunk-I5M7SVQU.js +1 -0
- package/dist/chunk-SVYZRVHS.js +7 -0
- package/dist/chunk-XEAIJXWV.js +1 -0
- package/dist/chunk-XNBJ3NXF.js +2 -0
- package/dist/chunk-YP6KFYYU.js +2 -0
- package/dist/i18n.d.ts +47 -5
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +135 -40
- package/dist/index.js +1 -1
- package/dist/sdk.d.ts +128 -37
- package/dist/sdk.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CVLKJADF.js +0 -1
- package/dist/chunk-J77L6JLQ.js +0 -2
- package/dist/chunk-PPXQWMHO.js +0 -1
- package/dist/chunk-SVA6OESM.js +0 -2
- package/dist/chunk-YNYTR73D.js +0 -7
package/dist/sdk.d.ts
CHANGED
|
@@ -47,8 +47,8 @@ interface ConversationDraft$1 {
|
|
|
47
47
|
attachments: readonly [];
|
|
48
48
|
updatedAt: number;
|
|
49
49
|
}
|
|
50
|
-
/** 消息内容类型。sticker=表情/贴图(BMessage contentType=7);call=单聊通话记录(contentType=10);transfer=转账(contentType=16);gift=礼品/刮刮卡(contentType=17);robot=机器人卡片(contentType=18);miniProgram=小程序分享卡(contentType=22);redPacket=红包卡(contentType=25);game=小游戏(contentType=27);未知 wire 正文统一归一为 unknown。 */
|
|
51
|
-
type MessageContentType = 'text' | 'system' | 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'contact' | 'miniProgram' | 'game' | 'transfer' | 'gift' | 'call' | 'redPacket' | 'mediaAlbum' | 'filesAlbum' | 'robot' | 'unknown';
|
|
50
|
+
/** 消息内容类型。sticker=表情/贴图(BMessage contentType=7);call=单聊通话记录(contentType=10);transfer=转账(contentType=16);gift=礼品/刮刮卡(contentType=17);robot=机器人卡片(contentType=18);miniProgram=小程序分享卡(contentType=22);redPacket=红包卡(contentType=25);game=小游戏(contentType=27);liveRoom=直播间分享(contentType=30);未知 wire 正文统一归一为 unknown。 */
|
|
51
|
+
type MessageContentType = 'text' | 'system' | 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'contact' | 'miniProgram' | 'game' | 'transfer' | 'gift' | 'call' | 'redPacket' | 'mediaAlbum' | 'filesAlbum' | 'robot' | 'liveRoom' | 'unknown';
|
|
52
52
|
/**
|
|
53
53
|
* 发送态(客户端态):消息从本地创建到服务端确认的生命周期。
|
|
54
54
|
* `uploading` 仅媒体消息使用:文件上传阶段(uploading→pending→sending→sent);
|
|
@@ -119,6 +119,8 @@ type LastMessageSummary = {
|
|
|
119
119
|
kind: 'transfer';
|
|
120
120
|
} | {
|
|
121
121
|
kind: 'gift';
|
|
122
|
+
} | {
|
|
123
|
+
kind: 'liveRoom';
|
|
122
124
|
} | {
|
|
123
125
|
kind: 'call';
|
|
124
126
|
callKind: ImCallKind;
|
|
@@ -617,6 +619,40 @@ interface ImMediaAlbumBody {
|
|
|
617
619
|
/** 媒体项,顺序即用户选择顺序(决定宫格 index 与首项朝向)。 */
|
|
618
620
|
items: readonly ImMediaAlbumItem[];
|
|
619
621
|
}
|
|
622
|
+
/** 直播间分享的直播类型。wire `liveType`:1 视频、2 语音、3 双手机、4 单手机录屏、5 语聊房。 */
|
|
623
|
+
type ImLiveRoomType = 'video' | 'voice' | 'dual-phone' | 'screen-record' | 'voice-chat';
|
|
624
|
+
/** 直播间分享的房间状态。wire `liveRoomStatus`:1 预告、2 直播中、3 已结束。 */
|
|
625
|
+
type ImLiveRoomStatus = 'preview' | 'live' | 'ended';
|
|
626
|
+
/**
|
|
627
|
+
* 直播间分享卡片正文(contentType==='liveRoom',协议 BMessage.contentType=30,fields 98-112)。
|
|
628
|
+
*
|
|
629
|
+
* @remarks 调用方先拿到直播间快照再写入本结构。Core 不请求直播接口,也不把缺省枚举猜成某一种直播。
|
|
630
|
+
* `uid` 是声网 SDK 初始化用的 UID,不是 IM 用户 id。
|
|
631
|
+
*/
|
|
632
|
+
interface ImLiveRoomBody {
|
|
633
|
+
/** 直播间 ID(BMessage.liveRoomId)。 */
|
|
634
|
+
liveRoomId: string;
|
|
635
|
+
liveType: ImLiveRoomType;
|
|
636
|
+
liveRoomStatus: ImLiveRoomStatus;
|
|
637
|
+
/** 当前账号是否已关注主播。协议 bool 无法区分未设置,false 也是有效状态。 */
|
|
638
|
+
isFocus: boolean;
|
|
639
|
+
/** 当前账号是否已预约这场直播。 */
|
|
640
|
+
isReservation: boolean;
|
|
641
|
+
liveRecordId?: string;
|
|
642
|
+
/** 画面比例原文,例如 `16:9`。 */
|
|
643
|
+
screenRatio?: string;
|
|
644
|
+
broadcasterUserId?: string;
|
|
645
|
+
broadcasterUserName?: string;
|
|
646
|
+
/** 声网 SDK 初始化 UID(BMessage.uid)。 */
|
|
647
|
+
uid?: string;
|
|
648
|
+
liveCover?: string;
|
|
649
|
+
liveRoomName?: string;
|
|
650
|
+
/** 预告时间,秒级时间戳的十进制字符串。 */
|
|
651
|
+
livePreviewTime?: string;
|
|
652
|
+
livePreviewId?: string;
|
|
653
|
+
/** 直播间人数字符串,保持协议原文,不在 Core 换算。 */
|
|
654
|
+
liveRoomViewers?: string;
|
|
655
|
+
}
|
|
620
656
|
interface ImMessageBody {
|
|
621
657
|
/** P0 文本内容(明文,解密后的结果)。 */
|
|
622
658
|
text?: string;
|
|
@@ -652,6 +688,8 @@ interface ImMessageBody {
|
|
|
652
688
|
filesAlbum?: ImFilesAlbumBody;
|
|
653
689
|
/** contentType==='robot' 时的机器人卡片。 */
|
|
654
690
|
robot?: ImRobotBody;
|
|
691
|
+
/** contentType==='liveRoom' 时的直播间分享卡片。 */
|
|
692
|
+
liveRoom?: ImLiveRoomBody;
|
|
655
693
|
/** contentType==='unknown' 时的稳定未知正文,不含原始 wire type。 */
|
|
656
694
|
unknown?: UnknownMessageBody;
|
|
657
695
|
}
|
|
@@ -2061,6 +2099,8 @@ interface MessageWindowInfo {
|
|
|
2061
2099
|
* true = 处于「历史定位窗口」:新实时消息不追加进本窗口(避免跨缺口断层),宿主应据此把「跳到最新」改为重新 open() 最新页。
|
|
2062
2100
|
*/
|
|
2063
2101
|
hasNewer: boolean;
|
|
2102
|
+
/** 已启用远端连续分页;定位调用方需先补齐锚点前后文,不能把本地散点当成连续页。 */
|
|
2103
|
+
remotePagination?: true;
|
|
2064
2104
|
}
|
|
2065
2105
|
interface MessageWindowPage {
|
|
2066
2106
|
/** 本次操作面向的会话 id;宿主据此与当前选中会话比对做二次守卫。 */
|
|
@@ -2846,6 +2886,10 @@ interface TransferMessageOptions {
|
|
|
2846
2886
|
interface GiftMessageOptions {
|
|
2847
2887
|
replyToMessageId?: string;
|
|
2848
2888
|
}
|
|
2889
|
+
/** 直播间分享卡发送选项;正文由调用方提供,Core 不补默认直播类型。 */
|
|
2890
|
+
interface LiveRoomMessageOptions {
|
|
2891
|
+
replyToMessageId?: string;
|
|
2892
|
+
}
|
|
2849
2893
|
/**
|
|
2850
2894
|
* 媒体合集里的一项:一张图片或一个视频。
|
|
2851
2895
|
*
|
|
@@ -3059,6 +3103,36 @@ interface ImDirectorySearchApi {
|
|
|
3059
3103
|
search: (keyword: string) => Promise<ImDirectorySearchResult>;
|
|
3060
3104
|
}
|
|
3061
3105
|
|
|
3106
|
+
/** 回源失败的原因与能否重试。 */
|
|
3107
|
+
interface MessagesByIdFailure {
|
|
3108
|
+
/**
|
|
3109
|
+
* 能否稍后重试。
|
|
3110
|
+
*
|
|
3111
|
+
* 服务端错误、网络异常和登录过期都算可以重试;无权限(已退群或已退出频道)和参数错误是终态,
|
|
3112
|
+
* 再试多少次结果都一样,调用方应该停下来而不是反复打接口。
|
|
3113
|
+
*/
|
|
3114
|
+
retryable: boolean;
|
|
3115
|
+
/** 原始错误,供诊断与上报。 */
|
|
3116
|
+
error: unknown;
|
|
3117
|
+
}
|
|
3118
|
+
/** 回源的汇总结果。三组 id 互不重叠,合起来覆盖调用方传入的全部有效 id。 */
|
|
3119
|
+
interface ImMessagesByIdResult<TMessage> {
|
|
3120
|
+
/** 成功取回的消息。已经进了本地历史,后续本地查询就能命中。 */
|
|
3121
|
+
readonly messages: readonly TMessage[];
|
|
3122
|
+
/**
|
|
3123
|
+
* 服务端确认没有这些消息:已被删除、超出保留期被清理,或对当前用户不可见。
|
|
3124
|
+
* 这是终态,调用方应记下来并停止重试。
|
|
3125
|
+
*/
|
|
3126
|
+
readonly missingMessageIds: readonly string[];
|
|
3127
|
+
/**
|
|
3128
|
+
* 这次没取到、但不代表不存在的消息 id(请求失败了)。
|
|
3129
|
+
* 是否值得再试看 `failure.retryable`。
|
|
3130
|
+
*/
|
|
3131
|
+
readonly unresolvedMessageIds: readonly string[];
|
|
3132
|
+
/** `unresolvedMessageIds` 非空时的失败原因;全部取到或全部确认缺失时不存在。 */
|
|
3133
|
+
readonly failure?: MessagesByIdFailure;
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3062
3136
|
/**
|
|
3063
3137
|
* SDK 内部 CHANNEL sibling:装配资料、成员、申请、置顶、历史限制与通知修复能力。
|
|
3064
3138
|
*
|
|
@@ -3211,6 +3285,15 @@ interface ImContactSearchResult {
|
|
|
3211
3285
|
age?: number;
|
|
3212
3286
|
relationship: ImContactRelationship;
|
|
3213
3287
|
}
|
|
3288
|
+
/** 当前账号黑名单中的一名用户;不暴露关系记录 id、status 等后端字段。 */
|
|
3289
|
+
interface ImBlockedContact {
|
|
3290
|
+
userId: string;
|
|
3291
|
+
/** 优先当前账号设置的备注,没有备注时为对方昵称。 */
|
|
3292
|
+
displayName: string;
|
|
3293
|
+
nickname: string;
|
|
3294
|
+
remark?: string;
|
|
3295
|
+
avatarUrl?: string;
|
|
3296
|
+
}
|
|
3214
3297
|
/** 好友申请提交结果;调用成功不等于一定需要对端审核。 */
|
|
3215
3298
|
interface ImFriendshipRequestResult {
|
|
3216
3299
|
status: 'sent' | 'added' | 'already-friend';
|
|
@@ -3250,6 +3333,15 @@ interface ImContactApi extends ImDirectoryApi<'individual'> {
|
|
|
3250
3333
|
}) => Promise<ImFriendshipRequestResult>;
|
|
3251
3334
|
/** 远端确认后加入黑名单,并清理该用户的本机 direct 会话和聊天数据。 */
|
|
3252
3335
|
blockUser: (userId: string) => Promise<void>;
|
|
3336
|
+
/** 读取当前账号的黑名单;结果直接来自服务端,空数组表示名单为空。 */
|
|
3337
|
+
listBlocked: () => Promise<readonly ImBlockedContact[]>;
|
|
3338
|
+
/**
|
|
3339
|
+
* 远端确认后把用户移出黑名单。
|
|
3340
|
+
*
|
|
3341
|
+
* @remarks 移出后双方是否恢复为好友由服务端决定,SDK 不猜:本地关系先改为 `unknown`,
|
|
3342
|
+
* 再强制查询服务端关系并刷新资料。拉黑时已删除的 direct 会话和聊天记录不会恢复。
|
|
3343
|
+
*/
|
|
3344
|
+
unblockUser: (userId: string) => Promise<void>;
|
|
3253
3345
|
/** 提交联系人举报;该操作不修改好友关系、会话或本地资料。 */
|
|
3254
3346
|
reportUser: (userId: string, problem: string) => Promise<void>;
|
|
3255
3347
|
/**
|
|
@@ -3996,6 +4088,8 @@ type ConversationLastMessageSummary = {
|
|
|
3996
4088
|
kind: 'transfer';
|
|
3997
4089
|
} | {
|
|
3998
4090
|
kind: 'gift';
|
|
4091
|
+
} | {
|
|
4092
|
+
kind: 'liveRoom';
|
|
3999
4093
|
} | {
|
|
4000
4094
|
kind: 'redPacket';
|
|
4001
4095
|
} | {
|
|
@@ -4382,36 +4476,6 @@ interface ImExpressionsApi {
|
|
|
4382
4476
|
};
|
|
4383
4477
|
}
|
|
4384
4478
|
|
|
4385
|
-
/** 回源失败的原因与能否重试。 */
|
|
4386
|
-
interface MessagesByIdFailure {
|
|
4387
|
-
/**
|
|
4388
|
-
* 能否稍后重试。
|
|
4389
|
-
*
|
|
4390
|
-
* 服务端错误、网络异常和登录过期都算可以重试;无权限(已退群或已退出频道)和参数错误是终态,
|
|
4391
|
-
* 再试多少次结果都一样,调用方应该停下来而不是反复打接口。
|
|
4392
|
-
*/
|
|
4393
|
-
retryable: boolean;
|
|
4394
|
-
/** 原始错误,供诊断与上报。 */
|
|
4395
|
-
error: unknown;
|
|
4396
|
-
}
|
|
4397
|
-
/** 回源的汇总结果。三组 id 互不重叠,合起来覆盖调用方传入的全部有效 id。 */
|
|
4398
|
-
interface ImMessagesByIdResult<TMessage> {
|
|
4399
|
-
/** 成功取回的消息。已经进了本地历史,后续本地查询就能命中。 */
|
|
4400
|
-
readonly messages: readonly TMessage[];
|
|
4401
|
-
/**
|
|
4402
|
-
* 服务端确认没有这些消息:已被删除、超出保留期被清理,或对当前用户不可见。
|
|
4403
|
-
* 这是终态,调用方应记下来并停止重试。
|
|
4404
|
-
*/
|
|
4405
|
-
readonly missingMessageIds: readonly string[];
|
|
4406
|
-
/**
|
|
4407
|
-
* 这次没取到、但不代表不存在的消息 id(请求失败了)。
|
|
4408
|
-
* 是否值得再试看 `failure.retryable`。
|
|
4409
|
-
*/
|
|
4410
|
-
readonly unresolvedMessageIds: readonly string[];
|
|
4411
|
-
/** `unresolvedMessageIds` 非空时的失败原因;全部取到或全部确认缺失时不存在。 */
|
|
4412
|
-
readonly failure?: MessagesByIdFailure;
|
|
4413
|
-
}
|
|
4414
|
-
|
|
4415
4479
|
/**
|
|
4416
4480
|
* 绑定单个精确会话的产品句柄与独立连续消息窗口。
|
|
4417
4481
|
* 句柄提供历史、消息、草稿、已读和免打扰动作;SDK/DomainState 仍拥有消息真相,关闭只释放窗口和订阅。
|
|
@@ -4569,6 +4633,12 @@ interface ConversationMessageApi {
|
|
|
4569
4633
|
* @remarks CHANNEL 当前产品入口不发送礼物,会返回 unsupported。消息固定明文。
|
|
4570
4634
|
*/
|
|
4571
4635
|
sendGift: (gift: ImGiftBody, options?: GiftMessageOptions) => Promise<SendMessageResult>;
|
|
4636
|
+
/**
|
|
4637
|
+
* 分享直播间卡片。调用方必须先拿到直播间快照。
|
|
4638
|
+
*
|
|
4639
|
+
* @remarks Core 不请求直播接口,也不补默认直播类型或房间状态。群和频道按会话加密发送。
|
|
4640
|
+
*/
|
|
4641
|
+
sendLiveRoom: (liveRoom: ImLiveRoomBody, options?: LiveRoomMessageOptions) => Promise<SendMessageResult>;
|
|
4572
4642
|
/** 当前用户已选相同 emoji 时移除,否则添加或替换。emoji 必须是协议 token,例如 `[Great]`。 */
|
|
4573
4643
|
toggleReaction: (messageId: string, emoji: string) => Promise<ImReactionChangeResult>;
|
|
4574
4644
|
/** 显式添加/替换或移除,供参与者详情等不能用 toggle 猜动作的产品交互。 */
|
|
@@ -4596,7 +4666,7 @@ interface ConversationMessageApi {
|
|
|
4596
4666
|
*/
|
|
4597
4667
|
replaceInterruptedFile: (messageId: string, file: File | Blob, options?: FileMessageOptions) => Promise<SendMessageResult>;
|
|
4598
4668
|
/**
|
|
4599
|
-
*
|
|
4669
|
+
* 编辑当前会话的一条非置顶文本消息;所有权、正文类型、时间窗、加密与 CHANNEL 权限由对应 core sibling 校验。
|
|
4600
4670
|
* @throws 消息不属于当前 handle,或 core 返回稳定业务失败时抛出 `ImSdkErrorShape`;不暴露协议 errcode。
|
|
4601
4671
|
* @example
|
|
4602
4672
|
* ```ts
|
|
@@ -4607,10 +4677,10 @@ interface ConversationMessageApi {
|
|
|
4607
4677
|
* ```
|
|
4608
4678
|
*/
|
|
4609
4679
|
editText: (messageId: string, text: string, options?: EditTextOptions) => Promise<ImProductMessage>;
|
|
4610
|
-
/**
|
|
4680
|
+
/** 撤回当前会话非置顶消息;成功后由同一 DomainState 更新窗口,失败抛稳定产品错误。 */
|
|
4611
4681
|
recall: (messageId: string) => Promise<void>;
|
|
4612
4682
|
/**
|
|
4613
|
-
*
|
|
4683
|
+
* 仅从当前账号本机删除一条已落地且未置顶的消息。
|
|
4614
4684
|
*
|
|
4615
4685
|
* @remarks 不清理已读、置顶、草稿、宿主下载文件、独立媒体缓存或远端历史。仍由 Outbox 持有或正在上传的消息会被拒绝;
|
|
4616
4686
|
* queued 消息只有在 `client.outbox.cancel` 成功移除账本后,才能删除其本地失败气泡,避免把删除气泡误当作取消发送。
|
|
@@ -4732,7 +4802,7 @@ interface ChannelConversationMessageApi extends ConversationMessageApi {
|
|
|
4732
4802
|
*
|
|
4733
4803
|
* @remarks 不受本人撤回时间窗限制;权限由 CHANNEL profile 预检并由服务端最终校验。成功后消息进入
|
|
4734
4804
|
* `deletedForEveryone` 终态;Chat Kit 时间线仅向社群群主和管理员显示删除提示,普通成员隐藏该项。
|
|
4735
|
-
*
|
|
4805
|
+
* 置顶原消息即使由管理员或群主操作也会拒绝;该方法不用于本机删除,也不适用于普通群。
|
|
4736
4806
|
* @example
|
|
4737
4807
|
* ```ts
|
|
4738
4808
|
* const channel = await client.openConversation({ conversationType: 'channel', conversationId: '9001' })
|
|
@@ -5915,6 +5985,25 @@ interface ImContactsApi extends ImDirectoryApi<'individual'> {
|
|
|
5915
5985
|
* ```
|
|
5916
5986
|
*/
|
|
5917
5987
|
blockUser: (userId: string) => Promise<void>;
|
|
5988
|
+
/**
|
|
5989
|
+
* 读取当前账号的黑名单;每次都查询服务端,空数组表示名单为空。
|
|
5990
|
+
*
|
|
5991
|
+
* @example
|
|
5992
|
+
* ```ts
|
|
5993
|
+
* const blocked = await client.contacts.listBlocked()
|
|
5994
|
+
* ```
|
|
5995
|
+
*/
|
|
5996
|
+
listBlocked: () => Promise<readonly ImBlockedContact[]>;
|
|
5997
|
+
/**
|
|
5998
|
+
* 把用户移出黑名单。
|
|
5999
|
+
*
|
|
6000
|
+
* @remarks 远端成功后 SDK 重新向服务端查询双方关系,不假设恢复为好友;拉黑时已删除的会话和聊天记录不会恢复。
|
|
6001
|
+
* @example
|
|
6002
|
+
* ```ts
|
|
6003
|
+
* await client.contacts.unblockUser('user-7')
|
|
6004
|
+
* ```
|
|
6005
|
+
*/
|
|
6006
|
+
unblockUser: (userId: string) => Promise<void>;
|
|
5918
6007
|
/**
|
|
5919
6008
|
* 举报联系人;成功只表示服务端已接收,不改变好友关系或本地会话。
|
|
5920
6009
|
*
|
|
@@ -6047,6 +6136,8 @@ interface AdvancedContactsApi extends ImDirectoryApi<'individual'> {
|
|
|
6047
6136
|
searchUser: ImContactApi['searchUser'];
|
|
6048
6137
|
requestFriendship: ImContactApi['requestFriendship'];
|
|
6049
6138
|
blockUser: ImContactApi['blockUser'];
|
|
6139
|
+
listBlocked: ImContactApi['listBlocked'];
|
|
6140
|
+
unblockUser: ImContactApi['unblockUser'];
|
|
6050
6141
|
reportUser: ImContactApi['reportUser'];
|
|
6051
6142
|
deleteFriendship: ImContactApi['deleteFriendship'];
|
|
6052
6143
|
}
|
|
@@ -6365,4 +6456,4 @@ interface ImResourceUploader {
|
|
|
6365
6456
|
declare function createImResourceUploader(config: ImResourceUploaderConfig): ImResourceUploader;
|
|
6366
6457
|
|
|
6367
6458
|
export { EDIT_WINDOW_MS, IMAGE_MESSAGE_ACCEPT, IM_CHAT_FONT_SCALES, IM_DIAGNOSTIC_CATEGORIES, IM_EMOJI_CATALOG, ImPinnedMessageOperationError, MEDIA_ALBUM_CAPTION_MAX_LENGTH, MEDIA_ALBUM_MAX_ITEMS, MediaTransferError, REACTION_SUPPORTED_CONTENT_TYPES, buildSessionFavoritePlainBody, canReactToMessage, canTransmit, canTransmitByType, canTransmitContent, classifyStickerImageType, createFaceToFaceGroupQrPayload, createImClient, createImConsoleDiagnosticSink, createImDiagnosticMemoryBuffer, createImResourceUploader, createImTextSearchMatcher, createSdkDiagnosticWriter, createVoicePlayer, createVoiceRecordingSession, detectVoiceCapabilities, extractSearchText, getImTextSearchInitial, isSupportedImageFile, mediaTransferErrorCodeOf, migrateImCachePrefix, normalizeMediaUploadCredentials, parseSessionFavoriteAlbumItems, requiresForwardTypeConfirmation, resolveChannelAccess, resolveImEmojiToken, resolveMediaAlbumSendContentType, resolveSessionFavoriteAlbumCaption, resolveSessionFavoriteAlbumItemPreviewUrl, resolveSessionFavoriteKindFromMessage, resolveTextSegments, sortSessions, sumSessionsUnread, voiceErrorCodeOf };
|
|
6368
|
-
export type { CapabilityAvailability, CapabilityDecision, CapabilityReason, ChannelAccessSnapshot, ChannelBaseSessionState, ChannelConversationCapabilities, ChannelConversationMessageApi, ChannelJoinApplication, ChannelJoinApplicationNotification, ChannelJoinApplicationPage, ChannelMember, ChannelMemberPage, ChannelMentionMember, ChannelMentionMemberPage, ChannelMiniProgramRel, ChannelMiniProgramRelConfigType, ChannelMuteReason, ChannelPermissionSet, ChannelProfile, ChannelRole, ChannelSessionState, ContactCardInput, ContactMessageOptions, ConversationBackgroundPreset, ConversationBackgroundSelection, ConversationCapabilitySnapshot, ConversationDraft, ConversationDraftApi, ConversationEntryUnreadNavigation, ConversationEntryUnreadSnapshot, ConversationHandle, ConversationHandleSnapshot, ConversationInitialPosition, ConversationLastMessageSummary, ConversationListItem, ConversationListMention, ConversationMessageApi, ConversationOpenOptions, ConversationPrefetchOptions, ConversationPrefetchResult, ConversationRef, ConversationSearchPage, ConversationSearchResult, ConversationSystemSummary, ConversationType, DirectConversationCapabilities, DirectConversationMessageApi, DraftInput, EditTextOptions, ExpressionMessageOptions, FileMessageOptions, ForwardFailReason, ForwardItemStatus, ForwardMessageFailure, ForwardMessagesInput, ForwardMessagesResult, ForwardTarget, ForwardedMessageRef, GameMessageOptions, GifMessageOptions, GiftMessageOptions, GroupConversationCapabilities, GroupConversationMessageApi, GroupMemberItem, GroupProfile, ImAppearanceSettingsApi, ImApplicationItem, ImApplicationRef, ImApplicationsApi, ImAuthIssue, ImAuthProvider, ImCacheOptions, ImCachePrefixMigrationContext, ImCachePrefixMigrator, ImCallKind, ImCallOutcome, ImCallRecordBody, ImChannelConversationAccessSnapshot, ImChannelMentionApi, ImChannelMiniProgramRel, ImChannelPermissions, ImChannelPinnedMessage, ImChannelProfile, ImChannelRole, ImChannelState, ImChannelsApi, ImChatFontScale, ImClientOptions, ImConnectionState, ImContactBody, ImContactKind, ImContactProfile, ImContactRelationship, ImContactRemarkPhone, ImContactSearchResult, ImContactsApi, ImConversationBackgroundApi, ImConversationCapabilitiesApi, ImConversationListApi, ImConversationListSnapshot, ImConversationListState, ImConversationSearchApi, ImCoreApiOptions, ImCreateChannelInput, ImCreateChannelResult, ImCreateFaceToFaceGroupResult, ImCreateGroupInput, ImCreateGroupResult, ImCreatedChannel, ImCreatedGroup, ImDebugOptions, ImDiagnosticCategory, ImDiagnosticError, ImDiagnosticLayer, ImDiagnosticLevel, ImDiagnosticMemoryBuffer, ImDiagnosticMemoryBufferFilter, ImDiagnosticMemoryBufferOptions, ImDiagnosticMemoryBufferSnapshot, ImDiagnosticMessage, ImDiagnosticRecord, ImDiagnosticSink, ImDiagnosticWriter, ImDirectCallAnswerResult, ImDirectCallFailReason, ImDirectCallHangupInput, ImDirectCallHangupReason, ImDirectCallInviteInput, ImDirectCallNotifyAudioInput, ImDirectCallTargetInput, ImDirectCallsApi, ImDirectReadReceiptSettings, ImDirectoryApi, ImDirectoryFieldMatch, ImDirectoryItem, ImDirectoryKind, ImDirectoryPage, ImDirectorySearchApi, ImDirectorySearchItem, ImDirectorySearchResult, ImDraftsApi, ImEmojiCatalogEntry, ImEndpointProvider, ImEventsApi, ImExpressionAsset, ImExpressionAssetInput, ImExpressionEmojiRecentInput, ImExpressionFavoriteKind, ImExpressionOptions, ImExpressionRecentInput, ImExpressionRecentItem, ImExpressionRecentItemKind, ImExpressionsApi, ImFaceToFaceGroup, ImFileBody, ImFilesAlbumBody, ImFriendshipRequestResult, ImGameBody, ImGameType, ImGifAssetInput, ImGiftBody, ImGiftSessionType, ImGiftStatus, ImGiftType, ImGiphyAsset, ImGiphyPage, ImGiphyPageOptions, ImGroupCallAnswerInput, ImGroupCallBusyInput, ImGroupCallCreateInput, ImGroupCallJoinInput, ImGroupCallMeetingSnapshot, ImGroupCallMember, ImGroupCallMemberStatus, ImGroupCallStatusInput, ImGroupCallTargetInput, ImGroupCallsApi, ImGroupConversationState, ImGroupMentionApi, ImGroupPinnedMessage, ImGroupProfile, ImGroupsApi, ImImageBody, ImLifecycleSnapshot, ImLocalDataApi, ImLocalDataInfo, ImLogoutOptions, ImMediaAlbumBody, ImMediaAlbumItem, ImMediaConfig, ImMediaTask, ImMediaTasksApi, ImMembershipJoinResult, ImMessageMention, ImMessageReactionAggregate, ImMessageReactions, ImMessageRef, ImMessageSearchApi, ImMessageView, ImMessageViewBody, ImMessagesByIdResult, ImMiniProgramBody, ImMiniProgramShowType, ImOutboxApi, ImOutboxItem, ImPageToken, ImPinnedMessageErrorKind, ImPinnedMessageOperation, ImProductApplicationUpdate, ImProductAuthInvalidReason, ImProductClient, ImProductEvent, ImProductEventError, ImProductEventMap, ImProductMessage, ImPushApi, ImPushSnapshot, ImReactionChangeAction, ImReactionChangeResult, ImReadReceiptSettingsApi, ImRedPacketBody, ImRedPacketType, ImRequestError, ImRequestErrorHandler, ImResourceKind, ImResourceUploadInput, ImResourceUploadProgress, ImResourceUploadResult, ImResourceUploader, ImResourceUploaderConfig, ImRobotBody, ImRobotCommand, ImRobotConversationBindInput, ImRobotDirectoryItem, ImRobotDirectoryPage, ImRobotDirectoryScope, ImRobotModule, ImRobotsApi, ImSdkErrorCategory, ImSdkErrorShape, ImSearchApi, ImSessionApi, ImSessionFavoriteAlbumItem, ImSessionFavoriteItem, ImSessionFavoriteKind, ImSessionFavoritesApi, ImSessionLifecycleState, ImSettingsApi, ImStickerAssetInput, ImStickerBody, ImStickerPack, ImSupportedConversationRef, ImTextSearchMatch, ImTextSearchMatchOptions, ImTextSearchMatcher, ImTextSearchRange, ImTransferBody, ImTransferSessionType, ImTransferStatus, ImVideoBody, ImVoiceBody, ImWebPushSubscription, ImageMessageOptions, ImagePreviewMetadata, LocalConversationHistoryClearResult, LocalMessageDeletionResult, MediaAlbumItemInput, MediaAlbumMessageOptions, MediaTransferErrorCode, MediaUploadCredentials, MediaUploadCredentialsProvider, MediaUploadCredentialsRequest, MentionCandidate, MentionCandidatePage, MentionInput, MessageContentType, MessageWindowInfo, MessageWindowPage, MessagesByIdFailure, MigrateImCachePrefixInput, MiniProgramMessageOptions, ProductConversationListType, ProductHandleConversationType, ProductMessageSearchPage, ProductMessageSearchPreviewPart, ProductMessageSearchResult, ResolveTextOptions, ResolvedConversationBackground, RobotConversationCapabilities, SegmentMatch, SegmentMatcher, SendMessageResult, StickerAssetKind, TextMessageOptions, TextSegment, TransferMessageOptions, UnknownMessageBody, UserProfile, VideoMessageOptions, VideoPreviewMetadata, VoiceCapabilities, VoiceErrorCode, VoiceMessageMetadata, VoicePlayer, VoicePlayerOptions, VoicePlayerState, VoiceRecordingResult, VoiceRecordingSession, VoiceRecordingSessionOptions, VoiceRecordingState, VoiceToggleOptions };
|
|
6459
|
+
export type { CapabilityAvailability, CapabilityDecision, CapabilityReason, ChannelAccessSnapshot, ChannelBaseSessionState, ChannelConversationCapabilities, ChannelConversationMessageApi, ChannelJoinApplication, ChannelJoinApplicationNotification, ChannelJoinApplicationPage, ChannelMember, ChannelMemberPage, ChannelMentionMember, ChannelMentionMemberPage, ChannelMiniProgramRel, ChannelMiniProgramRelConfigType, ChannelMuteReason, ChannelPermissionSet, ChannelProfile, ChannelRole, ChannelSessionState, ContactCardInput, ContactMessageOptions, ConversationBackgroundPreset, ConversationBackgroundSelection, ConversationCapabilitySnapshot, ConversationDraft, ConversationDraftApi, ConversationEntryUnreadNavigation, ConversationEntryUnreadSnapshot, ConversationHandle, ConversationHandleSnapshot, ConversationInitialPosition, ConversationLastMessageSummary, ConversationListItem, ConversationListMention, ConversationMessageApi, ConversationOpenOptions, ConversationPrefetchOptions, ConversationPrefetchResult, ConversationRef, ConversationSearchPage, ConversationSearchResult, ConversationSystemSummary, ConversationType, DirectConversationCapabilities, DirectConversationMessageApi, DraftInput, EditTextOptions, ExpressionMessageOptions, FileMessageOptions, ForwardFailReason, ForwardItemStatus, ForwardMessageFailure, ForwardMessagesInput, ForwardMessagesResult, ForwardTarget, ForwardedMessageRef, GameMessageOptions, GifMessageOptions, GiftMessageOptions, GroupConversationCapabilities, GroupConversationMessageApi, GroupMemberItem, GroupProfile, ImAppearanceSettingsApi, ImApplicationItem, ImApplicationRef, ImApplicationsApi, ImAuthIssue, ImAuthProvider, ImBlockedContact, ImCacheOptions, ImCachePrefixMigrationContext, ImCachePrefixMigrator, ImCallKind, ImCallOutcome, ImCallRecordBody, ImChannelConversationAccessSnapshot, ImChannelMentionApi, ImChannelMiniProgramRel, ImChannelPermissions, ImChannelPinnedMessage, ImChannelProfile, ImChannelRole, ImChannelState, ImChannelsApi, ImChatFontScale, ImClientOptions, ImConnectionState, ImContactBody, ImContactKind, ImContactProfile, ImContactRelationship, ImContactRemarkPhone, ImContactSearchResult, ImContactsApi, ImConversationBackgroundApi, ImConversationCapabilitiesApi, ImConversationListApi, ImConversationListSnapshot, ImConversationListState, ImConversationSearchApi, ImCoreApiOptions, ImCreateChannelInput, ImCreateChannelResult, ImCreateFaceToFaceGroupResult, ImCreateGroupInput, ImCreateGroupResult, ImCreatedChannel, ImCreatedGroup, ImDebugOptions, ImDiagnosticCategory, ImDiagnosticError, ImDiagnosticLayer, ImDiagnosticLevel, ImDiagnosticMemoryBuffer, ImDiagnosticMemoryBufferFilter, ImDiagnosticMemoryBufferOptions, ImDiagnosticMemoryBufferSnapshot, ImDiagnosticMessage, ImDiagnosticRecord, ImDiagnosticSink, ImDiagnosticWriter, ImDirectCallAnswerResult, ImDirectCallFailReason, ImDirectCallHangupInput, ImDirectCallHangupReason, ImDirectCallInviteInput, ImDirectCallNotifyAudioInput, ImDirectCallTargetInput, ImDirectCallsApi, ImDirectReadReceiptSettings, ImDirectoryApi, ImDirectoryFieldMatch, ImDirectoryItem, ImDirectoryKind, ImDirectoryPage, ImDirectorySearchApi, ImDirectorySearchItem, ImDirectorySearchResult, ImDraftsApi, ImEmojiCatalogEntry, ImEndpointProvider, ImEventsApi, ImExpressionAsset, ImExpressionAssetInput, ImExpressionEmojiRecentInput, ImExpressionFavoriteKind, ImExpressionOptions, ImExpressionRecentInput, ImExpressionRecentItem, ImExpressionRecentItemKind, ImExpressionsApi, ImFaceToFaceGroup, ImFileBody, ImFilesAlbumBody, ImFriendshipRequestResult, ImGameBody, ImGameType, ImGifAssetInput, ImGiftBody, ImGiftSessionType, ImGiftStatus, ImGiftType, ImGiphyAsset, ImGiphyPage, ImGiphyPageOptions, ImGroupCallAnswerInput, ImGroupCallBusyInput, ImGroupCallCreateInput, ImGroupCallJoinInput, ImGroupCallMeetingSnapshot, ImGroupCallMember, ImGroupCallMemberStatus, ImGroupCallStatusInput, ImGroupCallTargetInput, ImGroupCallsApi, ImGroupConversationState, ImGroupMentionApi, ImGroupPinnedMessage, ImGroupProfile, ImGroupsApi, ImImageBody, ImLifecycleSnapshot, ImLiveRoomBody, ImLiveRoomStatus, ImLiveRoomType, ImLocalDataApi, ImLocalDataInfo, ImLogoutOptions, ImMediaAlbumBody, ImMediaAlbumItem, ImMediaConfig, ImMediaTask, ImMediaTasksApi, ImMembershipJoinResult, ImMessageMention, ImMessageReactionAggregate, ImMessageReactions, ImMessageRef, ImMessageSearchApi, ImMessageView, ImMessageViewBody, ImMessagesByIdResult, ImMiniProgramBody, ImMiniProgramShowType, ImOutboxApi, ImOutboxItem, ImPageToken, ImPinnedMessageErrorKind, ImPinnedMessageOperation, ImProductApplicationUpdate, ImProductAuthInvalidReason, ImProductClient, ImProductEvent, ImProductEventError, ImProductEventMap, ImProductMessage, ImPushApi, ImPushSnapshot, ImReactionChangeAction, ImReactionChangeResult, ImReadReceiptSettingsApi, ImRedPacketBody, ImRedPacketType, ImRequestError, ImRequestErrorHandler, ImResourceKind, ImResourceUploadInput, ImResourceUploadProgress, ImResourceUploadResult, ImResourceUploader, ImResourceUploaderConfig, ImRobotBody, ImRobotCommand, ImRobotConversationBindInput, ImRobotDirectoryItem, ImRobotDirectoryPage, ImRobotDirectoryScope, ImRobotModule, ImRobotsApi, ImSdkErrorCategory, ImSdkErrorShape, ImSearchApi, ImSessionApi, ImSessionFavoriteAlbumItem, ImSessionFavoriteItem, ImSessionFavoriteKind, ImSessionFavoritesApi, ImSessionLifecycleState, ImSettingsApi, ImStickerAssetInput, ImStickerBody, ImStickerPack, ImSupportedConversationRef, ImTextSearchMatch, ImTextSearchMatchOptions, ImTextSearchMatcher, ImTextSearchRange, ImTransferBody, ImTransferSessionType, ImTransferStatus, ImVideoBody, ImVoiceBody, ImWebPushSubscription, ImageMessageOptions, ImagePreviewMetadata, LiveRoomMessageOptions, LocalConversationHistoryClearResult, LocalMessageDeletionResult, MediaAlbumItemInput, MediaAlbumMessageOptions, MediaTransferErrorCode, MediaUploadCredentials, MediaUploadCredentialsProvider, MediaUploadCredentialsRequest, MentionCandidate, MentionCandidatePage, MentionInput, MessageContentType, MessageWindowInfo, MessageWindowPage, MessagesByIdFailure, MigrateImCachePrefixInput, MiniProgramMessageOptions, ProductConversationListType, ProductHandleConversationType, ProductMessageSearchPage, ProductMessageSearchPreviewPart, ProductMessageSearchResult, ResolveTextOptions, ResolvedConversationBackground, RobotConversationCapabilities, SegmentMatch, SegmentMatcher, SendMessageResult, StickerAssetKind, TextMessageOptions, TextSegment, TransferMessageOptions, UnknownMessageBody, UserProfile, VideoMessageOptions, VideoPreviewMetadata, VoiceCapabilities, VoiceErrorCode, VoiceMessageMetadata, VoicePlayer, VoicePlayerOptions, VoicePlayerState, VoiceRecordingResult, VoiceRecordingSession, VoiceRecordingSessionOptions, VoiceRecordingState, VoiceToggleOptions };
|
package/dist/sdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-IDECJJXC.js';export{e as IMAGE_MESSAGE_ACCEPT,n as IM_CHAT_FONT_SCALES,g as IM_DIAGNOSTIC_CATEGORIES,j as IM_EMOJI_CATALOG,c as ImPinnedMessageOperationError,m as buildSessionFavoritePlainBody,d as createFaceToFaceGroupQrPayload,o as createImClient,h as createImConsoleDiagnosticSink,r as createImDiagnosticMemoryBuffer,s as createImResourceUploader,i as createSdkDiagnosticWriter,f as isSupportedImageFile,a as migrateImCachePrefix,k as resolveImEmojiToken,l as resolveSessionFavoriteKindFromMessage}from'./chunk-
|
|
1
|
+
import'./chunk-IDECJJXC.js';export{e as IMAGE_MESSAGE_ACCEPT,n as IM_CHAT_FONT_SCALES,g as IM_DIAGNOSTIC_CATEGORIES,j as IM_EMOJI_CATALOG,c as ImPinnedMessageOperationError,m as buildSessionFavoritePlainBody,d as createFaceToFaceGroupQrPayload,o as createImClient,h as createImConsoleDiagnosticSink,r as createImDiagnosticMemoryBuffer,s as createImResourceUploader,i as createSdkDiagnosticWriter,f as isSupportedImageFile,a as migrateImCachePrefix,k as resolveImEmojiToken,l as resolveSessionFavoriteKindFromMessage}from'./chunk-YP6KFYYU.js';export{Ya as MediaTransferError,kb as createVoicePlayer,lb as createVoiceRecordingSession,ib as detectVoiceCapabilities,Za as mediaTransferErrorCodeOf,$a as normalizeMediaUploadCredentials,jb as voiceErrorCodeOf}from'./chunk-SVYZRVHS.js';export{ra as EDIT_WINDOW_MS,n as MEDIA_ALBUM_CAPTION_MAX_LENGTH,o as MEDIA_ALBUM_MAX_ITEMS,za as REACTION_SUPPORTED_CONTENT_TYPES,Aa as canReactToMessage,va as canTransmit,ta as canTransmitByType,ua as canTransmitContent,u as classifyStickerImageType,ga as createImTextSearchMatcher,ea as extractSearchText,fa as getImTextSearchInitial,xb as parseSessionFavoriteAlbumItems,sa as requiresForwardTypeConfirmation,Ca as resolveChannelAccess,p as resolveMediaAlbumSendContentType,yb as resolveSessionFavoriteAlbumCaption,wb as resolveSessionFavoriteAlbumItemPreviewUrl,la as resolveTextSegments,La as sortSessions,Ma as sumSessionsUnread}from'./chunk-XNBJ3NXF.js';import'./chunk-WOT6VMZA.js';
|
package/package.json
CHANGED
package/dist/chunk-CVLKJADF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {c as c$1}from'./chunk-PPXQWMHO.js';import {u as u$1}from'./chunk-J77L6JLQ.js';var w=864e5,P=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function u(e){return e!=null&&Number.isFinite(e)&&e>0&&!Number.isNaN(new Date(e).getTime())}function v(e,r){if(u(e))return e;if(u(r))return r}function y(e,r){return v(r,e)}function m(e){if(!u(e))return "";let r=new Date(e);return `${r.getFullYear()}-${r.getMonth()+1}-${r.getDate()}`}function h(e,r){return u(e)?u(r)?m(e)!==m(r):true:false}function F(e,r){return T(e,r,"conversation")}function L(e,r){return T(e,r,"separator")}function T(e,r,t){if(!u(e))return "";let n=r.now??new Date;if(Number.isNaN(n.getTime()))return "";let o=new Date(e),a=b(n)-b(o),i=c$1(r.locale);return o.getFullYear()!==n.getFullYear()?A(o):a===0?t==="conversation"?k(o):i.today:a===1?i.yesterday:a>=2&&a<=6?x(o,i):D(o)}function b(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())/w}function x(e,r){return r.weekdays[P[e.getDay()]]}function k(e){return `${c(e.getHours())}:${c(e.getMinutes())}`}function A(e){return `${e.getFullYear()}/${c(e.getMonth()+1)}/${c(e.getDate())}`}function D(e){return `${c(e.getMonth()+1)}/${c(e.getDate())}`}function c(e){return String(e).padStart(2,"0")}function O(e){if(e.markers.length===0)return null;let r=e.viewportTop+e.overlayTop;if(e.markers[0].top>r+1)return null;let t=0;for(let d=0;d<e.markers.length&&!(e.markers[d].top>r+1);d+=1)t=d;let n=e.markers[t],o=r+e.overlayHeight,a=e.markers.filter(d=>d.top<o+1&&d.top+d.height>r-1).at(-1),i=a===void 0?0:Math.max(0,Math.min(a.top+a.height,o)-Math.max(a.top,r)),s=a===void 0?1:Math.max(1,Math.min(a.height,e.overlayHeight)),l=Math.min(1,i/s);return {key:n.key,label:n.label,inlineOpacity:1-l,...a===void 0?{}:{inlineDateKey:a.key}}}var C={text:"text",image:"image",video:"video",voice:"voice",file:"file",filesAlbum:"filesAlbum",sticker:"sticker",contact:"contact",miniProgram:"miniProgram",robot:"robot",game:"game",transfer:"transfer",gift:"gift",redPacket:"redPacket",call:"call",mediaAlbum:"mediaAlbum",system:"system",unknown:"unknown"};function S(e){switch(e.contentType){case "text":return typeof e.body.text=="string";case "image":return e.body.image!==void 0&&typeof e.body.image.url=="string";case "video":return e.body.video!==void 0&&typeof e.body.video.url=="string";case "voice":return e.body.voice!==void 0;case "filesAlbum":return (e.body.filesAlbum?.items.length??0)>0;case "file":return e.body.file!==void 0;case "sticker":return e.body.sticker!==void 0;case "contact":return e.body.contact!==void 0;case "miniProgram":return e.body.miniProgram!==void 0&&typeof e.body.miniProgram.appId=="string";case "robot":return e.body.robot!==void 0&&Array.isArray(e.body.robot.modules)&&Array.isArray(e.body.robot.commands);case "transfer":return e.body.transfer!==void 0&&typeof e.body.transfer.serialNumber=="string";case "gift":{let r=e.body.gift;return r!==void 0&&typeof r.serialNumber=="string"&&typeof r.giftName=="string"&&(r.giftType===0||r.giftType===1||r.giftType===2)}case "redPacket":{let r=e.body.redPacket;return r!==void 0&&r.packetId.trim()!==""&&(r.packetType===1||r.packetType===2||r.packetType===3||r.packetType===4)}case "call":return e.body.call!==void 0&&(e.body.call.callKind==="audio"||e.body.call.callKind==="video")&&typeof e.body.call.durationMs=="number";case "game":{let r=e.body.game;return r?.gameType==="dice"?Number.isInteger(r.value)&&r.value>=1&&r.value<=6:r?.gameType==="rock-paper-scissors"&&Number.isInteger(r.value)&&r.value>=1&&r.value<=3}case "mediaAlbum":{let r=e.body.mediaAlbum;return r!==void 0&&r.items.length>0&&r.items.every(t=>typeof t.url=="string"&&t.url!=="")}case "system":return e.body.system!==void 0;case "unknown":return e.body.unknown!==void 0}}function I(e){return e.encryption.decryptFailed===true?"decrypt-failed":S(e)?e.contentType==="sticker"?u$1(e.body.sticker.imageType):C[e.contentType]:"unknown"}function _(e){let r=[...e.leadingItems??[]],t=e.entryUnread.state==="located"?e.entryUnread:null,n,o=null,a=false;for(let i of e.messages){let s=y(i.createdAt,i.serverTime),l=s!==void 0&&h(s,n);s!==void 0&&l&&r.push({kind:"date-separator",key:`date-${m(s)}-${i.id}`,label:e.formatDate(s)}),n=s,!a&&t!==null&&i.id===t.firstMessageId&&(r.push({kind:"entry-unread",key:`entry-unread-${i.id}`,...t.count===void 0?{}:{count:t.count}}),a=true);let d=e.beforeMessageItems?.(i)??[];if(r.push(...d),I(i)==="system"){r.push({kind:"system",key:i.id,message:i}),o=null;continue}r.push({kind:"message",key:`message-${i.id}`,message:i,firstOfRun:l||i.senderId!==o}),o=i.senderId;}return r}function U(e){let r=e.targetTop-e.viewportTop,t=e.currentScrollTop+r-(e.viewportHeight-e.targetHeight)/2,n=Math.max(0,e.scrollHeight-e.viewportHeight);return Math.min(n,Math.max(0,t))}function j(e){return e!==null&&e.clientWidth>0&&e.clientHeight>0}function G(e){return e.locatedAt<=0||e.duration<0||e.now<e.locatedAt?false:e.now-e.locatedAt<=e.duration}function q(e){return !Number.isFinite(e.topThreshold)||e.topThreshold<0?false:e.currentScrollTop<e.previousScrollTop&&e.currentScrollTop<=e.topThreshold}function H(e,r){return e.find(t=>t.bottom>r.top&&t.top<r.bottom)??e[0]}function f(e){return e.anchorTop??e.top}function B(e,r){let t=H(e,r);return t===void 0?void 0:{id:t.id,offset:f(t)-r.top}}function J(e,r,t){if(e===void 0)return;let n=r.find(o=>o.id===e.id);return n!==void 0&&n.bottom>t.top&&n.top<t.bottom?{id:e.id,offset:f(n)-t.top}:B(r,t)??e}function V(e,r,t){if(e===void 0)return;let n=r.find(o=>o.id===e.id);return n===void 0?void 0:f(n)-t.top-e.offset}function Q(e,r,t=3){return !Number.isFinite(t)||t<=0?[]:e.filter(n=>n.bottom>r.top&&n.top<r.bottom).slice(0,Math.floor(t)).map(n=>({id:n.id,offset:f(n)-r.top}))}function X(e,r,t){for(let n of e){let o=V(n,r,t);if(o!==void 0)return o}}function Z(e){return e.sameConversation&&!e.isHistoryWindow&&!e.isLocating&&!e.isLocateProtected&&e.userKeptLatestIntent}function ee(e){return e.isPageVisible&&!e.isHistoryWindow&&!e.isLocating&&!e.isLocateProtected&&(e.isOwnMessage||e.isAtBottom)}function re(e){return e.isLoadingOlder&&e.previousTailId!==void 0&&e.previousTailId!==e.currentTailId&&e.previousMessageIds.includes(e.currentTailId)}function te(e,r){return e!==void 0&&!r.has(e)}async function ne(e,r){let t=0;for(;e()&&!(await r()<=0);)t+=1;return t}function oe(e){return e.hasMoreHistory&&Number.isFinite(e.scrollHeight)&&Number.isFinite(e.clientHeight)&&e.scrollHeight>0&&e.clientHeight>0&&e.scrollHeight<=e.clientHeight}function ie(e){return e.isHistoryWindow&&!e.isPageSettling&&e.isAtBottom&&(e.currentScrollTop>e.previousScrollTop||e.allowStationaryBoundary===true)}function M(e){return !e.isPageVisible||!e.isAtBottom||e.isHistoryWindow}function ae(e){let r=Math.max(0,e.margin);return e.messageTop<e.viewportBottom-r&&e.messageBottom>e.viewportTop+r}function le(e){let r=new Set;function t(s){return s===r.size?false:(e?.(r.size),true)}function n(s){let l=r.size;for(let d of s)d!==""&&r.add(d);return t(l)}function o(s,l){return M(l)&&n(s)}function a(s){let l=r.size;for(let d of s)r.delete(d);return t(l)}function i(){let s=r.size;return r.clear(),t(s)}return {get count(){return r.size},add:n,trackRemote:o,acknowledgeVisible:a,clear:i}}export{M as A,ae as B,le as C,v as a,y as b,m as c,h as d,F as e,L as f,O as g,I as h,_ as i,U as j,j as k,G as l,q as m,H as n,B as o,J as p,V as q,Q as r,X as s,Z as t,ee as u,re as v,te as w,ne as x,oe as y,ie as z};
|